2

I'm using the sphinx.ext.viewcode extension to generate [source] links to classes and functions.

This works great for documentation produced via autodoc, but there doesn't seem to be any restructured-text syntax available for me to make my own links.

I tried getting Sphinx to dump an rst version of its output, but that contains no trace of any markup relating to source code links.

EDIT: To be more specific, I do get proper source links when applying directives such as .. py:function: somefunction, but for a page documenting a single module I would like the header to have a [source] link to the module file, but .. py:module: mymodule does not produce such a link, and neither does ..automodule::.

I guess I'm really asking the underlying question of: How does viewcode decide where to put in [source] links and how can I control it?

plc
  • 864
  • 8
  • 20

0 Answers0