sphinx / doc / invocation.rst

Invocation of sphinx-build

The :program:`sphinx-build` script builds a Sphinx documentation set. It is called like this:

$ sphinx-build [options] sourcedir builddir [filenames]

where sourcedir is the :term:`source directory`, and builddir is the directory in which you want to place the built documentation. Most of the time, you don't need to specify any filenames.

The :program:`sphinx-build` script has several options:

You can also give one or more filenames on the command line after the source and build directories. Sphinx will then try to build only these output files (and their dependencies).

Makefile options

The :file:`Makefile` and :file:`make.bat` files created by :program:`sphinx-quickstart` usually run :program:`sphinx-build` only with the :option:`-b` and :option:`-d` options. However, they support the following variables to customize behavior:

Invocation of sphinx-apidoc

The :program:`sphinx-apidoc` generates completely automatic API documentation for a Python package. It is called like this:

$ sphinx-apidoc [options] -o outputdir packagedir [pathnames]

where packagedir is the path to the package to document, and outputdir is the directory where the generated sources are placed. Any pathnames given are paths to be excluded ignored during generation.

The :program:`sphinx-apidoc` script has several options: