Questions tagged [python-sphinx]

Sphinx is a tool that makes it easy to create intelligent and beautiful documentation. Sphinx is especially suitable for Python documentation, but it is a general-purpose tool that can be used to document anything.

Filter by
Sorted by
Tagged with
0 votes
0 answers
58 views

Building documentation from GitHub workflow

I have set the following workflow in one of my GitHub repositories and trying to make a page for the it. name: documentation on: [push] jobs: docs: runs-on: ubuntu-latest steps: - uses:...
Abolfazl's user avatar
  • 1,117
0 votes
0 answers
65 views

Generate static/complete `.rst` files with autodoc [duplicate]

is there a way to make sphinx-apidoc (by using the autodoc extension) generate fully static .rst files with the complete documentation content (docstrings) directly embedded in them? For example, ...
Low Yield Bond's user avatar
1 vote
0 answers
21 views

How to customize sphinx search?

I wanted to be able to customize my python sphinx search to include keywords. For example, if I type METHOD fill it would prioritize (or ideally only show) methods with the word fill in it. However, I ...
Jason Grace's user avatar
0 votes
1 answer
127 views

Sphinx autodoc import problems

I have a python project main file that resides in C:\b_tool\b.py. I start it from C: with python -m b_tool.b. b.py imports all kinds of other modules. I would like to add a Sphinx folder like here C:\...
zeus300's user avatar
  • 1,007
0 votes
1 answer
96 views

Sphinx autosummary only adding __init__ methods for classes

