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
5
votes
1 answer

How to make Sphinx autodoc extension include an underscore/private Python module

I am autogenerating documentation for a Python package using Sphinx with the autodoc extension. The issue I am facing is that the autodoc skips any modules with an underscore. Some modules were underscored to discourage users from importing them.…
hamaney
  • 454
  • 7
  • 16
5
votes
0 answers

How do you include several subdirectories with sphinx-apidoc?

Problem I'm trying to build documentation for a Python project that contains a number of subdirectories. I'm trying to use sphinx-apidoc to make the process seamless. However, despite my best efforts, I can't deal with code that is in…
whoopscheckmate
  • 746
  • 8
  • 23
3
votes
0 answers

Can you autodoc only submodules using sphinx-apidoc?

I use sphinx-click extension for my click application, and i want to use sphinx-apidoc to generate .rst files for only submodules. I've been working with pythons Sphinx documentation library for about a year now, and I have a usecase... I cannot…
M.M
  • 51
  • 3
3
votes
1 answer

Sphinx Autodoc remove empty submodules and packages

I'm trying to use sphinx in order to create a documentation for my project, it is a bunch of functions divided to modules inside the project. I need only a small subset of the functions to be exposed in the documentation so I used…
Amir Rossert
  • 1,003
  • 2
  • 13
  • 33
3
votes
0 answers

Getting started with Sphinx when your source files aren't in the project base folder

Alright, I've been struggling with Sphinx not producing any documentation from the docstrings I've written in this example code. Its a simple implementation of a stack in Python. You probably need not read all of this: src/stack.py class Stack: …
3
votes
0 answers

Sphinx autodoc including classes and methods

I have python classes and some of them are in their own files i.e. userdata.py: class userdata: """User input class for reading...""" def __init__(self, fname): self.fname = fname def trykey(self,name,injson): .... I…
user2375049
  • 350
  • 2
  • 15
3
votes
2 answers

Django Sphinx automodule -- basics

I have a project with several large apps and where settings and apps files are split. directory structure goes something like…
Matt Harasymczuk
  • 1,728
  • 2
  • 21
  • 29
3
votes
1 answer

How to generate index.rst alone or generate everything excluding conf.py by sphinx-apidocs?

I understand that the following generates rst for all modules, excluding the index.rst sphinx-apidoc -f -o very_good_docs/ very_good And the following generates everything, including index.rst, conf.py, Makefile, etc sphinx-apidoc -F -f -o…
Herman
  • 1,882
  • 3
  • 14
  • 17
3
votes
1 answer

using Sphinx's sphinx-apidoc utility to autogenerate documentation from python code

I am wondering what the commenting format is in order to have self-documenting code using Sphinx's sphinx-apidoc utility. I am able to get this utility to generate a set of reStructuredText files for each python file, but these files still need to…
scagnetti
  • 1,435
  • 3
  • 20
  • 38
2
votes
1 answer

Is it possible to create docs for multiple packages within the same git repository with sphinx-apidoc?

I have a git repository which includes multiple packages which follow a namespace (i.e PEP 420. I am trying to create a ReadTheDocs documentation using Sphinx. The git repository looks like this repo:…
2
votes
0 answers

sphinx-apidoc generate documentation for class re-exported in __init__.py

In mypkg/_core.py I have class SomeClass: """Here is my class.""" def __init__(self, x: int): self.x = x In __init__.py I have from mypkg._core import SomeClass I figure there's a default configuration to avoid documenting…
Hatshepsut
  • 5,962
  • 8
  • 44
  • 80
2
votes
1 answer

Setting up Sphinx Autodoc with existing project

I'm am completely new to Sphinx and have watched hours of tutorials, but could not find the answer to my issue I have a current project structure like the following -project folder |-sub folder 1 | |- sub folder 1.a | | - ... |-sub folder 2 …
Josh Sullivan
  • 107
  • 1
  • 11
2
votes
0 answers

sphinx-apidoc does not include a sub-package in the generated files

My directory is as follows (with the proper __init__.py files not listed here): root package1/ subpackage1/ submodule1.py module1.py package2/ module2.py docs/ Running sphinx-apidoc . --full -o docs…
ted
  • 13,596
  • 9
  • 65
  • 107
2
votes
1 answer

sphinx-apidoc -F -o failing to create make file:

I'm attempting to use Sphinx to document a Python library I've been working on. I've been using this post as a rough guide along the way. But, I'm having issues getting Sphinx to work correctly. Once everything is set up, Sphinx has been installed,…
user1558914
  • 293
  • 1
  • 3
  • 10
1
vote
0 answers

How to make sphinx-apidoc, doctest and -W option play together nicely?

My current pipeline looks something like the following: sphinx-build -b doctest -d docs/build/doctrees docs docs/build/doctest sphinx-apidoc -f -o docs/ src/my_package sphinx-build -b html -d docs/build/doctrees docs docs/build/html The index.rst…
Mr-Pepe
  • 77
  • 6