Questions tagged [autosummary]

Extension for the Sphinx documentation generator that outputs summary lists for Python objects, similar to the output from Epydoc and other API documentation tools.

Extension for the Sphinx documentation generator that outputs summary lists for Python objects, similar to the output from Epydoc and other API documentation tools.

22 questions
6
votes
1 answer

How do I exclude modules from autosummary recursive documentation

I have some Sphinx docs like so: Browse the code-based documentation here: .. autosummary:: :toctree: _autosummary :template: custom-module-template.rst :recursive: foo Where foo is a module which has foo.bar, foo.bar.a, foo.baz, etc.…
Dion Moult
  • 109
  • 4
4
votes
1 answer

Sphinx recursive autosummary: duplicate objects warning, :noindex: option breaks links

I am using Sphinx to generate the API documentation for a python package. At the moment I get the warning WARNING: duplicate object description of package.module.submodule.Class.function other instance in generated/package.module.submodule, use…
Luke
  • 41
  • 2
4
votes
0 answers

sphinx autosummary: "failed to import Child.model" (inherited instance attribute)

I'm having trouble with sphinx and autosummary. Apparently, sphinx is unable to document inherited instance attributes. For some reason, the resulting error is an import error. python code: class Base: """Base class.""" def __init__(self,…
Muller20
  • 71
  • 1
  • 6
3
votes
0 answers

Hide module paths with sphinx autodoc, autosummary and autodoc_pydantic

I am using Sphinx with autodoc and autosummary to generate documentation for a pydantic model using autodoc_pydantic. The model is quite complex and has a lot of sub-models in various files and includes custom types used for validation in a separate…
3
votes
0 answers

In Sphinx, when using sphinx.ext.autosummary, how do I exclude base class members?

I am using Sphinx to document a code base docString; in python. I have code like this - class foo(np.ndarray): def foo_func(): pass class bar(foo): def bar_func(): pass When using sphinx.ext.autosummary to document the code…
Phil
  • 2,143
  • 19
  • 44
3
votes
1 answer

Force sphinx autosummary to display the first line after the heading in module docstrings in modules' summary table

For classes/functions, sphinx's autosummary extension can generate a nice table summarizing the list of available classes/functions in a particular module, such that the first column consists a list of these items, and the second column consists of…
2
votes
0 answers

Sphinx recursive autosummary not importing modules

I'm going crazy with Sphinx's recursive autosummary. My working directory is: my_wd | |-- docs | |-- source | |--index.md | |--conf.py | |-- _templates | |-- custom-module-template.rst | |--…
sato
  • 768
  • 1
  • 9
  • 30
2
votes
1 answer

Sphinx hiding modules imported in __init__.py

My package has a structure, similar to the following: ├── README.md ├── __init__.py ├── module1 │ └── submodule1.py │ └── submodule2.py ├── module2 │ ├── __init__.py │ ├── _hiden_submodule1.py │ ├── _hiden_submodule2.py │ └──…
Liris
  • 1,399
  • 3
  • 11
  • 29
2
votes
1 answer

Sphinx autosummary: dataclass inheritance

Following code makes Sphinx autosummary fail: @dataclasses.dataclass class Foo: bar: int class FooChild(Foo): pass My autosummary template (_templates/autosummary/class.rst): {{ name | escape | underline}} .. currentmodule:: {{ module…
ikamen
  • 3,175
  • 1
  • 25
  • 47
2
votes
0 answers

Why does sphinx autosummary not create a toctree when used inside a class?

I am trying to use ..autosummary to document a module that replaces itself with a class upon import (lazy importing). Without lazy imports the module looks like this: """ The demp_project package The demp_project consists of the following…
FirefoxMetzger
  • 2,880
  • 1
  • 18
  • 32
2
votes
0 answers

Set a default option for a given directive in Sphinx

In Sphinx, is there a way to set a default value for a directive option in conf.py, so that it is always used whenever I use that directive? In particular, I am using autosummary, and I always want :toctree: to be set so that I don't have to…
asmeurer
  • 86,894
  • 26
  • 169
  • 240
1
vote
1 answer

Sphinx Autosummary (Autodoc) partially imports modules

Sphinx autosummary/autodoc gives error for some of the modules, but not all. My code is opensource: https://github.com/dream-faster/krisi I get the following error: WARNING: autodoc: failed to import module 'metric'; the following exception was…
semyd
  • 430
  • 4
  • 17
1
vote
0 answers

Sphinx autosummary without new page

Using sphinx's autodoc extension, the autosummary functionality produces a link towards a new page with all modules in a table. Is there any way that the produced table can be put inside the current page, without the link? Someone pointed in that…
tanglef
  • 106
  • 1
  • 4
0
votes
0 answers

Sphinx autosummary of class attributes not included in the proper toctree with numpydoc?

My class.rst: {% extends "!autosummary/class.rst" %} {% block methods %} {% if methods %} .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. .. autosummary:: …
Astral Cai
  • 63
  • 7
0
votes
1 answer

Sphinx's autosummary with recursive option is not being fully recursive

I am using Sphinx to document a Python project, which has the structure tree depicted below. calculator | set_rho_and_f.py | set_rho_and_V_dot.py | ├───data │ ├───fans │ │ ... │ │ │ ├───functions │ │ ... │ │ │ …
Élio Pereira
  • 181
  • 1
  • 14
1
2