autodoc

Python Sphinx Module Not Found

Python Sphinx Module Not Found Question: I have a subproject that I would like to document with python sphinx. It is structured this way: The documentation from the extraction_model went without any problems. But now, if I try to document the ocr part, I always get the warning: WARNING: autodoc: failed to import module ‘nfzOcr’ …

Total answers: 1

Sphinx: Autodocs for classes inheriting from base classes implemented in C

Sphinx: Autodocs for classes inheriting from base classes implemented in C Question: I am running into an error/warning when inheriting from collections.deque. Sphinx complains: utils.py:docstring of utils.Test.count:1: WARNING: py:class reference target not found: integer — return number of occurrences of value For this example, utils.py only contains from collections import deque class Test(deque): pass My …

Total answers: 1

Generating documentation for multiple folders with Sphinx

Generating documentation for multiple folders with Sphinx Question: I am currently working on a Python project that is growing bigger than expected. My code is documented all throughout with docstrings, and I would now like to generate a comprehensive documentation with Sphinx. However, no matter what I try, I can’t figure out a way to …

Total answers: 1

autodoc duplicates class' methods

autodoc duplicates class' methods Question: The automatically generated documentation duplicates the Methods for the Test class, as shown below. Why is this duplication occurring and how can it be stopped? I have tried several variations within the conf.py module, but it has been to no avail. After the documentation image, there is a redacted version …

Total answers: 2

How can I use automodule or autoclass for Sphinx in a markdown file?

How can I use automodule or autoclass for Sphinx in a markdown file? Question: I understand the Sphinx supports markdown or .md files optionally, which works great for me for my supplimental documentation. What I am trying to do is use the autoclass or automodule tags in a markdown file. Normally, in a .rst file, …

Total answers: 3

How to specify different return types in python docstring

How to specify different return types in python docstring Question: I’m currently writing documentation for my python package using Sphinx and the autodoc plugin. For a function return value I can e.g. write :returns: int: count which tells sphinx that there is a return value of type int, named count. I now got a function …

Total answers: 2

How to properly write cross-references to external documentation with intersphinx?

How to properly write cross-references to external documentation with intersphinx? Question: I’m trying to add cross-references to external API into my documentation but I’m facing three different behaviors. I am using sphinx(1.3.1) with Python(2.7.3) and my intersphinx mapping is configured as: { ‘python’: (‘https://docs.python.org/2.7’, None), ‘numpy’: (‘http://docs.scipy.org/doc/numpy/’, None), ‘cv2’ : (‘http://docs.opencv.org/2.4/’, None), ‘h5py’ : (‘http://docs.h5py.org/en/latest/’, …

Total answers: 7

How would I cross-reference a function generated by autodoc in Sphinx?

How would I cross-reference a function generated by autodoc in Sphinx? Question: I am using the Sphinx autodoc feature to generate documentation based on the docstrings of my Python library. The syntax for cross referencing is found here A label must precede the section in order to allow that section to be referenced from other …

Total answers: 2

Including docstring in Sphinx Documentation

Including docstring in Sphinx Documentation Question: I’d like to include just the docstring of a specific function in my Sphinx documentation. However there seem to be no options to just display these details without associated class and function definitions using http://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html I’ve tried creating a class as outlined in Show *only* docstring in Sphinx documentation? …

Total answers: 2

Sphinx automodule: how to reference classes in same module?

Sphinx automodule: how to reference classes in same module? Question: I am trying to use the sphinx autodoc extension and specifically the automodule directive to automatically generate documentation for django app I am working on. The problem is that I want to create internal references to different classes within the module, without having to use …

Total answers: 2