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
56
votes
4 answers

Automatically Generating Documentation for All Python Package Contents

I'm trying to auto-generate basic documentation for my codebase using Sphinx. However, I'm having difficulty instructing Sphinx to recursively scan my files. I have a Python codebase with a folder structure like: └── src └──…
Cerin
  • 60,957
  • 96
  • 316
  • 522
37
votes
4 answers

Sphinx: force rebuild of html, including autodoc

Currently, whenever I run sphinx-build, only when there are changes to the source files are the inline docstrings picked up and used. I've tried calling sphinx-build with the -a switch but this seems to have no effect. How can I force a full rebuild…
Phillip B Oldham
  • 18,807
  • 20
  • 94
  • 134
31
votes
2 answers

How can I prevent sphinx from displaying the full path to my class?

I have a project structure like this: package/ __init__.py module.py __init__.py contains: from .module import Class module.py contains: class Class: pass Using sphinx-apidoc -o package/docs/ package/ and sphinx-build package/docs/…
Aran-Fey
  • 39,665
  • 11
  • 104
  • 149
25
votes
1 answer

Using Sphinx-apidoc to generate documentation from C++ code

There have been a couple of threads on this topic in the past that claim Sphinx doesn't support this at all. I had my doubts but either it has been updated since or the documentation for it was quite well hidden, because here is a link on the…
16
votes
1 answer

Sphinx-apidoc on django build html failure on `django.core.exceptions.AppRegistryNotReady`

Question background: I want to write documents with sphinx on my django project and auto create docs with my django code comments. Now I have a django(1.9) project, the file structure is as below: myproject/ myproject/ __init__.py …
Alfred Huang
  • 17,654
  • 32
  • 118
  • 189
16
votes
1 answer

Sphinx doesn't find Python packages when using autodoc

I'm trying to create documentation for test Python project before doing it for the real project. My system : Win7 64 bit, python 2.7.5 64 bit. My project name is testDoc. It includes python pakage, named t, which includes 2 modules t1 and t2 and…
rok
  • 9,403
  • 17
  • 70
  • 126
13
votes
1 answer

How to automatically add parameter types in sphinx documentation

I am currently trying to implement automatic documentation creation with Sphinx (using the extensions sphinx-apidoc and napoleon). This works quite well, but it would be even better if the typehints (PEP484 convention) are added automatically to the…
13
votes
1 answer

How to document Python packages using Sphinx

I am trying to document a package in Python. At the moment I have the following directory structure: . └── project ├── _build │   ├── doctrees │   └── html │   ├── _sources │   └── _static ├── conf.py ├──…
Dror
  • 12,174
  • 21
  • 90
  • 160
13
votes
1 answer

sphinx-apidoc usage - multiple source python directories

So I have my python source files in two different directories:- e.g. ~/work/myproject ~/.virtualenvs/myproject How do I use sphinx-apidoc to look in both directories recursively to generate my reST files? Obviously, sphinx-apidoc -o docs/source…
Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167
10
votes
1 answer

How to document one file with functions?

I have a python file with functions (lib.py), without classes. Each function has the following style: def fnc1(a,b,c): ''' This fonction does something. :param a: lalala :type a: str :param b: hahaha :type b: int :param…
natalia
  • 309
  • 2
  • 11
8
votes
2 answers

How to generate HTML Documentation with Python-Sphinx?

I'm working on a Python project using PyCharm and now I need to generate the corresponding API documentation. I'm documenting the code methods and classes using docstrings. I read about Sphinx and Doxygen, with Sphinx being the most recommended…
Juan Carlos
  • 367
  • 2
  • 8
  • 16
8
votes
2 answers

Sphinx documentation and autodoc-skip-member

I'm building my sphinx doc for a django project the following way: sphinx-apidoc app -o docs/source/app --force Now it includes all of the South migrations which I don't want to have in my documentation. I now tried to exclude them the following…
melbic
  • 11,988
  • 5
  • 33
  • 37
7
votes
2 answers

Python: Generate autodoc with Sphinx on a single module?

I'm working on a Python library that only has a single .py module and I'm trying to generate documentation for it from the docstrings. I have Sphinx set up and ran through the spinx-quickstart script, but when I try to run (while in the docs…
Isaac Freeman
  • 308
  • 2
  • 16
6
votes
1 answer

Sphinx's autodoc's automodule having apparently no effect

I am running Sphinx on a rst file containing automodule but it does not seem to have any effect. Here are the details: I have a Python project with a file agent.py containing a class Agent in it. I also have a subdirectory apidoc with a file…
user118967
  • 4,895
  • 5
  • 33
  • 54
6
votes
1 answer

What is the correct workflow in using Sphinx for Python project documentation?

I want to use Sphinx to document a large project that is currently not well-documented. In particular I want to use sphinx-apidoc to produce the documentation from the code as I document it. However I also want to have some pages of tutorial on how…
SKV
  • 274
  • 4
  • 13
1
2 3 4