[EMAIL PROTECTED] schrieb:
> Dear all,
> 
> first of all I want to thank the Sphinx developers for this great
> tool. I
> ported the developers manual for our openWNS (open Wireless Network
> Simulator)
> to Sphinx. I am still surprised how easy and intuitively the work with
> Sphinx is.
> So, thanks for that!
> 
> During the work on the documentation I often wanted to place ToDos
> within the text to keep track of
> things that still need to be documented. I think it would be
> benefitial to have
> a special kind of admonition (.. todo::) to place inline in the text
> for this task.
> Furthermore, I want these admonitions to show only if a certain flag
> is set in the
> configuration, such that a released version of the documentation does
> not show any
> todo content. In addition to that I want a separate page that collects
> all todo
> admonitions and provides an overview of all pending todos within the
> document.

That's a good idea! I'd like to include the extension when it's finished.

> I did not find any support for this within the current release of
> Sphinx, so I started
> developing a todo extension of my own. I implemented two directives:
> todo & todolist
> that should take care of the task. The basic functionality works now,
> but I still face
> some problems. You can take a look at what I have done so far here:
> 
> http://pastebin.com/f55ea9fe0
> 
> An example of how I use this example can be seen here:
> 
> http://pastebin.com/f7913c13a
> 
> The problems I have now are:
> 
> 1. I only want to include the todolist page in the TOC if the
> configuration flag is set.
>    The todolist page is now always included, although it is empty if
> the configuration file
>    is not set. I want it to completely vanish.

Hmm... there's no API yet for excluding items from the TOC.

Of course, as a hack-around, you could generate the document heading only
if the "todo" option is set. Then, since there is no heading in the document,
none will show up in the TOC.

> 2. With this implementation all todo admonitions show up in the final
> document as
>    '''Note: The todo description''' I want them to show up as '''Todo:
> The todo description'''

If you modify your make_admonition call a bit, that should be fine. Look
at the seealso directive:

    seealsonode = make_admonition(
        addnodes.seealso, name, [_('See also')], options, content,
        lineno, content_offset, block_text, state, state_machine)

IOW, the "arguments" arg is replaced by your wanted title.

> 3. In the todolist I only copy the original todo. It would be nice to
> include additional
>    information there, such as a link to the original todo location and
> the original location within the
>    source (filename, linenumber, etc.)

For the link to the location, you can put a "target" node at the point
where the todo directive occurs. Look at the index directive for an example.

I see that you store all todo nodes as an attribute of the node class.
This will not work with partial builds, when only changed files are parsed.
The canonical way is to use an attribute of the environment object, which
is pickled and restored between calls.

> I am a little bit stuck here and wonder if someone could help. I
> already tried the sphinx.ext.ifconfig
> to exclude the todolist from the TOC, but this does not work. I think
> Sphinx does not expect any directive within the TOC.

That's true. It doesn't interpret the content in the "normal" way.

cheers,
Georg


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to