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.

Sphinx is a tool that makes it easy to create intelligent and beautiful documentation, written by Georg Brandl and licensed under the BSD license.

It was originally created for the new Python documentation, and it has excellent facilities for the documentation of Python projects, but C/C++ is already supported as well, and it is planned to add special support for other languages as well.

Sphinx is under constant development. The following features are present, work fine and can be seen “in action” in the Python documentation:

  • Output formats: HTML (including Windows HTML Help), LaTeX (for printable PDF versions), ePub, Texinfo, manual pages, plain text.

  • Extensive cross-references: semantic markup and automatic links for functions, classes, citations, glossary terms and similar pieces of information.

  • Hierarchical structure: easy definition of a document tree, with automatic links to siblings, parents and children.

  • Automatic indices: general index as well as a module index.

  • Code handling: automatic highlighting using the Pygments highlighter.

  • Extensions: automatic testing of code snippets, inclusion of docstrings from Python modules (API docs), and more.

Sphinx uses reStructuredText as its markup language, and many of its strengths come from the power and straightforwardness of reStructuredText and its parsing and translating suite, the Docutils.

See also:

3663 questions
2
votes
1 answer

Rename autosummary toctree entries

I have decided to use autosummary to create documentation of my module. In index.rst I have "imported" all relevant modules and submodules that I want documentation on. The modules are documented as expected, but one thing bothers me. The module…
Felix
  • 2,548
  • 19
  • 48
2
votes
2 answers

How to print the document version in the title?

I've just created a Sphinx doc using sphinx-quickstart.exe with alabaster theme. And I would like to print the version of the document somewhere in the title. I filled version and release variables in conf.py # -*- coding: utf-8 -*- # #…
and1er
  • 749
  • 8
  • 18
2
votes
0 answers

How to add numpy to required dependencies in autodoc

I get an error when trying to generate the documentation in readthedocs.org, autodoc is failing to import a set of functions with the following error message: WARNING: autodoc: failed to import function 'open_template' from module 'pypyt'; the…
llulai
  • 627
  • 1
  • 6
  • 9
2
votes
0 answers

Sphinx autodoc duplicating module name and function name

I have a python module with the following structure: my_mod |--- __init__.py |--- mod1 | |---- __init__.py |---- testA.py |---- testB.py |---- testC.py Inside each testX.py is a single function that is named testX. These functions…
Kschau
  • 145
  • 1
  • 12
2
votes
1 answer

Create PDF with Anaconda Sphinx

I am attempting to create documentation using sphinx. I do not have sudo permissions, but do have anaconda installed in my environment. I can successfully build HTML, but when I build PDF I am receiving errors and no PDF. Steps conda create --name…
Jefferey Cave
  • 2,507
  • 1
  • 27
  • 46
2
votes
0 answers

Sphinx - how to generate dynamic level of headings (change level, offset)

I am trying out sphinx + readthedocs as my documentation generator. I would like to have multiple subfiles included in my index file. There are files (sections) that I would like to use in two different index, but as they (index files) can have…
Jakub
  • 193
  • 1
  • 10
2
votes
1 answer

How to refer a glossary term defined in singular but expressed in plural?

If I define a glossary and a term called foobar, I can then use that term from text as This is a ref to the :term:`foobar` term. This will then make foobar into a clickable reference taking me to the glossary. However, what if I want to refer to a…
JHH
  • 8,567
  • 8
  • 47
  • 91
2
votes
0 answers

How to set up default settings for many automodules?

Assume that you have multiple classes and generate documentation using Sphinx. Instead of writing: ReverseRecallCommandLines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autoclass:: ReverseRecallCommandLines :members: :special-members: …
2
votes
0 answers

Arbitrary line breaks in Sphinx

Sphinx allows arbitrarily placed line breaks in HTML output with the |br| notation. However this does not work with Latex or EPUB. Is there any way in Sphinx to specify arbitrary line breaks in an output platform independent manner? The problem I…
Jonathan
  • 2,635
  • 3
  • 30
  • 49
2
votes
0 answers

How to parse Keras docstrings with Sphinx when inheriting them with autodoc

I am building a package that uses Keras classes. I am generating my documentation with Sphinx, using the Google docstring convention with sphinx-napoleon to parse it. Some of my methods override Keras methods and are not documented, so the Sphinx…
2
votes
2 answers

Use Sphinx to make a bibliography in a latex document

I am currently using Sphinx to produce a latex document. I have some problems with the Bibliography. I would like the Bibliography to appear in the table of contents without a chapter number. When I include the Bibliography as a separate section,…
2
votes
0 answers

Can you get normal Figure captions for Graphviz (digraph) graphs with Sphinx python document generator?

Can you use Figure captions for graphs created by Graphviz (digraph) with Sphinx? I would like to use the same numbering and style of captions for my Graphviz graphs as a I do for all Figures. For example, if I try putting this into the…
Philip Whitten
  • 293
  • 2
  • 16
2
votes
1 answer

Sphinx Integration in Qt

I would like to integrate Sphinx documentation functionality to help with my Qt project. However, when including the HTML files for Sphinx, the formatting appears differently and no file links work. For example: QFile…
Mister David
  • 49
  • 1
  • 10
2
votes
0 answers

Override default signature of __getitem__ in autodoc for sphinx

I have a class Foo that supports subscripting, so if foo is an instance of Foo, foo[12] will find the 12th one. Foo is defined something like this: class Foo: def __getitem__(self, i): """Get the ith element of self.""" .... The…
David Bridgeland
  • 525
  • 1
  • 9
  • 16
2
votes
2 answers

How to add "Fork me on Github" ribbon using Sphinx and ReadTheDocs theme?

Many open-source projects use a "Fork me on Github" banner at the top-right corner of the pages in the documentation. To name just one, let's take the example of Python requests: There is a post on the Github blog about those banners where image…
Delgan
  • 18,571
  • 11
  • 90
  • 141
1 2 3
99
100