python - How do I avoid "SEVERE: Duplicate ID" warnings for my autodoc'd modules in Sphinx? -


i'm using rst/sphinx document python, when building it's throwing warnings such

...code/doc/code.rst:3: severe: duplicate id: "module-toast". 

my python source files documented so:

#!/usr/bin/env python ''' .. module:: toast     :synopsis: processes blobs produced :mod:`bread`. ''' # inline-rst documented code... 

and rst files use autodoc provided automodule directive pull docstrings out , document members.

toast --------------------------------  .. automodule:: toast     :members: 

the above combo seems work fine, error seems imply there proper way this. if remove module directive top of source file error goes away, can't add synopsis option in source that's picked sphinx.

one way around use :noindex: flag.

.. automodule:: toast     :members:     :noindex: 

then in source code can use:

#!/usr/bin/env python ''' .. module:: toast     :synopsis: processes blobs produced :mod:`bread`. ''' 

there'll no severe warning , message in synopsis appear in module index.

on other side :noindex: hide module index if doesn't have .. module:: in source file.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -