mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
commit
c5015224e2
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user