Questions tagged [autodoc]

Extension for the Sphinx documentation generator that imports Python modules in order to extract docstrings in a semi-automatic way.

Python Sphinx extension that can import the modules being documented, and pull in documentation from docstrings in a semi-automatic way.

The sphix.ext.autodoc extension can be used in conjunction with the sphinx.ext.napoleon extension. This allows use of NumPy and Google style docstrings. The Napoleon prepocessor will initially convert your docstrings to ReStructured text, that afterwards is processed by autodoc.

Several commonly used directives are provided by autodoc, namely ..automodule:: and ..autoclass: For examples of use see the sphinx.ext.autodoc documentation.

See also:

456 questions
1
vote
2 answers

Documenting class instance as a function

When using sphinx autodoc extension to create documentation how can I document a class instance (not the class itself) as if it was a function? Class has a __call__ method defined.
ZyX
  • 52,536
  • 7
  • 114
  • 135
1
vote
2 answers

Postgresql Autodoc install: "No rule to make target `postgresql_autodoc.1.in', needed by `postgresql_autodoc.1'. Stop

I downloaded the latest Postgresql Autodoc (v1.41) from http://www.rbt.ca/autodoc/index.html When I run make I get this error: make: *** No rule to make target `postgresql_autodoc.1.in', needed by `postgresql_autodoc.1'. Stop. What is the…
Rob Bednark
  • 25,981
  • 23
  • 80
  • 125
1
vote
1 answer

Sphinx cannot import name gql

Sphinx throws this error when I try to make docs for a module in which I import from google.appengine.ext import ndb: Traceback (most recent call last):e/adapters File…
Peter Hudec
  • 2,462
  • 3
  • 22
  • 29
1
vote
1 answer

Sphinx autodoc with Django 1.4

I'm having issues building the module autodocs for a Django 1.4.1 project. make html seems to be failing to read my docstrings because it's running into trouble importing my settings. All of the online guides I've seen suggest using import…
acjay
  • 34,571
  • 6
  • 57
  • 100
1
vote
1 answer

in slime-autodoc: error in process filter: Wrong type argument: sequencep, :not-available

When I use the slime-repl, I get this message in my minibuffer and emacs hangs for a second: error in process filter: Wrong type argument: sequencep, :not-available It stops happening when I turn off slime-autodoc-mode Has anyone seen that before?
banjomonster
  • 589
  • 1
  • 6
  • 15
0
votes
1 answer

Get Sphinx to autodoc my Cython class's __init__

I have this Cython class: cdef class Sprite: def __init__(self, someargument): pass And I want Sphinx to document it like this: class Sprite(self, texture)     Does stuff. so I tried documenting it: cdef class Sprite: def…
orlp
  • 112,504
  • 36
  • 218
  • 315
0
votes
1 answer

How to exclude an autodoc object from the toctree?

We are using the autoclass directive a few times in a file, but it doesn't make sense for these to show up in the TOC tree. However, there are other files where it does make sense for autodoc objects to show up in the TOC tree. Is there a way to…
binaryfunt
  • 6,401
  • 5
  • 37
  • 59
0
votes
0 answers

Python documentation using Sphinx: docstring documentation won't generate

I'm trying to generate my project documentation using Sphinx 6.2.1 and Python3. I'm working with a test project named sphinx-basic-test. I've created a docs folder and run sphinx-quickstart inside. So far, my project structure…
0
votes
0 answers

Sphinx automodule is not generating documentation

I am generating documentation but my function: .. automodule:: the.path.of.the.file is not generated by sphinx documentation. With the other file on the same folder it works but for this one, there is no error message, nothing appears. I checked the…
kitchat
  • 9
  • 2
0
votes
0 answers

Sphinx with PydataSphinxTheme: make autoattribute and automethod create headings without class prefix in the page contents

I am using Sphinx with PydataSphinxTheme. I created a custom class template which goes over all the attributes and methods of a class and uses autodoc to document them, like so: ***************** Attribute details ***************** {% for item in…
Maurycyt
  • 676
  • 3
  • 19
0
votes
0 answers

How to use an alias when creating sphinx autodoc for python packages?

I have a folder structure for my python package something on these lines: mypackage ├── subpackage1 │   ├── _somefunctions.py │   └── __init__.py ├── subpackage2 │   ├── _classFunc.py │   └── __init__.py └── __init__.py in mypackage.__init__.py…
0
votes
0 answers

sphinx autodoc remove raises from docstring

My codebase's docstrings are set up like this: """_summary_ Args: dbconn (SQLConnection): _description_ data_model (DataModel): _description_ pc_num (int): _description_ numeric_features (List[str]):…
0
votes
0 answers

Issue with Rendering Table of Contents using Sphinx in Flask API Template

I have managed to successfully render the body of my package and its modules using Sphinx. However, I'm encountering an issue with the readability of the table of contents. The current output of the table of contents looks as follows: MyPackage …
Joseph
  • 431
  • 1
  • 4
  • 15
0
votes
1 answer

Structuring documentation with sphinx autodoc

So, I have two modules: """ Module 1 ========= """ def foo(): """foo doc""" and """ Module 2 ========= """ def bar(): """bar doc""" Then I have a rst file that goes like ************* Some heading ************* .. automodule::…
MaxPowers
  • 5,235
  • 2
  • 44
  • 69
0
votes
2 answers

Sphinx cannot find module during make html, but parent folder of package is on path

Note: edited to reflect name change from gui.py to neuro_gui.py Here is my project structure: gui ├── src │ └── gui │ ├── __init__.py │ ├── neuro_gui.py │ └── listen.py └── docs ├── _build ├── conf.py └── etc In my…
wesmlr
  • 53
  • 8