EDIT: Other answers than the one I provided are welcome! Consider the following function: When documenting with sphinx, I would like to cross-ref both str and Path with intersphinx. But obviously, it does not work for the latter since it is referenced as pathlib.Path in the objects.inv file. Is there a way to tell intersphinx/sphinx that Path is from the
Tag: python-sphinx
Doctest not working in Sphinx, cannot import python files Python
I have a problem trying to run doctest from the Sphinx Tutorial. I have the directory tree below but I cannot run a doctest for lumache.py. How would be able to make it so that lumache.py is importable with the pathlib function in conf.py which is sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix()).The code I am trying to execute is of the same one from
Why am I unable to get docstring printed out using sphinx python package?
I am using Sphinx to document out my functions. However, it does not read my doc strings for function with a decorator. Sphinx just replace the function doc strings with <The magic happens here> My functions are written in this manner with a decorator. How do i make Sphinx detect the doc strings in the function. Folder is in this
How to use the sphinx plugin of pybuilder?
I try to create a python package using pybuilder and wonder how to make use of the sphinx plugin. I already initiated a sphinx documentation scaffold via sphinx-quickstart and activated the sphinx plugin within the build.py file of pybuilder. The following displays my current build.py: However, when I run the pyb command to build the package, pybuilder does not generate
How to exclude imports from automodapi output?
I am trying to use automodapi to generate documentation for my Django project. When I call automodapi like this: the output includes all imported classes and functions, e.g, the Django Model class, in the index of Functions and Classes. I would like to exclude the imports and only list those classes and functions declared in the module I specified. I
Python Sphinx exclude patterns
I’m generating documentation with Sphinx for project with structure like this : I want to exclude tests, and workflow/definition from documentation. I tried exclude pattern in docs/conf.py But even though workflow/definitions are still automatically generated. Could someone show me correct exclude pattern how to ignore ‘definitions’ folder ? Answer exclude_patterns can be used to exclude source files (reStructuredText files) from
Substitutions next to angle brackets in Sphinx
I’m trying to use substitutions in a parsed literal block in my Sphinx documentation like this: Which gets rendered like this: Where what I want is this: If I add spaces around the substitution in the source, I get this: So I know release is defined as I expect. How can I get rid of the spaces? Answer This works:
adding xml content to sphinx generated doc
So here is my problem. I’m trying to generate documentation for my project using sphinx and managed to get the basic working, like adding modules and images. So a basic index.rst would look like: ‘tvb’ here contains top level modules and links to sub-packages and so on. This seems to work fine and the html documentation is generated accordingly. However