From 05cf79da52cb08c4f13f79884d5e49e68b34e1a8 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 22 Jan 2009 19:22:49 +0100 Subject: [PATCH] A bit of clarification about where Sphinx finds autodoced modules. --- doc/ext/autodoc.rst | 7 +++++++ sphinx/quickstart.py | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/ext/autodoc.rst b/doc/ext/autodoc.rst index 993f971ae..3e5ce3e16 100644 --- a/doc/ext/autodoc.rst +++ b/doc/ext/autodoc.rst @@ -12,6 +12,13 @@ This extension can import the modules you are documenting, and pull in documentation from docstrings in a semi-automatic way. +.. note:: + + For Sphinx (actually, the Python interpreter that executes Sphinx) to find + your module, it must be importable. That means that the module or the + package must be in one of the directories on :data:`sys.path` -- adapt your + :data:`sys.path` in the configuration file accordingly. + For this to work, the docstrings must of course be written in correct reStructuredText. You can then use all of the usual Sphinx markup in the docstrings, and it will end up correctly in the documentation. Together with diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index 4ab26b861..173f26a17 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -40,9 +40,9 @@ QUICKSTART_CONF = '''\ import sys, os -# If your extensions are in another directory, add it here. If the directory -# is relative to the documentation root, use os.path.abspath to make it -# absolute, like shown here. +# If your extensions (or modules documented by autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.append(os.path.abspath('.')) # General configuration