Sponsor:

Your company here — click to reach over 10,000 unique daily visitors

sphinx-autogen - Man Page

Generate autodoc stub pages

Synopsis

sphinx-autogen [options] <sourcefile> …

Description

sphinx-autogen is a tool for automatic generation of Sphinx sources that, using the X'tty: link #module-sphinx.ext.autodoc'autodocX'tty: link' extension, document items included in X'tty: link #directive-autosummary'autosummaryX'tty: link' listing(s).

sourcefile is the path to one or more reStructuredText documents containing X'tty: link #directive-autosummary'autosummaryX'tty: link' entries with the :toctree:: option set. sourcefile can be an fnmatch-style pattern.

Options

-o <outputdir>

Directory to place the output file. If it does not exist, it is created. Defaults to the value passed to the :toctree: option.

-s <suffix>, --suffix <suffix>

Default suffix to use for generated files. Defaults to rst.

-t <templates>, --templates <templates>

Custom template directory. Defaults to None.

-i,  --imported-members

Document imported members.

-a,  --respect-module-all

Document exactly the members in a module’s __all__ attribute.

Example

Given the following directory structure:

docs
├── index.rst
└── ...
foobar
├── foo
│   └── __init__.py
└── bar
    ├── __init__.py
    └── baz
        └── __init__.py

and assuming docs/index.rst contained the following:

Modules
=======

.. autosummary::
   :toctree: modules

   foobar.foo
   foobar.bar
   foobar.bar.baz

If you run the following:

$ PYTHONPATH=. sphinx-autogen docs/index.rst

then the following stub files will be created in docs:

docs
├── index.rst
└── modules
    ├── foobar.bar.rst
    ├── foobar.bar.baz.rst
    └── foobar.foo.rst

and each of those files will contain a X'tty: link #module-sphinx.ext.autodoc'autodocX'tty: link' directive and some other information.

See Also

sphinx-build(1), sphinx-apidoc(1)

Referenced By

sphinx-all(1), sphinx-apidoc(1).

Jul 16, 2024 7.3.7 Sphinx