I am trying to use Sphinx autosummary to document all of the classes within the directory mypackage/src/. Sphinx is only generating proper documentation for the class constructors but none of the (...
Adventure-Knorrig's user avatar
-2 votes
1 answer
48 views

Unable to upload package using twine

When I build my Python package, I get no warnings or errors: H:\git\graphab4py>py -m build * Creating venv isolated environment... * Installing packages in isolated environment... (setuptools>=...
Manuel Popp's user avatar
  • 1,069
0 votes
0 answers
34 views

How do I disable (only) the following Sphinx autodocs warning? "WARNING: duplicate object description of .."

this warning is dumping lots of unwanted and misguided noise at me: https://github.com/sphinx-doc/sphinx/blob/35965903177c6ed9a6afb62ccd33243a746a3fc0/sphinx/domains/python.py#L1520 how can I get rid ...
oberstet's user avatar
  • 21.5k
0 votes
0 answers
72 views

Sphinx documentation tree without full path to module

I'm trying to create an automated documentation using sphinx with autodoc and autosummary extension. I'm also using the pydata_sphinx_theme. My goal is to automatically create a tree of of objects (...
J.K.'s user avatar
  • 565
-1 votes
0 answers
12 views

Can you check that functions/classes have been added to sphinx docs pages in CI?

When adding new features its sometimes quite easy to forget to add new functions and classes into the API documentation. As far as I know (at least in python sphinx) You need to explicitly add the new ...
Callum's user avatar
  • 119
0 votes
0 answers
43 views

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

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:\ProgramData\...
pittnerf's user avatar
  • 741
0 votes
0 answers
19 views

When should I use :c:expr to write inline code in Sphinx?

According to the documentation of Sphinx, inline code can be written with :c:expr:. Here is an example: This is a simple typecast: :c:expr:`(int*)var`. Using features of reStructuredText, we can also ...
apadana's user avatar
  • 628
0 votes
0 answers
26 views

sphinx autoapi makes a weird bullet list in "Returns" section and mixes "Returns" and "Return type" sections

I am working on a Python library and I am writing documentation using sphinx and the sphinx-autoapi extension to generate API references. It works quite well, but I encountered a weird issue today. I ...
Shai Avr's user avatar
  • 1,022
0 votes
0 answers
19 views

Sphinx Duplicate descriptions with autosummary_imported_members = True

In Sphinx-autosummary, I set the autosummary to display methods and classes with autosummary_imported_members = True, so I have a clear list of functions and methods. Further, I kept modules in the ...
Vogu66's user avatar
  • 1
0 votes
0 answers
29 views

Table Directives for Row and Cell

I was wondering if it is possible to compose a table with just directives. Currently I use: ````{list-table} * - My text in the left cell - ```{figure} ./image.png --- ...
atecnara's user avatar
0 votes
1 answer
75 views

Search "as you type" in sphinx-doc

As mkdocs or mdbook, I want search results are displayed as you type in sphinx-doc search page. Is it possible? How to change _static/searchtools.js?
somenxavier's user avatar
  • 1,250
0 votes
0 answers
18 views

Use a different docname in build tree than in source tree

My source tree looks like this: doc/ |- conf.py |- index.rst |- foo/ |- bar/ |- page01.rst |- page02.rst And I'd like a way to automatically rewrite "foo/bar" into "baz&...
Lithy's user avatar
  • 837
1 vote
1 answer
68 views

How to strikethrough substrings without spaces in Sphinx?

I need to strike substrings without spaces in Sphinx .rst file to transform it to HTML in a similar manner as <span style="text-decoration: line-through;">strike</span>substring. ...
pyjedy's user avatar
  • 557
1 vote
0 answers
56 views

python sphinx autodoc exclude __init__

I have 2 classes. Class1 needs to display all docstrings, while Class2 needs to display only method docstrings. In the following example, I am trying to disable Class2 without success, docstrings of ...
pyjedy's user avatar
  • 557
0 votes
0 answers
41 views

Disabling Logging in Sphinx Documentation

I use jupyter notebooks and build Sphinx documentation out of it. I set the nbsphinx_execute = 'always' This would print all the log messages from the code I am executing in the documentation. I know ...
user19898808's user avatar
-1 votes
0 answers
69 views

Automated documentation for Python project

I am setting up an own Python library (https://github.com/JanSkn/machine-learning-library) and now I want to add a documentation. I generated it using sphinx. But how can I automate it that the ...
JanSkn's user avatar
  • 1
0 votes
0 answers
44 views

RST + Sphinx: definition list with `include` directives

I have a definition list (HTML <dl>) of separate pages, and I'm trying to store both the page link (<dt> + <a href>) and page description (<dd>) in separate files for ...
Nik's user avatar
  • 61
0 votes
0 answers
61 views

How to manually document C typedef struct with Sphinx?

This is the first time I'm using Sphinx. I'm trying to document a C API manually, but I'm not sure if I'm doing it in the right way. I wasn't able to document typedef struct { int i; float f; }...
apadana's user avatar
  • 628
0 votes
0 answers
85 views

Guix Error when trying to make sphinx documentation

Good afternoon. The OS used is Guix guix --version (GNU Guix) 938a47c86d7bea785f33f42834c5c1f3dfa594b0 guix package --list-installed make 4.3 out /gnu/store/...
uanr81's user avatar
  • 309
0 votes
0 answers
74 views

Hide specific headings from (python) sphinx toctree while still showing other headings of same depth/level (or deeper)

Assume I have the following rst file: child_file.rst ========= Chapter ========= Sample text Sample text Sample text ---------- Section 1 ---------- Sample text **************** Section 1.1 ********...
Carlo's user avatar
  • 185
0 votes
0 answers
31 views

How to make imported member link to its documentation with autoapi?

I am working on a Python package and I use sphinx to build documentation for my package and the autoapi extension to automatically generate API references. In my package, I have a module named foo and ...
Shai Avr's user avatar
  • 1,022
1 vote
1 answer
37 views

Sphinx conf.py can’t find my find my external classes

I have a folder structure that looks like this: root/ —docs/ -source/ -_utils/ -utils.py -conf.py In conf.py I want to import a class from the utils.py file. I do this from _utils....
Austin Benny's user avatar
0 votes
0 answers
25 views

How to create new documents with a sphinx extension

From a sphinx extension, how do I create new documents (new page) under the current document that called my extension. I.e, I have an extension that is called from a rst file. Something like: foo.rst ...
Breno Leitão's user avatar
0 votes
0 answers
62 views

Unable to build Sphinx autodocs on read the docs

I know the question has been asked before, but the proposed solutions still do not work for me. When I build my docs online I am getting these warnings: WARNING: autodoc: failed to import module '...
Steven Wijnen's user avatar
0 votes
1 answer
42 views

How to add a reference in a Sphinx custom directive?

I'm creating a custom directive to display the list of all the available components in pydata-sphinx theme. I try to avoid using the raw directive so I'm building a custom one to remain compatible ...
Pierrick Rambaud's user avatar
0 votes
0 answers
77 views

Document two python applications with similar structure using sphinx

The folder structure looks as follows: |- ext | | - app.py | | - extensions.py (creates db instance) | | - models/ (containing sqlalchemy models) | | - routes/ (containing endpoint-files) |- ...
E.Murphy's user avatar
1 vote
1 answer
108 views

How to link image to heading in different document with Sphinx and ReStructuredText?

I have a documentation written in Sphinx/rst where I would like to have an image that links to a heading in a different file. Somehow the following is not working and I have no clue why: In document A....
raphael's user avatar
  • 2,344
0 votes
0 answers
83 views

How can I use pipe formatting in my type hints in Sphinx auto documentation?

I'm generating documentation for a library at work using Sphinx. In some of the type hints, we have this formatting: def find_and_read_ugrids(sim_node, query) -> tuple[UGrid3d | None, UGrid3d | ...
Jacob Johnson's user avatar
1 vote
1 answer
40 views

Sphinx make html fails: WARNING: autodoc: failed to import module

I have an error with Sphinx Autodoc. I am not sure why it can't find those modules. My project structure is: Project | |--Main Folder | |--docs | _build | ...
Alexander's user avatar
-1 votes
0 answers
51 views

Why are notes and warnings coming always at the end of content when using breathe to create documentation from doxygen generated xml files

I am trying to generate sphinx documentation using breathe from the xml generated by doxygen. But the notes in the html created is always at the end of other contents. I am using ..doxypage:: mypage ...
Anjali Rajasekhar 's user avatar
0 votes
0 answers
81 views

Concatenate sphinx doc from base and derived class

The accepted answer of this question provides a handy decorator for inserting the docstring of a base class's method into the documentation of a given derived class's method. This way, when ...
JustLearning's user avatar
  • 1,917
0 votes
0 answers
83 views

Generating sphinx documentation for ROS package - No module named '..'

I am trying to generate sphinx docs for some python modules in a ROS package, but I encountered an issue where the autodoc does not find some of the imports. The imports in question are generated from ...
wstyczen's user avatar
0 votes
1 answer
60 views

Integrating access controlled static docs into SolidJS app using Supabase

I am trying to create a website with Supabase as the backend and SolidJS for the frontend. The users of this website are logged in, authenticated using Supabase, and have access to some docs, based on ...
Frieksel's user avatar
0 votes
0 answers
51 views

How to change the image link by using conf.py

I'd like to create a flexible sphinx doc. One of the requirements is to change the image link based on conf.py. For example, if flag in conf.py is True, it will use imageA in doc.rst. If it's False, ...
ChenZX's user avatar
  • 457
1 vote
0 answers
87 views

Sphinx: custom Pygments' lexer not found

I created Pygments customized lexer and style: acetexlexer.py (lexer file), acedracula.py (style file), that work pretty well since the following command returns the expected result: pygmentize -O ...
Denis Bitouzé's user avatar
0 votes
0 answers
115 views

Sphinx toctree cannot contain cross reference explicit target

Testing ======= .. Define an explicit target. .. _my-target: .. These all error out. .. toctree:: :ref:`My Target <my-target>` `My Target <my-target>`_ My Target <my-target&...
Alex Latchford's user avatar
0 votes
0 answers
57 views

Sphinx multiple spaces in text

I want to insert multiple spaces into some text in a Sphinx document. The text appears in the value portion of a definition list entry. Here is a sample of working text. I want to replace the - with ...
Jonathan's user avatar
  • 2,675
1 vote
0 answers
64 views

How can I cross-reference one Sphinx LateX document from another?

I have a Sphinx documentation project with a Developer's Manual and a Reference Manual in separate subdirectories, resulting in a single set of HTML docs with both manuals, but separate LaTeX PDF ...
Ray Zimmerman's user avatar
0 votes
0 answers
58 views

Sphinx generates empty modules [duplicate]

I am trying to use sphinx in a dummy project with this structure Sphinx └── docs ├── conf.py ├── index.rst ├── Makefile ├── Module1.rst ├── ...
Dakolas's user avatar
  • 33
1 vote
0 answers
56 views

How to loop over all documents and get meta information about existing directives in Sphinx?

I would like to create a custom Sphinx extension, that shows a list of all figures. Also see related question How to create list of all figures (tables) in Sphinx? In the Sphinx documentation there is ...
Stefan's user avatar
  • 10.5k
0 votes
0 answers
90 views

How to create list of all figures (tables) in Sphinx?

In Latex it is possible to create lists of figures and tables: \listoffigures \listoftables => How to do so in Sphinx for the html output? I found :ref:`genindex` but nothing like :ref:`...
Stefan's user avatar
  • 10.5k
4 votes
1 answer
627 views

Sphinx-AutoAPI Error: "'Module' object has no attribute 'doc'" with Various Sphinx Versions

I'm relatively new to using Sphinx and I've encountered an issue that I'm struggling to solve. I suspect the error might be related to the version of Sphinx I'm using, but attempts to resolve it with ...
daniel guo's user avatar
1 vote
0 answers
34 views

How to turn off all sphinx latex formatting and use custom latex style file

In my workflow, the PDF output is more important than the HTML output. I have read the docs section here that outlines latex customization but wanted to ask this general question to see what others ...
Austin Benny's user avatar
0 votes
0 answers
40 views

Sphinx `make html` fails with symbol not found error

I am trying to use Sphinx to produce documentation for a small set of Python files that exists within a larger source code repository. The source uses ctypes to load GetInfo and AddInfo symbols from ...
dcs3spp's user avatar
  • 513
0 votes
1 answer
38 views

How to add Meta (Facebook) Pixel to web pages generated by Sphinx?

I have obtained the Meta Pixel from Meta and I have a website made in Python documentation tool called Sphinx. Now I need to add the generated code of Meta Pixel in the head section of my pages, right ...
Pavel Hanpari's user avatar
1 vote
0 answers
40 views

exercises not rendering properly in sphinx with jupyter-book

I am working with a jupyter book, where I want to include exercises. To the best of my knowledge, I have followed the documentation for this type of directive. First, in my requirements.txt file I ...
daviddesancho's user avatar

1
2 3 4 5
75