On Tue, May 14, 2013 at 2:08 PM, Nick Timkovich <[email protected]>wrote:
> Sphinx experts: > > I asked this on Stack Overflow a few days ago ( > http://stackoverflow.com/q/16471032/194586) but Sphinx aficionados don't > seem to be all that numerous there... I'm using rST/Sphinx to document my > Python, however when building it's throwing warnings such as > > ...Code/doc/code.rst:3: SEVERE: Duplicate ID: "module-toast". > > My Python source files are documented like so: > > #!/usr/bin/env python > ''' > .. module:: toast > :synopsis: Processes the blobs produced by :mod:`bread`. > ''' > # my inline-rST documented code... > > And the rST files use the autodoc provided automodule directive to pull > all the docstrings out and document all the members. > > Toast > -------------------------------- > > .. automodule:: toast > :members: > > The above combo seems to work just fine, but the error seems to imply > there is a proper way to do this. If I remove the module directive from > the top of my source file the error goes away, but then I can't add a > synopsis option in the source that's picked up by Sphinx. > > Cheers, > Nick > > > I'm not sure, but I believe that the 'automodule' directive will create a 'module' directive on it's own. Then, since you already have one specified, there are two, and thus you get a duplicate ID message. You might try using the 'currentmodule' directive in your module markup instead of 'module'. It seems like that _should_ work, though I admit I haven't actually tried it. -- Kevin Horn -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sphinx-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
