doc: viewcode

This commit is contained in:
Takeshi KOMIYA 2018-05-12 11:35:54 +09:00
parent 86f179e312
commit 0ed86d37a5

View File

@ -17,15 +17,17 @@ from the source to the description will also be inserted.
.. warning::
If :confval:`viewcode_follow_imported_members` is True, or if the
:event:`viewcode-find-source` event does not find source code for the given
module, ``viewcode`` will import the modules being linked to. If any modules
have side effects on import, these will be executed by ``viewcode`` when
Basically, ``viewcode`` extension will import the modules being linked to.
If any modules have side effects on import, these will be executed when
``sphinx-build`` is run.
If you document scripts (as opposed to library modules), make sure their
main routine is protected by a ``if __name__ == '__main__'`` condition.
In addition, if you don't want to import the modules by ``viewcode``,
you can tell the location of the location of source code to ``viewcode``
using :event:`viewcode-find-source` event.
This extension works only on HTML related builders like ``html``,
``applehelp``, ``devhelp``, ``htmlhelp``, ``qthelp`` and so on except
``singlehtml``. By default ``epub`` builder doesn't