python-sphinx

Running sphinx-build leads to AttributeError: 'Values' object has no attribute 'link_base'

Running sphinx-build leads to AttributeError: 'Values' object has no attribute 'link_base' Question: I have a Django 4.2 project and wish to run Sphinx to generate the docs. When I run sphinx-build -b html docs_source/ docs/ I got the following error: Exception occurred: File "C:ProgramDataAnaconda3envsdjango_3_8Libsite-packagesdjangocontribadmindocsutils.py", line 116, in _role inliner.document.settings.link_base, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: ‘Values’ object has no …

Total answers: 1

sphinx-autoapi fails to combine class and __init__ docstrings (autoapi_python_class_content = 'both')

sphinx-autoapi fails to combine class and __init__ docstrings (autoapi_python_class_content = 'both') Question: sphinx-autoapi allows to combine the class docstrings and the __init__ docstrings using the autoapi_python_class_content = ‘both’ option. However, even with this option set (conf.py), it fails to properly combine the docstrings: The class SingleOutputEcospold2Importer class SingleOutputEcospold2Importer(LCIImporter): """ Class for importing single-output ecospold2 format …

Total answers: 1

How to Correctly Display Pipe/Vertical Bar Character in Python Docstrings Using Sphinx

How to Correctly Display Pipe/Vertical Bar Character in Python Docstrings Using Sphinx Question: I’d like to put in a Python docstring something like: output_dir │ categories.yaml │ └───images │ filename1.png │ filename1.png │ … │ └───masks filename1.png filename2.png … But this is visualized by Sphinx as: output_dir │ categories.yaml │ └───images │ filename1.png │ filename1.png …

Total answers: 1

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

Configuring source dir for Sphinx documentation conf.py file

Configuring source dir for Sphinx documentation conf.py file Question: I got a package that i am about to upload to a local devpi server. I got some issues with the package not being able to find the conf.py file for Sphinx which makes sense as it looks at the (package_name)/docs folder instead of (package_name)/docs/source which …

Total answers: 2

Persistent cache during deployment with sphinx-autoapi?

Persistent cache during deployment with sphinx-autoapi? Question: I have been stuck with a problem for several days without solutions. I am trying to deploy local docs generated with Sphinx to Gitlab pages. Below is my .gitlab-ci.yml on the root directory of the repos, and I am using the latest Ubuntu image: stage: deploy script: – …

Total answers: 1

Sphinx: how to change the function signature display format?

Sphinx: how to change the function signature display format? Question: I have a sphinx theme that renders function signatures using italics rather than code. (my_function(arg1, arg2) rather than my_function(arg1, arg2)) I’d like to change that behavior, but I’m not sure how… Any ideas? I’m using autodoc so most of my .rst files just look like …

Total answers: 1

Python code blocks not rendering with readthedocs and sphinx

Python code blocks not rendering with readthedocs and sphinx Question: I’m building docs for a python project using Sphinx and readthedocs. For some reason, the code blocks aren’t rendering after building the docs, and inline code (marked with backticks) appears italic. I’ve checked the raw build, there was a warning that the exomagpy module couldn’t …

Total answers: 1