Merge pull request #4958 from tk0miya/update_doc

doc: viewcode
This commit is contained in:
Takeshi KOMIYA 2018-05-12 22:39:45 +09:00 committed by GitHub
commit c5015224e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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