diff options
| author | Georg Brandl <georg@python.org> | 2014-03-06 08:13:14 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2014-03-06 08:13:14 +0100 |
| commit | a5488a86c5572228556a5ffe1fa051b4bdf5391a (patch) | |
| tree | 1cf550061f8bd5d30b4e834fe9992cca83be9284 /doc/tutorial.rst | |
| parent | 9dbb0729aeac645fc8940572751b8f30937dfe6f (diff) | |
| parent | 2d297818c560eb93823cc6eb6a808107c72db898 (diff) | |
| download | sphinx-a5488a86c5572228556a5ffe1fa051b4bdf5391a.tar.gz | |
merge with stable
Diffstat (limited to 'doc/tutorial.rst')
| -rw-r--r-- | doc/tutorial.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/tutorial.rst b/doc/tutorial.rst index 8e949d4c..cae4c8db 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -245,6 +245,15 @@ autodoc needs to import your modules in order to extract the docstrings. Therefore, you must add the appropriate path to :py:data:`sys.path` in your :file:`conf.py`. +.. warning:: + + :mod:`~sphinx.ext.autodoc` **imports** the modules to be documented. If any + modules have side effects on import, these will be executed by ``autodoc`` + 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. + |more| See :mod:`sphinx.ext.autodoc` for the complete description of the features of autodoc. |
