Hi Daniel,
Thanks for posting this.   It caused me to read about extensions to
Sphinx...

I don't know if I"m missing something in config somewhere -  I put in one
test ".. todo::"
and the node seems to be created, but docutils/nodes.py  doesn't like that

    node.replace_self([])

is being called on a node whose attribute is ['admonition-todo']


I've got a todolist.rst, and a single todo test entry in the sources.   I'm
pretty sure I've configured conf.py right (after all, the extension is
correctly getting called - I've stepped through this to try to find what's
going on).

I've also put my new todolist in the toctree - basically just trying to
start w/ the example usage file you'd posted.

Can you help?

Thanks much,

Yarko

On Thu, Nov 6, 2008 at 9:00 AM, <[EMAIL PROTECTED]> wrote:

>
> Thanks for your quick help. I managed to make todos show up as 'Todo:
> content of todo'. It
> did not work by simply putting 'Todo' in the argument list. It showed
> up then as 'Note: Todo:'.
> I needed to create a new node type 'todoNode' and add appropriate
> visitors. The Sphinx documentation
> is not up to date I think, addNode does not take any visitor arguments
> anymore, so I helped myself
> by using setattr on the translator object. This did the job. Maybe
> there is a better way?
>
> I manged to include a target node for each todo item, but I did not
> find how to actually insert a
> reference to these labels in the todolist. How is this done? I cannot
> find the code that actually
> generates the index pages.
>
> I also collect all todo nodes at the environment object now.
>
> I have put the current version here:
>
> http://pastebin.com/m2b02f72b
>
> Regards,
>  Daniel
>
> On Nov 6, 11:11 am, Georg Brandl <[EMAIL PROTECTED]> wrote:
> > [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