Questions tagged [sphinx-apidoc]

sphinx-apidoc is a command-line tool for automatic generation of Sphinx reStructuredText sources, that, with the Sphinx autodoc extension, document a whole package in the style of other automatic API documentation tools.

sphinx-apidoc is a tool for automatic generation of Sphinx sources that document a whole package.

Usage of the sphinx-apidoc command is as follows:

sphinx-apidoc [OPTIONS] -o <OUTPUT_PATH> <MODULE_PATH> [EXCLUDE_PATTERN …]

Sphinx-apidoc uses to extract docstrings from source files (located in <MODULE_PATH>) and places the resulting .rst reStructuredText files in OUTPUT_PATH. Latter, documentation can be generated from those .rst files into several formats like HTML, PDF using sphinx-build.

The documentation of sphinx-apidoc can be found here.

See also:

Links

54 questions
0
votes
1 answer

Sphinx ignores py-file starting with a _ in filename

I am playing around with Sphinx 4.4.0 in a test project. I use sphinx.ext.autodoc and sphinx-apidoc. But not all py files are recognized. It seams like that files with a starting _ in filename are ignored (e.g. _mypackage.py). But i am not sure if…
buhtz
  • 10,774
  • 18
  • 76
  • 149
0
votes
1 answer

Sphinx Autodoc Without Submodules

I'm developing a Python package that allows users to import its functions like this: import mymodule mymodule.afunction() I'm documenting the code with sphinx. I first ran sphinx-quickstart, then I changed conf.py to include sys.path.insert(0,…
Danny
  • 35
  • 4
0
votes
0 answers

How to force sphinx to only use filename as heading in a multi-level project?

I have a sample project: docs/ src/ ----| model/ ------------| first.py ------------| second.py ----| utils ------------| some_helper.py ------------| some_organizer.py ----| io ------------| read_data.py ------------|…
0
votes
0 answers

Can't get local sphinx-apidoc templates to work

Re: Using sphinx-apidoc to automatically generate API reference from docstrings via the autodoc extension... I copied the global /site-packages/sphinx/templates/apidoc/package.rst_t template to a local folder, and made a nonsense edit. When I built…
James Leedham
  • 2,064
  • 1
  • 10
  • 11
0
votes
1 answer

apidoc not excluding exclude_patterns

I have the following directory structure: +project_name | +---project_name | |---subpackage | |---__init__.py | |---api.py | |---mock_run.py | +---docs |---conf.py I don't want mock_run in my docs so in the conf.py I…
DeanLa
  • 1,871
  • 3
  • 21
  • 37
0
votes
1 answer

Sphinx api-doc not putting packages together

Background My code has the following structure: . └── my_package ├── __init__.py ├── classif │   ├── __init__.py │   ├── inference.py │   └── models.py ├── datasets │   ├── __init__.py │   └── datasets.py └──…
ted
  • 13,596
  • 9
  • 65
  • 107
0
votes
1 answer

Django-Sphinx RuntimeError: Model class models.Project doesn't declare

I am attempting to generate a html documentation with Sphinx of a django project. I am getting the following error when executing make html on windows cmd. My settings.py contains an entry for the application I built, where the models.py file…
Philipp Schwarz
  • 18,050
  • 5
  • 32
  • 36
0
votes
1 answer

How can I force sphinx-apidoc to generate doc using my own rst templates?

I generate documentation by sphinx-apidoc. Documentation is genereted to default rst templates. How can I generate documentation with my own rst templates?
Tomek
  • 116
  • 2
  • 11
-1
votes
0 answers

Using sphinx-apidoc command to generate rst files works, but using sphinx-build command only generates one rst and it's pretty blank

Trying to set up documentation using Sphinx, using the command sphinx-apidoc -o source/_autosummary ../tests produces the right .rst files. Using the command sphinx-build -W -b html -d build/doctress source/ build/html only produces a test.rst file…
1 2 3
4