'\" t .\" Man page generated from reStructuredText .\" by the Docutils 0.22.4 manpage writer. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "SPHINX-ALL" "1" "Mar 04, 2026" "9.1.0" "Sphinx" .SH NAME sphinx-all \- Sphinx documentation generator system manual .INDENT 0.0 .INDENT 3.5 Create intelligent and beautiful documentation with ease .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .IP "📝 Rich Text Formatting" .sp Author in reStructuredText \%<#\:rst-primer> or MyST Markdown \%<#\:markdown> to create highly structured technical documents, including tables, highlighted code blocks, mathematical notations, and more. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .IP "🔗 Powerful Cross\-Referencing" .sp Create cross\-references \%<#\:xref> within your project, and even across different projects \%<#\:ext-intersphinx>\&. Include references to sections, figures, tables, citations, glossaries, code objects, and more. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .IP "📚 Versatile Documentation Formats" .sp Generate documentation in the preferred formats of your audience, including HTML, LaTeX (for PDF), ePub, Texinfo, and more \%<#\:builders>\&. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .IP "🎨 Extensive Theme Support" .sp Create visually appealing documentation, with a wide choice of built\-in \%<#\:builtin-themes> and third\-party \%<#\:third-party-themes> HTML themes and the ability to customize or create new themes \%<#\:extension-html-theme>\&. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .IP "🔌 Fully Extensible" .sp Add custom functionality, via robust extension mechanisms \%<#\:extending-sphinx> with numerous built\-in \%<#\:builtin-extensions> and third\-party \%<#\:third-party-extensions> extensions available for tasks like creating diagrams, testing code, and more. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .IP "🛠️ Automatic API Documentation" .sp Generate API documentation for Python, C++ and other software domains \%<#\:usage-domains>, manually or automatically from docstrings \%<#\:ext-autodoc>, ensuring your code documentation stays up\-to\-date with minimal effort. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .IP "🌍 Internationalization (i18n)" .sp Add documentation translations \%<#\:intl> multiple languages to reach a global audience. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .IP "🌟 Active Community and Support" .sp Benefit from an active community \%<#\:support-index>, with numerous resources, tutorials, forums, and examples. .UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp As used by: .INDENT 0.0 .INDENT 2.5 [image: Python Logo] [image] \%Python.UNINDENT .UNINDENT .INDENT 0.0 .INDENT 2.5 [image: Linux Logo] [image] \%Linux Kernel.UNINDENT .UNINDENT .INDENT 0.0 .INDENT 2.5 [image: Jupyter Logo] [image] \%Project Jupyter.UNINDENT .UNINDENT .sp .ce ---- .ce 0 .sp .sp See below for how to navigate Sphinx\(aqs documentation. .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 The Sphinx documentation Table of Contents \% has a full list of this site\(aqs pages. .UNINDENT .UNINDENT .SH GET STARTED .sp These sections cover the basics of getting started with Sphinx, including creating and building your own documentation from scratch. .SS Installing Sphinx .sp Sphinx is a Python application. It can be installed in one of the ways described below. .SS Installation methods .INDENT 0.0 .IP \(bu 2 PyPI package .IP \(bu 2 Conda package .IP \(bu 2 OS\-specific package manager .INDENT 2.0 .IP \(bu 2 Linux .IP \(bu 2 macOS .IP \(bu 2 Windows .UNINDENT .IP \(bu 2 Docker .IP \(bu 2 Installation of the latest development release .IP \(bu 2 Installation from source .UNINDENT .sp After installation, you can check that Sphinx is available by running .INDENT 0.0 .INDENT 3.5 .sp .EX $ sphinx\-build \-\-version .EE .UNINDENT .UNINDENT .sp This should print out the Sphinx version number. .sp \fBTip:\fP .INDENT 0.0 .INDENT 3.5 For local development, it is generally recommended to install Sphinx into a non\-global environment (using for example venv \% or conda \% environments). This will allow for the use of separate sphinx versions and third\-party extensions for each sphinx project. .UNINDENT .UNINDENT .SS PyPI package .sp Sphinx packages are published on the Python Package Index \% (PyPI). The preferred tool for installing packages from PyPI is \fBpip\fP, which is included in all modern versions of Python. .sp Run the following command: .INDENT 0.0 .INDENT 3.5 .sp .EX $ pip install \-U sphinx .EE .UNINDENT .UNINDENT .sp \fBTip:\fP .INDENT 0.0 .INDENT 3.5 To avoid issues when rebuilding your environment, it is advisable to pin sphinx and third\-party extension versions in a requirements.txt file \%: .INDENT 0.0 .INDENT 3.5 .sp .EX $ pip install \-r requirements.txt .EE .UNINDENT .UNINDENT .sp Or, if writing documentation for a Python package, place the dependencies in the pyproject.toml file \%: .INDENT 0.0 .INDENT 3.5 .sp .EX $ pip install . \-\-group docs .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS Conda package .sp To work with \fBconda\fP, you need a conda\-based Python distribution such as anaconda \%, miniconda \%, miniforge \% or micromamba \%\&. .sp Sphinx is available both via the \fIanaconda main\fP channel (maintained by Anaconda Inc.) .INDENT 0.0 .INDENT 3.5 .sp .EX $ conda install sphinx .EE .UNINDENT .UNINDENT .sp as well as via the \fIconda\-forge\fP community channel .INDENT 0.0 .INDENT 3.5 .sp .EX $ conda install \-c conda\-forge sphinx .EE .UNINDENT .UNINDENT .SS OS\-specific package manager .sp You may install a global version of Sphinx into your system using OS\-specific package managers. However, be aware that this is less flexible and you may run into compatibility issues if you want to work across different projects. .SS Linux .SS Debian/Ubuntu .sp Install either \fBpython3\-sphinx\fP using \fBapt\-get\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX $ apt\-get install python3\-sphinx .EE .UNINDENT .UNINDENT .sp If it not already present, this will install Python for you. .SS RHEL, CentOS .sp Install \fBpython\-sphinx\fP using \fByum\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX $ yum install python\-sphinx .EE .UNINDENT .UNINDENT .sp If it not already present, this will install Python for you. .SS Other distributions .sp Most Linux distributions have Sphinx in their package repositories. Usually the package is called \fBpython3\-sphinx\fP, \fBpython\-sphinx\fP or \fBsphinx\fP\&. Be aware that there are at least two other packages with \fBsphinx\fP in their name: a speech recognition toolkit (\fICMU Sphinx\fP) and a full\-text search database (\fISphinx search\fP). .SS macOS .sp Sphinx can be installed using Homebrew \%, MacPorts \%\&. .SS Homebrew .INDENT 0.0 .INDENT 3.5 .sp .EX $ brew install sphinx\-doc .EE .UNINDENT .UNINDENT .sp For more information, refer to the package overview \%\&. .SS MacPorts .sp Install either \fBpython3x\-sphinx\fP using \fBport\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX $ sudo port install py314\-sphinx .EE .UNINDENT .UNINDENT .sp To set up the executable paths, use the \fBport select\fP command: .INDENT 0.0 .INDENT 3.5 .sp .EX $ sudo port select \-\-set python python314 $ sudo port select \-\-set sphinx py314\-sphinx .EE .UNINDENT .UNINDENT .sp For more information, refer to the package overview \%\&. .SS Windows .sp Sphinx can be installed using Chocolatey \%\&. .SS Chocolatey .INDENT 0.0 .INDENT 3.5 .sp .EX $ choco install sphinx .EE .UNINDENT .UNINDENT .sp You would need to install Chocolatey \% before running this. .sp For more information, refer to the chocolatey page \%\&. .SS Docker .sp Docker images for Sphinx are published on the Docker Hub \%\&. There are two kind of images: .INDENT 0.0 .IP \(bu 2 sphinxdoc/sphinx \% .IP \(bu 2 sphinxdoc/sphinx\-latexpdf \% .UNINDENT .sp Former one is used for standard usage of Sphinx, and latter one is mainly used for PDF builds using LaTeX. Please choose one for your purpose. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 sphinxdoc/sphinx\-latexpdf contains TeXLive packages. So the image is very large (over 2GB!). .UNINDENT .UNINDENT .sp \fBHint:\fP .INDENT 0.0 .INDENT 3.5 When using docker images, please use \fBdocker run\fP command to invoke sphinx commands. For example, you can use following command to create a Sphinx project: .INDENT 0.0 .INDENT 3.5 .sp .EX $ docker run \-it \-\-rm \-v /path/to/document:/docs sphinxdoc/sphinx sphinx\-quickstart .EE .UNINDENT .UNINDENT .sp And you can use the following command to build HTML document: .INDENT 0.0 .INDENT 3.5 .sp .EX $ docker run \-\-rm \-v /path/to/document:/docs sphinxdoc/sphinx make html .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp For more details, please read README file \% of docker images. .SS Installation of the latest development release .sp You can install the latest development from \fIPyPI\fP using the \fB\-\-pre\fP flag: .INDENT 0.0 .INDENT 3.5 .sp .EX $ pip install \-U \-\-pre sphinx .EE .UNINDENT .UNINDENT .sp \fBWarning:\fP .INDENT 0.0 .INDENT 3.5 You will not generally need (or want) to do this, but it can be useful if you see a possible bug in the latest stable release. .UNINDENT .UNINDENT .SS Installation from source .sp You can install Sphinx directly from a clone of the Git repository \%\&. This can be done either by cloning the repo and installing from the local clone, on simply installing directly via \fBgit\fP\&. .INDENT 0.0 .INDENT 3.5 .sp .EX $ git clone https://github.com/sphinx\-doc/sphinx $ cd sphinx $ pip install . .EE .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .EX $ pip install git+https://github.com/sphinx\-doc/sphinx .EE .UNINDENT .UNINDENT .sp You can also download a snapshot of the Git repo in either tar.gz \% or zip \% format. Once downloaded and extracted, these can be installed with \fBpip\fP as above. .SS Getting started .sp Sphinx is a \fIdocumentation generator\fP or a tool that translates a set of plain text source files into various output formats, automatically producing cross\-references, indices, etc. That is, if you have a directory containing a bunch of reStructuredText \%<> or Markdown \%<> documents, Sphinx can generate a series of HTML files, a PDF file (via LaTeX), man pages and much more. .sp Sphinx focuses on documentation, in particular handwritten documentation, however, Sphinx can also be used to generate blogs, homepages and even books. Much of Sphinx\(aqs power comes from the richness of its default plain\-text markup format, reStructuredText \%<>, along with its significant extensibility capabilities \%<>\&. .sp The goal of this document is to give you a quick taste of what Sphinx is and how you might use it. When you\(aqre done here, you can check out the installation guide \%<> followed by the intro to the default markup format used by Sphinx, reStructuredText \%<>\&. .sp For a great \(dqintroduction\(dq to writing docs in general \-\- the whys and hows, see also Write the docs \%, written by Eric Holscher. .SS Setting up the documentation sources .sp The root directory of a Sphinx collection of plain\-text document sources is called the source directory \%<#\:term-source-directory>\&. This directory also contains the Sphinx configuration file \fBconf.py\fP, where you can configure all aspects of how Sphinx reads your sources and builds your documentation. [1] .sp Sphinx comes with a script called \fBsphinx\-quickstart\fP that sets up a source directory and creates a default \fBconf.py\fP with the most useful configuration values from a few questions it asks you. To use this, run: .INDENT 0.0 .INDENT 3.5 .sp .EX $ sphinx\-quickstart .EE .UNINDENT .UNINDENT .SS Defining document structure .sp Let\(aqs assume you\(aqve run \fBsphinx\-quickstart\fP\&. It created a source directory with \fBconf.py\fP and a root document, \fBindex.rst\fP\&. The main function of the root document \%<#\:term-root-document> is to serve as a welcome page, and to contain the root of the \(dqtable of contents tree\(dq (or \fItoctree\fP). This is one of the main things that Sphinx adds to reStructuredText, a way to connect multiple files to a single hierarchy of documents. .INDENT 0.0 .INDENT 3.5 .IP "reStructuredText directives" .sp \fBtoctree\fP is a reStructuredText \fIdirective\fP, a very versatile piece of markup. Directives can have arguments, options and content. .sp \fIArguments\fP are given directly after the double colon following the directive\(aqs name. Each directive decides whether it can have arguments, and how many. .sp \fIOptions\fP are given after the arguments, in form of a \(dqfield list\(dq. The \fBmaxdepth\fP is such an option for the \fBtoctree\fP directive. .sp \fIContent\fP follows the options or arguments after a blank line. Each directive decides whether to allow content, and what to do with it. .sp A common gotcha with directives is that \fBthe first line of the content must be indented to the same level as the options are\fP\&. .UNINDENT .UNINDENT .sp The \fBtoctree\fP directive initially is empty, and looks like so: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. toctree:: :maxdepth: 2 .EE .UNINDENT .UNINDENT .sp You add documents listing them in the \fIcontent\fP of the directive: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. toctree:: :maxdepth: 2 usage/installation usage/quickstart ... .EE .UNINDENT .UNINDENT .sp This is exactly how the \fBtoctree\fP for this documentation looks. The documents to include are given as document name \%<#\:term-document-name>s, which in short means that you leave off the file name extension and use forward slashes (\fB/\fP) as directory separators. .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 Read more about the toctree directive \%<#\:toctree-directive>\&. .UNINDENT .UNINDENT .sp You can now create the files you listed in the \fBtoctree\fP and add content, and their section titles will be inserted (up to the \fBmaxdepth\fP level) at the place where the \fBtoctree\fP directive is placed. Also, Sphinx now knows about the order and hierarchy of your documents. (They may contain \fBtoctree\fP directives themselves, which means you can create deeply nested hierarchies if necessary.) .SS Adding content .sp In Sphinx source files, you can use most features of standard reStructuredText \%<#\:term-reStructuredText>\&. There are also several features added by Sphinx. For example, you can add cross\-file references in a portable way (which works for all output types) using the \fBref\fP \%<#\:role-ref> role. .sp For an example, if you are viewing the HTML version, you can look at the source for this document \-\- use the \(dqShow Source\(dq link in the sidebar. .INDENT 0.0 .INDENT 3.5 .SS Todo .sp Update the below link when we add new guides on these. .UNINDENT .UNINDENT .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 reStructuredText \%<> for a more in\-depth introduction to reStructuredText, including markup added by Sphinx. .UNINDENT .UNINDENT .SS Running the build .sp Now that you have added some files and content, let\(aqs make a first build of the docs. A build is started with the \fBsphinx\-build\fP program: .INDENT 0.0 .INDENT 3.5 .sp .EX $ sphinx\-build \-M html sourcedir outputdir .EE .UNINDENT .UNINDENT .sp where \fIsourcedir\fP is the source directory \%<#\:term-source-directory>, and \fIoutputdir\fP is the directory in which you want to place the built documentation. The \fB\-M\fP \%<#\:cmdoption-sphinx-build-M> option selects a builder; in this example Sphinx will build HTML files. .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 Refer to the sphinx\-build man page \%<> for all options that \fBsphinx\-build\fP supports. .UNINDENT .UNINDENT .sp You can also build a \fBlive version of the documentation\fP that you can preview in the browser. It will detect changes and reload the page any time you make edits. To do so, use sphinx\-autobuild \% to run the following command: .INDENT 0.0 .INDENT 3.5 .sp .EX $ sphinx\-autobuild source\-dir output\-dir .EE .UNINDENT .UNINDENT .sp However, \fBsphinx\-quickstart\fP script creates a \fBMakefile\fP and a \fBmake.bat\fP which make life even easier for you. These can be executed by running \fBmake\fP with the name of the builder. For example. .INDENT 0.0 .INDENT 3.5 .sp .EX $ make html .EE .UNINDENT .UNINDENT .sp This will build HTML docs in the build directory you chose. Execute \fBmake\fP without an argument to see which targets are available. .INDENT 0.0 .INDENT 3.5 .IP "How do I generate PDF documents?" .sp \fBmake latexpdf\fP runs the \fBLaTeX builder\fP \%<#\:sphinx\:.builders\:.latex\:.LaTeXBuilder> and readily invokes the pdfTeX toolchain for you. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .SS Todo .sp Move this whole section into a guide on rST or directives .UNINDENT .UNINDENT .SS Documenting objects .sp One of Sphinx\(aqs main objectives is easy documentation of \fIobjects\fP (in a very general sense) in any \fIdomain\fP\&. A domain is a collection of object types that belong together, complete with markup to create and reference descriptions of these objects. .sp The most prominent domain is the Python domain. For example, to document Python\(aqs built\-in function \fBenumerate()\fP, you would add this to one of your source files. .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. py:function:: enumerate(sequence[, start=0]) Return an iterator that yields tuples of an index and an item of the *sequence*. (And so on.) .EE .UNINDENT .UNINDENT .sp This is rendered like this: .INDENT 0.0 .TP .B enumerate(sequence[, start=0]) Return an iterator that yields tuples of an index and an item of the \fIsequence\fP\&. (And so on.) .UNINDENT .sp The argument of the directive is the \fIsignature\fP of the object you describe, the content is the documentation for it. Multiple signatures can be given, each in its own line. .sp The Python domain also happens to be the default domain, so you don\(aqt need to prefix the markup with the domain name. .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. function:: enumerate(sequence[, start=0]) ... .EE .UNINDENT .UNINDENT .sp does the same job if you keep the default setting for the default domain. .sp There are several more directives for documenting other types of Python objects, for example \fBpy:class\fP \%<#\:directive-py-class> or \fBpy:method\fP \%<#\:directive-py-method>\&. There is also a cross\-referencing \fIrole\fP for each of these object types. This markup will create a link to the documentation of \fBenumerate()\fP\&. .INDENT 0.0 .INDENT 3.5 .sp .EX The :py:func:\(gaenumerate\(ga function can be used for ... .EE .UNINDENT .UNINDENT .sp And here is the proof: A link to \fBenumerate()\fP\&. .sp Again, the \fBpy:\fP can be left out if the Python domain is the default one. It doesn\(aqt matter which file contains the actual documentation for \fBenumerate()\fP; Sphinx will find it and create a link to it. .sp Each domain will have special rules for how the signatures can look like, and make the formatted output look pretty, or add specific features like links to parameter types, e.g. in the C/C++ domains. .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 Domains \%<> for all the available domains and their directives/roles. .UNINDENT .UNINDENT .SS Basic configuration .sp Earlier we mentioned that the \fBconf.py\fP file controls how Sphinx processes your documents. In that file, which is executed as a Python source file, you assign configuration values. For advanced users: since it is executed by Sphinx, you can do non\-trivial tasks in it, like extending \fBsys.path\fP \% or importing a module to find out the version you are documenting. .sp The config values that you probably want to change are already put into the \fBconf.py\fP by \fBsphinx\-quickstart\fP and initially commented out (with standard Python syntax: a \fB#\fP comments the rest of the line). To change the default value, remove the hash sign and modify the value. To customize a config value that is not automatically added by \fBsphinx\-quickstart\fP, just add an additional assignment. .sp Keep in mind that the file uses Python syntax for strings, numbers, lists and so on. The file is saved in UTF\-8 by default, as indicated by the encoding declaration in the first line. .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 Configuration \%<> for documentation of all available config values. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .SS Todo .sp Move this entire doc to a different section .UNINDENT .UNINDENT .SS Autodoc .sp When documenting Python code, it is common to put a lot of documentation in the source files, in documentation strings. Sphinx supports the inclusion of docstrings from your modules with an \fIextension\fP (an extension is a Python module that provides additional features for Sphinx projects) called \fIautodoc\fP\&. .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 \fBsphinx.ext.autodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> for the complete description of the features of autodoc. .UNINDENT .UNINDENT .SS Intersphinx .sp Many Sphinx documents including the Python documentation \% are published on the Internet. When you want to make links to such documents from your documentation, you can do it with \fBsphinx.ext.intersphinx\fP \%<#\:module-sphinx\:.ext\:.intersphinx>\&. .sp In order to use intersphinx, you need to activate it in \fBconf.py\fP by putting the string \fB\(aqsphinx.ext.intersphinx\(aq\fP into the \fBextensions\fP \%<#\:confval-extensions> list and set up the \fBintersphinx_mapping\fP \%<#\:confval-intersphinx_mapping> config value. .sp For example, to link to \fBio.open()\fP in the Python library manual, you need to setup your \fBintersphinx_mapping\fP \%<#\:confval-intersphinx_mapping> like: .INDENT 0.0 .INDENT 3.5 .sp .EX intersphinx_mapping = {\(aqpython\(aq: (\(aqhttps://docs.python.org/3\(aq, None)} .EE .UNINDENT .UNINDENT .sp And now, you can write a cross\-reference like \fB:py:func:\(gaio.open\(ga\fP\&. Any cross\-reference that has no matching target in the current documentation set, will be looked up in the documentation sets configured in \fBintersphinx_mapping\fP \%<#\:confval-intersphinx_mapping> (this needs access to the URL in order to download the list of valid targets). Intersphinx also works for some other domain \%<#\:term-domain>\(aqs roles including \fB:ref:\fP, however it doesn\(aqt work for \fB:doc:\fP as that is non\-domain role. .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 \fBsphinx.ext.intersphinx\fP \%<#\:module-sphinx\:.ext\:.intersphinx> for the complete description of the features of intersphinx. .UNINDENT .UNINDENT .SS More topics to be covered .INDENT 0.0 .IP \(bu 2 Other extensions \%<>: .IP \(bu 2 Static files .IP \(bu 2 Selecting a theme \%<> .IP \(bu 2 Templating \%<#\:templating> .IP \(bu 2 Using extensions .IP \(bu 2 Writing extensions \%<#\:dev-extensions> .UNINDENT .SH FOOTNOTES .IP [1] 5 This is the usual layout. However, \fBconf.py\fP can also live in another directory, the configuration directory \%<#\:term-configuration-directory>\&. Refer to the sphinx\-build man page \%<> for more information. .SS Build your first project .sp In this tutorial you will build a simple documentation project using Sphinx, and view it in your browser as HTML. The project will include narrative, handwritten documentation, as well as autogenerated API documentation. .sp The tutorial is aimed towards Sphinx newcomers willing to learn the fundamentals of how projects are created and structured. You will create a fictional software library to generate random food recipes that will serve as a guide throughout the process, with the objective of properly documenting it. .sp To showcase Sphinx capabilities for code documentation you will use Python, which also supports \fIautomatic\fP documentation generation. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Several other languages are natively supported in Sphinx for \fImanual\fP code documentation, however they require extensions for \fIautomatic\fP code documentation, like Breathe \%\&. .UNINDENT .UNINDENT .sp To follow the instructions you will need access to a Linux\-like command line and a basic understanding of how it works, as well as a working Python installation for development, since you will use \fIPython virtual environments\fP to create the project. .SS Getting started .SS Setting up your project and development environment .sp In a new directory, create a file called \fBREADME.rst\fP with the following content. .sp README.rst .INDENT 0.0 .INDENT 3.5 .sp .EX Lumache ======= **Lumache** (/lu\(aqmake/) is a Python library for cooks and food lovers that creates recipes mixing random ingredients. .EE .UNINDENT .UNINDENT .sp It is a good moment to create a Python virtual environment and install the required tools. For that, open a command line terminal, \fBcd\fP into the directory you just created, and run the following commands: .INDENT 0.0 .INDENT 3.5 .sp .EX $ python \-m venv .venv $ source .venv/bin/activate (.venv) $ python \-m pip install sphinx .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The installation method used above is described in more detail in PyPI package \%<#\:install-pypi>\&. For the rest of this tutorial, the instructions will assume a Python virtual environment. .UNINDENT .UNINDENT .sp If you executed these instructions correctly, you should have the Sphinx command line tools available. You can do a basic verification running this command: .INDENT 0.0 .INDENT 3.5 .sp .EX (.venv) $ sphinx\-build \-\-version sphinx\-build 4.0.2 .EE .UNINDENT .UNINDENT .sp If you see a similar output, you are on the right path! .SS Creating the documentation layout .sp Then from the command line, run the following command: .INDENT 0.0 .INDENT 3.5 .sp .EX (.venv) $ sphinx\-quickstart docs .EE .UNINDENT .UNINDENT .sp This will present to you a series of questions required to create the basic directory and configuration layout for your project inside the \fBdocs\fP folder. To proceed, answer each question as follows: .INDENT 0.0 .IP \(bu 2 \fB> Separate source and build directories (y/n) [n]\fP: Write \(dq\fBy\fP\(dq (without quotes) and press \fBEnter\fP\&. .IP \(bu 2 \fB> Project name\fP: Write \(dq\fBLumache\fP\(dq (without quotes) and press \fBEnter\fP\&. .IP \(bu 2 \fB> Author name(s)\fP: Write \(dq\fBGraziella\fP\(dq (without quotes) and press \fBEnter\fP\&. .IP \(bu 2 \fB> Project release []\fP: Write \(dq\fB0.1\fP\(dq (without quotes) and press \fBEnter\fP\&. .IP \(bu 2 \fB> Project language [en]\fP: Leave it empty (the default, English) and press \fBEnter\fP\&. .UNINDENT .sp After the last question, you will see the new \fBdocs\fP directory with the following content. .INDENT 0.0 .INDENT 3.5 .sp .EX docs ├── build ├── make.bat ├── Makefile └── source ├── conf.py ├── index.rst ├── _static └── _templates .EE .UNINDENT .UNINDENT .sp The purpose of each of these files is: .INDENT 0.0 .TP .B \fBbuild/\fP An empty directory (for now) that will hold the rendered documentation. .TP .B \fBmake.bat\fP and \fBMakefile\fP Convenience scripts to simplify some common Sphinx operations, such as rendering the content. .TP .B \fBsource/conf.py\fP A Python script holding the configuration of the Sphinx project. It contains the project name and release you specified to \fBsphinx\-quickstart\fP, as well as some extra configuration keys. .TP .B \fBsource/index.rst\fP The root document \%<#\:term-root-document> of the project, which serves as welcome page and contains the root of the \(dqtable of contents tree\(dq (or \fItoctree\fP). .UNINDENT .sp Thanks to this bootstrapping step, you already have everything needed to render the documentation as HTML for the first time. To do that, run this command: .INDENT 0.0 .INDENT 3.5 .sp .EX (.venv) $ sphinx\-build \-M html docs/source/ docs/build/ .EE .UNINDENT .UNINDENT .sp And finally, open \fBdocs/build/html/index.html\fP in your browser. You should see something like this: .INDENT 0.0 .INDENT 2.5 [image: Freshly created documentation of Lumache] [image] Freshly created documentation of Lumache.UNINDENT .UNINDENT .sp There we go! You created your first HTML documentation using Sphinx. Now you can start customizing it \%<>\&. .SS First steps to document your project using Sphinx .SS Building your HTML documentation .sp The \fBindex.rst\fP file that \fBsphinx\-quickstart\fP created has some content already, and it gets rendered as the front page of your HTML documentation. It is written in reStructuredText, a powerful markup language. .sp Modify the file as follows: .sp docs/source/index.rst .INDENT 0.0 .INDENT 3.5 .sp .EX Welcome to Lumache\(aqs documentation! =================================== **Lumache** (/lu\(aqmake/) is a Python library for cooks and food lovers that creates recipes mixing random ingredients. It pulls data from the \(gaOpen Food Facts database \(ga_ and offers a *simple* and *intuitive* API. \&.. note:: This project is under active development. .EE .UNINDENT .UNINDENT .sp This showcases several features of the reStructuredText syntax, including: .INDENT 0.0 .IP \(bu 2 a \fBsection header\fP using \fB===\fP for the underline, .IP \(bu 2 two examples of Inline markup \%<#\:rst-inline-markup>: \fB**strong emphasis**\fP (typically bold) and \fB*emphasis*\fP (typically italics), .IP \(bu 2 an \fBinline external link\fP, .IP \(bu 2 and a \fBnote\fP \fBadmonition\fP (one of the available directives \%<#\:rst-directives>) .UNINDENT .sp Now to render it with the new content, you can use the \fBsphinx\-build\fP command as before, or leverage the convenience script as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX (.venv) $ cd docs (.venv) $ make html .EE .UNINDENT .UNINDENT .sp After running this command, you will see that \fBindex.html\fP reflects the new changes! .SS Building your documentation in other formats .sp Sphinx supports a variety of formats apart from HTML, including PDF, EPUB, and more \%<#\:builders>\&. For example, to build your documentation in EPUB format, run this command from the \fBdocs\fP directory: .INDENT 0.0 .INDENT 3.5 .sp .EX (.venv) $ make epub .EE .UNINDENT .UNINDENT .sp After that, you will see the files corresponding to the e\-book under \fBdocs/build/epub/\fP\&. You can either open \fBLumache.epub\fP with an EPUB\-compatible e\-book viewer, like Calibre \%, or preview \fBindex.xhtml\fP on a web browser. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 To quickly display a complete list of possible output formats, plus some extra useful commands, you can run \fBmake help\fP\&. .UNINDENT .UNINDENT .sp Each output format has some specific configuration options that you can tune, including EPUB \%<#\:epub-options>\&. For instance, the default value of \fBepub_show_urls\fP \%<#\:confval-epub_show_urls> is \fBinline\fP, which means that, by default, URLs are shown right after the corresponding link, in parentheses. You can change that behavior by adding the following code at the end of your \fBconf.py\fP: .sp docs/source/conf.py .INDENT 0.0 .INDENT 3.5 .sp .EX # EPUB options epub_show_urls = \(aqfootnote\(aq .EE .UNINDENT .UNINDENT .sp With this configuration value, and after running \fBmake epub\fP again, you will notice that URLs appear now as footnotes, which avoids cluttering the text. Sweet! Read on to explore other ways to customize Sphinx \%<>\&. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Generating a PDF using Sphinx can be done running \fBmake latexpdf\fP, provided that the system has a working LaTeX installation, as explained in the documentation of \fBsphinx.builders.latex.LaTeXBuilder\fP \%<#\:sphinx\:.builders\:.latex\:.LaTeXBuilder>\&. Although this is perfectly feasible, such installations are often big, and in general LaTeX requires careful configuration in some cases, so PDF generation is out of scope for this tutorial. .UNINDENT .UNINDENT .SS More Sphinx customization .sp There are two main ways to customize your documentation beyond what is possible with core Sphinx: extensions and themes. .SS Enabling a built\-in extension .sp In addition to these configuration values, you can customize Sphinx even more by using extensions \%<>\&. Sphinx ships several builtin ones \%<#\:builtin-extensions>, and there are many more maintained by the community \%<#\:third-party-extensions>\&. .sp For example, to enable the \fBsphinx.ext.duration\fP \%<#\:module-sphinx\:.ext\:.duration> extension, locate the \fBextensions\fP list in your \fBconf.py\fP and add one element as follows: .sp docs/source/conf.py .INDENT 0.0 .INDENT 3.5 .sp .EX # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named \(aqsphinx.ext.*\(aq) or your custom # ones. extensions = [ \(aqsphinx.ext.duration\(aq, ] .EE .UNINDENT .UNINDENT .sp After that, every time you generate your documentation, you will see a short durations report at the end of the console output, like this one: .INDENT 0.0 .INDENT 3.5 .sp .EX (.venv) $ make html \&... The HTML pages are in build/html. ====================== slowest reading durations ======================= 0.042 temp/source/index .EE .UNINDENT .UNINDENT .SS Using a third\-party HTML theme .sp Themes, on the other hand, are a way to customize the appearance of your documentation. Sphinx has several builtin themes \%<#\:builtin-themes>, and there are also third\-party ones \%\&. .sp For example, to use the Furo \% third\-party theme in your HTML documentation, first you will need to install it with \fBpip\fP in your Python virtual environment, like this: .INDENT 0.0 .INDENT 3.5 .sp .EX (.venv) $ pip install furo .EE .UNINDENT .UNINDENT .sp And then, locate the \fBhtml_theme\fP variable on your \fBconf.py\fP and replace its value as follows: .sp docs/source/conf.py .INDENT 0.0 .INDENT 3.5 .sp .EX # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = \(aqfuro\(aq .EE .UNINDENT .UNINDENT .sp With this change, you will notice that your HTML documentation has now a new appearance: .INDENT 0.0 .INDENT 2.5 [image: HTML documentation of Lumache with the Furo theme] [image] HTML documentation of Lumache with the Furo theme.UNINDENT .UNINDENT .sp It is now time to expand the narrative documentation and split it into several documents \%<>\&. .SS Narrative documentation in Sphinx .SS Structuring your documentation across multiple pages .sp The file \fBindex.rst\fP created by \fBsphinx\-quickstart\fP is the root document \%<#\:term-root-document>, whose main function is to serve as a welcome page and to contain the root of the \(dqtable of contents tree\(dq (or \fItoctree\fP). Sphinx allows you to assemble a project from different files, which is helpful when the project grows. .sp As an example, create a new file \fBdocs/source/usage.rst\fP (next to \fBindex.rst\fP) with these contents: .sp docs/source/usage.rst .INDENT 0.0 .INDENT 3.5 .sp .EX Usage ===== Installation \-\-\-\-\-\-\-\-\-\-\-\- To use Lumache, first install it using pip: \&.. code\-block:: console (.venv) $ pip install lumache .EE .UNINDENT .UNINDENT .sp This new file contains two section \%<#\:rst-sections> headers, normal paragraph text, and a \fBcode\-block\fP \%<#\:directive-code-block> directive that renders a block of content as source code, with appropriate syntax highlighting (in this case, generic \fBconsole\fP text). .sp The structure of the document is determined by the succession of heading styles, which means that, by using \fB\-\-\-\fP for the \(dqInstallation\(dq section after \fB===\fP for the \(dqUsage\(dq section, you have declared \(dqInstallation\(dq to be a \fIsubsection\fP of \(dqUsage\(dq. .sp To complete the process, add a \fBtoctree\fP directive \%<#\:rst-directives> at the end of \fBindex.rst\fP including the document you just created, as follows: .sp docs/source/index.rst .INDENT 0.0 .INDENT 3.5 .sp .EX Contents \-\-\-\-\-\-\-\- \&.. toctree:: usage .EE .UNINDENT .UNINDENT .sp This step inserts that document in the root of the \fItoctree\fP, so now it belongs to the structure of your project, which so far looks like this: .INDENT 0.0 .INDENT 3.5 .sp .EX index └── usage .EE .UNINDENT .UNINDENT .sp If you build the HTML documentation running \fBmake html\fP, you will see that the \fBtoctree\fP gets rendered as a list of hyperlinks, and this allows you to navigate to the new page you just created. Neat! .sp \fBWarning:\fP .INDENT 0.0 .INDENT 3.5 Documents outside a \fItoctree\fP will result in \fBWARNING: document isn\(aqt included in any toctree\fP messages during the build process, and will be unreachable for users. .UNINDENT .UNINDENT .SS Adding cross\-references .sp One powerful feature of Sphinx is the ability to seamlessly add cross\-references \%<#\:xref> to specific parts of the documentation: a document, a section, a figure, a code object, etc. This tutorial is full of them! .sp To add a cross\-reference, write this sentence right after the introduction paragraph in \fBindex.rst\fP: .sp docs/source/index.rst .INDENT 0.0 .INDENT 3.5 .sp .EX Check out the :doc:\(gausage\(ga section for further information. .EE .UNINDENT .UNINDENT .sp The \fBdoc\fP \%<#\:role-doc> role \%<#\:rst-roles> you used automatically references a specific document in the project, in this case the \fBusage.rst\fP you created earlier. .sp Alternatively, you can also add a cross\-reference to an arbitrary part of the project. For that, you need to use the \fBref\fP \%<#\:role-ref> role, and add an explicit \fIlabel\fP that acts as a target \%\&. .sp For example, to reference the \(dqInstallation\(dq subsection, add a label right before the heading, as follows: .sp docs/source/usage.rst .INDENT 0.0 .INDENT 3.5 .sp .EX Usage ===== \&.. _installation: Installation \-\-\-\-\-\-\-\-\-\-\-\- \&... .EE .UNINDENT .UNINDENT .sp And make the sentence you added in \fBindex.rst\fP look like this: .sp docs/source/index.rst .INDENT 0.0 .INDENT 3.5 .sp .EX Check out the :doc:\(gausage\(ga section for further information, including how to :ref:\(gainstall \(ga the project. .EE .UNINDENT .UNINDENT .sp Notice a trick here: the \fBinstall\fP part specifies how the link will look like (we want it to be a specific word, so the sentence makes sense), whereas the \fB\fP part refers to the actual label we want to add a cross\-reference to. If you do not include an explicit title, hence using \fB:ref:\(gainstallation\(ga\fP, the section title will be used (in this case, \fBInstallation\fP). Both the \fB:doc:\fP and the \fB:ref:\fP roles will be rendered as hyperlinks in the HTML documentation. .sp What about documenting code objects in Sphinx \%<>? Read on! .SS Describing code in Sphinx .sp In the previous sections of the tutorial \%<> you can read how to write narrative or prose documentation in Sphinx. In this section you will describe code objects instead. .sp Sphinx supports documenting code objects in several languages, namely Python, C, C++, JavaScript, and reStructuredText. Each of them can be documented using a series of directives and roles grouped by domain \%<>\&. For the remainder of the tutorial you will use the Python domain, but all the concepts seen in this section apply for the other domains as well. .SS Python .SS Documenting Python objects .sp Sphinx offers several roles and directives to document Python objects, all grouped together in the Python domain \%<>\&. For example, you can use the \fBpy:function\fP \%<#\:directive-py-function> directive to document a Python function, as follows: .sp docs/source/usage.rst .INDENT 0.0 .INDENT 3.5 .sp .EX Creating recipes \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- To retrieve a list of random ingredients, you can use the \(ga\(galumache.get_random_ingredients()\(ga\(ga function: \&.. py:function:: lumache.get_random_ingredients(kind=None) Return a list of random ingredients as strings. :param kind: Optional \(dqkind\(dq of ingredients. :type kind: list[str] or None :return: The ingredients list. :rtype: list[str] .EE .UNINDENT .UNINDENT .sp Which will render like this: .INDENT 0.0 .INDENT 2.5 [image: HTML result of documenting a Python function in Sphinx] [image] The rendered result of documenting a Python function in Sphinx.UNINDENT .UNINDENT .sp Notice several things: .INDENT 0.0 .IP \(bu 2 Sphinx parsed the argument of the \fB\&.. py:function\fP directive and highlighted the module, the function name, and the parameters appropriately. .IP \(bu 2 The directive content includes a one\-line description of the function, as well as an info field list \%<#\:info-field-lists> containing the function parameter, its expected type, the return value, and the return type. .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The \fBpy:\fP prefix specifies the domain \%<#\:term-domain>\&. You may configure the default domain so you can omit the prefix, either globally using the \fBprimary_domain\fP \%<#\:confval-primary_domain> configuration, or use the \fBdefault\-domain\fP \%<#\:directive-default-domain> directive to change it from the point it is called until the end of the file. For example, if you set it to \fBpy\fP (the default), you can write \fB\&.. function::\fP directly. .UNINDENT .UNINDENT .SS Cross\-referencing Python objects .sp By default, most of these directives generate entities that can be cross\-referenced from any part of the documentation by using a corresponding role \%<#\:python-xref-roles>\&. For the case of functions, you can use \fBpy:func\fP \%<#\:role-py-func> for that, as follows: .sp docs/source/usage.rst .INDENT 0.0 .INDENT 3.5 .sp .EX The \(ga\(gakind\(ga\(ga parameter should be either \(ga\(ga\(dqmeat\(dq\(ga\(ga, \(ga\(ga\(dqfish\(dq\(ga\(ga, or \(ga\(ga\(dqveggies\(dq\(ga\(ga. Otherwise, :py:func:\(galumache.get_random_ingredients\(ga will raise an exception. .EE .UNINDENT .UNINDENT .sp When generating code documentation, Sphinx will generate a cross\-reference automatically just by using the name of the object, without you having to explicitly use a role for that. For example, you can describe the custom exception raised by the function using the \fBpy:exception\fP \%<#\:directive-py-exception> directive: .sp docs/source/usage.rst .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. py:exception:: lumache.InvalidKindError Raised if the kind is invalid. .EE .UNINDENT .UNINDENT .sp Then, add this exception to the original description of the function: .sp docs/source/usage.rst .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. py:function:: lumache.get_random_ingredients(kind=None) Return a list of random ingredients as strings. :param kind: Optional \(dqkind\(dq of ingredients. :type kind: list[str] or None :raise lumache.InvalidKindError: If the kind is invalid. :return: The ingredients list. :rtype: list[str] .EE .UNINDENT .UNINDENT .sp And finally, this is how the result would look: .INDENT 0.0 .INDENT 2.5 [image: HTML result of documenting a Python function in Sphinx with cross-references] [image] HTML result of documenting a Python function in Sphinx with cross\-references.UNINDENT .UNINDENT .sp Beautiful, isn\(aqt it? .SS Including doctests in your documentation .sp Since you are now describing code from a Python library, it will become useful to keep both the documentation and the code as synchronized as possible. One of the ways to do that in Sphinx is to include code snippets in the documentation, called \fIdoctests\fP, that are executed when the documentation is built. .sp To demonstrate doctests and other Sphinx features covered in this tutorial, Sphinx will need to be able to import the code. To achieve that, write this at the beginning of \fBconf.py\fP: .sp docs/source/conf.py .INDENT 0.0 .INDENT 3.5 .sp .EX # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. import sys from pathlib import Path sys.path.insert(0, str(Path(__file__).resolve().parents[2])) .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 An alternative to changing the \fBsys.path\fP \% variable is to create a \fBpyproject.toml\fP file and make the code installable, so it behaves like any other Python library. However, the \fBsys.path\fP approach is simpler. .UNINDENT .UNINDENT .sp Then, before adding doctests to your documentation, enable the doctest \%<> extension in \fBconf.py\fP: .sp docs/source/conf.py .INDENT 0.0 .INDENT 3.5 .sp .EX extensions = [ \(aqsphinx.ext.duration\(aq, \(aqsphinx.ext.doctest\(aq, ] .EE .UNINDENT .UNINDENT .sp Next, write a doctest block as follows: .sp docs/source/usage.rst .INDENT 0.0 .INDENT 3.5 .sp .EX >>> import lumache >>> lumache.get_random_ingredients() [\(aqshells\(aq, \(aqgorgonzola\(aq, \(aqparsley\(aq] .EE .UNINDENT .UNINDENT .sp Doctests include the Python instructions to be run preceded by \fB>>>\fP, the standard Python interpreter prompt, as well as the expected output of each instruction. This way, Sphinx can check whether the actual output matches the expected one. .sp To observe how a doctest failure looks like (rather than a code error as above), let\(aqs write the return value incorrectly first. Therefore, add a function \fBget_random_ingredients\fP like this: .sp lumache.py .INDENT 0.0 .INDENT 3.5 .sp .EX def get_random_ingredients(kind=None): return [\(dqeggs\(dq, \(dqbacon\(dq, \(dqspam\(dq] .EE .UNINDENT .UNINDENT .sp You can now run \fBmake doctest\fP to execute the doctests of your documentation. Initially this will display an error, since the actual code does not behave as specified: .INDENT 0.0 .INDENT 3.5 .sp .EX (.venv) $ make doctest Running Sphinx v4.2.0 loading pickled environment... done \&... running tests... Document: usage \-\-\-\-\-\-\-\-\-\-\-\-\-\-\- ********************************************************************** File \(dqusage.rst\(dq, line 44, in default Failed example: lumache.get_random_ingredients() Expected: [\(aqshells\(aq, \(aqgorgonzola\(aq, \(aqparsley\(aq] Got: [\(aqeggs\(aq, \(aqbacon\(aq, \(aqspam\(aq] ********************************************************************** \&... make: *** [Makefile:20: doctest] Error 1 .EE .UNINDENT .UNINDENT .sp As you can see, doctest reports the expected and the actual results, for easy examination. It is now time to fix the function: .sp lumache.py .INDENT 0.0 .INDENT 3.5 .sp .EX def get_random_ingredients(kind=None): return [\(dqshells\(dq, \(dqgorgonzola\(dq, \(dqparsley\(dq] .EE .UNINDENT .UNINDENT .sp And finally, \fBmake doctest\fP reports success! .sp For big projects though, this manual approach can become a bit tedious. In the next section, you will see how to automate the process \%<>\&. .SS Other languages (C, C++, others) .SS Documenting and cross\-referencing objects .sp Sphinx also supports documenting and cross\-referencing objects written in other programming languages. There are four additional built\-in domains: C, C++, JavaScript, and reStructuredText. Third\-party extensions may define domains for more languages, such as .INDENT 0.0 .IP \(bu 2 Fortran \%, .IP \(bu 2 Julia \%, or .IP \(bu 2 PHP \%\&. .UNINDENT .sp For example, to document a C++ type definition, you would use the built\-in \fBcpp:type\fP \%<#\:directive-cpp-type> directive, as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. cpp:type:: std::vector CustomList A typedef\-like declaration of a type. .EE .UNINDENT .UNINDENT .sp Which would give the following result: .INDENT 0.0 .TP .B typedef std::vector CustomList A typedef\-like declaration of a type. .UNINDENT .sp All such directives then generate references that can be cross\-referenced by using the corresponding role. For example, to reference the previous type definition, you can use the \fBcpp:type\fP \%<#\:role-cpp-type> role as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX Cross reference to :cpp:type:\(gaCustomList\(ga. .EE .UNINDENT .UNINDENT .sp Which would produce a hyperlink to the previous definition: \fBCustomList\fP\&. .SS Automatic documentation generation from code .sp In the previous section \%<#\:tutorial-describing-objects> of the tutorial you manually documented a Python function in Sphinx. However, the description was out of sync with the code itself, since the function signature was not the same. Besides, it would be nice to reuse \fBPython docstrings\fP \% in the documentation, rather than having to write the information in two places. .sp Fortunately, the autodoc extension \%<> provides this functionality. .SS Reusing signatures and docstrings with autodoc .sp To use autodoc, first add it to the list of enabled extensions: .sp docs/source/conf.py .INDENT 0.0 .INDENT 3.5 .sp .EX extensions = [ \(aqsphinx.ext.duration\(aq, \(aqsphinx.ext.doctest\(aq, \(aqsphinx.ext.autodoc\(aq, ] .EE .UNINDENT .UNINDENT .sp Next, move the content of the \fB\&.. py:function\fP directive to the function docstring in the original Python file, as follows: .sp lumache.py .INDENT 0.0 .INDENT 3.5 .sp .EX def get_random_ingredients(kind=None): \(dq\(dq\(dq Return a list of random ingredients as strings. :param kind: Optional \(dqkind\(dq of ingredients. :type kind: list[str] or None :raise lumache.InvalidKindError: If the kind is invalid. :return: The ingredients list. :rtype: list[str] \(dq\(dq\(dq return [\(dqshells\(dq, \(dqgorgonzola\(dq, \(dqparsley\(dq] .EE .UNINDENT .UNINDENT .sp Finally, replace the \fB\&.. py:function\fP directive from the Sphinx documentation with \fBautofunction\fP \%<#\:directive-autofunction>: .sp docs/source/usage.rst .INDENT 0.0 .INDENT 3.5 .sp .EX you can use the \(ga\(galumache.get_random_ingredients()\(ga\(ga function: \&.. autofunction:: lumache.get_random_ingredients .EE .UNINDENT .UNINDENT .sp If you now build the HTML documentation, the output will be the same! With the advantage that it is generated from the code itself. Sphinx took the reStructuredText from the docstring and included it, also generating proper cross\-references. .sp You can also autogenerate documentation from other objects. For example, add the code for the \fBInvalidKindError\fP exception: .sp lumache.py .INDENT 0.0 .INDENT 3.5 .sp .EX class InvalidKindError(Exception): \(dq\(dq\(dqRaised if the kind is invalid.\(dq\(dq\(dq pass .EE .UNINDENT .UNINDENT .sp And replace the \fB\&.. py:exception\fP directive with \fBautoexception\fP \%<#\:directive-autoexception> as follows: .sp docs/source/usage.rst .INDENT 0.0 .INDENT 3.5 .sp .EX or \(ga\(ga\(dqveggies\(dq\(ga\(ga. Otherwise, :py:func:\(galumache.get_random_ingredients\(ga will raise an exception. \&.. autoexception:: lumache.InvalidKindError .EE .UNINDENT .UNINDENT .sp And again, after running \fBmake html\fP, the output will be the same as before. .SS Generating comprehensive API references .sp While using \fBsphinx.ext.autodoc\fP makes keeping the code and the documentation in sync much easier, it still requires you to write an \fBauto*\fP directive for every object you want to document. Sphinx provides yet another level of automation: the autosummary \%<> extension. .sp The \fBautosummary\fP \%<#\:directive-autosummary> directive generates documents that contain all the necessary \fBautodoc\fP directives. To use it, first enable the autosummary extension: .sp docs/source/conf.py .INDENT 0.0 .INDENT 3.5 .sp .EX extensions = [ \(aqsphinx.ext.duration\(aq, \(aqsphinx.ext.doctest\(aq, \(aqsphinx.ext.autodoc\(aq, \(aqsphinx.ext.autosummary\(aq, ] .EE .UNINDENT .UNINDENT .sp Next, create a new \fBapi.rst\fP file with these contents: .sp docs/source/api.rst .INDENT 0.0 .INDENT 3.5 .sp .EX API === \&.. autosummary:: :toctree: generated lumache .EE .UNINDENT .UNINDENT .sp Remember to include the new document in the root toctree: .sp docs/source/index.rst .INDENT 0.0 .INDENT 3.5 .sp .EX Contents \-\-\-\-\-\-\-\- \&.. toctree:: usage api .EE .UNINDENT .UNINDENT .sp Finally, after you build the HTML documentation running \fBmake html\fP, it will contain two new pages: .INDENT 0.0 .IP \(bu 2 \fBapi.html\fP, corresponding to \fBdocs/source/api.rst\fP and containing a table with the objects you included in the \fBautosummary\fP directive (in this case, only one). .IP \(bu 2 \fBgenerated/lumache.html\fP, corresponding to a newly created reStructuredText file \fBgenerated/lumache.rst\fP and containing a summary of members of the module, in this case one function and one exception. .UNINDENT .INDENT 0.0 .INDENT 2.5 [image: Summary page created by autosummary] [image] Summary page created by autosummary.UNINDENT .UNINDENT .sp Each of the links in the summary page will take you to the places where you originally used the corresponding \fBautodoc\fP directive, in this case in the \fBusage.rst\fP document. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The generated files are based on Jinja2 templates \% that can be customized \%<#\:autosummary-customizing-templates>, but that is out of scope for this tutorial. .UNINDENT .UNINDENT .SS Appendix: Deploying a Sphinx project online .sp When you are ready to show your documentation project to the world, there are many options available to do so. Since the HTML generated by Sphinx is static, you can decouple the process of building your HTML documentation from hosting such files in the platform of your choice. You will not need a sophisticated server running Python: virtually every web hosting service will suffice. .sp Therefore, the challenge is less how or where to serve the static HTML, but rather how to pick a workflow that automatically updates the deployed documentation every time there is a change in the source files. .sp The following sections describe some of the available options to deploy your online documentation, and give some background information. If you want to go directly to the practical part, you can skip to Publishing your documentation sources\&. .SS Sphinx\-friendly deployment options .sp There are several possible options you have to host your Sphinx documentation. Some of them are: .INDENT 0.0 .TP \fBRead the Docs\fP Read the Docs \% is an online service specialized in hosting technical documentation written in Sphinx, as well as MkDocs. They have a number of extra features, such as versioned documentation, traffic and search analytics, custom domains, user\-defined redirects, and more. .TP \fBGitHub Pages\fP GitHub Pages \% is a simple static web hosting tightly integrated with GitHub \%: static HTML is served from one of the branches of a project, and usually sources are stored in another branch so that the output can be updated every time the sources change (for example using GitHub Actions \%). It is free to use and supports custom domains. .TP \fBGitLab Pages\fP GitLab Pages \% is a similar concept to GitHub Pages, integrated with GitLab \% and usually automated with GitLab CI \% instead. .TP \fBNetlify\fP Netlify \% is a sophisticated hosting for static sites enhanced by client\-side web technologies like JavaScript (so\-called \(dqJamstack\(dq \%). They offer support for headless content management systems and serverless computing. .TP \fBYour own server\fP You can always use your own web server to host Sphinx HTML documentation. It is the option that gives more flexibility, but also more complexity. .UNINDENT .sp All these options have zero cost, with the option of paying for extra features. .SS Embracing the \(dqDocs as Code\(dq philosophy .sp The free offerings of most of the options listed above require your documentation sources to be publicly available. Moreover, these services expect you to use a Version Control System \%, a technology that tracks the evolution of a collection of files as a series of snapshots (\(dqcommits\(dq). The practice of writing documentation in plain text files with the same tools as the ones used for software development is commonly known as \(dqDocs as Code\(dq \%\&. .sp The most popular Version Control System nowadays is Git \%, a free and open source tool that is the backbone of services like GitHub and GitLab. Since both Read the Docs and Netlify have integrations with GitHub and GitLab, and both GitHub and GitLab have an integrated Pages product, the most effective way of automatically build your documentation online is to upload your sources to either of these Git hosting services. .SS Publishing your documentation sources .SS GitHub .sp The quickest way to upload an existing project to GitHub is to: .INDENT 0.0 .IP 1. 3 Sign up for a GitHub account \%\&. .IP 2. 3 Create a new repository \%\&. .IP 3. 3 Open the \(dqUpload files\(dq page \% of your new repository. .IP 4. 3 Select the files on your operating system file browser (in your case \fBREADME.rst\fP, \fBlumache.py\fP, the makefiles under the \fBdocs\fP directory, and everything under \fBdocs/source\fP) and drag them to the GitHub interface to upload them all. .IP 5. 3 Click on the Commit changes button. .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Make sure you don\(aqt upload the \fBdocs/build\fP directory, as it contains the output generated by Sphinx and it will change every time you change the sources, complicating your workflow. .UNINDENT .UNINDENT .sp These steps do not require access to the command line or installing any additional software. To learn more, read this quickstart tutorial \% or consult the official GitHub documentation \% .SS GitLab .sp Similarly to GitHub, the fastest way to upload your project to GitLab is using the web interface: .INDENT 0.0 .IP 1. 3 Sign up for a GitLab account \%\&. .IP 2. 3 Create a new blank project \%\&. .IP 3. 3 Upload the project files (in your case \fBREADME.rst\fP, \fBlumache.py\fP, the makefiles under the \fBdocs\fP directory, and everything under \fBdocs/source\fP) one by one using the Upload File button [1]\&. .UNINDENT .sp Again, these steps do not require additional software on your computer. To learn more, you can: .INDENT 0.0 .IP \(bu 2 Follow this tutorial \% to install Git on your machine. .IP \(bu 2 Browse the GitLab User documentation \% to understand the possibilities of the platform. .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Make sure you don\(aqt upload the \fBdocs/build\fP directory, as it contains the output generated by Sphinx and it will change every time you change the sources, complicating your workflow. .UNINDENT .UNINDENT .IP [1] 5 At the time of writing, uploading whole directories to GitLab using only the web interface \% is not yet implemented. .SS Publishing your HTML documentation .SS Read the Docs .sp Read the Docs \% offers integration with both GitHub and GitLab. The quickest way of getting started is to follow the RTD tutorial \%, which is loosely based on this one. You can publish your sources on GitHub as explained in the previous section, then skip directly to Creating a Read the Docs account \%\&. If you choose GitLab instead, the process is similar. .SS GitHub Pages .sp GitHub Pages \% requires you to publish your sources on GitHub \%\&. After that, you will need an automated process that performs the \fBmake html\fP step every time the sources change. That can be achieved using GitHub Actions \%\&. .sp After you have published your sources on GitHub, create a file named \fB\&.github/workflows/sphinx.yml\fP in your repository with the following contents: .sp \&.github/workflows/sphinx.yml .INDENT 0.0 .INDENT 3.5 .sp .EX name: \(dqSphinx: Render docs\(dq on: push jobs: build: runs\-on: ubuntu\-latest permissions: contents: write steps: \- uses: actions/checkout@v4 with: persist\-credentials: false \- name: Build HTML uses: ammaraskar/sphinx\-action@master \- name: Upload artifacts uses: actions/upload\-artifact@v4 with: name: html\-docs path: docs/build/html/ \- name: Deploy uses: peaceiris/actions\-gh\-pages@v3 if: github.ref == \(aqrefs/heads/main\(aq with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs/build/html .EE .UNINDENT .UNINDENT .sp This contains a GitHub Actions workflow with a single job of four steps: .INDENT 0.0 .IP 1. 3 Checkout the code. .IP 2. 3 Build the HTML documentation using Sphinx. .IP 3. 3 Attach the HTML output the artifacts to the GitHub Actions job, for easier inspection. .IP 4. 3 If the change happens on the default branch, take the contents of \fBdocs/build/html\fP and push it to the \fBgh\-pages\fP branch. .UNINDENT .sp Next, you need to specify the dependencies for the \fBmake html\fP step to be successful. For that, create a file \fBdocs/requirements.txt\fP and add the following contents: .sp docs/requirements.txt .INDENT 0.0 .INDENT 3.5 .sp .EX furo==2021.11.16 .EE .UNINDENT .UNINDENT .sp And finally, you are ready to publish GitHub Pages from a branch \%\&. For that, go to Settings, then Pages on the left sidebar, select the \fBDeploy from a branch\fP item in the \(dqSource\(dq dropdown menu, select the \fBgh\-page\fP branch in the \(dqBranch\(dq dropdown menu, and click Save\&. After a few minutes, you should be able to see your HTML at the designated URL. .SS GitLab Pages .sp GitLab Pages \%, on the other hand, requires you to publish your sources on GitLab \%\&. When you are ready, you can automate the process of running \fBmake html\fP using GitLab CI \%\&. .sp After you have published your sources on GitLab, create a file named \fB\&.gitlab\-ci.yml\fP in your repository with these contents: .sp \&.gitlab\-ci.yml .INDENT 0.0 .INDENT 3.5 .sp .EX stages: \- deploy pages: stage: deploy image: python:3.14\-slim before_script: \- apt\-get update && apt\-get install make \-\-no\-install\-recommends \-y \- python \-m pip install sphinx furo script: \- cd docs && make html after_script: \- mv docs/build/html/ ./public/ artifacts: paths: \- public rules: \- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH .EE .UNINDENT .UNINDENT .sp This contains a GitLab CI workflow with one job of several steps: .INDENT 0.0 .IP 1. 3 Install the necessary dependencies. .IP 2. 3 Build the HTML documentation using Sphinx. .IP 3. 3 Move the output to a known artifacts location. .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 You will need to validate your account \% by entering a payment method (you will be charged a small amount that will then be reimbursed). .UNINDENT .UNINDENT .sp After that, if the pipeline is successful, you should be able to see your HTML at the designated URL. .SS Where to go from here .sp This tutorial covered the very first steps to create a documentation project with Sphinx. To continue learning more about Sphinx, check out the rest of the documentation \%<../\:contents\:.html>\&. .SH USER GUIDE .sp These sections cover various topics in using and extending Sphinx for various use\-cases. They are a comprehensive guide to using Sphinx in many contexts and assume more knowledge of Sphinx. If you are new to Sphinx, we recommend starting with Get started\&. .SS Using Sphinx .sp This guide serves to demonstrate how one can get started with Sphinx and covers everything from installing Sphinx and configuring your first Sphinx project to using some of the advanced features Sphinx provides out\-of\-the\-box. If you are looking for guidance on extending Sphinx, refer to Extending Sphinx \%<>\&. .SS reStructuredText .sp reStructuredText (reST) is the default plaintext markup language used by both Docutils and Sphinx. Docutils provides the basic reStructuredText syntax, while Sphinx extends this to support additional functionality. .sp The below guides go through the most important aspects of reStructuredText. For the authoritative reference, refer to the docutils documentation \%\&. .SS reStructuredText Primer .sp reStructuredText is the default plaintext markup language used by Sphinx. This section is a brief introduction to reStructuredText (reST) concepts and syntax, intended to provide authors with enough information to author documents productively. Since reStructuredText was designed to be a simple, unobtrusive markup language, this will not take too long. .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 The authoritative reStructuredText User Documentation \%\&. The \(dqref\(dq links in this document link to the description of the individual constructs in the reStructuredText reference. .UNINDENT .UNINDENT .SS Paragraphs .sp The paragraph (ref \%) is the most basic block in a reStructuredText document. Paragraphs are simply chunks of text separated by one or more blank lines. As in Python, indentation is significant in reStructuredText, so all lines of the same paragraph must be left\-aligned to the same level of indentation. .SS Inline markup .sp The standard reStructuredText inline markup is quite simple: use .INDENT 0.0 .IP \(bu 2 one asterisk: \fB*text*\fP for emphasis (italics), .IP \(bu 2 two asterisks: \fB**text**\fP for strong emphasis (boldface), and .IP \(bu 2 backquotes: \fB\(ga\(gatext\(ga\(ga\fP for code samples. .UNINDENT .sp If asterisks or backquotes appear in running text and could be confused with inline markup delimiters, they have to be escaped with a backslash. .sp Be aware of some restrictions of this markup: .INDENT 0.0 .IP \(bu 2 it may not be nested, .IP \(bu 2 content may not start or end with whitespace: \fB* text*\fP is wrong, .IP \(bu 2 it must be separated from surrounding text by non\-word characters. Use a backslash escaped space to work around that: \fBthisis\e *one*\e word\fP\&. .UNINDENT .sp These restrictions may be lifted in future versions of the docutils. .sp It is also possible to replace or expand upon some of this inline markup with roles. Refer to Roles for more information. .SS Lists and Quote\-like blocks .sp List markup (ref \%) is natural: just place an asterisk at the start of a paragraph and indent properly. The same goes for numbered lists; they can also be autonumbered using a \fB#\fP sign: .INDENT 0.0 .INDENT 3.5 .sp .EX * This is a bulleted list. * It has two items, the second item uses two lines. 1. This is a numbered list. 2. It has two items too. #. This is a numbered list. #. It has two items too. .EE .UNINDENT .UNINDENT .sp Nested lists are possible, but be aware that they must be separated from the parent list items by blank lines: .INDENT 0.0 .INDENT 3.5 .sp .EX * this is * a list * with a nested list * and some subitems * and here the parent list continues .EE .UNINDENT .UNINDENT .sp Definition lists (ref \%) are created as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX term (up to a line of text) Definition of the term, which must be indented and can even consist of multiple paragraphs next term Description. .EE .UNINDENT .UNINDENT .sp Note that the term cannot have more than one line of text. .sp Quoted paragraphs (ref \%) are created by just indenting them more than the surrounding paragraphs. .sp Line blocks (ref \%) are a way of preserving line breaks: .INDENT 0.0 .INDENT 3.5 .sp .EX | These lines are | broken exactly like in | the source file. .EE .UNINDENT .UNINDENT .sp There are also several more special blocks available: .INDENT 0.0 .IP \(bu 2 field lists (ref \%, with caveats noted in Field Lists) .IP \(bu 2 option lists (ref \%) .IP \(bu 2 quoted literal blocks (ref \%) .IP \(bu 2 doctest blocks (ref \%) .UNINDENT .SS Literal blocks .sp Literal code blocks (ref \%) are introduced by ending a paragraph with the special marker \fB::\fP\&. The literal block must be indented (and, like all paragraphs, separated from the surrounding ones by blank lines): .INDENT 0.0 .INDENT 3.5 .sp .EX This is a normal text paragraph. The next paragraph is a code sample:: It is not processed in any way, except that the indentation is removed. It can span multiple lines. This is a normal text paragraph again. .EE .UNINDENT .UNINDENT .sp The handling of the \fB::\fP marker is smart: .INDENT 0.0 .IP \(bu 2 If it occurs as a paragraph of its own, that paragraph is completely left out of the document. .IP \(bu 2 If it is preceded by whitespace, the marker is removed. .IP \(bu 2 If it is preceded by non\-whitespace, the marker is replaced by a single colon. .UNINDENT .sp That way, the second sentence in the above example\(aqs first paragraph would be rendered as \(dqThe next paragraph is a code sample:\(dq. .sp Code highlighting can be enabled for these literal blocks on a document\-wide basis using the \fBhighlight\fP \%<#\:directive-highlight> directive and on a project\-wide basis using the \fBhighlight_language\fP \%<#\:confval-highlight_language> configuration option. The \fBcode\-block\fP \%<#\:directive-code-block> directive can be used to set highlighting on a block\-by\-block basis. These directives are discussed later. .SS Doctest blocks .sp Doctest blocks (ref \%) are interactive Python sessions cut\-and\-pasted into docstrings. They do not require the literal blocks syntax. The doctest block must end with a blank line and should \fInot\fP end with an unused prompt: .INDENT 0.0 .INDENT 3.5 .sp .EX >>> 1 + 1 2 .EE .UNINDENT .UNINDENT .SS Tables .sp For \fIgrid tables\fP (ref \%), you have to \(dqpaint\(dq the cell grid yourself. They look like this: .INDENT 0.0 .INDENT 3.5 .sp .EX +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+ | Header row, column 1 | Header 2 | Header 3 | Header 4 | | (header rows optional) | | | | +========================+============+==========+==========+ | body row 1, column 1 | column 2 | column 3 | column 4 | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+ | body row 2 | ... | ... | | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+ .EE .UNINDENT .UNINDENT .sp \fISimple tables\fP (ref \%) are easier to write, but limited: they must contain more than one row, and the first column cells cannot contain multiple lines. They look like this: .INDENT 0.0 .INDENT 3.5 .sp .EX ===== ===== ======= A B A and B ===== ===== ======= False False False True False False False True False True True True ===== ===== ======= .EE .UNINDENT .UNINDENT .sp Two more syntaxes are supported: \fICSV tables\fP and \fIList tables\fP\&. They use an \fIexplicit markup block\fP\&. Refer to Tables \%<#\:table-directives> for more information. .SS Hyperlinks .SS External links .sp URLs and email addresses in text are automatically linked and do not need explicit markup at all. For example, \% is written with no special markup in the source of this document, and is recognised as an external hyperlink. .sp To create text with a link, the best approach is generally to put the URL below the paragraph as follows (ref \%): .INDENT 0.0 .INDENT 3.5 .sp .EX This is a paragraph that contains \(gaa link\(ga_. \&.. _a link: https://domain.invalid/ .EE .UNINDENT .UNINDENT .sp This keeps the paragraph more readable in source code. .sp Alternatively, you can embed the URL within the prose for an \(aqinline link\(aq. This can lead to longer lines, but has the benefit of keeping the link text and the URL pointed to in the same place. This uses the following syntax: \fB\(gaLink text \(ga__\fP (ref \%). .sp \fBImportant:\fP .INDENT 0.0 .INDENT 3.5 There must be a space between the link text and the opening angle bracket (\(aq\fB<\fP\(aq) for the URL. .UNINDENT .UNINDENT .sp \fBTip:\fP .INDENT 0.0 .INDENT 3.5 Use two trailing underscores when embedding the URL. Technically, a single underscore works as well, but that would create a named reference instead of an anonymous one. Named references typically do not have a benefit when the URL is embedded. Moreover, they have the disadvantage that you must make sure that you do not use the same \(dqLink text\(dq for another link in your document. .UNINDENT .UNINDENT .sp You can also separate the link and the target definition (ref \%), like this: .INDENT 0.0 .INDENT 3.5 .sp .EX This is a paragraph that contains \(gaa link\(ga_. \&.. _a link: https://domain.invalid/ .EE .UNINDENT .UNINDENT .SS Internal links .sp Internal linking is done via a special reStructuredText role provided by Sphinx, see the section on specific markup, Cross\-referencing arbitrary locations \%<#\:ref-role>\&. .SS Sections .sp Section headers (ref \%) are created by underlining (and optionally overlining) the section title with a punctuation character, at least as long as the text: .INDENT 0.0 .INDENT 3.5 .sp .EX ================= This is a heading ================= .EE .UNINDENT .UNINDENT .sp Normally, there are no heading levels assigned to certain characters as the structure is determined from the succession of headings. However, this convention is used in Python Developer\(aqs Guide for documenting \% which you may follow: .INDENT 0.0 .IP \(bu 2 \fB#\fP with overline, for parts .IP \(bu 2 \fB*\fP with overline, for chapters .IP \(bu 2 \fB=\fP for sections .IP \(bu 2 \fB\-\fP for subsections .IP \(bu 2 \fB^\fP for subsubsections .IP \(bu 2 \fB\(dq\fP for paragraphs .UNINDENT .sp Of course, you are free to use your own marker characters (see the reStructuredText documentation), and use a deeper nesting level, but keep in mind that most target formats (HTML, LaTeX) have a limited supported nesting depth. .SS Field Lists .sp Field lists (ref \%) are sequences of fields marked up like this: .INDENT 0.0 .INDENT 3.5 .sp .EX :fieldname: Field content .EE .UNINDENT .UNINDENT .sp They are commonly used in Python documentation: .INDENT 0.0 .INDENT 3.5 .sp .EX def my_function(my_arg, my_other_arg): \(dq\(dq\(dqA function just for me. :param my_arg: The first of my arguments. :param my_other_arg: The second of my arguments. :returns: A message (just for me, of course). \(dq\(dq\(dq .EE .UNINDENT .UNINDENT .sp Sphinx extends standard docutils behavior and intercepts field lists specified at the beginning of documents. Refer to Field Lists \%<> for more information. .SS Roles .sp A role or \(dqcustom interpreted text role\(dq (ref \%) is an inline piece of explicit markup. It signifies that the enclosed text should be interpreted in a specific way. Sphinx uses this to provide semantic markup and cross\-referencing of identifiers, as described in the appropriate section. The general syntax is \fB:rolename:\(gacontent\(ga\fP\&. .sp Docutils supports the following roles: .INDENT 0.0 .IP \(bu 2 emphasis \% \-\- equivalent of \fB*emphasis*\fP .IP \(bu 2 strong \% \-\- equivalent of \fB**strong**\fP .IP \(bu 2 literal \% \-\- equivalent of \fB\(ga\(galiteral\(ga\(ga\fP .IP \(bu 2 subscript \% \-\- subscript text .IP \(bu 2 superscript \% \-\- superscript text .IP \(bu 2 title\-reference \% \-\- for titles of books, periodicals, and other materials .UNINDENT .sp Refer to Roles \%<> for roles added by Sphinx. .SS Explicit Markup .sp \(dqExplicit markup\(dq (ref \%) is used in reStructuredText for most constructs that need special handling, such as footnotes, specially\-highlighted paragraphs, comments, and generic directives. .sp An explicit markup block begins with a line starting with \fB\&..\fP followed by whitespace and is terminated by the next paragraph at the same level of indentation. (There needs to be a blank line between explicit markup and normal paragraphs. This may all sound a bit complicated, but it is intuitive enough when you write it.) .SS Directives .sp A directive (ref \%) is a generic block of explicit markup. Along with roles, it is one of the extension mechanisms of reStructuredText, and Sphinx makes heavy use of it. .sp Docutils supports the following directives: .INDENT 0.0 .IP \(bu 2 Admonitions: attention \%, caution \%, danger \%, error \%, hint \%, important \%, note \%, tip \%, warning \% and the generic admonition \%\&. (Most themes style only \(dqnote\(dq and \(dqwarning\(dq specially.) .IP \(bu 2 Images: .INDENT 2.0 .IP \(bu 2 image \% (see also Images below) .IP \(bu 2 figure \% (an image with caption and optional legend) .UNINDENT .IP \(bu 2 Additional body elements: .INDENT 2.0 .IP \(bu 2 contents \% (a local, i.e. for the current file only, table of contents) .IP \(bu 2 container \% (a container with a custom class, useful to generate an outer \fB
\fP in HTML) .IP \(bu 2 rubric \% (a heading without relation to the document sectioning) .IP \(bu 2 topic \%, sidebar \% (special highlighted body elements) .IP \(bu 2 parsed\-literal \% (literal block that supports inline markup) .IP \(bu 2 epigraph \% (a block quote with optional attribution line) .IP \(bu 2 highlights \%, pull\-quote \% (block quotes with their own class attribute) .IP \(bu 2 compound \% (a compound paragraph) .UNINDENT .IP \(bu 2 Special tables: .INDENT 2.0 .IP \(bu 2 table \% (a table with title) .IP \(bu 2 csv\-table \% (a table generated from comma\-separated values) .IP \(bu 2 list\-table \% (a table generated from a list of lists) .UNINDENT .IP \(bu 2 Special directives: .INDENT 2.0 .IP \(bu 2 raw \% (include raw target\-format markup) .IP \(bu 2 include \% (include reStructuredText from another file) \-\- in Sphinx, when given an absolute include file path, this directive takes it as relative to the source directory .IP \(bu 2 class \% (assign a class attribute to the next element) .sp \fBNote:\fP .INDENT 2.0 .INDENT 3.5 When the default domain contains a \fBclass\fP directive, this directive will be shadowed. Therefore, Sphinx re\-exports it as \fBrst\-class\fP\&. .UNINDENT .UNINDENT .sp \fBTip:\fP .INDENT 2.0 .INDENT 3.5 If you want to add a class to a directive, you may consider the \fB:class:\fP option \% instead, which is supported by most directives and allows for a more compact notation. .UNINDENT .UNINDENT .UNINDENT .IP \(bu 2 HTML specifics: .INDENT 2.0 .IP \(bu 2 meta \% (generation of HTML \fB\fP tags, see also HTML Metadata below) .IP \(bu 2 title \% (override document title) .UNINDENT .IP \(bu 2 Influencing markup: .INDENT 2.0 .IP \(bu 2 default\-role \% (set a new default role) .IP \(bu 2 role \% (create a new role) .UNINDENT .sp Since these are only per\-file, better use Sphinx\(aqs facilities for setting the \fBdefault_role\fP \%<#\:confval-default_role>\&. .UNINDENT .sp \fBWarning:\fP .INDENT 0.0 .INDENT 3.5 Do \fInot\fP use the directives sectnum \%, header \% and footer \%\&. .UNINDENT .UNINDENT .sp Directives added by Sphinx are described in Directives \%<>\&. .sp Basically, a directive consists of a name, arguments, options and content. (Keep this terminology in mind, it is used in the next chapter describing custom directives.) Looking at this example, .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. function:: foo(x) foo(y, z) :module: some.module.name Return a line of text input from the user. .EE .UNINDENT .UNINDENT .sp \fBfunction\fP is the directive name. It is given two arguments here, the remainder of the first line and the second line, as well as one option \fBmodule\fP (as you can see, options are given in the lines immediately following the arguments and indicated by the colons). Options must be indented to the same level as the directive content. .sp The directive content follows after a blank line and is indented relative to the directive start or if options are present, by the same amount as the options. .sp Be careful as the indent is not a fixed number of whitespace, e.g. three, but any number whitespace. This can be surprising when a fixed indent is used throughout the document and can make a difference for directives which are sensitive to whitespace. Compare: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. code\-block:: :caption: A cool example The output of this line starts with four spaces. \&.. code\-block:: The output of this line has no spaces at the beginning. .EE .UNINDENT .UNINDENT .sp In the first code block, the indent for the content was fixated by the option line to three spaces, consequently the content starts with four spaces. In the latter the indent was fixed by the content itself to seven spaces, thus it does not start with a space. .SS Images .sp reStructuredText supports an image directive (ref \%), used like so: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. image:: gnu.png (options) .EE .UNINDENT .UNINDENT .sp When used within Sphinx, the file name given (here \fBgnu.png\fP) must either be relative to the source file, or absolute which means that they are relative to the top source directory. For example, the file \fBsketch/spam.rst\fP could refer to the image \fBimages/spam.png\fP as \fB\&../images/spam.png\fP or \fB/images/spam.png\fP\&. .sp Sphinx will automatically copy image files over to a subdirectory of the output directory on building (e.g. the \fB_static\fP directory for HTML output.) .sp Interpretation of image size options (\fBwidth\fP and \fBheight\fP) is as follows: if the size has no unit or the unit is pixels, the given size will only be respected for output channels that support pixels. Other units (like \fBpt\fP for points) will be used for HTML and LaTeX output (the latter replaces \fBpt\fP by \fBbp\fP as this is the TeX unit such that \fB72bp=1in\fP). .sp Sphinx extends the standard docutils behavior by allowing an asterisk for the extension: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. image:: gnu.* .EE .UNINDENT .UNINDENT .sp Sphinx then searches for all images matching the provided pattern and determines their type. Each builder then chooses the best image out of these candidates. For instance, if the file name \fBgnu.*\fP was given and two files \fBgnu.pdf\fP and \fBgnu.png\fP existed in the source tree, the LaTeX builder would choose the former, while the HTML builder would prefer the latter. Supported image types and choosing priority are defined at Builders \%<>\&. .sp Note that image file names should not contain spaces. .sp Changed in version 0.4: Added the support for file names ending in an asterisk. .sp Changed in version 0.6: Image paths can now be absolute. .sp Changed in version 1.5: latex target supports pixels (default is \fB96px=1in\fP). .SS Footnotes .sp For footnotes (ref \%), use \fB[#name]_\fP to mark the footnote location, and add the footnote body at the bottom of the document after a \(dqFootnotes\(dq rubric heading, like so: .INDENT 0.0 .INDENT 3.5 .sp .EX Lorem ipsum [#f1]_ dolor sit amet ... [#f2]_ \&.. rubric:: Footnotes \&.. [#f1] Text of the first footnote. \&.. [#f2] Text of the second footnote. .EE .UNINDENT .UNINDENT .sp You can also explicitly number the footnotes (\fB[1]_\fP) or use auto\-numbered footnotes without names (\fB[#]_\fP). .SS Citations .sp Standard reStructuredText citations (ref \%) are supported, with the additional feature that they are \(dqglobal\(dq, i.e. all citations can be referenced from all files. Use them like so: .INDENT 0.0 .INDENT 3.5 .sp .EX Lorem ipsum [Ref]_ dolor sit amet. \&.. [Ref] Book or article reference, URL or whatever. .EE .UNINDENT .UNINDENT .sp Citation usage is similar to footnote usage, but with a label that is not numeric or begins with \fB#\fP\&. .SS Substitutions .sp reStructuredText supports \(dqsubstitutions\(dq (ref \%), which are pieces of text and/or markup referred to in the text by \fB|name|\fP\&. They are defined like footnotes with explicit markup blocks, like this: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. |name| replace:: replacement *text* .EE .UNINDENT .UNINDENT .sp or this: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. |caution| image:: warning.png :alt: Warning! .EE .UNINDENT .UNINDENT .sp See the reStructuredText reference for substitutions \% for details. .sp If you want to use some substitutions for all documents, put them into \fBrst_prolog\fP \%<#\:confval-rst_prolog> or \fBrst_epilog\fP \%<#\:confval-rst_epilog> or put them into a separate file and include it into all documents you want to use them in, using the include \% directive. (Be sure to give the include file a file name extension differing from that of other source files, to avoid Sphinx finding it as a standalone document.) .sp Sphinx defines some default substitutions, see Substitutions \%<#\:default-substitutions>\&. .SS Comments .sp Every explicit markup block which isn\(aqt a valid markup construct (like the footnotes above) is regarded as a comment (ref \%). For example: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. This is a comment. .EE .UNINDENT .UNINDENT .sp You can indent text after a comment start to form multiline comments: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. This whole indented block is a comment. Still in the comment. .EE .UNINDENT .UNINDENT .SS HTML Metadata .sp The meta \% directive allows specifying the HTML metadata element \% of a Sphinx documentation page. For example, the directive: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. meta:: :description: The Sphinx documentation builder :keywords: Sphinx, documentation, builder .EE .UNINDENT .UNINDENT .sp will generate the following HTML output: .INDENT 0.0 .INDENT 3.5 .sp .EX .EE .UNINDENT .UNINDENT .sp Also, Sphinx will add the keywords as specified in the meta directive to the search index. Thereby, the \fBlang\fP attribute of the meta element is considered. For example, the directive: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. meta:: :keywords: backup :keywords lang=en: pleasefindthiskey pleasefindthiskeytoo :keywords lang=de: bittediesenkeyfinden .EE .UNINDENT .UNINDENT .sp adds the following words to the search indices of builds with different language configurations: .INDENT 0.0 .IP \(bu 2 \fBpleasefindthiskey\fP, \fBpleasefindthiskeytoo\fP to \fIEnglish\fP builds; .IP \(bu 2 \fBbittediesenkeyfinden\fP to \fIGerman\fP builds; .IP \(bu 2 \fBbackup\fP to builds in all languages. .UNINDENT .SS Source encoding .sp Sphinx supports source files that are encoded in UTF\-8. This means that the full range of Unicode \% characters may be used directly in reStructuredText. .SS Gotchas .sp There are some problems one commonly runs into while authoring reStructuredText documents: .INDENT 0.0 .IP \(bu 2 \fBSeparation of inline markup:\fP As said above, inline markup spans must be separated from the surrounding text by non\-word characters, you have to use a backslash\-escaped space to get around that. See the reference \% for the details. .IP \(bu 2 \fBNo nested inline markup:\fP Something like \fB*see :func:\(gafoo\(ga*\fP is not possible. .UNINDENT .SS Roles .sp Sphinx uses interpreted text roles to insert semantic markup into documents. They are written as \fB:rolename:\(gacontent\(ga\fP\&. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The default role (\fB\(gacontent\(ga\fP) has no special meaning by default. You are free to use it for anything you like, e.g. variable names; use the \fBdefault_role\fP \%<#\:confval-default_role> config value to set it to a known role \-\- the \fBany\fP \%<#\:role-any> role to find anything or the \fBpy:obj\fP \%<#\:role-py-obj> role to find Python objects are very useful for this. .UNINDENT .UNINDENT .sp See Domains \%<> for roles added by domains. .SS Cross\-references .sp See Cross\-references \%<>\&. .sp Cross\-reference roles include: .INDENT 0.0 .IP \(bu 2 \fBany\fP \%<#\:role-any> .IP \(bu 2 \fBdoc\fP \%<#\:role-doc> .IP \(bu 2 \fBdownload\fP \%<#\:role-download> .IP \(bu 2 \fBenvvar\fP \%<#\:role-envvar> .IP \(bu 2 \fBkeyword\fP \%<#\:role-keyword> .IP \(bu 2 \fBnumref\fP \%<#\:role-numref> .IP \(bu 2 \fBoption\fP \%<#\:role-option> (and the deprecated \fBcmdoption\fP) .IP \(bu 2 \fBref\fP \%<#\:role-ref> .IP \(bu 2 \fBterm\fP \%<#\:role-term> .IP \(bu 2 \fBtoken\fP \%<#\:role-token> .UNINDENT .SS Inline code highlighting .INDENT 0.0 .TP .B :code: An \fIinline\fP code example. When used directly, this role just displays the text \fIwithout\fP syntax highlighting, as a literal. .INDENT 7.0 .INDENT 3.5 .sp .EX By default, inline code such as :code:\(ga1 + 2\(ga just displays without highlighting. .EE .UNINDENT .UNINDENT .sp Displays: By default, inline code such as \fB1 + 2\fP just displays without highlighting. .sp Unlike the \fBcode\-block\fP \%<#\:directive-code-block> directive, this role does not respect the default language set by the \fBhighlight\fP \%<#\:directive-highlight> directive. .sp To enable syntax highlighting, you must first use the Docutils role \% directive to define a custom role associated with a specific language: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. role:: python(code) :language: python In Python, :python:\(ga1 + 2\(ga is equal to :python:\(ga3\(ga. .EE .UNINDENT .UNINDENT .sp To display a multi\-line code example, use the \fBcode\-block\fP \%<#\:directive-code-block> directive instead. .UNINDENT .SS Math .INDENT 0.0 .TP .B :math: Role for inline math. Use like this: .INDENT 7.0 .INDENT 3.5 .sp .EX Since Pythagoras, we know that :math:\(gaa^2 + b^2 = c^2\(ga. .EE .UNINDENT .UNINDENT .sp Displays: Since Pythagoras, we know that a^2 + b^2 = c^2\&. .UNINDENT .INDENT 0.0 .TP .B :eq: Same as \fBmath:numref\fP \%<#\:role-math-numref>\&. .UNINDENT .SS Other semantic markup .sp The following roles don\(aqt do anything special except formatting the text in a different style: .INDENT 0.0 .TP .B :abbr: An abbreviation. If the role content contains a parenthesized explanation, it will be treated specially: it will be shown in a tool\-tip in HTML, and output only once in LaTeX. .sp For example: \fB:abbr:\(gaLIFO (last\-in, first\-out)\(ga\fP displays LIFO\&. .sp Added in version 0.6. .UNINDENT .INDENT 0.0 .TP .B :command: The name of an OS\-level command, such as \fBrm\fP\&. .sp For example: \fBrm\fP .UNINDENT .INDENT 0.0 .TP .B :dfn: Mark the defining instance of a term in the text. (No index entries are generated.) .sp For example: \fIbinary mode\fP .UNINDENT .INDENT 0.0 .TP .B :file: The name of a file or directory. Within the contents, you can use curly braces to indicate a \(dqvariable\(dq part, for example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&... is installed in :file:\(ga/usr/lib/python3.{x}/site\-packages\(ga ... .EE .UNINDENT .UNINDENT .sp Displays: ... is installed in \fB/usr/lib/python3.\fP\fIx\fP\fB/site\-packages\fP ... .sp In the built documentation, the \fBx\fP will be displayed differently to indicate that it is to be replaced by the Python minor version. .UNINDENT .INDENT 0.0 .TP .B :guilabel: Labels presented as part of an interactive user interface should be marked using \fBguilabel\fP\&. This includes labels from text\-based interfaces such as those created using \fBcurses\fP \% or other text\-based libraries. Any label used in the interface should be marked with this role, including button labels, window titles, field names, menu and menu selection names, and even values in selection lists. .sp Changed in version 1.0: An accelerator key for the GUI label can be included using an ampersand; this will be stripped and displayed underlined in the output (for example: \fB:guilabel:\(ga&Cancel\(ga\fP displays Cancel). To include a literal ampersand, double it. .UNINDENT .INDENT 0.0 .TP .B :kbd: Mark a sequence of keystrokes. What form the key sequence takes may depend on platform\- or application\-specific conventions. When there are no relevant conventions, the names of modifier keys should be spelled out, to improve accessibility for new users and non\-native speakers. For example, an \fIxemacs\fP key sequence may be marked like \fB:kbd:\(gaC\-x C\-f\(ga\fP, but without reference to a specific application or platform, the same sequence should be marked as \fB:kbd:\(gaControl\-x Control\-f\(ga\fP, displaying \fBC\fP\-\fBx\fP \fBC\fP\-\fBf\fP and \fBControl\fP\-\fBx\fP \fBControl\fP\-\fBf\fP respectively. .UNINDENT .INDENT 0.0 .TP .B :mailheader: The name of an RFC 822\-style mail header. This markup does not imply that the header is being used in an email message, but can be used to refer to any header of the same \(dqstyle.\(dq This is also used for headers defined by the various MIME specifications. The header name should be entered in the same way it would normally be found in practice, with the camel\-casing conventions being preferred where there is more than one common usage. For example: \fB:mailheader:\(gaContent\-Type\(ga\fP displays \fIContent\-Type\fP\&. .UNINDENT .INDENT 0.0 .TP .B :makevar: The name of a \fBmake\fP variable. .sp For example: \fBhelp\fP .UNINDENT .INDENT 0.0 .TP .B :manpage: A reference to a Unix manual page including the section, e.g. \fB:manpage:\(gals(1)\(ga\fP displays \fBls(1)\fP\&. Creates a hyperlink to an external site rendering the manpage if \fBmanpages_url\fP \%<#\:confval-manpages_url> is defined. .sp Changed in version 7.3: Allow specifying a target with \fB<>\fP, like hyperlinks. For example, \fB:manpage:\(gablah \(ga\fP displays \fBblah\fP\&. .UNINDENT .INDENT 0.0 .TP .B :menuselection: Menu selections should be marked using the \fBmenuselection\fP role. This is used to mark a complete sequence of menu selections, including selecting submenus and choosing a specific operation, or any subsequence of such a sequence. The names of individual selections should be separated by \fB\-\->\fP\&. .sp For example, to mark the selection \(dqStart > Programs\(dq, use this markup: .INDENT 7.0 .INDENT 3.5 .sp .EX :menuselection:\(gaStart \-\-> Programs\(ga .EE .UNINDENT .UNINDENT .sp Displays: Start ‣ Programs .sp When including a selection that includes some trailing indicator, such as the ellipsis some operating systems use to indicate that the command opens a dialog, the indicator should be omitted from the selection name. .sp \fBmenuselection\fP also supports ampersand accelerators just like \fBguilabel\fP\&. .UNINDENT .INDENT 0.0 .TP .B :mimetype: The name of a MIME type, or a component of a MIME type (the major or minor portion, taken alone). .sp For example: \fItext/plain\fP .UNINDENT .INDENT 0.0 .TP .B :newsgroup: The name of a Usenet newsgroup. .sp For example: \fIcomp.lang.python\fP .UNINDENT .INDENT 0.0 .INDENT 3.5 .SS Todo .sp Is this not part of the standard domain? .UNINDENT .UNINDENT .INDENT 0.0 .TP .B :program: The name of an executable program. This may differ from the file name for the executable for some platforms. In particular, the \fB\&.exe\fP (or other) extension should be omitted for Windows programs. .sp For example: \fBcurl\fP .UNINDENT .INDENT 0.0 .TP .B :regexp: A regular expression. Quotes should not be included. .sp For example: \fB([abc])+\fP .UNINDENT .INDENT 0.0 .TP .B :samp: A piece of literal text, such as code. Within the contents, you can use curly braces to indicate a \(dqvariable\(dq part, as in \fBfile\fP\&. For example, in \fB:samp:\(gaprint(1+{variable})\(ga\fP, the part \fBvariable\fP would be emphasized: \fBprint(1+\fP\fIvariable\fP\fB)\fP .sp If you don\(aqt need the \(dqvariable part\(dq indication, use the standard \fBcode\fP role instead. .sp Changed in version 1.8: Allowed to escape curly braces with double backslash. For example, in \fB:samp:\(gaprint(f\(dqanswer=\e\e{1+{variable}*2\e\e}\(dq)\(ga\fP, the part \fBvariable\fP would be emphasized and the escaped curly braces would be displayed: \fBprint(f\(dqanswer={1+\fP\fIvariable\fP\fB*2}\(dq)\fP .UNINDENT .sp There is also an \fBindex\fP \%<#\:role-index> role to generate index entries. .sp The following roles generate external links: .INDENT 0.0 .TP .B :cve: A reference to a Common Vulnerabilities and Exposures \% record. This generates appropriate index entries. The text \(dqCVE \fInumber\fP\(dq is generated; with a link to an online copy of the specified CVE. You can link to a specific section by using \fB:cve:\(ganumber#anchor\(ga\fP\&. .sp For example: \fBCVE 2020\-10735\fP \% .sp Added in version 8.1. .UNINDENT .INDENT 0.0 .TP .B :cwe: A reference to a Common Weakness Enumeration \%\&. This generates appropriate index entries. The text \(dqCWE \fInumber\fP\(dq is generated; in the HTML output, with a link to an online copy of the specified CWE. You can link to a specific section by using \fB:cwe:\(ganumber#anchor\(ga\fP\&. .sp For example: \fBCWE 787\fP \% .sp Added in version 8.1. .UNINDENT .INDENT 0.0 .TP .B :pep: A reference to a Python Enhancement Proposal. This generates appropriate index entries. The text \(dqPEP \fInumber\fP\(dq is generated; in the HTML output, this text is a hyperlink to an online copy of the specified PEP. You can link to a specific section by saying \fB:pep:\(ganumber#anchor\(ga\fP\&. .sp For example: \fBPEP 8\fP \% .UNINDENT .INDENT 0.0 .TP .B :rfc: A reference to an Internet Request for Comments. This generates appropriate index entries. The text \(dqRFC \fInumber\fP\(dq is generated; in the HTML output, this text is a hyperlink to an online copy of the specified RFC. You can link to a specific section by saying \fB:rfc:\(ganumber#anchor\(ga\fP\&. .sp For example: \fBRFC 2324\fP \% .UNINDENT .sp Note that there are no special roles for including hyperlinks as you can use the standard reStructuredText markup for that purpose. .SS Substitutions .sp The documentation system provides some substitutions that are defined by default. They are set in the build configuration file. .INDENT 0.0 .TP .B |release| Replaced by the project release the documentation refers to. This is meant to be the full version string including alpha/beta/release candidate tags, e.g. \fB2.5.2b3\fP\&. Set by \fBrelease\fP \%<#\:confval-release>\&. .UNINDENT .INDENT 0.0 .TP .B |version| Replaced by the project version the documentation refers to. This is meant to consist only of the major and minor version parts, e.g. \fB2.5\fP, even for version 2.5.1. Set by \fBversion\fP \%<#\:confval-version>\&. .UNINDENT .INDENT 0.0 .TP .B |today| Replaced by either today\(aqs date (the date on which the document is read), or the date set in the build configuration file. Normally has the format \fBApril 14, 2007\fP\&. Set by \fBtoday_fmt\fP \%<#\:confval-today_fmt> and \fBtoday\fP \%<#\:confval-today>\&. .UNINDENT .INDENT 0.0 .TP .B |translation progress| Replaced by the translation progress of the document. This substitution is intended for use by document translators as a marker for the translation progress of the document. .UNINDENT .SS Directives .sp As previously discussed \%<#\:rst-directives>, a directive is a generic block of explicit markup. While Docutils provides a number of directives, Sphinx provides many more and uses directives as one of the primary extension mechanisms. .sp See Domains \%<> for roles added by domains. .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 Refer to the reStructuredText Primer \%<#\:rst-directives> for an overview of the directives provided by Docutils. .UNINDENT .UNINDENT .SS Table of contents .sp Since reStructuredText does not have facilities to interconnect several documents, or split documents into multiple output files, Sphinx uses a custom directive to add relations between the single files the documentation is made of, as well as tables of contents. The \fBtoctree\fP directive is the central element. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Simple \(dqinclusion\(dq of one file in another can be done with the include \% directive. .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 To create table of contents for current document (.rst file), use the standard reStructuredText contents directive \%\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. toctree:: This directive inserts a \(dqTOC tree\(dq at the current location, using the individual TOCs (including \(dqsub\-TOC trees\(dq) of the documents given in the directive body. Relative document names (not beginning with a slash) are relative to the document the directive occurs in, absolute names are relative to the source directory. A numeric \fBmaxdepth\fP option may be given to indicate the depth of the tree; by default, all levels are included. [1] .sp The representation of \(dqTOC tree\(dq is changed in each output format. The builders that output multiple files (e.g. HTML) treat it as a collection of hyperlinks. On the other hand, the builders that output a single file (e.g. LaTeX, man page, etc.) replace it with the content of the documents on the TOC tree. .sp Consider this example (taken from the Python docs\(aq library reference index): .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. toctree:: :maxdepth: 2 intro strings datatypes numeric (many more documents listed here) .EE .UNINDENT .UNINDENT .sp This accomplishes two things: .INDENT 7.0 .IP \(bu 2 Tables of contents from all those documents are inserted, with a maximum depth of two, that means one nested heading. \fBtoctree\fP directives in those documents are also taken into account. .IP \(bu 2 Sphinx knows the relative order of the documents \fBintro\fP, \fBstrings\fP and so forth, and it knows that they are children of the shown document, the library index. From this information it generates \(dqnext chapter\(dq, \(dqprevious chapter\(dq and \(dqparent chapter\(dq links. .UNINDENT .sp \fBEntries\fP .sp Document titles in the \fBtoctree\fP will be automatically read from the title of the referenced document. If that isn\(aqt what you want, you can specify an explicit title and target using a similar syntax to reStructuredText hyperlinks (and Sphinx\(aqs cross\-referencing syntax \%<#\:xref-syntax>). This looks like: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. toctree:: intro All about strings datatypes .EE .UNINDENT .UNINDENT .sp The second line above will link to the \fBstrings\fP document, but will use the title \(dqAll about strings\(dq instead of the title of the \fBstrings\fP document. .sp You can also add external links, by giving an HTTP URL instead of a document name. .sp The special entry name \fBself\fP stands for the document containing the toctree directive. This is useful if you want to generate a \(dqsitemap\(dq from the toctree. .sp In the end, all documents in the source directory \%<#\:term-source-directory> (or subdirectories) must occur in some \fBtoctree\fP directive; Sphinx will emit a warning if it finds a file that is not included, because that means that this file will not be reachable through standard navigation. .sp Use \fBexclude_patterns\fP \%<#\:confval-exclude_patterns> to explicitly exclude documents or directories from building completely. Use the \(dqorphan\(dq metadata \%<#\:metadata> to let a document be built, but notify Sphinx that it is not reachable via a toctree. .sp The \(dqroot document\(dq (selected by \fBroot_doc\fP \%<#\:confval-root_doc>) is the \(dqroot\(dq of the TOC tree hierarchy. It can be used as the documentation\(aqs main page, or as a \(dqfull table of contents\(dq if you don\(aqt give a \fB:maxdepth:\fP option. .sp Changed in version 0.6: Added support for external links and \(dqself\(dq references. .sp Options .INDENT 7.0 .TP .B :class: class names (a list of class names, separated by spaces) Assign class attributes \%\&. This is a common option \%\&. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. toctree:: :class: custom\-toc .EE .UNINDENT .UNINDENT .sp Added in version 7.4. .UNINDENT .INDENT 7.0 .TP .B :name: label (text) An implicit target name that can be referenced using \fBref\fP \%<#\:role-ref>\&. This is a common option \%\&. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. toctree:: :name: mastertoc foo .EE .UNINDENT .UNINDENT .sp Added in version 1.3. .UNINDENT .INDENT 7.0 .TP .B :caption: (text) Add a caption to the toctree. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. toctree:: :caption: Table of Contents foo .EE .UNINDENT .UNINDENT .sp Added in version 1.3. .UNINDENT .INDENT 7.0 .TP .B :numbered: .TP .B :numbered: depth If you want to have section numbers even in HTML output, add the \fB:numbered:\fP option to the \fItop\-level\fP toctree. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. toctree:: :numbered: foo bar .EE .UNINDENT .UNINDENT .sp Section numbering then starts at the heading of \fBfoo\fP\&. Sub\-toctrees are automatically numbered (don\(aqt give the \fBnumbered\fP flag to those). .sp Numbering up to a specific depth is also possible, by giving the depth as a numeric argument to \fBnumbered\fP\&. .sp Added in version 0.6. .sp Changed in version 1.1: Added the numeric \fIdepth\fP argument. .UNINDENT .INDENT 7.0 .TP .B :titlesonly: Only list document titles, not other headings of the same level. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. toctree:: :titlesonly: foo bar .EE .UNINDENT .UNINDENT .sp Added in version 1.0. .UNINDENT .INDENT 7.0 .TP .B :glob: Parse glob wildcards in toctree entries. All entries are matched against the list of available documents, and matches are inserted into the list alphabetically. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. toctree:: :glob: intro* recipe/* * .EE .UNINDENT .UNINDENT .sp This includes first all documents whose names start with \fBintro\fP, then all documents in the \fBrecipe\fP folder, then all remaining documents (except the one containing the directive, of course.) [2] .sp Added in version 0.3. .UNINDENT .INDENT 7.0 .TP .B :reversed: Reverse the order of the entries in the list. This is particularly useful when using the \fB:glob:\fP option. .sp Added in version 1.5. .UNINDENT .INDENT 7.0 .TP .B :hidden: A hidden toctree only defines the document hierarchy. It will not insert links into the document at the location of the directive. .sp This makes sense if you have other means of navigation, e.g. through manual links, HTML sidebar navigation, or if you use the \fB:includehidden:\fP option on the top\-level toctree. .sp Added in version 0.6. .UNINDENT .INDENT 7.0 .TP .B :includehidden: If you want one global table of contents showing the complete document structure, you can add the \fB:includehidden:\fP option to the \fItop\-level\fP toctree directive. All other toctrees on child pages can then be made invisible with the \fB:hidden:\fP option. The top\-level toctree with \fB:includehidden:\fP will then include their entries. .sp Added in version 1.2. .UNINDENT .UNINDENT .SS Special names .sp Sphinx reserves some document names for its own use; you should not try to create documents with these names \-\- it will cause problems. .sp The special document names (and pages generated for them) are: .INDENT 0.0 .IP \(bu 2 \fBgenindex\fP .sp This is used for the general index, which is populated with entries from \fBindex\fP directives and all index\-generating object descriptions \%<#\:basic-domain-markup>\&. For example, see Sphinx\(aqs Index \%<>\&. .IP \(bu 2 \fBmodindex\fP .sp This is used for the Python module index, which contains one entry per \fBpy:module\fP \%<#\:directive-py-module> directive. For example, see Sphinx\(aqs Python Module Index \%<>\&. .IP \(bu 2 \fBsearch\fP .sp This is used for the search page, which contains a form that uses the generated JSON search index and JavaScript to full\-text search the generated documents for search words; it works on every major browser. For example, see Sphinx\(aqs Search Page \%<>\&. .IP \(bu 2 Every name beginning with \fB_\fP .sp Though few such names are currently used by Sphinx, you should not create documents or document\-containing directories with such names. (Using \fB_\fP as a prefix for a custom template directory is fine.) .UNINDENT .sp \fBWarning:\fP .INDENT 0.0 .INDENT 3.5 Be careful with unusual characters in filenames. Some formats may interpret these characters in unexpected ways: .INDENT 0.0 .IP \(bu 2 Do not use the colon \fB:\fP for HTML based formats. Links to other parts may not work. .IP \(bu 2 Do not use the plus \fB+\fP for the ePub format. Some resources may not be found. .UNINDENT .UNINDENT .UNINDENT .SS Paragraph\-level markup .sp These directives create short paragraphs and can be used inside information units as well as normal text. .SS Admonitions, messages, and warnings .sp The admonition directives create \(aqadmonition\(aq elements, a standardised system of communicating different types of information, from a helpful \fBtip\fP to matters of paramount \fBdanger\fP\&. These directives can be used anywhere an ordinary body element can, and can contain arbitrary body elements. There are nine specific named admonitions and the generic \fBadmonition\fP directive. .INDENT 0.0 .TP .B \&.. attention:: Information that requires the reader\(aqs attention. The content of the directive should be written in complete sentences and include all appropriate punctuation. .sp Example: .sp \fBAttention:\fP .INDENT 7.0 .INDENT 3.5 Please may I have your attention. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. caution:: Information with regard to which the reader should exercise care. The content of the directive should be written in complete sentences and include all appropriate punctuation. .sp Example: .sp \fBCaution:\fP .INDENT 7.0 .INDENT 3.5 Exercise due caution. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. danger:: Information which may lead to near and present danger if not heeded. The content of the directive should be written in complete sentences and include all appropriate punctuation. .sp Example: .sp \fBDanger:\fP .INDENT 7.0 .INDENT 3.5 Let none think to fly the danger for soon or late love is his own avenger. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. error:: Information relating to failure modes of some description. The content of the directive should be written in complete sentences and include all appropriate punctuation. .sp Example: .sp \fBError:\fP .INDENT 7.0 .INDENT 3.5 ERROR 418: I\(aqm a teapot. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. hint:: Information that is helpful to the reader. The content of the directive should be written in complete sentences and include all appropriate punctuation. .sp Example: .sp \fBHint:\fP .INDENT 7.0 .INDENT 3.5 Look under the flowerpot. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. important:: Information that is of paramount importance and which the reader must not ignore. The content of the directive should be written in complete sentences and include all appropriate punctuation. .sp Example: .sp \fBImportant:\fP .INDENT 7.0 .INDENT 3.5 This is a statement of paramount importance. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. note:: An especially important bit of information that the reader should know. The content of the directive should be written in complete sentences and include all appropriate punctuation. .sp Example: .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 This function is not suitable for sending tins of spam. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. tip:: Some useful tidbit of information for the reader. The content of the directive should be written in complete sentences and include all appropriate punctuation. .sp Example: .sp \fBTip:\fP .INDENT 7.0 .INDENT 3.5 Remember your sun cream! .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. warning:: An important bit of information that the reader should be very aware of. The content of the directive should be written in complete sentences and include all appropriate punctuation. .sp Example: .sp \fBWarning:\fP .INDENT 7.0 .INDENT 3.5 Beware of the dog. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. admonition:: title A generic admonition, with an optional title. The content of the directive should be written in complete sentences and include all appropriate punctuation. .sp Example: .INDENT 7.0 .INDENT 3.5 .IP "This is a title" .sp This is the content of the admonition. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. seealso:: Many sections include a list of references to module documentation or external documents. These lists are created using the \fBseealso\fP directive. .sp The \fBseealso\fP directive is typically placed in a section just before any subsections. The content of the \fBseealso\fP directive should be either a single line or a reStructuredText definition list \%\&. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. seealso:: Python\(aqs :py:mod:\(gazipfile\(ga module Documentation of Python\(aqs standard :py:mod:\(gazipfile\(ga module. \(gaGNU tar manual, Basic Tar Format \(ga_ Documentation for tar archive files, including GNU tar extensions. .EE .UNINDENT .UNINDENT .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .TP .B Python\(aqs \fBzipfile\fP \% module Documentation of Python\(aqs standard \fBzipfile\fP \% module. .TP .B GNU tar manual, Basic Tar Format \% Documentation for tar archive files, including GNU tar extensions. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp Collapsible text .sp Added in version 8.2. .sp Each admonition directive supports a \fB:collapsible:\fP option, to make the content of the admonition collapsible (where supported by the output format). This can be useful for content that is not always relevant. By default, collapsible admonitions are initially open, but this can be controlled with the \fBopen\fP and \fBclosed\fP arguments to the \fB:collapsible:\fP option, which change the default state. In output formats that don\(aqt support collapsible content, the text is always included. For example: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. note:: :collapsible: This note is collapsible, and initially open by default. \&.. admonition:: Example :collapsible: open This example is collapsible, and initially open. \&.. hint:: :collapsible: closed This hint is collapsible, but initially closed. .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 This note is collapsible, and initially open by default. .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .IP "Example" .sp This example is collapsible, and initially open. .UNINDENT .UNINDENT .sp \fBHint:\fP .INDENT 0.0 .INDENT 3.5 This hint is collapsible, but initially closed. .UNINDENT .UNINDENT .SS Describing changes between versions .INDENT 0.0 .TP .B \&.. version\-added:: version [brief explanation] .TP .B \&.. versionadded:: version [brief explanation] This directive documents the version of the project which added the described feature. When this applies to an entire module or component, it should be placed at the top of the relevant section before any prose. .sp The first argument must be given and is the version in question; you can add a second argument consisting of a \fIbrief\fP explanation of the change. .sp \fBAttention:\fP .INDENT 7.0 .INDENT 3.5 There must be no blank line between the directive head and the explanation; this is to make these blocks visually continuous in the markup. .UNINDENT .UNINDENT .sp Changed in version 9.0: The \fBversionadded\fP directive was renamed to \fBversion\-added\fP\&. The previous name is retained as an alias. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. version\-added:: 2.5 The *spam* parameter. .EE .UNINDENT .UNINDENT .sp Added in version 2.5: The \fIspam\fP parameter. .UNINDENT .INDENT 0.0 .TP .B \&.. version\-changed:: version [brief explanation] .TP .B \&.. versionchanged:: version [brief explanation] Similar to \fBversion\-added\fP, but describes when and what changed in the named feature in some way (new parameters, changed side effects, etc.). .sp Changed in version 9.0: The \fBversionchanged\fP directive was renamed to \fBversion\-changed\fP\&. The previous name is retained as an alias. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. version\-changed:: 2.8 The *spam* parameter is now of type *boson*. .EE .UNINDENT .UNINDENT .sp Changed in version 2.8: The \fIspam\fP parameter is now of type \fIboson\fP\&. .UNINDENT .INDENT 0.0 .TP .B \&.. version\-deprecated:: version [brief explanation] .TP .B \&.. deprecated:: version [brief explanation] Similar to \fBversion\-added\fP, but describes when the feature was deprecated. A \fIbrief\fP explanation can also be given, for example to tell the reader what to use instead. .sp Changed in version 9.0: The \fBdeprecated\fP directive was renamed to \fBversion\-deprecated\fP\&. The previous name is retained as an alias .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. version\-deprecated:: 3.1 Use :py:func:\(gaspam\(ga instead. .EE .UNINDENT .UNINDENT .sp Deprecated since version 3.1: Use \fBspam()\fP instead. .UNINDENT .INDENT 0.0 .TP .B \&.. version\-removed:: version [brief explanation] .TP .B \&.. versionremoved:: version [brief explanation] Similar to \fBversion\-added\fP, but describes when the feature was removed. An explanation may be provided to tell the reader what to use instead, or why the feature was removed. .sp Added in version 7.3. .sp Changed in version 9.0: The \fBversionremoved\fP directive was renamed to \fBversion\-removed\fP\&. The previous name is retained as an alias. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. version\-removed:: 4.0 The :py:func:\(gaspam\(ga function is more flexible, and should be used instead. .EE .UNINDENT .UNINDENT .sp Removed in version 4.0: The \fBspam()\fP function is more flexible, and should be used instead. .UNINDENT .SS Presentational .INDENT 0.0 .TP .B \&.. rubric:: title A rubric is like an informal heading that doesn\(aqt correspond to the document\(aqs structure, i.e. it does not create a table of contents node. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 If the \fItitle\fP of the rubric is \(dqFootnotes\(dq (or the selected language\(aqs equivalent), this rubric is ignored by the LaTeX writer, since it is assumed to only contain footnote definitions and therefore would create an empty heading. .UNINDENT .UNINDENT .sp Options .INDENT 7.0 .TP .B :class: class names (a list of class names, separated by spaces) Assign class attributes \%\&. This is a common option \%\&. .UNINDENT .INDENT 7.0 .TP .B :name: label (text) An implicit target name that can be referenced using \fBref\fP \%<#\:role-ref>\&. This is a common option \%\&. .UNINDENT .INDENT 7.0 .TP .B :heading\-level: n (number from 1 to 6) Added in version 7.4.1. .sp Use this option to specify the heading level of the rubric. In this case the rubric will be rendered as \fB

\fP to \fB

\fP for HTML output, or as the corresponding non\-numbered sectioning command for LaTeX (see \fBlatex_toplevel_sectioning\fP \%<#\:confval-latex_toplevel_sectioning>). .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. centered:: This directive creates a centered boldfaced line of text. .sp Deprecated since version 1.1: This presentation\-only directive is a legacy from older versions. Use a rst\-class \%<#\:rstclass> directive instead and add an appropriate style. .UNINDENT .INDENT 0.0 .TP .B \&.. hlist:: This directive must contain a bullet list. It will transform it into a more compact list by either distributing more than one item horizontally, or reducing spacing between items, depending on the builder. .sp Options .INDENT 7.0 .TP .B :columns: n (int) The number of columns; defaults to 2. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. hlist:: :columns: 3 * A list of * short items * that should be * displayed * horizontally .EE .UNINDENT .UNINDENT .UNINDENT .sp Added in version 0.6. .UNINDENT .SS Showing code examples .sp There are multiple ways to show syntax\-highlighted literal code blocks in Sphinx: .INDENT 0.0 .IP \(bu 2 using reStructuredText doctest blocks \%<#\:rst-doctest-blocks>; .IP \(bu 2 using reStructuredText literal blocks \%<#\:rst-literal-blocks>, optionally in combination with the \fBhighlight\fP directive; .IP \(bu 2 using the \fBcode\-block\fP directive; .IP \(bu 2 and using the \fBliteralinclude\fP directive. .UNINDENT .sp Doctest blocks can only be used to show interactive Python sessions, while the remaining three can be used for other languages. Of these three, literal blocks are useful when an entire document, or at least large sections of it, use code blocks with the same syntax and which should be styled in the same manner. On the other hand, the \fBcode\-block\fP directive makes more sense when you want more fine\-tuned control over the styling of each block or when you have a document containing code blocks using multiple varied syntaxes. Finally, the \fBliteralinclude\fP directive is useful for including entire code files in your documentation. .sp In all cases, Syntax highlighting is provided by Pygments \%\&. When using literal blocks, this is configured using any \fBhighlight\fP directives in the source file. When a \fBhighlight\fP directive is encountered, it is used until the next \fBhighlight\fP directive is encountered. If there is no \fBhighlight\fP directive in the file, the global highlighting language is used. This defaults to \fBpython\fP but can be configured using the \fBhighlight_language\fP \%<#\:confval-highlight_language> config value. The following values are supported: .INDENT 0.0 .IP \(bu 2 \fBnone\fP (no highlighting) .IP \(bu 2 \fBdefault\fP (similar to \fBpython3\fP but with a fallback to \fBnone\fP without warning highlighting fails; the default when \fBhighlight_language\fP \%<#\:confval-highlight_language> isn\(aqt set) .IP \(bu 2 \fBguess\fP (let Pygments guess the lexer based on contents, only works with certain well\-recognizable languages) .IP \(bu 2 \fBpython\fP .IP \(bu 2 \fBrest\fP .IP \(bu 2 \fBc\fP .IP \(bu 2 \&... and any other lexer alias that Pygments supports \% .UNINDENT .sp If highlighting with the selected language fails (i.e. Pygments emits an \(dqError\(dq token), the block is not highlighted in any way. .sp \fBImportant:\fP .INDENT 0.0 .INDENT 3.5 The list of lexer aliases supported is tied to the Pygment version. If you want to ensure consistent highlighting, you should fix your version of Pygments. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. highlight:: language Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. highlight:: c .EE .UNINDENT .UNINDENT .sp This language is used until the next \fBhighlight\fP directive is encountered. As discussed previously, \fIlanguage\fP can be any lexer alias supported by Pygments. .sp Options .INDENT 7.0 .TP .B :linenothreshold: threshold (number (optional)) Enable to generate line numbers for code blocks. .sp This option takes an optional number as threshold parameter. If any threshold given, the directive will produce line numbers only for the code blocks longer than N lines. If not given, line numbers will be produced for all of code blocks. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. highlight:: python :linenothreshold: 5 .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :force: (no value) If given, minor errors on highlighting are ignored. .sp Added in version 2.1. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. code\-block:: [language] .TP .B \&.. sourcecode:: [language] .TP .B \&.. code:: [language] Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. code\-block:: ruby Some Ruby code. .EE .UNINDENT .UNINDENT .sp The directive\(aqs alias name \fBsourcecode\fP works as well. This directive takes a language name as an argument. It can be any lexer alias supported by Pygments \%\&. If it is not given, the setting of \fBhighlight\fP directive will be used. If not set, \fBhighlight_language\fP \%<#\:confval-highlight_language> will be used. To display a code example \fIinline\fP within other text, rather than as a separate block, you can use the \fBcode\fP \%<#\:role-code> role instead. .sp Changed in version 2.0: The \fBlanguage\fP argument becomes optional. .sp Options .INDENT 7.0 .TP .B :linenos: (no value) Enable to generate line numbers for the code block: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. code\-block:: ruby :linenos: Some more Ruby code. .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :lineno\-start: number (number) Set the first line number of the code block. If present, \fBlinenos\fP option is also automatically activated: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. code\-block:: ruby :lineno\-start: 10 Some more Ruby code, with line numbering starting at 10. .EE .UNINDENT .UNINDENT .sp Added in version 1.3. .UNINDENT .INDENT 7.0 .TP .B :emphasize\-lines: line numbers (comma separated numbers) Emphasize particular lines of the code block: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. code\-block:: python :emphasize\-lines: 3,5 def some_function(): interesting = False print(\(aqThis line is highlighted.\(aq) print(\(aqThis one is not...\(aq) print(\(aq...but this one is.\(aq) .EE .UNINDENT .UNINDENT .sp Added in version 1.1. .sp Changed in version 1.6.6: LaTeX supports the \fBemphasize\-lines\fP option. .UNINDENT .INDENT 7.0 .TP .B :force: (no value) Ignore minor errors on highlighting. .sp Added in version 2.1. .UNINDENT .INDENT 7.0 .TP .B :caption: caption of code block (text) Set a caption to the code block. .sp Added in version 1.3. .UNINDENT .INDENT 7.0 .TP .B :name: a label for hyperlink (text) Define implicit target name that can be referenced by using \fBref\fP \%<#\:role-ref>\&. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. code\-block:: python :caption: this.py :name: this\-py print(\(aqExplicit is better than implicit.\(aq) .EE .UNINDENT .UNINDENT .sp In order to cross\-reference a code\-block using either the \fBref\fP \%<#\:role-ref> or the \fBnumref\fP \%<#\:role-numref> role, it is necessary that both \fBname\fP and \fBcaption\fP be defined. The argument of \fBname\fP can then be given to \fBnumref\fP \%<#\:role-numref> to generate the cross\-reference. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX See :numref:\(gathis\-py\(ga for an example. .EE .UNINDENT .UNINDENT .sp When using \fBref\fP \%<#\:role-ref>, it is possible to generate a cross\-reference with only \fBname\fP defined, provided an explicit title is given. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX See :ref:\(gathis code snippet \(ga for an example. .EE .UNINDENT .UNINDENT .sp Added in version 1.3. .UNINDENT .INDENT 7.0 .TP .B :class: class names (a list of class names separated by spaces) Assign class attributes \%\&. This is a common option \%\&. .sp Added in version 1.4. .UNINDENT .INDENT 7.0 .TP .B :dedent: number (number or no value) Strip indentation characters from the code block. When number given, leading N characters are removed. When no argument given, leading spaces are removed via \fBtextwrap.dedent()\fP \%\&. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. code\-block:: ruby :linenos: :dedent: 4 some ruby code .EE .UNINDENT .UNINDENT .sp Added in version 1.3. .sp Changed in version 3.5: Support automatic dedent. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. literalinclude:: filename Longer displays of verbatim text may be included by storing the example text in an external file containing only plain text. The file may be included using the \fBliteralinclude\fP directive. [3] For example, to include the Python source file \fBexample.py\fP, use: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. literalinclude:: example.py .EE .UNINDENT .UNINDENT .sp The file name is usually relative to the current file\(aqs path. However, if it is absolute (starting with \fB/\fP), it is relative to the top source directory. .sp General options .INDENT 7.0 .TP .B :class: class names (a list of class names, separated by spaces) Assign class attributes \%\&. This is a common option \%\&. .sp Added in version 1.4. .UNINDENT .INDENT 7.0 .TP .B :name: label (text) An implicit target name that can be referenced using \fBref\fP \%<#\:role-ref>\&. This is a common option \%\&. .sp Added in version 1.3. .UNINDENT .INDENT 7.0 .TP .B :caption: caption (text) Add a caption above the included content. If no argument is given, the filename is used as the caption. .sp Added in version 1.3. .UNINDENT .sp Options for formatting .INDENT 7.0 .TP .B :dedent: number (number or no value) Strip indentation characters from the included content. When a number is given, the leading N characters are removed. When no argument given, all common leading indentation is removed (using \fBtextwrap.dedent()\fP \%). .sp Added in version 1.3. .sp Changed in version 3.5: Support automatic dedent. .UNINDENT .INDENT 7.0 .TP .B :tab\-width: N (number) Expand tabs to N spaces. .sp Added in version 1.0. .UNINDENT .INDENT 7.0 .TP .B :encoding: (text) Explicitly specify the encoding of the file. This overwrites the default encoding (UTF\-8). For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. literalinclude:: example.txt :encoding: latin\-1 .EE .UNINDENT .UNINDENT .sp Added in version 0.4.3. .UNINDENT .INDENT 7.0 .TP .B :linenos: (no value) Show line numbers alongside the included content. By default, line numbers are counted from 1. This can be changed by the options \fB:lineno\-start:\fP and \fB:lineno\-match:\fP\&. .UNINDENT .INDENT 7.0 .TP .B :lineno\-start: number (number) Set line number for the first line to show. If given, this automatically activates \fB:linenos:\fP\&. .UNINDENT .INDENT 7.0 .TP .B :lineno\-match: When including only parts of a file and show the original line numbers. This is only allowed only when the selection consists of contiguous lines. .sp Added in version 1.3. .UNINDENT .INDENT 7.0 .TP .B :emphasize\-lines: line numbers (comma separated numbers) Emphasise particular lines of the included content. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. literalinclude:: example.txt :emphasize\-lines: 1,2,4\-6 .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :language: language (text) Select a highlighting language (Pygments lexer \%) different from the current file\(aqs standard language (set by \fBhighlight\fP or \fBhighlight_language\fP \%<#\:confval-highlight_language>). .UNINDENT .INDENT 7.0 .TP .B :force: (no value) Ignore minor errors in highlighting. .sp Added in version 2.1. .UNINDENT .sp Options for selecting the content to include .INDENT 7.0 .TP .B :pyobject: object (text) For Python files, only include the specified class, function or method: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. literalinclude:: example.py :pyobject: Timer.start .EE .UNINDENT .UNINDENT .sp Added in version 0.6. .UNINDENT .INDENT 7.0 .TP .B :lines: line numbers (comma separated numbers) Specify exactly which lines to include: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. literalinclude:: example.py :lines: 1,3,5\-10,20\- .EE .UNINDENT .UNINDENT .sp This includes line 1, line 3, lines 5 to 10, and line 20 to the end. .sp Added in version 0.6. .UNINDENT .INDENT 7.0 .TP .B :start\-at: text .TP .B :start\-after: text .TP .B :end\-before: text .TP .B :end\-at: text Another way to control which part of the file is included is to use the \fBstart\-after\fP and \fBend\-before\fP options (or only one of them). If \fBstart\-after\fP is given as a string option, only lines that follow the first line containing that string are included. If \fBend\-before\fP is given as a string option, only lines that precede the first lines containing that string are included. The \fBstart\-at\fP and \fBend\-at\fP options behave in a similar way, but the lines containing the matched string are included. .sp \fBstart\-after\fP/\fBstart\-at\fP and \fBend\-before\fP/\fBend\-at\fP can have same string. \fBstart\-after\fP/\fBstart\-at\fP filter lines before the line that contains the option string (\fBstart\-at\fP will keep the line). Then \fBend\-before\fP/\fBend\-at\fP filter lines after the line that contains the option string (\fBend\-at\fP will keep the line and \fBend\-before\fP skip the first line). .sp Added in version 0.6: Added the \fBstart\-after\fP and \fBend\-before\fP options. .sp Added in version 1.5: Added the \fBstart\-at\fP, and \fBend\-at\fP options. .sp \fBTip:\fP .INDENT 7.0 .INDENT 3.5 To only select \fB[second\-section]\fP of an INI file such as the following, use \fB:start\-at: [second\-section]\fP and \fB:end\-before: [third\-section]\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX [first\-section] var_in_first=true [second\-section] var_in_second=true [third\-section] var_in_third=true .EE .UNINDENT .UNINDENT .sp These options can be useful when working with tag comments. Using \fB:start\-after: [initialise]\fP and \fB:end\-before: [initialised]\fP keeps the lines between between the two comments below: .INDENT 0.0 .INDENT 3.5 .sp .EX if __name__ == \(dq__main__\(dq: # [initialise] app.start(\(dq:8000\(dq) # [initialised] .EE .UNINDENT .UNINDENT .sp When lines have been selected in any of the ways described above, the line numbers in \fBemphasize\-lines\fP refer to these selected lines, counted consecutively starting from 1. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :prepend: line (text) Prepend a line before the included code. This can be useful for example when highlighting PHP code that doesn\(aqt include the \fB\fP markers. .sp Added in version 1.0. .UNINDENT .INDENT 7.0 .TP .B :append: line (text) Append a line after the included code. This can be useful for example when highlighting PHP code that doesn\(aqt include the \fB\fP markers. .sp Added in version 1.0. .UNINDENT .INDENT 7.0 .TP .B :diff: filename Show the diff of two files. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. literalinclude:: example.txt :diff: example.txt.orig .EE .UNINDENT .UNINDENT .sp This shows the diff between \fBexample.txt\fP and \fBexample.txt.orig\fP with unified diff format. .sp Added in version 1.3. .UNINDENT .sp Changed in version 0.6: Added support for absolute filenames. .sp Changed in version 1.6: With both \fBstart\-after\fP and \fBlines\fP in use, the first line as per \fBstart\-after\fP is considered to be with line number \fB1\fP for \fBlines\fP\&. .UNINDENT .SS Glossary .INDENT 0.0 .TP .B \&.. glossary:: This directive must contain a reStructuredText definition\-list\-like markup with terms and definitions. The definitions will then be referenceable with the \fBterm\fP \%<#\:role-term> role. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. glossary:: environment A structure where information about all documents under the root is saved, and used for cross\-referencing. The environment is pickled after the parsing stage, so that successive runs only need to read and parse new and changed documents. source directory The directory which, including its subdirectories, contains all source files for one Sphinx project. .EE .UNINDENT .UNINDENT .sp In contrast to regular definition lists, \fImultiple\fP terms per entry are allowed, and inline markup is allowed in terms. You can link to all of the terms. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. glossary:: term 1 term 2 Definition of both terms. .EE .UNINDENT .UNINDENT .sp (When the glossary is sorted, the first term determines the sort order.) .sp If you want to specify \(dqgrouping key\(dq for general index entries, you can put a \(dqkey\(dq as \(dqterm : key\(dq. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. glossary:: term 1 : A term 2 : B Definition of both terms. .EE .UNINDENT .UNINDENT .sp Note that \(dqkey\(dq is used for grouping key as is. The \(dqkey\(dq isn\(aqt normalized; key \(dqA\(dq and \(dqa\(dq become different groups. The whole characters in \(dqkey\(dq is used instead of a first character; it is used for \(dqCombining Character Sequence\(dq and \(dqSurrogate Pairs\(dq grouping key. .sp In i18n situation, you can specify \(dqlocalized term : key\(dq even if original text only have \(dqterm\(dq part. In this case, translated \(dqlocalized term\(dq will be categorized in \(dqkey\(dq group. .sp Changed in version 1.1: Now supports multiple terms and inline markup in terms. .sp Changed in version 1.4: Index key for glossary term should be considered \fIexperimental\fP\&. .sp Options .INDENT 7.0 .TP .B :sorted: Sort the entries alphabetically. .sp Added in version 0.6. .sp Changed in version 4.4: In internationalized documentation, sort according to translated terms. .UNINDENT .UNINDENT .SS Meta\-information markup .INDENT 0.0 .TP .B \&.. sectionauthor:: name Identifies the author of the current section. The argument should include the author\(aqs name such that it can be used for presentation and email address. The domain name portion of the address should be lower case. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. sectionauthor:: Guido van Rossum .EE .UNINDENT .UNINDENT .sp By default, this markup isn\(aqt reflected in the output in any way (it helps keep track of contributions), but you can set the configuration value \fBshow_authors\fP \%<#\:confval-show_authors> to \fBTrue\fP to make them produce a paragraph in the output. .UNINDENT .INDENT 0.0 .TP .B \&.. codeauthor:: name The \fBcodeauthor\fP directive, which can appear multiple times, names the authors of the described code, just like \fBsectionauthor\fP names the author(s) of a piece of documentation. It too only produces output if the \fBshow_authors\fP \%<#\:confval-show_authors> configuration value is \fBTrue\fP\&. .UNINDENT .SS Index\-generating markup .sp Sphinx automatically creates index entries from all object descriptions (like functions, classes or attributes) like discussed in Domains \%<>\&. .sp However, there is also explicit markup available, to make the index more comprehensive and enable index entries in documents where information is not mainly contained in information units, such as the language reference. .INDENT 0.0 .TP .B \&.. index:: This directive contains one or more index entries. Each entry consists of a type and a value, separated by a colon. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. index:: single: execution; context pair: module; __main__ pair: module; sys triple: module; search; path seealso: scope The execution context \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \&... .EE .UNINDENT .UNINDENT .sp This directive contains five entries, which will be converted to entries in the generated index which link to the exact location of the index statement (or, in case of offline media, the corresponding page number). .sp Since index directives generate cross\-reference targets at their location in the source, it makes sense to put them \fIbefore\fP the thing they refer to \-\- e.g. a heading, as in the example above. .sp The possible entry types are: .INDENT 7.0 .TP .B single Creates a single index entry. Can be made a sub\-entry by separating the sub\-entry text with a semicolon (this notation is also used below to describe what entries are created). Examples: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. index:: single: execution single: execution; context .EE .UNINDENT .UNINDENT .INDENT 7.0 .IP \(bu 2 \fBsingle: execution\fP creates an index entry labelled \fBexecution\fP\&. .IP \(bu 2 \fBsingle: execution; context\fP creates an sub\-entry of \fBexecution\fP labelled \fBcontext\fP\&. .UNINDENT .TP .B pair A shortcut to create two index entries. The pair of values must be separated by a semicolon. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. index:: pair: loop; statement .EE .UNINDENT .UNINDENT .sp This would create two index entries; \fBloop; statement\fP and \fBstatement; loop\fP\&. .TP .B triple A shortcut to create three index entries. All three values must be separated by a semicolon. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. index:: triple: module; search; path .EE .UNINDENT .UNINDENT .sp This would create three index entries; \fBmodule; search path\fP, \fBsearch; path, module\fP, and \fBpath; module search\fP\&. .TP .B see A shortcut to create an index entry that refers to another entry. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. index:: see: entry; other .EE .UNINDENT .UNINDENT .sp This would create an index entry referring from \fBentry\fP to \fBother\fP (i.e. \(aqentry\(aq: See \(aqother\(aq). .TP .B seealso Like \fBsee\fP, but inserts \(aqsee also\(aq instead of \(aqsee\(aq. .TP .B module, keyword, operator, object, exception, statement, builtin These \fBdeprecated\fP shortcuts all create two index entries. For example, \fBmodule: hashlib\fP creates the entries \fBmodule; hashlib\fP and \fBhashlib; module\fP\&. .sp Deprecated since version 1.0: These Python\-specific entry types are deprecated. .sp Changed in version 7.1: Removal version set to Sphinx 9.0. Using these entry types will now emit warnings with the \fBindex\fP category. .UNINDENT .sp You can mark up \(dqmain\(dq index entries by prefixing them with an exclamation mark. The references to \(dqmain\(dq entries are emphasized in the generated index. For example, if two pages contain .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. index:: Python .EE .UNINDENT .UNINDENT .sp and one page contains .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. index:: ! Python .EE .UNINDENT .UNINDENT .sp then the backlink to the latter page is emphasized among the three backlinks. .sp For index directives containing only \(dqsingle\(dq entries, there is a shorthand notation: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. index:: BNF, grammar, syntax, notation .EE .UNINDENT .UNINDENT .sp This creates four index entries. .sp Changed in version 1.1: Added \fBsee\fP and \fBseealso\fP types, as well as marking main entries. .sp Options .INDENT 7.0 .TP .B :name: a label for hyperlink (text) Define implicit target name that can be referenced by using \fBref\fP \%<#\:role-ref>\&. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. index:: Python :name: py\-index .EE .UNINDENT .UNINDENT .UNINDENT .sp Added in version 3.0. .UNINDENT .INDENT 0.0 .TP .B :index: While the \fBindex\fP directive is a block\-level markup and links to the beginning of the next paragraph, there is also a corresponding role that sets the link target directly where it is used. .sp The content of the role can be a simple phrase, which is then kept in the text and used as an index entry. It can also be a combination of text and index entry, styled like with explicit targets of cross\-references. In that case, the \(dqtarget\(dq part can be a full entry as described for the directive above. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX This is a normal reStructuredText :index:\(gaparagraph\(ga that contains several :index:\(gaindex entries \(ga. .EE .UNINDENT .UNINDENT .sp Added in version 1.1. .UNINDENT .SS Including content based on tags .INDENT 0.0 .TP .B \&.. only:: Include the content of the directive only if the \fIexpression\fP is true. The expression should consist of tags, like this: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. only:: html and draft .EE .UNINDENT .UNINDENT .sp Undefined tags are false, defined tags are true (tags can be defined via the \fB\-\-tag\fP \%<#\:cmdoption-sphinx-build-t> command\-line option or within \fBconf.py\fP, see here \%<#\:conf-tags>). Boolean expressions (like \fB(latex or html) and draft\fP) are supported and may use parentheses. .sp The \fIformat\fP and the \fIname\fP of the current builder (\fBhtml\fP, \fBlatex\fP or \fBtext\fP) are always set as a tag [4]\&. To make the distinction between format and name explicit, they are also added with the prefix \fBformat_\fP and \fBbuilder_\fP, e.g. the epub builder defines the tags \fBhtml\fP, \fBepub\fP, \fBformat_html\fP and \fBbuilder_epub\fP\&. .sp These standard tags are set \fIafter\fP the configuration file is read, so they are not available there. .sp All tags must follow the standard Python identifier syntax as set out in the Identifiers and keywords \% documentation. That is, a tag expression may only consist of tags that conform to the syntax of Python variables. In ASCII, this consists of the uppercase and lowercase letters \fBA\fP through \fBZ\fP, the underscore \fB_\fP and, except for the first character, the digits \fB0\fP through \fB9\fP\&. .sp Added in version 0.6. .sp Changed in version 1.2: Added the name of the builder and the prefixes. .sp \fBWarning:\fP .INDENT 7.0 .INDENT 3.5 This directive is designed to control only content of document. It could not control sections, labels and so on. .UNINDENT .UNINDENT .UNINDENT .SS Tables .sp Use reStructuredText tables \%<#\:rst-tables>, i.e. either .INDENT 0.0 .IP \(bu 2 grid table syntax (ref \%), .IP \(bu 2 simple table syntax (ref \%), .IP \(bu 2 csv\-table \% syntax, .IP \(bu 2 or list\-table \% syntax. .UNINDENT .sp The table \% directive serves as optional wrapper of the \fIgrid\fP and \fIsimple\fP syntaxes. .sp They work fine in HTML output, but rendering tables to LaTeX is complex. Check the \fBlatex_table_style\fP \%<#\:confval-latex_table_style>\&. .sp Changed in version 1.6: Merged cells (multi\-row, multi\-column, both) from grid tables containing complex contents such as multiple paragraphs, blockquotes, lists, literal blocks, will render correctly to LaTeX output. .sp Changed in version 9.0: The partial support of the LaTeX builder for nesting a table in another has been extended. Formerly Sphinx would raise an error if \fBlongtable\fP class was specified for a table containing a nested table, and some cases would not raise an error at Sphinx level but fail at LaTeX level during PDF build. This is a complex topic in LaTeX rendering and the output can sometimes be improved via the \fBtabularcolumns\fP directive. .INDENT 0.0 .TP .B \&.. tabularcolumns:: column spec This directive influences only the LaTeX output, and only for the next table in source. The mandatory argument is a column specification (known as an \(dqalignment preamble\(dq in LaTeX idiom). Please refer to a LaTeX documentation, such as the wiki page \%, for basics of such a column specification. .sp Added in version 0.3. .sp Sphinx renders tables with at most 30 rows using \fBtabulary\fP (or \fBtabular\fP if at least one cell contains either a code\-block or a nested table), and those with more rows with \fBlongtable\fP\&. The advantage of using \fBtabulary\fP is that it tries to compute automatically (internally to LaTeX) suitable column widths. .sp The \fBtabulary\fP algorithm often works well, but in some cases when a cell contains long paragraphs, the column will be given a large width and other columns whose cells contain only single words may end up too narrow. The \fBtabularcolumns\fP can help solve this via providing to LaTeX a custom \(dqalignment preamble\(dq (aka \(dqcolspec\(dq). For example \fBlJJ\fP will be suitable for a three\-columns table whose first column contains only single words and the other two have cells with long paragraphs. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 Of course, a fully automated solution would be better, and it is still hoped for, but it is an intrinsic aspect of \fBtabulary\fP, and the latter is in use by Sphinx ever since \fB0.3\fP\&... It looks as if solving the problem of squeezed columns could require substantial changes to that LaTeX package. And no good alternative appears to exist, as of 2025. .UNINDENT .UNINDENT .sp \fBHint:\fP .INDENT 7.0 .INDENT 3.5 A way to solve the issue for all tables at once, is to inject in the LaTeX preamble (see \fBlatex_elements\fP \%<#\:confval-latex_elements>) a command such as \fB\esetlength{\etymin}{1cm}\fP which causes all columns to be at least \fB1cm\fP wide (not counting inter\-column whitespace). Currently, Sphinx configures \fB\etymin\fP to allow room for three characters at least. .UNINDENT .UNINDENT .sp Here is a more sophisticated \(dqcolspec\(dq, for a 4\-columns table: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. tabularcolumns:: >{\eraggedright}\eY{.4}>{\ecentering}\eY{.1}>{\esphinxcolorblend{!95!red}\ecentering\enoindent\ebfseries\ecolor{red}}\eY{.12}>{\eraggedright\earraybackslash}\eY{.38} .EE .UNINDENT .UNINDENT .sp This is used in Sphinx own PDF docs at Deprecated APIs \%<#\:dev-deprecated-apis>\&. Regarding column widths, this \(dqcolspec\(dq achieves the same as would \fB:widths:\fP option set to \fB40 10 12 38\fP but it injects extra effects. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 In case both \fBtabularcolumns\fP and \fB:widths:\fP option of table directives are used, \fB:widths:\fP option will be ignored by the LaTeX builder. Of course it is obeyed by other builders. .UNINDENT .UNINDENT .sp Literal blocks do not work at all with \fBtabulary\fP and Sphinx will then fall back to \fBtabular\fP LaTeX environment. It will employ the \fBtabularcolumns\fP specification in that case only if it contains no usage of the \fBtabulary\fP specific column types (which are \fBL\fP, \fBR\fP, \fBC\fP and \fBJ\fP). .sp Besides the LaTeX \fBl\fP, \fBr\fP, \fBc\fP and \fBp{width}\fP column specifiers, and the \fBtabulary\fP specific \fBL\fP, \fBR\fP, \fBC\fP and \fBJ\fP, one can also use (with all table types) \fB\eX{a}{b}\fP which configures the column width to be a fraction \fBa/b\fP of the total line width and \fB\eY{f}\fP where \fBf\fP is a decimal: for example \fB\eY{0.2}\fP means that the column will occupy \fB0.2\fP times the line width. .UNINDENT .sp Changed in version 1.6: Sphinx uses \fBJ\fP (justified) by default with \fBtabulary\fP, not \fBL\fP (flushed\-left). To revert, include \fB\enewcolumntype{T}{L}\fP in the LaTeX preamble, as in fact Sphinx uses \fBT\fP and sets it by default to be an alias of \fBJ\fP\&. .sp Changed in version 9.0: Formerly, Sphinx did not use \fBtabulary\fP if the table had at least one cell containing \(dqproblematic\(dq elements such as lists, object descriptions, blockquotes (etc...) because such contents are not out\-of\-the\-box compatible with \fBtabulary\fP\&. At \fB9.0\fP a technique, which was already in use for merged cells, was extended to such cases, and the sole \(dqproblematic\(dq contents are code\-blocks and nested tables. So tables containing (only) cells with multiple paragraphs, bullet or enumerated lists, or line blocks, will now better fit to their contents (if not rendered by \fBlongtable\fP). Cells with object descriptions or admonitions will still have a tendency to induce the table to fill the full text area width, but columns in that table with no such contents will be tighter. .sp \fBHint:\fP .INDENT 0.0 .INDENT 3.5 To force usage of the LaTeX \fBlongtable\fP environment pass \fBlongtable\fP as a \fB:class:\fP option to table \%, csv\-table \%, or list\-table \%\&. Use rst\-class \%<#\:rstclass> for other tables. .UNINDENT .UNINDENT .SS Math .sp The input language for mathematics is LaTeX markup. This is the de\-facto standard for plain\-text math notation and has the added advantage that no further translation is necessary when building LaTeX output. .sp Keep in mind that when you put math markup in \fBPython docstrings\fP read by \fBautodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc>, you either have to double all backslashes, or use Python raw strings (\fBr\(dqraw\(dq\fP). .INDENT 0.0 .TP .B \&.. math:: Directive for displayed math (math that takes the whole line for itself). .sp The directive supports multiple equations, which should be separated by a blank line: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. math:: (a + b)^2 = a^2 + 2ab + b^2 (a \- b)^2 = a^2 \- 2ab + b^2 .EE .UNINDENT .UNINDENT .sp In addition, each single equation is set within a \fBsplit\fP environment, which means that you can have multiple aligned lines in an equation, aligned at \fB&\fP and separated by \fB\e\e\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. math:: (a + b)^2 &= (a + b)(a + b) \e\e &= a^2 + 2ab + b^2 .EE .UNINDENT .UNINDENT .sp For more details, look into the documentation of the AmSMath LaTeX package \%\&. .sp When the math is only one line of text, it can also be given as a directive argument: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. math:: (a + b)^2 = a^2 + 2ab + b^2 .EE .UNINDENT .UNINDENT .sp Options .INDENT 7.0 .TP .B :class: class names (a list of class names, separated by spaces) Assign class attributes \%\&. This is a common option \%\&. .UNINDENT .INDENT 7.0 .TP .B :name: label (text) An implicit target name that can be referenced using \fBref\fP \%<#\:role-ref>\&. This is a common option \%\&. .UNINDENT .INDENT 7.0 .TP .B :label: label (text) Normally, equations are not numbered. If you want your equation to get a number, use the \fBlabel\fP option. When given, it selects an internal label for the equation, by which it can be cross\-referenced, and causes an equation number to be issued. See \fBeq\fP \%<#\:role-eq> for an example. The numbering style depends on the output format. .UNINDENT .INDENT 7.0 .TP .B :no\-wrap: Prevent wrapping of the given math in a math environment. When you give this option, you must make sure yourself that the math is properly set up. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. math:: :no\-wrap: \ebegin{eqnarray} y & = & ax^2 + bx + c \e\e f(x) & = & x^2 + 2xy + y^2 \eend{eqnarray} .EE .UNINDENT .UNINDENT .sp Changed in version 8.2: The directive option \fB:nowrap:\fP was renamed to \fB:no\-wrap:\fP\&. .sp The previous name has been retained as an alias, but will be deprecated and removed in a future version of Sphinx. .UNINDENT .UNINDENT .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .TP .B Math support for HTML outputs in Sphinx \%<#\:math-support> Rendering options for math with HTML builders. .TP .B \fBlatex_engine\fP \%<#\:confval-latex_engine> Explains how to configure LaTeX builder to support Unicode literals in math mark\-up. .UNINDENT .UNINDENT .UNINDENT .SS Grammar production displays .sp Special markup is available for displaying the productions of a formal grammar. The markup is simple and does not attempt to model all aspects of BNF \% (or any derived forms), but provides enough to allow context\-free grammars to be displayed in a way that causes uses of a symbol to be rendered as hyperlinks to the definition of the symbol. There is this directive: .INDENT 0.0 .TP .B \&.. productionlist:: [production_group] This directive is used to enclose a group of productions. Each production is given on a single line and consists of a name, separated by a colon from the following definition. If the definition spans multiple lines, each continuation line must begin with a colon placed at the same column as in the first line. Blank lines are not allowed within \fBproductionlist\fP directive arguments. .sp The optional \fIproduction_group\fP directive argument serves to distinguish different sets of production lists that belong to different grammars. Multiple production lists with the same \fIproduction_group\fP thus define rules in the same scope. This can also be used to split the description of a long or complex grammar across multiple \fBproductionlist\fP directives with the same \fIproduction_group\fP\&. .sp The definition can contain token names which are marked as interpreted text, (e.g. \(dq\fBsum ::= \(gainteger\(ga \(dq+\(dq \(gainteger\(ga\fP\(dq), to generate cross\-references to the productions of these tokens. Such cross\-references implicitly refer to productions from the current group. To reference a production from another grammar, the token name must be prefixed with the group name and a colon, e.g. \(dq\fBother\-group:sum\fP\(dq. If the group of the token should not be shown in the production, it can be prefixed by a tilde, e.g., \(dq\fB~other\-group:sum\fP\(dq. To refer to a production from an unnamed grammar, the token should be prefixed by a colon, e.g., \(dq\fB:sum\fP\(dq. No further reStructuredText parsing is done in the production, so that special characters (\fB*\fP, \fB|\fP, etc) do not need to be escaped. .sp Token productions can be cross\-referenced outwith the production list by using the \fBtoken\fP \%<#\:role-token> role. If you have used a \fIproduction_group\fP argument, the token name must be prefixed with the group name and a colon, e.g., \(dq\fBmy_group:sum\fP\(dq instead of just \(dq\fBsum\fP\(dq. Standard cross\-referencing modifiers \%<#\:xref-modifiers> may be used with the \fB:token:\fP role, such as custom link text and suppressing the group name with a tilde (\fB~\fP). .UNINDENT .sp The following is an example taken from the Python Reference Manual: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. productionlist:: try_stmt: try1_stmt | try2_stmt try1_stmt: \(dqtry\(dq \(dq:\(dq \(gasuite\(ga : (\(dqexcept\(dq [\(gaexpression\(ga [\(dq,\(dq \(gatarget\(ga]] \(dq:\(dq \(gasuite\(ga)+ : [\(dqelse\(dq \(dq:\(dq \(gasuite\(ga] : [\(dqfinally\(dq \(dq:\(dq \(gasuite\(ga] try2_stmt: \(dqtry\(dq \(dq:\(dq \(gasuite\(ga : \(dqfinally\(dq \(dq:\(dq \(gasuite\(ga .EE .UNINDENT .UNINDENT .SH FOOTNOTES .IP [1] 5 The LaTeX writer only refers the \fBmaxdepth\fP option of first toctree directive in the document. .IP [2] 5 A note on available globbing syntax: you can use the standard shell constructs \fB*\fP, \fB?\fP, \fB[...]\fP and \fB[!...]\fP with the feature that these all don\(aqt match slashes. A double star \fB**\fP can be used to match any sequence of characters \fIincluding\fP slashes. .IP [3] 5 There is a standard \fB\&.. include\fP directive, but it raises errors if the file is not found. This one only emits a warning. .IP [4] 5 For most builders name and format are the same. At the moment only builders derived from the html builder distinguish between the builder format and the builder name. .sp Note that the current builder tag is not available in \fBconf.py\fP, it is only available after the builder is initialized. .SS Field Lists .sp As previously discussed \%<#\:rst-field-lists>, field lists are sequences of fields marked up like this: .INDENT 0.0 .INDENT 3.5 .sp .EX :fieldname: Field content .EE .UNINDENT .UNINDENT .sp Sphinx extends standard docutils behavior for field lists and adds some extra functionality that is covered in this section. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The values of field lists will be parsed as strings. You cannot use Python collections such as lists or dictionaries. .UNINDENT .UNINDENT .SS File\-wide metadata .sp A field list near the top of a file is normally parsed by docutils as the \fIdocinfo\fP and shown on the page. However, in Sphinx, a field list preceding any other markup is moved from the \fIdocinfo\fP to the Sphinx environment as document metadata, and is not displayed in the output. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 A field list appearing after the document title \fIwill\fP be part of the \fIdocinfo\fP as normal and will be displayed in the output. .UNINDENT .UNINDENT .SS Special metadata fields .sp Sphinx provides custom behavior for bibliographic fields compared to docutils. .sp At the moment, these metadata fields are recognized: .INDENT 0.0 .TP .B \fBtocdepth\fP The maximum depth for a table of contents of this file. .INDENT 7.0 .INDENT 3.5 .sp .EX :tocdepth: 2 .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 This metadata affects the depth of the local toctree. But it does not affect the depth of the \fIglobal\fP toctree. So this does not change the sidebar of themes that use the global toctree. .UNINDENT .UNINDENT .sp Added in version 0.4. .TP .B \fBnocomments\fP If set, the web application won\(aqt display a comment form for a page generated from this source file. .INDENT 7.0 .INDENT 3.5 .sp .EX :nocomments: .EE .UNINDENT .UNINDENT .TP .B \fBorphan\fP If set, warnings about this file not being included in any toctree will be suppressed. .INDENT 7.0 .INDENT 3.5 .sp .EX :orphan: .EE .UNINDENT .UNINDENT .sp Added in version 1.0. .TP .B \fBno\-search\fP Disable full text search for this document. .INDENT 7.0 .INDENT 3.5 .sp .EX :no\-search: .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The \fB:no\-search:\fP option only disables full text search, meaning that object search will still be available even if \fB:no\-search:\fP is set. .UNINDENT .UNINDENT .sp Added in version 3.0. .sp Changed in version 7.3: The file\-wide metadata option \fB:nosearch:\fP was renamed to \fB:no\-search:\fP\&. The previous name has been retained as an alias, but will be deprecated and removed in a future version of Sphinx. .UNINDENT .SS MOVED: Domains .SS MOVED: Basic Markup .sp See Domains \%<>\&. .SS MOVED: Python Domain .sp See The Python Domain \%<>\&. .SS MOVED: C Domain .sp See The C Domain \%<>\&. .SS MOVED: C++ Domain .sp See The C++ Domain \%<>\&. .SS MOVED: Standard Domain .sp See The Standard Domain \%<>\&. .SS MOVED: JavaScript Domain .sp See The JavaScript Domain \%<>\&. .SS MOVED: reStructuredText Domain .sp See The reStructuredText Domain \%<>\&. .SS MOVED: Math Domain .sp See The Mathematics Domain \%<>\&. .SS MOVED: More domains .sp See Domains \%<>\&. .SS Markdown .sp Markdown \% is a lightweight markup language with a simplistic plain text formatting syntax. It exists in many syntactically different \fIflavors\fP\&. To support Markdown\-based documentation, Sphinx can use MyST\-Parser \%\&. MyST\-Parser is a Docutils bridge to markdown\-it\-py \%, a Python package for parsing the CommonMark \% Markdown flavor. .SS Configuration .sp To configure your Sphinx project for Markdown support, proceed as follows: .INDENT 0.0 .IP 1. 3 Install the Markdown parser \fIMyST\-Parser\fP: .INDENT 3.0 .INDENT 3.5 .sp .EX pip install \-\-upgrade myst\-parser .EE .UNINDENT .UNINDENT .IP 2. 3 Add \fImyst_parser\fP to the \fBlist of configured extensions\fP \%<#\:confval-extensions>: .INDENT 3.0 .INDENT 3.5 .sp .EX extensions = [\(aqmyst_parser\(aq] .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 3.0 .INDENT 3.5 MyST\-Parser requires Sphinx 2.1 or newer. .UNINDENT .UNINDENT .IP 3. 3 If you want to use Markdown files with extensions other than \fB\&.md\fP, adjust the \fBsource_suffix\fP \%<#\:confval-source_suffix> variable. The following example configures Sphinx to parse all files with the extensions \fB\&.md\fP and \fB\&.txt\fP as Markdown: .INDENT 3.0 .INDENT 3.5 .sp .EX source_suffix = { \(aq.rst\(aq: \(aqrestructuredtext\(aq, \(aq.txt\(aq: \(aqmarkdown\(aq, \(aq.md\(aq: \(aqmarkdown\(aq, } .EE .UNINDENT .UNINDENT .IP 4. 3 You can further configure \fIMyST\-Parser\fP to allow custom syntax that standard \fICommonMark\fP doesn\(aqt support. Read more in the MyST\-Parser documentation \%\&. .UNINDENT .SS Cross\-references .sp One of Sphinx\(aqs most useful features is creating automatic cross\-references through semantic cross\-referencing roles. A cross reference to an object description, such as \fB:func:\(gaspam\(ga\fP, will create a link to the place where \fBspam()\fP is documented, appropriate to each output format (HTML, PDF, ePUB, etc.). .SS Syntax .sp Sphinx supports various cross\-referencing roles to create links to other elements in the documentation. In general, writing \fB:role:\(gatarget\(ga\fP creates a link to the object called \fItarget\fP of the type indicated by \fIrole\fP\&. The link\(aqs text depends the role but is often the same as or similar to \fItarget\fP\&. .sp The behavior can be modified in the following ways: .INDENT 0.0 .IP \(bu 2 \fBCustom link text:\fP You can specify the link text explicitly using the same notation as in reStructuredText external links \%<#\:rst-external-links>: \fB:role:\(gacustom text \(ga\fP will refer to \fItarget\fP and display \fIcustom text\fP as the text of the link. .IP \(bu 2 \fBSuppressed link:\fP Prefixing with an exclamation mark (\fB!\fP) prevents the creation of a link but otherwise keeps the visual output of the role. .sp For example, writing \fB:py:func:\(ga!target\(ga\fP displays \fBtarget()\fP, with no link generated. .sp This is helpful for cases in which the link target does not exist; e.g. changelog entries that describe removed functionality, or third\-party libraries that don\(aqt support intersphinx \%<>\&. Suppressing the link prevents warnings in \fBnitpicky\fP \%<#\:confval-nitpicky> mode. .IP \(bu 2 \fBModified domain reference:\fP When referencing domain objects, a tilde \fB~\fP prefix shortens the link text to the last component of the target. For example, \fB:py:meth:\(ga~queue.Queue.get\(ga\fP will refer to \fBqueue.Queue.get\fP but only display \fBget\fP as the link text. .sp In HTML output, the link\(aqs \fBtitle\fP attribute (that is e.g. shown as a tool\-tip on mouse\-hover) will always be the full target name. .UNINDENT .SS Cross\-referencing objects .sp These roles are described with their respective domains: .INDENT 0.0 .IP \(bu 2 C \%<#\:c-xref-roles> .IP \(bu 2 C++ \%<#\:cpp-xref-roles> .IP \(bu 2 JavaScript \%<#\:js-xref-roles> .IP \(bu 2 reStructuredText \%<#\:rst-xref-roles> .IP \(bu 2 Python \%<#\:python-xref-roles> .UNINDENT .SS Cross\-referencing arbitrary locations .INDENT 0.0 .TP .B :ref: To support cross\-referencing to arbitrary locations in any document, the standard reStructuredText labels are used. For this to work label names must be unique throughout the entire documentation. There are two ways in which you can refer to labels: .INDENT 7.0 .IP \(bu 2 If you place a label directly before a section title, you can reference to it with \fB:ref:\(galabel\-name\(ga\fP\&. For example: .INDENT 2.0 .INDENT 3.5 .sp .EX \&.. _my\-reference\-label: Section to cross\-reference \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- This is the text of the section. It refers to the section itself, see :ref:\(gamy\-reference\-label\(ga. .EE .UNINDENT .UNINDENT .sp The \fB:ref:\fP role would then generate a link to the section, with the link title being \(dqSection to cross\-reference\(dq. This works just as well when section and reference are in different source files. .sp Automatic labels also work with figures. For example: .INDENT 2.0 .INDENT 3.5 .sp .EX \&.. _my\-figure: \&.. figure:: whatever Figure caption .EE .UNINDENT .UNINDENT .sp In this case, a reference \fB:ref:\(gamy\-figure\(ga\fP would insert a reference to the figure with link text \(dqFigure caption\(dq. .sp The same works for tables that are given an explicit caption using the table \% directive. .IP \(bu 2 Labels that aren\(aqt placed before a section title can still be referenced, but you must give the link an explicit title, using this syntax: \fB:ref:\(gaLink title \(ga\fP\&. .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 Reference labels must start with an underscore. When referencing a label, the underscore must be omitted (see examples above). .UNINDENT .UNINDENT .sp Using \fBref\fP is advised over standard reStructuredText links to sections (like \fB\(gaSection title\(ga_\fP) because it works across files, when section headings are changed, will raise warnings if incorrect, and works for all builders that support cross\-references. .UNINDENT .SS Cross\-referencing documents .sp Added in version 0.6. .sp There is also a way to directly link to documents: .INDENT 0.0 .TP .B :doc: Link to the specified document; the document name can be a relative or absolute path and is always case\-sensitive, even on Windows. For example, if the reference \fB:doc:\(gaparrot\(ga\fP occurs in the document \fBsketches/index\fP, then the link refers to \fBsketches/parrot\fP\&. If the reference is \fB:doc:\(ga/people\(ga\fP or \fB:doc:\(ga../people\(ga\fP, the link refers to \fBpeople\fP\&. .sp If no explicit link text is given (like usual: \fB:doc:\(gaMonty Python members \(ga\fP), the link caption will be the title of the given document. .UNINDENT .SS Referencing downloadable files .sp Added in version 0.6. .INDENT 0.0 .TP .B :download: This role lets you link to files within your source tree that are not reStructuredText documents that can be viewed, but files that can be downloaded. .sp When you use this role, the referenced file is automatically marked for inclusion in the output when building (obviously, for HTML output only). All downloadable files are put into a \fB_downloads//\fP subdirectory of the output directory; duplicate filenames are handled. .sp An example: .INDENT 7.0 .INDENT 3.5 .sp .EX See :download:\(gathis example script <../example.py>\(ga. .EE .UNINDENT .UNINDENT .sp The given filename is usually relative to the directory the current source file is contained in, but if it absolute (starting with \fB/\fP), it is taken as relative to the top source directory. .sp The \fBexample.py\fP file will be copied to the output directory, and a suitable link generated to it. .sp Not to show unavailable download links, you should wrap whole paragraphs that have this role: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. only:: builder_html See :download:\(gathis example script <../example.py>\(ga. .EE .UNINDENT .UNINDENT .UNINDENT .SS Cross\-referencing figures by figure number .sp Added in version 1.3. .sp Changed in version 1.5: \fBnumref\fP role can also refer sections. And \fBnumref\fP allows \fB{name}\fP for the link text. .INDENT 0.0 .TP .B :numref: Link to the specified figures, tables, code\-blocks and sections; the standard reStructuredText labels are used. When you use this role, it will insert a reference to the figure with link text by its figure number like \(dqFig. 1.1\(dq. .sp If an explicit link text is given (as usual: \fB:numref:\(gaImage of Sphinx (Fig. %s) \(ga\fP), the link caption will serve as title of the reference. As placeholders, \fI%s\fP and \fI{number}\fP get replaced by the figure number and \fI{name}\fP by the figure caption. If no explicit link text is given, the \fBnumfig_format\fP \%<#\:confval-numfig_format> setting is used as fall\-back default. .sp If \fBnumfig\fP \%<#\:confval-numfig> is \fBFalse\fP, figures are not numbered, so this role inserts not a reference but the label or the link text. .UNINDENT .SS Cross\-referencing other items of interest .sp The following roles do possibly create a cross\-reference, but do not refer to objects: .INDENT 0.0 .TP .B :confval: A configuration value or setting. Index entries are generated. Also generates a link to the matching \fBconfval\fP \%<#\:directive-confval> directive, if it exists. .UNINDENT .INDENT 0.0 .TP .B :envvar: An environment variable. Index entries are generated. Also generates a link to the matching \fBenvvar\fP \%<#\:directive-envvar> directive, if it exists. .UNINDENT .INDENT 0.0 .TP .B :token: The name of a grammar token (used to create links between \fBproductionlist\fP \%<#\:directive-productionlist> directives). .UNINDENT .INDENT 0.0 .TP .B :keyword: The name of a keyword in Python. This creates a link to a reference label with that name, if it exists. .UNINDENT .INDENT 0.0 .TP .B :option: A command\-line option to an executable program. This generates a link to a \fBoption\fP \%<#\:directive-option> directive, if it exists. .UNINDENT .sp The following role creates a cross\-reference to a term in a glossary \%<#\:glossary-directive>: .INDENT 0.0 .TP .B :term: Reference to a term in a glossary. A glossary is created using the \fBglossary\fP directive containing a definition list with terms and definitions. It does not have to be in the same file as the \fBterm\fP markup, for example the Python docs have one global glossary in the \fBglossary.rst\fP file. .sp If you use a term that\(aqs not explained in a glossary, you\(aqll get a warning during build. .sp This role also supports custom link text from the general cross\-reference syntax. .UNINDENT .SS Cross\-referencing anything .INDENT 0.0 .TP .B :any: Added in version 1.3. .sp This convenience role tries to do its best to find a valid target for its reference text. .INDENT 7.0 .IP \(bu 2 First, it tries standard cross\-reference targets that would be referenced by \fBdoc\fP, \fBref\fP or \fBoption\fP\&. .sp Custom objects added to the standard domain by extensions (see \fBSphinx.add_object_type()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_object_type>) are also searched. .IP \(bu 2 Then, it looks for objects (targets) in all loaded domains. It is up to the domains how specific a match must be. For example, in the Python domain a reference of \fB:any:\(gaBuilder\(ga\fP would match the \fBsphinx.builders.Builder\fP class. .UNINDENT .sp If none or multiple targets are found, a warning will be emitted. In the case of multiple targets, you can change \(dqany\(dq to a specific role. .sp This role is a good candidate for setting \fBdefault_role\fP \%<#\:confval-default_role>\&. If you do, you can write cross\-references without a lot of markup overhead. For example, in this Python function documentation: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. function:: install() This function installs a \(gahandler\(ga for every signal known by the \(gasignal\(ga module. See the section \(gaabout\-signals\(ga for more information. .EE .UNINDENT .UNINDENT .sp there could be references to a glossary term (usually \fB:term:\(gahandler\(ga\fP), a Python module (usually \fB:py:mod:\(gasignal\(ga\fP or \fB:mod:\(gasignal\(ga\fP) and a section (usually \fB:ref:\(gaabout\-signals\(ga\fP). .sp The \fBany\fP role also works together with the \fBintersphinx\fP \%<#\:module-sphinx\:.ext\:.intersphinx> extension: when no local cross\-reference is found, all object types of intersphinx inventories are also searched. .UNINDENT .SS Configuration .sp The configuration directory \%<#\:term-configuration-directory> must contain a file named \fBconf.py\fP\&. This file (containing Python code) is called the \(dqbuild configuration file\(dq and contains (almost) all configuration needed to customise Sphinx input and output behaviour. .sp An optional file docutils.conf \% can be added to the configuration directory to adjust Docutils \% configuration if not otherwise overridden or set by Sphinx. .sp Important points to note: .INDENT 0.0 .IP \(bu 2 If not otherwise documented, values must be strings, and their default is the empty string. .IP \(bu 2 The term \(dqfully\-qualified name\(dq (FQN) refers to a string that names an importable Python object inside a module; for example, the fully\-qualified name \fB\(dqsphinx.builders.Builder\(dq\fP means the \fBBuilder\fP class in the \fBsphinx.builders\fP module. .IP \(bu 2 Document names use \fB/\fP as the path separator and do not contain the file name extension. .UNINDENT .INDENT 0.0 .IP \(bu 2 Where glob\-style patterns are permitted, you can use the standard shell constructs (\fB*\fP, \fB?\fP, \fB[...]\fP, and \fB[!...]\fP) with the feature that none of these will match slashes (\fB/\fP). A double star \fB**\fP can be used to match any sequence of characters \fIincluding\fP slashes. .UNINDENT .sp \fBTip:\fP .INDENT 0.0 .INDENT 3.5 The configuration file is executed as Python code at build time (using \fBimportlib.import_module()\fP \%, with the current directory set to the configuration directory \%<#\:term-configuration-directory>), and therefore can execute arbitrarily complex code. .sp Sphinx then reads simple names from the file\(aqs namespace as its configuration. In general, configuration values should be simple strings, numbers, or lists or dictionaries of simple values. .sp The contents of the config namespace are pickled (so that Sphinx can find out when configuration changes), so it may not contain unpickleable values \-\- delete them from the namespace with \fBdel\fP if appropriate. Modules are removed automatically, so deleting imported modules is not needed. .UNINDENT .UNINDENT .SS Project tags .sp There is a special object named \fBtags\fP available in the config file, which exposes the project tags \%<#\:tags>\&. Tags are defined either via the \fB\-\-tag\fP \%<#\:cmdoption-sphinx-build-t> command\-line option or \fBtags.add(\(aqtag\(aq)\fP\&. Note that the builder\(aqs name and format tags are not available in \fBconf.py\fP\&. .sp It can be used to query and change the defined tags as follows: .INDENT 0.0 .IP \(bu 2 To query whether a tag is set, use \fB\(aqtag\(aq in tags\fP\&. .IP \(bu 2 To add a tag, use \fBtags.add(\(aqtag\(aq)\fP\&. .IP \(bu 2 To remove a tag, use \fBtags.remove(\(aqtag\(aq)\fP\&. .UNINDENT .SS Project information .INDENT 0.0 .TP .B project .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqProject name not set\(aq\fP.UNINDENT .sp The documented project\(aqs name. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX project = \(aqThermidor\(aq .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B author .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqAuthor name not set\(aq\fP.UNINDENT .sp The project\(aqs author(s). Example: .INDENT 7.0 .INDENT 3.5 .sp .EX author = \(aqJoe Bloggs\(aq .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B copyright .TP .B project_copyright .INDENT 7.0 .TP .B Type \fBstr | Sequence[str]\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp A copyright statement. Permitted styles are as follows, where \(aqYYYY\(aq represents a four\-digit year. .INDENT 7.0 .IP \(bu 2 \fBcopyright = \(aqYYYY\(aq\fP .IP \(bu 2 \fBcopyright = \(aqYYYY, Author Name\(aq\fP .IP \(bu 2 \fBcopyright = \(aqYYYY Author Name\(aq\fP .IP \(bu 2 \fBcopyright = \(aqYYYY\-YYYY, Author Name\(aq\fP .IP \(bu 2 \fBcopyright = \(aqYYYY\-YYYY Author Name\(aq\fP .UNINDENT .sp If the string \fB\(aq%Y\(aq\fP appears in a copyright line, it will be replaced with the current four\-digit year. For example: .INDENT 7.0 .IP \(bu 2 \fBcopyright = \(aq%Y\(aq\fP .IP \(bu 2 \fBcopyright = \(aq%Y, Author Name\(aq\fP .IP \(bu 2 \fBcopyright = \(aqYYYY\-%Y, Author Name\(aq\fP .UNINDENT .sp Added in version 3.5: The \fBproject_copyright\fP alias. .sp Changed in version 7.1: The value may now be a sequence of copyright statements in the above form, which will be displayed each to their own line. .sp Changed in version 8.1: Copyright statements support the \fB\(aq%Y\(aq\fP placeholder. .UNINDENT .INDENT 0.0 .TP .B version .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp The major project version, used as the replacement for the \fB|version|\fP default substitution \%<#\:default-substitutions>\&. .sp This may be something like \fBversion = \(aq4.2\(aq\fP\&. The full project version is defined in \fBrelease\fP\&. .sp If your project does not draw a meaningful distinction between between a \(aqfull\(aq and \(aqmajor\(aq version, set both \fBversion\fP and \fBrelease\fP to the same value. .UNINDENT .INDENT 0.0 .TP .B release .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp The full project version, used as the replacement for the \fB|release|\fP default substitution \%<#\:default-substitutions>, and e.g. in the HTML templates. .sp This may be something like \fBrelease = \(aq4.2.1b0\(aq\fP\&. The major (short) project version is defined in \fBversion\fP\&. .sp If your project does not draw a meaningful distinction between between a \(aqfull\(aq and \(aqmajor\(aq version, set both \fBversion\fP and \fBrelease\fP to the same value. .UNINDENT .SS General configuration .INDENT 0.0 .TP .B needs_sphinx .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp Set a minimum supported version of Sphinx required to build the project. The format should be a \fB\(aqmajor.minor\(aq\fP version string like \fB\(aq1.1\(aq\fP Sphinx will compare it with its version and refuse to build the project if the running version of Sphinx is too old. By default, there is no minimum version. .sp Added in version 1.0. .sp Changed in version 1.4: Allow a \fB\(aqmajor.minor.micro\(aq\fP version string. .UNINDENT .INDENT 0.0 .TP .B extensions .INDENT 7.0 .TP .B Type \fBlist[str]\fP.TP .B Default \fB[]\fP.UNINDENT .sp A list of strings that are module names of Sphinx extensions \%<>\&. These can be extensions bundled with Sphinx (named \fBsphinx.ext.*\fP) or custom first\-party or third\-party extensions. .sp To use a third\-party extension, you must ensure that it is installed and include it in the \fBextensions\fP list, like so: .INDENT 7.0 .INDENT 3.5 .sp .EX extensions = [ ... \(aqnumpydoc\(aq, ] .EE .UNINDENT .UNINDENT .sp There are two options for first\-party extensions. The configuration file itself can be an extension; for that, you only need to provide a \fBsetup()\fP function in it. Otherwise, you must ensure that your custom extension is importable, and located in a directory that is in the Python path. .sp Ensure that absolute paths are used when modifying \fBsys.path\fP \%\&. If your custom extensions live in a directory that is relative to the configuration directory \%<#\:term-configuration-directory>, use \fBpathlib.Path.resolve()\fP \% like so: .INDENT 7.0 .INDENT 3.5 .sp .EX import sys from pathlib import Path sys.path.append(str(Path(\(aqsphinxext\(aq).resolve())) extensions = [ ... \(aqextname\(aq, ] .EE .UNINDENT .UNINDENT .sp The directory structure illustrated above would look like this: .INDENT 7.0 .INDENT 3.5 .sp .EX / ├── conf.py └── sphinxext/ \ \ └── extname.py .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B needs_extensions .INDENT 7.0 .TP .B Type \fBdict[str, str]\fP.TP .B Default \fB{}\fP.UNINDENT .sp If set, this value must be a dictionary specifying version requirements for extensions in \fBextensions\fP\&. The version strings should be in the \fB\(aqmajor.minor\(aq\fP form. Requirements do not have to be specified for all extensions, only for those you want to check. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX needs_extensions = { \(aqsphinxcontrib.something\(aq: \(aq1.5\(aq, } .EE .UNINDENT .UNINDENT .sp This requires that the extension declares its version in the \fBsetup()\fP function. See Sphinx API \%<#\:dev-extensions> for further details. .sp Added in version 1.3. .UNINDENT .INDENT 0.0 .TP .B manpages_url .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp A URL to cross\-reference \fBmanpage\fP \%<#\:role-manpage> roles. If this is defined to \fBhttps://manpages.debian.org/{path}\fP, the \fB:manpage:\(gaman(1)\(ga\fP role will link to <\%>. The patterns available are: .INDENT 7.0 .TP .B \fBpage\fP The manual page (\fBman\fP) .TP .B \fBsection\fP The manual section (\fB1\fP) .TP .B \fBpath\fP The original manual page and section specified (\fBman(1)\fP) .UNINDENT .sp This also supports manpages specified as \fBman.1\fP\&. .INDENT 7.0 .INDENT 3.5 .sp .EX # To use manpages.debian.org: manpages_url = \(aqhttps://manpages.debian.org/{path}\(aq # To use man7.org: manpages_url = \(aqhttps://man7.org/linux/man\-pages/man{section}/{page}.{section}.html\(aq # To use linux.die.net: manpages_url = \(aqhttps://linux.die.net/man/{section}/{page}\(aq # To use helpmanual.io: manpages_url = \(aqhttps://helpmanual.io/man{section}/{page}\(aq .EE .UNINDENT .UNINDENT .sp Added in version 1.7. .UNINDENT .INDENT 0.0 .TP .B today .TP .B today_fmt These values determine how to format the current date, used as the replacement for the \fB|today|\fP default substitution \%<#\:default-substitutions>\&. .INDENT 7.0 .IP \(bu 2 If you set \fBtoday\fP to a non\-empty value, it is used. .IP \(bu 2 Otherwise, the current time is formatted using \fBtime.strftime()\fP \% and the format given in \fBtoday_fmt\fP\&. .UNINDENT .sp The default for \fBtoday\fP is \fB\(aq\(aq\fP, and the default for \fBtoday_fmt\fP is \fB\(aq%b %d, %Y\(aq\fP (or, if translation is enabled with \fBlanguage\fP, an equivalent format for the selected locale). .UNINDENT .SS Options for figure numbering .INDENT 0.0 .TP .B numfig .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If \fBTrue\fP, figures, tables and code\-blocks are automatically numbered if they have a caption. The \fBnumref\fP \%<#\:role-numref> role is enabled. Obeyed so far only by HTML and LaTeX builders. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The LaTeX builder always assigns numbers whether this option is enabled or not. .UNINDENT .UNINDENT .sp Added in version 1.3. .UNINDENT .INDENT 0.0 .TP .B numfig_format .INDENT 7.0 .TP .B Type \fBdict[str, str]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary mapping \fB\(aqfigure\(aq\fP, \fB\(aqtable\(aq\fP, \fB\(aqcode\-block\(aq\fP and \fB\(aqsection\(aq\fP to strings that are used for format of figure numbers. The marker \fB%s\fP will be replaced with the figure number. .sp The defaults are: .INDENT 7.0 .INDENT 3.5 .sp .EX numfig_format = { \(aqcode\-block\(aq: \(aqListing %s\(aq, \(aqfigure\(aq: \(aqFig. %s\(aq, \(aqsection\(aq: \(aqSection\(aq, \(aqtable\(aq: \(aqTable %s\(aq, } .EE .UNINDENT .UNINDENT .sp Added in version 1.3. .UNINDENT .INDENT 0.0 .TP .B numfig_secnum_depth .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fB1\fP.UNINDENT .INDENT 7.0 .IP \(bu 2 If set to \fB0\fP, figures, tables, and code\-blocks are continuously numbered starting at \fB1\fP\&. .IP \(bu 2 If \fB1\fP, the numbering will be \fBx.1\fP, \fBx.2\fP, ... with \fBx\fP representing the section number. (If there is no top\-level section, the prefix will not be added ). This naturally applies only if section numbering has been activated via the \fB:numbered:\fP option of the \fBtoctree\fP \%<#\:directive-toctree> directive. .IP \(bu 2 If \fB2\fP, the numbering will be \fBx.y.1\fP, \fBx.y.2\fP, ... with \fBx\fP representing the section number and \fBy\fP the sub\-section number. If located directly under a section, there will be no \fBy.\fP prefix, and if there is no top\-level section, the prefix will not be added. .IP \(bu 2 Any other positive integer can be used, following the rules above. .UNINDENT .sp Added in version 1.3. .sp Changed in version 1.7: The LaTeX builder obeys this setting if \fBnumfig\fP is set to \fBTrue\fP\&. .UNINDENT .SS Options for highlighting .INDENT 0.0 .TP .B highlight_language .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqdefault\(aq\fP.UNINDENT .sp The default language to highlight source code in. The default is \fB\(aqdefault\(aq\fP, which suppresses warnings if highlighting as Python code fails. .sp The value should be a valid Pygments lexer name, see Showing code examples \%<#\:code-examples> for more details. .sp Added in version 0.5. .sp Changed in version 1.4: The default is now \fB\(aqdefault\(aq\fP\&. .UNINDENT .INDENT 0.0 .TP .B highlight_options .INDENT 7.0 .TP .B Type \fBdict[str, dict[str, Any]]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary that maps Pygments lexer names to their options. These are lexer\-specific; for the options understood by each, see the Pygments documentation \%\&. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX highlight_options = { \(aqdefault\(aq: {\(aqstripall\(aq: True}, \(aqphp\(aq: {\(aqstartinline\(aq: True}, } .EE .UNINDENT .UNINDENT .sp Added in version 1.3. .sp Changed in version 3.5: Allow configuring highlight options for multiple lexers. .UNINDENT .INDENT 0.0 .TP .B pygments_style .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqsphinx\(aq\fP.UNINDENT .sp The style name to use for Pygments highlighting of source code. If not set, either the theme\(aqs default style or \fB\(aqsphinx\(aq\fP is selected for HTML output. .sp Changed in version 0.3: If the value is a fully\-qualified name of a custom Pygments style class, this is then used as custom style. .UNINDENT .SS Options for HTTP requests .INDENT 0.0 .TP .B tls_verify .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If True, Sphinx verifies server certificates. .sp Added in version 1.5. .UNINDENT .INDENT 0.0 .TP .B tls_cacerts .INDENT 7.0 .TP .B Type \fBstr | dict[str, str]\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp A path to a certification file of CA or a path to directory which contains the certificates. This also allows a dictionary mapping hostnames to the certificate file path. The certificates are used to verify server certifications. .sp Added in version 1.5. .sp \fBTip:\fP .INDENT 7.0 .INDENT 3.5 Sphinx uses requests \% as a HTTP library internally. If \fBtls_cacerts\fP is not set, Sphinx falls back to requests\(aq default behaviour. See SSL Cert Verification \% for further details. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B user_agent .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqMozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0 Sphinx/X.Y.Z\(aq\fP.UNINDENT .sp Set the User\-Agent used by Sphinx for HTTP requests. .sp Added in version 2.3. .UNINDENT .SS Options for internationalisation .sp These options influence Sphinx\(aqs \fINative Language Support\fP\&. See the documentation on Internationalization \%<#\:intl> for details. .INDENT 0.0 .TP .B language .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqen\(aq\fP.UNINDENT .sp The code for the language the documents are written in. Any text automatically generated by Sphinx will be in that language. Also, Sphinx will try to substitute individual paragraphs from your documents with the translation sets obtained from \fBlocale_dirs\fP\&. Sphinx will search language\-specific figures named by \fBfigure_language_filename\fP (e.g. the German version of \fBmyfigure.png\fP will be \fBmyfigure.de.png\fP by default setting) and substitute them for original figures. In the LaTeX builder, a suitable language will be selected as an option for the \fIBabel\fP package. .sp Added in version 0.5. .sp Changed in version 1.4: Support figure substitution .sp Changed in version 5.0: The default is now \fB\(aqen\(aq\fP (previously \fBNone\fP). .sp Currently supported languages by Sphinx are: .INDENT 7.0 .IP \(bu 2 \fBar\fP \-\- Arabic .IP \(bu 2 \fBbg\fP \-\- Bulgarian .IP \(bu 2 \fBbn\fP \-\- Bengali .IP \(bu 2 \fBca\fP \-\- Catalan .IP \(bu 2 \fBcak\fP \-\- Kaqchikel .IP \(bu 2 \fBcs\fP \-\- Czech .IP \(bu 2 \fBcy\fP \-\- Welsh .IP \(bu 2 \fBda\fP \-\- Danish .IP \(bu 2 \fBde\fP \-\- German .IP \(bu 2 \fBel\fP \-\- Greek .IP \(bu 2 \fBen\fP \-\- English (default) .IP \(bu 2 \fBeo\fP \-\- Esperanto .IP \(bu 2 \fBes\fP \-\- Spanish .IP \(bu 2 \fBet\fP \-\- Estonian .IP \(bu 2 \fBeu\fP \-\- Basque .IP \(bu 2 \fBfa\fP \-\- Iranian .IP \(bu 2 \fBfi\fP \-\- Finnish .IP \(bu 2 \fBfr\fP \-\- French .IP \(bu 2 \fBhe\fP \-\- Hebrew .IP \(bu 2 \fBhi\fP \-\- Hindi .IP \(bu 2 \fBhi_IN\fP \-\- Hindi (India) .IP \(bu 2 \fBhr\fP \-\- Croatian .IP \(bu 2 \fBhu\fP \-\- Hungarian .IP \(bu 2 \fBid\fP \-\- Indonesian .IP \(bu 2 \fBit\fP \-\- Italian .IP \(bu 2 \fBja\fP \-\- Japanese .IP \(bu 2 \fBko\fP \-\- Korean .IP \(bu 2 \fBlt\fP \-\- Lithuanian .IP \(bu 2 \fBlv\fP \-\- Latvian .IP \(bu 2 \fBmk\fP \-\- Macedonian .IP \(bu 2 \fBnb_NO\fP \-\- Norwegian Bokmal .IP \(bu 2 \fBne\fP \-\- Nepali .IP \(bu 2 \fBnl\fP \-\- Dutch .IP \(bu 2 \fBpl\fP \-\- Polish .IP \(bu 2 \fBpt\fP \-\- Portuguese .IP \(bu 2 \fBpt_BR\fP \-\- Brazilian Portuguese .IP \(bu 2 \fBpt_PT\fP \-\- European Portuguese .IP \(bu 2 \fBro\fP \-\- Romanian .IP \(bu 2 \fBru\fP \-\- Russian .IP \(bu 2 \fBsi\fP \-\- Sinhala .IP \(bu 2 \fBsk\fP \-\- Slovak .IP \(bu 2 \fBsl\fP \-\- Slovenian .IP \(bu 2 \fBsq\fP \-\- Albanian .IP \(bu 2 \fBsr\fP \-\- Serbian .IP \(bu 2 \fBsr@latin\fP \-\- Serbian (Latin) .IP \(bu 2 \fBsr_RS\fP \-\- Serbian (Cyrillic) .IP \(bu 2 \fBsv\fP \-\- Swedish .IP \(bu 2 \fBta\fP \-\- Tamil .IP \(bu 2 \fBte\fP \-\- Telugu .IP \(bu 2 \fBtr\fP \-\- Turkish .IP \(bu 2 \fBuk_UA\fP \-\- Ukrainian .IP \(bu 2 \fBur\fP \-\- Urdu .IP \(bu 2 \fBvi\fP \-\- Vietnamese .IP \(bu 2 \fBzh_CN\fP \-\- Simplified Chinese .IP \(bu 2 \fBzh_TW\fP \-\- Traditional Chinese .UNINDENT .UNINDENT .INDENT 0.0 .TP .B locale_dirs .INDENT 7.0 .TP .B Type \fBlist[str]\fP.TP .B Default \fB[\(aqlocales\(aq]\fP.UNINDENT .sp Directories in which to search for additional message catalogs (see \fBlanguage\fP), relative to the source directory. The directories on this path are searched by the \fBgettext\fP \% module. .sp Internal messages are fetched from a text domain of \fBsphinx\fP; so if you add the directory \fB\&./locales\fP to this setting, the message catalogs (compiled from \fB\&.po\fP format using \fBmsgfmt\fP) must be in \fB\&./locales/\fP\fIlanguage\fP\fB/LC_MESSAGES/sphinx.mo\fP\&. The text domain of individual documents depends on \fBgettext_compact\fP\&. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The \fB\-v option to sphinx\-build\fP \%<#\:cmdoption-sphinx-build-v> is useful to check the \fBlocale_dirs\fP setting is working as expected. If the message catalog directory not found, debug messages are emitted. .UNINDENT .UNINDENT .sp Added in version 0.5. .sp Changed in version 1.5: Use \fBlocales\fP directory as a default value .UNINDENT .INDENT 0.0 .TP .B gettext_allow_fuzzy_translations .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If True, \(dqfuzzy\(dq messages in the message catalogs are used for translation. .sp Added in version 4.3. .UNINDENT .INDENT 0.0 .TP .B gettext_compact .INDENT 7.0 .TP .B Type \fBbool | str\fP.TP .B Default \fBTrue\fP.UNINDENT .INDENT 7.0 .IP \(bu 2 If \fBTrue\fP, a document\(aqs text domain is its docname if it is a top\-level project file and its very base directory otherwise. .IP \(bu 2 If \fBFalse\fP, a document\(aqs text domain is the docname, in full. .IP \(bu 2 If set to a string, every document\(aqs text domain is set to this string, making all documents use single text domain. .UNINDENT .sp With \fBgettext_compact = True\fP, the document \fBmarkup/code.rst\fP ends up in the \fBmarkup\fP text domain. With this option set to \fBFalse\fP, it is \fBmarkup/code\fP\&. With this option set to \fB\(aqsample\(aq\fP, it is \fBsample\fP\&. .sp Added in version 1.1. .sp Changed in version 3.3: Allow string values. .UNINDENT .INDENT 0.0 .TP .B gettext_uuid .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If \fBTrue\fP, Sphinx generates UUID information for version tracking in message catalogs. It is used to: .INDENT 7.0 .IP \(bu 2 Add a UUID line for each \fImsgid\fP in \fB\&.pot\fP files. .IP \(bu 2 Calculate similarity between new msgids and previously saved old msgids. (This calculation can take a long time.) .UNINDENT .sp \fBTip:\fP .INDENT 7.0 .INDENT 3.5 If you want to accelerate the calculation, you can use a third\-party package (Levenshtein \%) by running \fBpip install levenshtein\fP\&. .UNINDENT .UNINDENT .sp Added in version 1.3. .UNINDENT .INDENT 0.0 .TP .B gettext_location .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If \fBTrue\fP, Sphinx generates location information for messages in message catalogs. .sp Added in version 1.3. .UNINDENT .INDENT 0.0 .TP .B gettext_auto_build .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If \fBTrue\fP, Sphinx builds a \fB\&.mo\fP file for each translation catalog file. .sp Added in version 1.3. .UNINDENT .INDENT 0.0 .TP .B gettext_additional_targets .INDENT 7.0 .TP .B Type \fBset[str] | Sequence[str]\fP.TP .B Default \fB[]\fP.UNINDENT .sp Enable \fBgettext\fP translation for certain element types. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX gettext_additional_targets = {\(aqliteral\-block\(aq, \(aqimage\(aq} .EE .UNINDENT .UNINDENT .sp The following element types are supported: .INDENT 7.0 .IP \(bu 2 \fB\(aqindex\(aq\fP \-\- index terms .IP \(bu 2 \fB\(aqliteral\-block\(aq\fP \-\- literal blocks (\fB::\fP annotation and \fBcode\-block\fP directive) .IP \(bu 2 \fB\(aqdoctest\-block\(aq\fP \-\- doctest block .IP \(bu 2 \fB\(aqraw\(aq\fP \-\- raw content .IP \(bu 2 \fB\(aqimage\(aq\fP \-\- image/figure uri .UNINDENT .sp Added in version 1.3. .sp Changed in version 4.0: The alt text for images is translated by default. .sp Changed in version 7.4: Permit and prefer a set type. .UNINDENT .INDENT 0.0 .TP .B figure_language_filename .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq{root}.{language}{ext}\(aq\fP.UNINDENT .sp The filename format for language\-specific figures. The available format tokens are: .INDENT 7.0 .IP \(bu 2 \fB{root}\fP: the filename, including any path component, without the file extension. For example: \fBimages/filename\fP\&. .IP \(bu 2 \fB{path}\fP: the directory path component of the filename, with a trailing slash if non\-empty. For example: \fBimages/\fP\&. .IP \(bu 2 \fB{basename}\fP: the filename without the directory path or file extension components. For example: \fBfilename\fP\&. .IP \(bu 2 \fB{ext}\fP: the file extension. For example: \fB\&.png\fP\&. .IP \(bu 2 \fB{language}\fP: the translation language. For example: \fBen\fP\&. .IP \(bu 2 \fB{docpath}\fP: the directory path component for the current document, with a trailing slash if non\-empty. For example: \fBdirname/\fP\&. .UNINDENT .sp By default, an image directive \fB\&.. image:: images/filename.png\fP, using an image at \fBimages/filename.png\fP, will use the language\-specific figure filename \fBimages/filename.en.png\fP\&. .sp If \fBfigure_language_filename\fP is set as below, the language\-specific figure filename will be \fBimages/en/filename.png\fP instead. .INDENT 7.0 .INDENT 3.5 .sp .EX figure_language_filename = \(aq{path}{language}/{basename}{ext}\(aq .EE .UNINDENT .UNINDENT .sp Added in version 1.4. .sp Changed in version 1.5: Added \fB{path}\fP and \fB{basename}\fP tokens. .sp Changed in version 3.2: Added \fB{docpath}\fP token. .UNINDENT .INDENT 0.0 .TP .B translation_progress_classes .INDENT 7.0 .TP .B Type \fBbool | \(aqtranslated\(aq | \(aquntranslated\(aq\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Control which, if any, classes are added to indicate translation progress. This setting would likely only be used by translators of documentation, in order to quickly indicate translated and untranslated content. .INDENT 7.0 .TP .B \fBTrue\fP Add \fBtranslated\fP and \fBuntranslated\fP classes to all nodes with translatable content. .TP .B \fB\(aqtranslated\(aq\fP Only add the \fBtranslated\fP class. .TP .B \fB\(aquntranslated\(aq\fP Only add the \fBuntranslated\fP class. .TP .B \fBFalse\fP Do not add any classes to indicate translation progress. .UNINDENT .sp Added in version 7.1. .UNINDENT .SS Options for markup .INDENT 0.0 .TP .B default_role .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fBNone\fP.UNINDENT .sp The name of a reStructuredText role (builtin or Sphinx extension) to use as the default role, that is, for text marked up \fB\(galike this\(ga\fP\&. This can be set to \fB\(aqpy:obj\(aq\fP to make \fB\(gafilter\(ga\fP a cross\-reference to the Python function \(dqfilter\(dq. .sp The default role can always be set within individual documents using the standard reStructuredText default\-role \% directive. .sp Added in version 0.4. .UNINDENT .INDENT 0.0 .TP .B keep_warnings .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Keep warnings as \(dqsystem message\(dq paragraphs in the rendered documents. Warnings are always written to the standard error stream when \fBsphinx\-build\fP is run, regardless of this setting. .sp Added in version 0.5. .UNINDENT .INDENT 0.0 .TP .B option_emphasise_placeholders .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp When enabled, emphasise placeholders in \fBoption\fP \%<#\:directive-option> directives. To display literal braces, escape with a backslash (\fB\e{\fP). For example, \fBoption_emphasise_placeholders=True\fP and \fB\&.. option:: \-foption={TYPE}\fP would render with \fBTYPE\fP emphasised. .sp Added in version 5.1. .UNINDENT .INDENT 0.0 .TP .B primary_domain .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqpy\(aq\fP.UNINDENT .sp The name of the default domain \%<>\&. Can also be \fBNone\fP to disable a default domain. The default is \fB\(aqpy\(aq\fP, for the Python domain. .sp Those objects in other domain (whether the domain name is given explicitly, or selected by a \fBdefault\-domain\fP \%<#\:directive-default-domain> directive) will have the domain name explicitly prepended when named (e.g., when the default domain is C, Python functions will be named \(dqPython function\(dq, not just \(dqfunction\(dq). Example: .INDENT 7.0 .INDENT 3.5 .sp .EX primary_domain = \(aqcpp\(aq .EE .UNINDENT .UNINDENT .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B rst_epilog .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp A string of reStructuredText that will be included at the end of every source file that is read. This is a possible place to add substitutions that should be available in every file (another being \fBrst_prolog\fP). Example: .INDENT 7.0 .INDENT 3.5 .sp .EX rst_epilog = \(dq\(dq\(dq \&.. |psf| replace:: Python Software Foundation \(dq\(dq\(dq .EE .UNINDENT .UNINDENT .sp Added in version 0.6. .UNINDENT .INDENT 0.0 .TP .B rst_prolog .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp A string of reStructuredText that will be included at the beginning of every source file that is read. This is a possible place to add substitutions that should be available in every file (another being \fBrst_epilog\fP). Example: .INDENT 7.0 .INDENT 3.5 .sp .EX rst_prolog = \(dq\(dq\(dq \&.. |psf| replace:: Python Software Foundation \(dq\(dq\(dq .EE .UNINDENT .UNINDENT .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B show_authors .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp A boolean that decides whether \fBcodeauthor\fP \%<#\:directive-codeauthor> and \fBsectionauthor\fP \%<#\:directive-sectionauthor> directives produce any output in the built files. .UNINDENT .INDENT 0.0 .TP .B trim_footnote_reference_space .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Trim spaces before footnote references that are necessary for the reStructuredText parser to recognise the footnote, but do not look too nice in the output. .sp Added in version 0.6. .UNINDENT .SS Options for Maths .sp These options control maths markup and notation. .INDENT 0.0 .TP .B math_eqref_format .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq({number})\(aq\fP.UNINDENT .sp A string used for formatting the labels of references to equations. The \fB{number}\fP place\-holder stands for the equation number. .sp Example: \fB\(aqEq.{number}\(aq\fP gets rendered as, for example, \fBEq.10\fP\&. .sp Added in version 1.7. .UNINDENT .INDENT 0.0 .TP .B math_number_all .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Force all displayed equations to be numbered. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX math_number_all = True .EE .UNINDENT .UNINDENT .sp Added in version 1.4. .UNINDENT .INDENT 0.0 .TP .B math_numfig .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If \fBTrue\fP, displayed math equations are numbered across pages when \fBnumfig\fP is enabled. The \fBnumfig_secnum_depth\fP setting is respected. The \fBeq\fP \%<#\:role-eq>, not \fBnumref\fP \%<#\:role-numref>, role must be used to reference equation numbers. .sp Added in version 1.7. .UNINDENT .INDENT 0.0 .TP .B math_numsep .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq.\(aq\fP.UNINDENT .sp A string that defines the separator between section numbers and the equation number when \fBnumfig\fP is enabled and \fBnumfig_secnum_depth\fP is positive. .sp Example: \fB\(aq\-\(aq\fP gets rendered as \fB1.2\-3\fP\&. .sp Added in version 7.4. .UNINDENT .SS Options for the nitpicky mode .INDENT 0.0 .TP .B nitpicky .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Enables nitpicky mode if \fBTrue\fP\&. In nitpicky mode, Sphinx will warn about \fIall\fP references where the target cannot be found. This is recommended for new projects as it ensures that all references are to valid targets. .sp You can activate this mode temporarily using the \fB\-\-nitpicky\fP \%<#\:cmdoption-sphinx-build-n> command\-line option. See \fBnitpick_ignore\fP for a way to mark missing references as \(dqknown missing\(dq. .INDENT 7.0 .INDENT 3.5 .sp .EX nitpicky = True .EE .UNINDENT .UNINDENT .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B nitpick_ignore .INDENT 7.0 .TP .B Type \fBset[tuple[str, str]] | Sequence[tuple[str, str]]\fP.TP .B Default \fB()\fP.UNINDENT .sp A set or list of \fB(warning_type, target)\fP tuples that should be ignored when generating warnings in \fB\(dqnitpicky mode\(dq\fP\&. Note that \fBwarning_type\fP should include the domain name if present. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX nitpick_ignore = { (\(aqpy:func\(aq, \(aqint\(aq), (\(aqenvvar\(aq, \(aqLD_LIBRARY_PATH\(aq), } .EE .UNINDENT .UNINDENT .sp Added in version 1.1. .sp Changed in version 6.2: Changed allowable container types to a set, list, or tuple .UNINDENT .INDENT 0.0 .TP .B nitpick_ignore_regex .INDENT 7.0 .TP .B Type \fBset[tuple[str, str]] | Sequence[tuple[str, str]]\fP.TP .B Default \fB()\fP.UNINDENT .sp An extended version of \fBnitpick_ignore\fP, which instead interprets the \fBwarning_type\fP and \fBtarget\fP strings as regular expressions. Note that the regular expression must match the whole string (as if the \fB^\fP and \fB$\fP markers were inserted). .sp For example, \fB(r\(aqpy:.*\(aq, r\(aqfoo.*bar\e.B.*\(aq)\fP will ignore nitpicky warnings for all python entities that start with \fB\(aqfoo\(aq\fP and have \fB\(aqbar.B\(aq\fP in them, such as \fB(\(aqpy:const\(aq, \(aqfoo_package.bar.BAZ_VALUE\(aq)\fP or \fB(\(aqpy:class\(aq, \(aqfood.bar.Barman\(aq)\fP\&. .sp Added in version 4.1. .sp Changed in version 6.2: Changed allowable container types to a set, list, or tuple .UNINDENT .SS Options for object signatures .INDENT 0.0 .TP .B add_function_parentheses .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp A boolean that decides whether parentheses are appended to function and method role text (e.g. the content of \fB:func:\(gainput\(ga\fP) to signify that the name is callable. .UNINDENT .INDENT 0.0 .TP .B maximum_signature_line_length .INDENT 7.0 .TP .B Type \fBint | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp If a signature\(aqs length in characters exceeds the number set, each parameter within the signature will be displayed on an individual logical line. .sp When \fBNone\fP, there is no maximum length and the entire signature will be displayed on a single logical line. .sp A \(aqlogical line\(aq is similar to a hard line break\-\-\-builders or themes may choose to \(aqsoft wrap\(aq a single logical line, and this setting does not affect that behaviour. .sp Domains may provide options to suppress any hard wrapping on an individual object directive, such as seen in the C, C++, and Python domains (e.g. \fBpy:function:single\-line\-parameter\-list\fP \%<#\:directive-option-py-function-single-line-parameter-list>). .sp Added in version 7.1. .UNINDENT .INDENT 0.0 .TP .B strip_signature_backslash .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp When backslash stripping is enabled then every occurrence of \fB\e\e\fP in a domain directive will be changed to \fB\e\fP, even within string literals. This was the behaviour before version 3.0, and setting this variable to \fBTrue\fP will reinstate that behaviour. .sp Added in version 3.0. .UNINDENT .INDENT 0.0 .TP .B toc_object_entries .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Create table of contents entries for domain objects (e.g. functions, classes, attributes, etc.). .sp Added in version 5.2. .UNINDENT .INDENT 0.0 .TP .B toc_object_entries_show_parents .INDENT 7.0 .TP .B Type \fB\(aqdomain\(aq | \(aqhide\(aq | \(aqall\(aq\fP.TP .B Default \fB\(aqdomain\(aq\fP.UNINDENT .sp A string that determines how domain objects (functions, classes, attributes, etc.) are displayed in their table of contents entry. .sp Use \fB\(aqdomain\(aq\fP to allow the domain to determine the appropriate number of parents to show. For example, the Python domain would show \fBClass.method()\fP and \fBfunction()\fP, leaving out the \fBmodule.\fP level of parents. .sp Use \fB\(aqhide\(aq\fP to only show the name of the element without any parents (i.e. \fBmethod()\fP). .sp Use \fB\(aqall\(aq\fP to show the fully\-qualified name for the object (i.e. \fBmodule.Class.method()\fP), displaying all parents. .sp Added in version 5.2. .UNINDENT .SS Options for source files .INDENT 0.0 .TP .B exclude_patterns .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A list of glob\-style patterns that should be excluded when looking for source files. They are matched against the source file names relative to the source directory, using slashes as directory separators on all platforms. \fBexclude_patterns\fP has priority over \fBinclude_patterns\fP\&. .sp Example patterns: .INDENT 7.0 .IP \(bu 2 \fB\(aqlibrary/xml.rst\(aq\fP \-\- ignores the \fBlibrary/xml.rst\fP file .IP \(bu 2 \fB\(aqlibrary/xml\(aq\fP \-\- ignores the \fBlibrary/xml\fP directory .IP \(bu 2 \fB\(aqlibrary/xml*\(aq\fP \-\- ignores all files and directories starting with \fBlibrary/xml\fP .IP \(bu 2 \fB\(aq**/.git\(aq\fP \-\- ignores all \fB\&.git\fP directories .IP \(bu 2 \fB\(aqThumbs.db\(aq\fP \-\- ignores all \fBThumbs.db\fP files .UNINDENT .sp \fBexclude_patterns\fP is also consulted when looking for static files in \fBhtml_static_path\fP and \fBhtml_extra_path\fP\&. .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B include_patterns .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB(\(aq**\(aq,)\fP.UNINDENT .sp A list of glob\-style patterns that are used to find source files. They are matched against the source file names relative to the source directory, using slashes as directory separators on all platforms. By default, all files are recursively included from the source directory. \fBexclude_patterns\fP has priority over \fBinclude_patterns\fP\&. .sp Example patterns: .INDENT 7.0 .IP \(bu 2 \fB\(aq**\(aq\fP \-\- all files in the source directory and subdirectories, recursively .IP \(bu 2 \fB\(aqlibrary/xml\(aq\fP \-\- just the \fBlibrary/xml\fP directory .IP \(bu 2 \fB\(aqlibrary/xml*\(aq\fP \-\- all files and directories starting with \fBlibrary/xml\fP .IP \(bu 2 \fB\(aq**/doc\(aq\fP \-\- all \fBdoc\fP directories (this might be useful if documentation is co\-located with source files) .UNINDENT .sp Added in version 5.1. .UNINDENT .INDENT 0.0 .TP .B master_doc .TP .B root_doc .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqindex\(aq\fP.UNINDENT .sp Sphinx builds a tree of documents based on the \fBtoctree\fP \%<#\:directive-toctree> directives contained within the source files. This sets the name of the document containing the master \fBtoctree\fP directive, and hence the root of the entire tree. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX master_doc = \(aqcontents\(aq .EE .UNINDENT .UNINDENT .sp Changed in version 2.0: Default is \fB\(aqindex\(aq\fP (previously \fB\(aqcontents\(aq\fP). .sp Added in version 4.0: The \fBroot_doc\fP alias. .UNINDENT .INDENT 0.0 .TP .B source_encoding .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqutf\-8\-sig\(aq\fP.UNINDENT .sp The file encoding of all source files. The recommended encoding is \fB\(aqutf\-8\-sig\(aq\fP\&. .sp Added in version 0.5. .sp Deprecated since version 9.0: Support for source encodings other than UTF\-8 is deprecated. Sphinx 11 will only support UTF\-8 files. .UNINDENT .INDENT 0.0 .TP .B source_suffix .INDENT 7.0 .TP .B Type \fBdict[str, str] | Sequence[str] | str\fP.TP .B Default \fB{\(aq.rst\(aq: \(aqrestructuredtext\(aq}\fP.UNINDENT .sp A dictionary mapping the file extensions (suffixes) of source files to their file types. Sphinx considers all files files with suffixes in \fBsource_suffix\fP to be source files. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX source_suffix = { \(aq.rst\(aq: \(aqrestructuredtext\(aq, \(aq.txt\(aq: \(aqrestructuredtext\(aq, \(aq.md\(aq: \(aqmarkdown\(aq, } .EE .UNINDENT .UNINDENT .sp By default, Sphinx only supports the \fB\(aqrestructuredtext\(aq\fP file type. Further file types can be added with extensions that register different source file parsers, such as MyST\-Parser \%\&. Refer to the extension\(aqs documentation to see which file types it supports. .sp If the value is a string or sequence of strings, Sphinx will consider that they are all \fB\(aqrestructuredtext\(aq\fP files. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 File extensions must begin with a dot (\fB\(aq.\(aq\fP). .UNINDENT .UNINDENT .sp Changed in version 1.3: Support a list of file extensions. .sp Changed in version 1.8: Change to a map of file extensions to file types. .UNINDENT .SS Options for smart quotes .INDENT 0.0 .TP .B smartquotes .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If \fBTrue\fP, the Smart Quotes transform \% will be used to convert quotation marks and dashes to typographically correct entities. .sp Added in version 1.6.6: Replaces the now\-removed \fBhtml_use_smartypants\fP\&. It applies by default to all builders except \fBman\fP and \fBtext\fP (see \fBsmartquotes_excludes\fP\&.) .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 A docutils.conf \% file located in the configuration directory \%<#\:term-configuration-directory> (or a global \fB~/.docutils\fP file) is obeyed unconditionally if it \fIdeactivates\fP smart quotes via the corresponding Docutils option \%\&. But if it \fIactivates\fP them, then \fBsmartquotes\fP does prevail. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B smartquotes_action .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqqDe\(aq\fP.UNINDENT .sp Customise the Smart Quotes transform. See below for the permitted codes. The default \fB\(aqqDe\(aq\fP educates normal \fBq\fPuote characters \fB\(dq\fP, \fB\(aq\fP, em\- and en\-\fBD\fPashes \fB\-\-\-\fP, \fB\-\-\fP, and \fBe\fPllipses \fB\&...\fP\&.. .INDENT 7.0 .TP .B \fB\(aqq\(aq\fP Convert quotation marks .TP .B \fB\(aqb\(aq\fP Convert backtick quotation marks (\fB\(ga\(gadouble\(aq\(aq\fP only) .TP .B \fB\(aqB\(aq\fP Convert backtick quotation marks (\fB\(ga\(gadouble\(aq\(aq\fP and \fB\(gasingle\(aq\fP) .TP .B \fB\(aqd\(aq\fP Convert dashes (convert \fB\-\-\fP to em\-dashes and \fB\-\-\-\fP to en\-dashes) .TP .B \fB\(aqD\(aq\fP Convert dashes (old school) (convert \fB\-\-\fP to en\-dashes and \fB\-\-\-\fP to em\-dashes) .TP .B \fB\(aqi\(aq\fP Convert dashes (inverted old school) (convert \fB\-\-\fP to em\-dashes and \fB\-\-\-\fP to en\-dashes) .TP .B \fB\(aqe\(aq\fP Convert ellipses \fB\&...\fP .TP .B \fB\(aqw\(aq\fP Convert \fB\(aq"\(aq\fP entities to \fB\(aq\(dq\(aq\fP .UNINDENT .sp Added in version 1.6.6. .UNINDENT .INDENT 0.0 .TP .B smartquotes_excludes .INDENT 7.0 .TP .B Type \fBdict[str, list[str]]\fP.TP .B Default \fB{\(aqlanguages\(aq: [\(aqja\(aq], \(aqbuilders\(aq: [\(aqman\(aq, \(aqtext\(aq]}\fP.UNINDENT .sp Control when the Smart Quotes transform is disabled. Permitted keys are \fB\(aqbuilders\(aq\fP and \fB\(aqlanguages\(aq\fP, and The values are lists of strings. .sp Each entry gives a sufficient condition to ignore the \fBsmartquotes\fP setting and deactivate the Smart Quotes transform. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX smartquotes_excludes = { \(aqlanguages\(aq: [\(aqja\(aq], \(aqbuilders\(aq: [\(aqman\(aq, \(aqtext\(aq], } .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 Currently, in case of invocation of \fBmake\fP with multiple targets, the first target name is the only one which is tested against the \fB\(aqbuilders\(aq\fP entry and it decides for all. Also, a \fBmake text\fP following \fBmake html\fP needs to be issued in the form \fBmake text SPHINXOPTS=\(dq\-E\(dq\fP to force re\-parsing of source files, as the cached ones are already transformed. On the other hand the issue does not arise with direct usage of \fBsphinx\-build\fP as it caches (in its default usage) the parsed source files in per builder locations. .UNINDENT .UNINDENT .sp \fBHint:\fP .INDENT 7.0 .INDENT 3.5 An alternative way to effectively deactivate (or customise) the smart quotes for a given builder, for example \fBlatex\fP, is to use \fBmake\fP this way: .INDENT 0.0 .INDENT 3.5 .sp .EX make latex SPHINXOPTS=\(dq\-D smartquotes_action=\(dq .EE .UNINDENT .UNINDENT .sp This can follow some \fBmake html\fP with no problem, in contrast to the situation from the prior note. .UNINDENT .UNINDENT .sp Added in version 1.6.6. .UNINDENT .SS Options for templating .INDENT 0.0 .TP .B template_bridge .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp A string with the fully\-qualified name of a callable (or simply a class) that returns an instance of \fBTemplateBridge\fP \%<#\:sphinx\:.application\:.TemplateBridge>\&. This instance is then used to render HTML documents, and possibly the output of other builders (currently the changes builder). (Note that the template bridge must be made theme\-aware if HTML themes are to be used.) Example: .INDENT 7.0 .INDENT 3.5 .sp .EX template_bridge = \(aqmodule.CustomTemplateBridge\(aq .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B templates_path .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A list of paths that contain extra templates (or templates that overwrite builtin/theme\-specific templates). Relative paths are taken as relative to the configuration directory \%<#\:term-configuration-directory>\&. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX templates_path = [\(aq.templates\(aq] .EE .UNINDENT .UNINDENT .sp Changed in version 1.3: As these files are not meant to be built, they are automatically excluded when discovering source files. .UNINDENT .SS Options for warning control .INDENT 0.0 .TP .B show_warning_types .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Add the type of each warning as a suffix to the warning message. For example, \fBWARNING: [...] [index]\fP or \fBWARNING: [...] [toc.circular]\fP\&. This setting can be useful for determining which warnings types to include in a \fBsuppress_warnings\fP list. .sp Added in version 7.3.0. .sp Changed in version 8.0.0: The default is now \fBTrue\fP\&. .UNINDENT .INDENT 0.0 .TP .B suppress_warnings .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A list of warning codes to suppress arbitrary warning messages. .sp Added in version 1.4. .sp By default, Sphinx supports the following warning codes: .INDENT 7.0 .IP \(bu 2 \fBapp.add_directive\fP .IP \(bu 2 \fBapp.add_generic_role\fP .IP \(bu 2 \fBapp.add_node\fP .IP \(bu 2 \fBapp.add_role\fP .IP \(bu 2 \fBapp.add_source_parser\fP .IP \(bu 2 \fBconfig.cache\fP .IP \(bu 2 \fBdocutils\fP .IP \(bu 2 \fBdownload.not_readable\fP .IP \(bu 2 \fBduplicate_declaration.c\fP .IP \(bu 2 \fBduplicate_declaration.cpp\fP .IP \(bu 2 \fBepub.duplicated_toc_entry\fP .IP \(bu 2 \fBepub.unknown_project_files\fP .IP \(bu 2 \fBi18n.babel\fP .IP \(bu 2 \fBi18n.inconsistent_references\fP .IP \(bu 2 \fBi18n.not_readable\fP .IP \(bu 2 \fBi18n.not_writeable\fP .IP \(bu 2 \fBimage.not_readable\fP .IP \(bu 2 \fBindex\fP .IP \(bu 2 \fBmisc.copy_overwrite\fP .IP \(bu 2 \fBmisc.highlighting_failure\fP .IP \(bu 2 \fBref.any\fP .IP \(bu 2 \fBref.citation\fP .IP \(bu 2 \fBref.doc\fP .IP \(bu 2 \fBref.equation\fP .IP \(bu 2 \fBref.footnote\fP .IP \(bu 2 \fBref.keyword\fP .IP \(bu 2 \fBref.numref\fP .IP \(bu 2 \fBref.option\fP .IP \(bu 2 \fBref.python\fP .IP \(bu 2 \fBref.ref\fP .IP \(bu 2 \fBref.term\fP .IP \(bu 2 \fBsource_code_parser.c\fP .IP \(bu 2 \fBsource_code_parser.cpp\fP .IP \(bu 2 \fBtoc.circular\fP .IP \(bu 2 \fBtoc.duplicate_entry\fP .IP \(bu 2 \fBtoc.empty_glob\fP .IP \(bu 2 \fBtoc.excluded\fP .IP \(bu 2 \fBtoc.no_title\fP .IP \(bu 2 \fBtoc.not_included\fP .IP \(bu 2 \fBtoc.not_readable\fP .IP \(bu 2 \fBtoc.secnum\fP .UNINDENT .sp Extensions can also define their own warning types. Those defined by the first\-party \fBsphinx.ext\fP extensions are: .INDENT 7.0 .IP \(bu 2 \fBautodoc\fP .IP \(bu 2 \fBautodoc.import_object\fP .IP \(bu 2 \fBautodoc.mocked_object\fP .IP \(bu 2 \fBautosectionlabel.\fP .IP \(bu 2 \fBautosummary\fP .IP \(bu 2 \fBautosummary.import_cycle\fP .IP \(bu 2 \fBduration\fP .IP \(bu 2 \fBintersphinx.external\fP .UNINDENT .sp You can choose from these types. You can also give only the first component to exclude all warnings attached to it. .sp Added in version 1.4: \fBref.citation\fP, \fBref.doc\fP, \fBref.keyword\fP, \fBref.numref\fP, \fBref.option\fP, \fBref.ref\fP, and \fBref.term\fP\&. .sp Added in version 1.4.2: \fBapp.add_directive\fP, \fBapp.add_generic_role\fP, \fBapp.add_node\fP, \fBapp.add_role\fP, and \fBapp.add_source_parser\fP\&. .sp Added in version 1.5: \fBmisc.highlighting_failure\fP\&. .sp Added in version 1.5.1: \fBepub.unknown_project_files\fP\&. .sp Added in version 1.5.2: \fBtoc.secnum\fP\&. .sp Added in version 1.6: \fBref.footnote\fP, \fBdownload.not_readable\fP, and \fBimage.not_readable\fP\&. .sp Added in version 1.7: \fBref.python\fP\&. .sp Added in version 2.0: \fBautodoc.import_object\fP\&. .sp Added in version 2.1: \fBautosectionlabel.\fP\&. .sp Added in version 3.1: \fBtoc.circular\fP\&. .sp Added in version 3.3: \fBepub.duplicated_toc_entry\fP\&. .sp Added in version 4.3: \fBtoc.excluded\fP and \fBtoc.not_readable\fP\&. .sp Added in version 4.5: \fBi18n.inconsistent_references\fP\&. .sp Added in version 7.1: \fBindex\fP\&. .sp Added in version 7.3: \fBconfig.cache\fP, \fBintersphinx.external\fP, and \fBtoc.no_title\fP\&. .sp Added in version 7.4: \fBdocutils\fP and \fBautosummary.import_cycle\fP\&. .sp Added in version 8.0: \fBmisc.copy_overwrite\fP\&. .sp Added in version 8.2: \fBautodoc.mocked_object\fP, \fBduplicate_declaration.c\fP, \fBduplicate_declaration.cpp\fP, \fBi18n.babel\fP, \fBi18n.not_readable\fP, \fBi18n.not_writeable\fP, \fBref.any\fP, \fBtoc.duplicate_entry\fP, \fBtoc.empty_glob\fP, and \fBtoc.not_included\fP\&. .sp Added in version 9.0: \fBduration\fP\&. .UNINDENT .SS Builder options .SS Options for HTML output .sp These options influence HTML output. Various other builders are derived from the HTML output, and also make use of these options. .INDENT 0.0 .TP .B html_theme .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqalabaster\(aq\fP.UNINDENT .sp The theme for HTML output. See the HTML theming section \%<>\&. .sp Added in version 0.6. .sp Changed in version 1.3: The default theme is now \fB\(aqalabaster\(aq\fP\&. .UNINDENT .INDENT 0.0 .TP .B html_theme_options .INDENT 7.0 .TP .B Type \fBdict[str, Any]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary of options that influence the look and feel of the selected theme. These are theme\-specific. The options understood by the builtin themes \%<#\:builtin-themes> are described here \%<#\:builtin-themes>\&. .sp Added in version 0.6. .UNINDENT .INDENT 0.0 .TP .B html_theme_path .INDENT 7.0 .TP .B Type \fBlist[str]\fP.TP .B Default \fB[]\fP.UNINDENT .sp A list of paths that contain custom themes, either as subdirectories or as zip files. Relative paths are taken as relative to the configuration directory \%<#\:term-configuration-directory>\&. .sp Added in version 0.6. .UNINDENT .INDENT 0.0 .TP .B html_style .INDENT 7.0 .TP .B Type \fBSequence[str] | str\fP.TP .B Default \fB()\fP.UNINDENT .sp Stylesheets to use for HTML pages. The stylesheet given by the selected theme is used by default A file of that name must exist either in Sphinx\(aqs \fBstatic/\fP path or in one of the custom paths given in \fBhtml_static_path\fP\&. If you only want to add or override a few things from the theme, use CSS \fB@import\fP to import the theme\(aqs stylesheet. .sp Changed in version 5.1: The value can be a iterable of strings. .UNINDENT .INDENT 0.0 .TP .B html_title .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\fP\fIproject\fP\fB \fP\fIrelease\fP\fB documentation\(aq\fP.UNINDENT .sp The \(dqtitle\(dq for HTML documentation generated with Sphinx\(aqs own templates. This is appended to the \fB\fP tag of individual pages, and used in the navigation bar as the \(dqtopmost\(dq element. .UNINDENT .INDENT 0.0 .TP .B html_short_title .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBhtml_title\fP.UNINDENT .sp A shorter \(dqtitle\(dq for HTML documentation. This is used for links in the header and in the HTML Help documentation. .sp Added in version 0.4. .UNINDENT .INDENT 0.0 .TP .B html_baseurl .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp The base URL which points to the root of the HTML documentation. It is used to indicate the location of document using \fBthe Canonical Link Relation\fP \%<https://\:datatracker\:.ietf\:.org/\:doc/\:html/\:rfc6596\:.html>\&. .sp Added in version 1.8. .UNINDENT .INDENT 0.0 .TP .B html_codeblock_linenos_style .INDENT 7.0 .TP .B Type \fB\(aqinline\(aq | \(aqtable\(aq\fP.TP .B Default \fB\(aqinline\(aq\fP.UNINDENT .sp The style of line numbers for code\-blocks. .INDENT 7.0 .TP .B \fB\(aqtable\(aq\fP Display line numbers using \fB<table>\fP tag .TP .B \fB\(aqinline\(aq\fP Display line numbers using \fB<span>\fP tag .UNINDENT .sp Added in version 3.2. .sp Changed in version 4.0: It defaults to \fB\(aqinline\(aq\fP\&. .sp Deprecated since version 4.0. .UNINDENT .INDENT 0.0 .TP .B html_context .INDENT 7.0 .TP .B Type \fBdict[str, Any]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary of values to pass into the template engine\(aqs context for all pages. Single values can also be put in this dictionary using \fBsphinx\-build\fP\(aqs \fB\-\-html\-define\fP \%<#\:cmdoption-sphinx-build-A> command\-line option. .sp Added in version 0.5. .UNINDENT .INDENT 0.0 .TP .B html_logo .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp If given, this must be the name of an image file (path relative to the configuration directory \%<#\:term-configuration-directory>) that is the logo of the documentation, or a URL that points an image file for the logo. It is placed at the top of the sidebar; its width should therefore not exceed 200 pixels. .sp Added in version 0.4.1: The image file will be copied to the \fB_static\fP directory, but only if the file does not already exist there. .sp Changed in version 4.0: Also accepts a URL. .UNINDENT .INDENT 0.0 .TP .B html_favicon .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp If given, this must be the name of an image file (path relative to the configuration directory \%<#\:term-configuration-directory>) that is the favicon \%<https://\:developer\:.mozilla\:.org/\:en-US/\:docs/\:Web/\:HTML/\:Attributes/\:rel#\:icon> of the documentation, or a URL that points an image file for the favicon. Browsers use this as the icon for tabs, windows and bookmarks. It should be a 16\-by\-16 pixel icon in the PNG, SVG, GIF, or ICO file formats. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX html_favicon = \(aqstatic/favicon.png\(aq .EE .UNINDENT .UNINDENT .sp Added in version 0.4: The image file will be copied to the \fB_static\fP, but only if the file does not already exist there. .sp Changed in version 4.0: Also accepts the URL for the favicon. .UNINDENT .INDENT 0.0 .TP .B html_css_files .INDENT 7.0 .TP .B Type \fBSequence[str | tuple[str, dict[str, str]]]\fP.TP .B Default \fB[]\fP.UNINDENT .sp A list of CSS files. The entry must be a \fIfilename\fP string or a tuple containing the \fIfilename\fP string and the \fIattributes\fP dictionary. The \fIfilename\fP must be relative to the \fBhtml_static_path\fP, or a full URI with scheme like \fB\(aqhttps://example.org/style.css\(aq\fP\&. The \fIattributes\fP dictionary is used for the \fB<link>\fP tag\(aqs attributes. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX html_css_files = [ \(aqcustom.css\(aq, \(aqhttps://example.com/css/custom.css\(aq, (\(aqprint.css\(aq, {\(aqmedia\(aq: \(aqprint\(aq}), ] .EE .UNINDENT .UNINDENT .sp The special attribute \fIpriority\fP can be set as an integer to load the CSS file at an earlier or later step. For more information, refer to \fBSphinx.add_css_file()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_css_file>\&. .sp Added in version 1.8. .sp Changed in version 3.5: Support the \fIpriority\fP attribute .UNINDENT .INDENT 0.0 .TP .B html_js_files .INDENT 7.0 .TP .B Type \fBSequence[str | tuple[str, dict[str, str]]]\fP.TP .B Default \fB[]\fP.UNINDENT .sp A list of JavaScript files. The entry must be a \fIfilename\fP string or a tuple containing the \fIfilename\fP string and the \fIattributes\fP dictionary. The \fIfilename\fP must be relative to the \fBhtml_static_path\fP, or a full URI with scheme like \fB\(aqhttps://example.org/script.js\(aq\fP\&. The \fIattributes\fP dictionary is used for the \fB<script>\fP tag\(aqs attributes. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX html_js_files = [ \(aqscript.js\(aq, \(aqhttps://example.com/scripts/custom.js\(aq, (\(aqcustom.js\(aq, {\(aqasync\(aq: \(aqasync\(aq}), ] .EE .UNINDENT .UNINDENT .sp As a special attribute, \fIpriority\fP can be set as an integer to load the JavaScript file at an earlier or later step. For more information, refer to \fBSphinx.add_js_file()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_js_file>\&. .sp Added in version 1.8. .sp Changed in version 3.5: Support the \fIpriority\fP attribute .UNINDENT .INDENT 0.0 .TP .B html_static_path .INDENT 7.0 .TP .B Type \fBlist[str]\fP.TP .B Default \fB[]\fP.UNINDENT .sp A list of paths that contain custom static files (such as style sheets or script files). Relative paths are taken as relative to the configuration directory \%<#\:term-configuration-directory>\&. They are copied to the output\(aqs \fB_static\fP directory after the theme\(aqs static files, so a file named \fBdefault.css\fP will overwrite the theme\(aqs \fBdefault.css\fP\&. .sp As these files are not meant to be built, they are automatically excluded from source files. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 For security reasons, dotfiles under \fBhtml_static_path\fP will not be copied. If you would like to copy them intentionally, explicitly add each file to this setting: .INDENT 0.0 .INDENT 3.5 .sp .EX html_static_path = [\(aq_static\(aq, \(aq_static/.htaccess\(aq] .EE .UNINDENT .UNINDENT .sp An alternative approach is to use \fBhtml_extra_path\fP, which allows copying dotfiles under the directories. .UNINDENT .UNINDENT .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBadd_static_dir()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_static_dir>, for use in extensions to copy static files to the output directory. .UNINDENT .UNINDENT .sp Changed in version 0.4: The paths in \fBhtml_static_path\fP can now contain subdirectories. .sp Changed in version 1.0: The entries in \fBhtml_static_path\fP can now be single files. .sp Changed in version 1.8: The files under \fBhtml_static_path\fP are excluded from source files. .UNINDENT .INDENT 0.0 .TP .B html_extra_path .INDENT 7.0 .TP .B Type \fBlist[str]\fP.TP .B Default \fB[]\fP.UNINDENT .sp A list of paths that contain extra files not directly related to the documentation, such as \fBrobots.txt\fP or \fB\&.htaccess\fP\&. Relative paths are taken as relative to the configuration directory \%<#\:term-configuration-directory>\&. They are copied to the output directory. They will overwrite any existing file of the same name. .sp As these files are not meant to be built, they are automatically excluded from source files. .sp Added in version 1.2. .sp Changed in version 1.4: The dotfiles in the extra directory will be copied to the output directory. And it refers \fBexclude_patterns\fP on copying extra files and directories, and ignores if path matches to patterns. .UNINDENT .INDENT 0.0 .TP .B html_last_updated_fmt .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fBNone\fP.UNINDENT .sp If set, a \(aqLast updated on:\(aq timestamp is inserted into the page footer using the given \fBstrftime()\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:time\:.html#\:time\:.strftime> format. The empty string is equivalent to \fB\(aq%b %d, %Y\(aq\fP (or a locale\-dependent equivalent). .UNINDENT .INDENT 0.0 .TP .B html_last_updated_use_utc .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Use GMT/UTC (+00:00) instead of the system\(aqs local time zone for the time supplied to \fBhtml_last_updated_fmt\fP\&. This is most useful when the format used includes the time. .UNINDENT .INDENT 0.0 .TP .B html_permalinks .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Add link anchors for each heading and description environment. .sp Added in version 3.5. .UNINDENT .INDENT 0.0 .TP .B html_permalinks_icon .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq¶\(aq\fP (the paragraph sign).UNINDENT .sp Text for link anchors for each heading and description environment. HTML entities and Unicode are allowed. .sp Added in version 3.5. .UNINDENT .INDENT 0.0 .TP .B html_sidebars .INDENT 7.0 .TP .B Type \fBdict[str, Sequence[str]]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary defining custom sidebar templates, mapping document names to template names. .sp The keys can contain glob\-style patterns, in which case all matching documents will get the specified sidebars. (A warning is emitted when a more than one glob\-style pattern matches for any document.) .sp Each value must be a list of strings which specifies the complete list of sidebar templates to include. If all or some of the default sidebars are to be included, they must be put into this list as well. .sp The default sidebars (for documents that don\(aqt match any pattern) are defined by theme itself. The builtin themes use these templates by default: \fB\(aqlocaltoc.html\(aq\fP, \fB\(aqrelations.html\(aq\fP, \fB\(aqsourcelink.html\(aq\fP, and \fB\(aqsearchbox.html\(aq\fP\&. .sp The bundled first\-party sidebar templates that can be rendered are: .INDENT 7.0 .IP \(bu 2 \fBlocaltoc.html\fP \-\- a fine\-grained table of contents of the current document .IP \(bu 2 \fBglobaltoc.html\fP \-\- a coarse\-grained table of contents for the whole documentation set, collapsed .IP \(bu 2 \fBrelations.html\fP \-\- two links to the previous and next documents .IP \(bu 2 \fBsourcelink.html\fP \-\- a link to the source of the current document, if enabled in \fBhtml_show_sourcelink\fP .IP \(bu 2 \fBsearchbox.html\fP \-\- the \(dqquick search\(dq box .UNINDENT .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX html_sidebars = { \(aq**\(aq: [\(aqglobaltoc.html\(aq, \(aqsourcelink.html\(aq, \(aqsearchbox.html\(aq], \(aqusing/windows\(aq: [\(aqwindows\-sidebar.html\(aq, \(aqsearchbox.html\(aq], } .EE .UNINDENT .UNINDENT .sp This will render the custom template \fBwindows\-sidebar.html\fP and the quick search box within the sidebar of the given document, and render the default sidebars for all other pages (except that the local TOC is replaced by the global TOC). .sp Note that this value only has no effect if the chosen theme does not possess a sidebar, like the builtin \fBscrolls\fP and \fBhaiku\fP themes. .sp Added in version 1.0: The ability to use globbing keys and to specify multiple sidebars. .sp Deprecated since version 1.7: A single string value for \fBhtml_sidebars\fP will be removed. .sp Changed in version 2.0: \fBhtml_sidebars\fP must be a list of strings, and no longer accepts a single string value. .UNINDENT .INDENT 0.0 .TP .B html_additional_pages .INDENT 7.0 .TP .B Type \fBdict[str, str]\fP.TP .B Default \fB{}\fP.UNINDENT .sp Additional templates that should be rendered to HTML pages, must be a dictionary that maps document names to template names. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX html_additional_pages = { \(aqdownload\(aq: \(aqcustom\-download.html.jinja\(aq, } .EE .UNINDENT .UNINDENT .sp This will render the template \fBcustom\-download.html.jinja\fP as the page \fBdownload.html\fP\&. .UNINDENT .INDENT 0.0 .TP .B html_domain_indices .INDENT 7.0 .TP .B Type \fBbool | Sequence[str]\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If True, generate domain\-specific indices in addition to the general index. For e.g. the Python domain, this is the global module index. .sp This value can be a Boolean or a list of index names that should be generated. To find out the index name for a specific index, look at the HTML file name. For example, the Python module index has the name \fB\(aqpy\-modindex\(aq\fP\&. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX html_domain_indices = { \(aqpy\-modindex\(aq, } .EE .UNINDENT .UNINDENT .sp Added in version 1.0. .sp Changed in version 7.4: Permit and prefer a set type. .UNINDENT .INDENT 0.0 .TP .B html_use_index .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Controls if an index is added to the HTML documents. .sp Added in version 0.4. .UNINDENT .INDENT 0.0 .TP .B html_split_index .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Generates two versions of the index: once as a single page with all the entries, and once as one page per starting letter. .sp Added in version 0.4. .UNINDENT .INDENT 0.0 .TP .B html_copy_source .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If True, the reStructuredText sources are included in the HTML build as \fB_sources/\fP\fIdocname\fP\&. .UNINDENT .INDENT 0.0 .TP .B html_show_sourcelink .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If True (and \fBhtml_copy_source\fP is true as well), links to the reStructuredText sources will be added to the sidebar. .sp Added in version 0.6. .UNINDENT .INDENT 0.0 .TP .B html_sourcelink_suffix .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq.txt\(aq\fP.UNINDENT .sp The suffix to append to source links (see \fBhtml_show_sourcelink\fP), unless files they have this suffix already. .sp Added in version 1.5. .UNINDENT .INDENT 0.0 .TP .B html_use_opensearch .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp If nonempty, an OpenSearch \%<https://\:github\:.com/\:dewitt/\:opensearch> description file will be output, and all pages will contain a \fB<link>\fP tag referring to it. Since OpenSearch doesn\(aqt support relative URLs for its search page location, the value of this option must be the base URL from which these documents are served (without trailing slash), e.g. \fB\(aqhttps://docs.python.org\(aq\fP\&. .sp Added in version 0.2. .UNINDENT .INDENT 0.0 .TP .B html_file_suffix .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq.html\(aq\fP.UNINDENT .sp The file name suffix (file extension) for generated HTML files. .sp Added in version 0.4. .UNINDENT .INDENT 0.0 .TP .B html_link_suffix .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBhtml_file_suffix\fP.UNINDENT .sp The suffix for generated links to HTML files. Intended to support more esoteric server setups. .sp Added in version 0.6. .UNINDENT .INDENT 0.0 .TP .B html_show_copyright .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If True, \(dq© Copyright ...\(dq is shown in the HTML footer, with the value or values from \fBcopyright\fP\&. .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B html_show_search_summary .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Show a summary of the search result, i.e., the text around the keyword. .sp Added in version 4.5. .UNINDENT .INDENT 0.0 .TP .B html_show_sphinx .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Add \(dqCreated using Sphinx \%<https://\:www\:.sphinx-doc\:.org/>\(dq to the HTML footer. .sp Added in version 0.4. .UNINDENT .INDENT 0.0 .TP .B html_output_encoding .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqutf\-8\(aq\fP.UNINDENT .sp Encoding of HTML output files. This encoding name must both be a valid Python encoding name and a valid HTML \fBcharset\fP value. .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B html_compact_lists .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If True, a list all whose items consist of a single paragraph and/or a sub\-list all whose items etc... (recursive definition) will not use the \fB<p>\fP element for any of its items. This is standard docutils behaviour. Default: \fBTrue\fP\&. .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B html_secnumber_suffix .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq. \(aq\fP.UNINDENT .sp Suffix for section numbers in HTML output. Set to \fB\(aq \(aq\fP to suppress the final dot on section numbers. .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B html_search_language .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBlanguage\fP.UNINDENT .sp Language to be used for generating the HTML full\-text search index. This defaults to the global language selected with \fBlanguage\fP\&. English (\fB\(aqen\(aq\fP) is used as a fall\-back option if there is no support for this language. .sp Support exists for the following languages: .INDENT 7.0 .IP \(bu 2 \fBda\fP \-\- Danish .IP \(bu 2 \fBnl\fP \-\- Dutch .IP \(bu 2 \fBen\fP \-\- English .IP \(bu 2 \fBfi\fP \-\- Finnish .IP \(bu 2 \fBfr\fP \-\- French .IP \(bu 2 \fBde\fP \-\- German .IP \(bu 2 \fBhu\fP \-\- Hungarian .IP \(bu 2 \fBit\fP \-\- Italian .IP \(bu 2 \fBja\fP \-\- Japanese .IP \(bu 2 \fBno\fP \-\- Norwegian .IP \(bu 2 \fBpt\fP \-\- Portuguese .IP \(bu 2 \fBro\fP \-\- Romanian .IP \(bu 2 \fBru\fP \-\- Russian .IP \(bu 2 \fBes\fP \-\- Spanish .IP \(bu 2 \fBsv\fP \-\- Swedish .IP \(bu 2 \fBtr\fP \-\- Turkish .IP \(bu 2 \fBzh\fP \-\- Chinese .UNINDENT .sp \fBTip:\fP .INDENT 7.0 .INDENT 3.5 Accelerating build speed .sp Each language (except Japanese) provides its own stemming algorithm. Sphinx uses a Python implementation by default. If you want to accelerate building the index file, you can use a third\-party package (PyStemmer \%<https://\:pypi\:.org/\:project/\:PyStemmer/>) by running \fBpip install PyStemmer\fP\&. .UNINDENT .UNINDENT .sp Added in version 1.1: Support English (\fBen\fP) and Japanese (\fBja\fP). .sp Changed in version 1.3: Added additional languages. .UNINDENT .INDENT 0.0 .TP .B html_search_options .INDENT 7.0 .TP .B Type \fBdict[str, str]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary with options for the search language support. The meaning of these options depends on the language selected. Currently, only Japanese and Chinese support options. .INDENT 7.0 .TP .B Japanese .INDENT 7.0 .TP .B \fBtype\fP \-\- the type of the splitter to use. The other options depend on the splitter used. .INDENT 7.0 .TP .B \fB\(aqsphinx.search.ja.DefaultSplitter\(aq\fP The TinySegmenter algorithm, used by default. .TP .B \fB\(aqsphinx.search.ja.MecabSplitter\(aq\fP: The MeCab binding To use this splitter, the \(aqmecab\(aq python binding or dynamic link library (\(aqlibmecab.so\(aq for Linux, \(aqlibmecab.dll\(aq for Windows) is required. .TP .B \fB\(aqsphinx.search.ja.JanomeSplitter\(aq\fP: The Janome binding. To use this splitter, Janome \%<https://\:pypi\:.org/\:project/\:Janome/> is required. .UNINDENT .sp Deprecated since version 1.6: \fB\(aqmecab\(aq\fP, \fB\(aqjanome\(aq\fP and \fB\(aqdefault\(aq\fP is deprecated. To keep compatibility, \fB\(aqmecab\(aq\fP, \fB\(aqjanome\(aq\fP and \fB\(aqdefault\(aq\fP are also acceptable. .TP .B Options for \fB\(aqmecab\(aq\fP: .INDENT 7.0 .TP .B dic_enc dic_enc option is the encoding for the MeCab algorithm. .TP .B dict dict option is the dictionary to use for the MeCab algorithm. .TP .B lib lib option is the library name for finding the MeCab library via \fBctypes\fP if the Python binding is not installed. .UNINDENT .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX html_search_options = { \(aqtype\(aq: \(aqmecab\(aq, \(aqdic_enc\(aq: \(aqutf\-8\(aq, \(aqdict\(aq: \(aq/path/to/mecab .dic\(aq, \(aqlib\(aq: \(aq/path/to/libmecab.so\(aq, } .EE .UNINDENT .UNINDENT .TP .B Options for \fB\(aqjanome\(aq\fP: .INDENT 7.0 .TP .B user_dic user_dic option is the user dictionary file path for Janome. .TP .B user_dic_enc user_dic_enc option is the encoding for the user dictionary file specified by \fBuser_dic\fP option. Default is \(aqutf8\(aq. .UNINDENT .UNINDENT .TP .B Chinese .INDENT 7.0 .TP .B \fBdict\fP The \fBjieba\fP dictionary path for using a custom dictionary. .UNINDENT .UNINDENT .sp Added in version 1.1. .sp Changed in version 1.4: Allow any custom splitter in the \fItype\fP setting for Japanese. .UNINDENT .INDENT 0.0 .TP .B html_search_scorer .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp The name of a JavaScript file (relative to the configuration directory \%<#\:term-configuration-directory>) that implements a search results scorer. If empty, the default will be used. .sp The scorer must implement the following interface, and may optionally define the \fBscore()\fP function for more granular control. .INDENT 7.0 .INDENT 3.5 .sp .EX const Scorer = { // Implement the following function to further tweak the score for each result score: result => { const [docName, title, anchor, descr, score, filename] = result // ... calculate a new score ... return score }, // query matches the full name of an object objNameMatch: 11, // or matches in the last dotted part of the object name objPartialMatch: 6, // Additive scores depending on the priority of the object objPrio: { 0: 15, // used to be importantResults 1: 5, // used to be objectResults 2: \-5, // used to be unimportantResults }, // Used when the priority is not in the mapping. objPrioDefault: 0, // query found in title title: 15, partialTitle: 7, // query found in terms term: 5, partialTerm: 2, }; .EE .UNINDENT .UNINDENT .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B html_scaled_image_link .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Link images that have been resized with a scale option (\fIscale\fP, \fIwidth\fP, or \fIheight\fP) to their original full\-resolution image. This will not overwrite any link given by the \fItarget\fP option on the the image \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:image> directive, if present. .sp \fBTip:\fP .INDENT 7.0 .INDENT 3.5 To disable this feature on a per\-image basis, add the \fBno\-scaled\-link\fP class to the image directive: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. image:: sphinx.png :scale: 50% :class: no\-scaled\-link .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp Added in version 1.3. .sp Changed in version 3.0: Images with the \fBno\-scaled\-link\fP class will not be linked. .UNINDENT .INDENT 0.0 .TP .B html_math_renderer .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqmathjax\(aq\fP.UNINDENT .sp The maths renderer to use for HTML output. The bundled renders are \fImathjax\fP and \fIimgmath\fP\&. You must also load the relevant extension in \fBextensions\fP\&. .sp Added in version 1.8. .UNINDENT .SS Options for Single HTML output .sp These options influence Single HTML output. This builder derives from the HTML builder, so the HTML options also apply where appropriate. .INDENT 0.0 .TP .B singlehtml_sidebars .INDENT 7.0 .TP .B Type \fBdict[str, Sequence[str]]\fP.TP .B Default The value of \fBhtml_sidebars\fP.UNINDENT .sp A dictionary defining custom sidebar templates, mapping document names to template names. .sp This has the same effect as \fBhtml_sidebars\fP, but the only permitted key is \fB\(aqindex\(aq\fP, and all other keys are ignored. .UNINDENT .SS Options for HTML help output .sp These options influence HTML help output. This builder derives from the HTML builder, so the HTML options also apply where appropriate. .INDENT 0.0 .TP .B htmlhelp_basename .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq{project}doc\(aq\fP.UNINDENT .sp Output file base name for HTML help builder. The default is the \fBproject name\fP with spaces removed and \fBdoc\fP appended. .UNINDENT .INDENT 0.0 .TP .B htmlhelp_file_suffix .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq.html\(aq\fP.UNINDENT .sp This is the file name suffix for generated HTML help files. .sp Added in version 2.0. .UNINDENT .INDENT 0.0 .TP .B htmlhelp_link_suffix .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBhtmlhelp_file_suffix\fP.UNINDENT .sp Suffix for generated links to HTML files. .sp Added in version 2.0. .UNINDENT .SS Options for Apple Help output .sp Added in version 1.3. .sp These options influence Apple Help output. This builder derives from the HTML builder, so the HTML options also apply where appropriate. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Apple Help output will only work on Mac OS X 10.6 and higher, as it requires the \fBhiutil\fP and \fBcodesign\fP command\-line tools, neither of which are Open Source. .sp You can disable the use of these tools using \fBapplehelp_disable_external_tools\fP, but the result will not be a valid help book until the indexer is run over the \fB\&.lproj\fP directories within the bundle. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B applehelp_bundle_name .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBproject\fP.UNINDENT .sp The basename for the Apple Help Book. The default is the \fBproject name\fP with spaces removed. .UNINDENT .INDENT 0.0 .TP .B applehelp_bundle_id .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fBNone\fP.UNINDENT .sp The bundle ID for the help book bundle. .sp \fBWarning:\fP .INDENT 7.0 .INDENT 3.5 You \fImust\fP set this value in order to generate Apple Help. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B applehelp_bundle_version .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq1\(aq\fP.UNINDENT .sp The bundle version, as a string. .UNINDENT .INDENT 0.0 .TP .B applehelp_dev_region .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqen\-us\(aq\fP.UNINDENT .sp The development region. Defaults to Apple’s recommended setting, \fB\(aqen\-us\(aq\fP\&. .UNINDENT .INDENT 0.0 .TP .B applehelp_icon .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fBNone\fP.UNINDENT .sp Path to the help bundle icon file or \fBNone\fP for no icon. According to Apple\(aqs documentation, this should be a 16\-by\-16 pixel version of the application\(aqs icon with a transparent background, saved as a PNG file. .UNINDENT .INDENT 0.0 .TP .B applehelp_kb_product .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\fP\fIproject\fP\fB\-\fP\fIrelease\fP\fB\(aq\fP.UNINDENT .sp The product tag for use with \fBapplehelp_kb_url\fP\&. .UNINDENT .INDENT 0.0 .TP .B applehelp_kb_url .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fBNone\fP.UNINDENT .sp The URL for your knowledgebase server, e.g. \fBhttps://example.com/kbsearch.py?p=\(aqproduct\(aq&q=\(aqquery\(aq&l=\(aqlang\(aq\fP\&. At runtime, Help Viewer will replace \fB\(aqproduct\(aq\fP with the contents of \fBapplehelp_kb_product\fP, \fB\(aqquery\(aq\fP with the text entered by the user in the search box, and \fB\(aqlang\(aq\fP with the user\(aqs system language. .sp Set this to to \fBNone\fP to disable remote search. .UNINDENT .INDENT 0.0 .TP .B applehelp_remote_url .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fBNone\fP.UNINDENT .sp The URL for remote content. You can place a copy of your Help Book\(aqs \fBResources\fP directory at this location and Help Viewer will attempt to use it to fetch updated content. .sp For example, if you set it to \fBhttps://example.com/help/Foo/\fP and Help Viewer wants a copy of \fBindex.html\fP for an English speaking customer, it will look at \fBhttps://example.com/help/Foo/en.lproj/index.html\fP\&. .sp Set this to to \fBNone\fP for no remote content. .UNINDENT .INDENT 0.0 .TP .B applehelp_index_anchors .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Tell the help indexer to index anchors in the generated HTML. This can be useful for jumping to a particular topic using the \fBAHLookupAnchor\fP function or the \fBopenHelpAnchor:inBook:\fP method in your code. It also allows you to use \fBhelp:anchor\fP URLs; see the Apple documentation for more information on this topic. .UNINDENT .INDENT 0.0 .TP .B applehelp_min_term_length .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fBNone\fP.UNINDENT .sp Controls the minimum term length for the help indexer. If \fBNone\fP, use the default length. .UNINDENT .INDENT 0.0 .TP .B applehelp_stopwords .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBlanguage\fP.UNINDENT .sp Either a language specification (to use the built\-in stopwords), or the path to a stopwords plist, or \fBNone\fP if you do not want to use stopwords. The default stopwords plist can be found at \fB/usr/share/hiutil/Stopwords.plist\fP and contains, at time of writing, stopwords for the following languages: .INDENT 7.0 .IP \(bu 2 German (\fBde\fP) .IP \(bu 2 English (\fBen\fP) .IP \(bu 2 Spanish (\fBes\fP) .IP \(bu 2 French (\fBfr\fP) .IP \(bu 2 Hungarian (\fBhu\fP) .IP \(bu 2 Italian (\fBit\fP) .IP \(bu 2 Swedish (\fBsv\fP) .UNINDENT .UNINDENT .INDENT 0.0 .TP .B applehelp_locale .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBlanguage\fP.UNINDENT .sp Specifies the locale to generate help for. This is used to determine the name of the \fB\&.lproj\fP directory inside the Help Book’s \fBResources\fP, and is passed to the help indexer. .UNINDENT .INDENT 0.0 .TP .B applehelp_title .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\fP\fIproject\fP\fB Help\(aq\fP.UNINDENT .sp Specifies the help book title. .UNINDENT .INDENT 0.0 .TP .B applehelp_codesign_identity .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBCODE_SIGN_IDENTITY\fP.UNINDENT .sp Specifies the identity to use for code signing. Use \fBNone\fP if code signing is not to be performed. .sp Defaults to the value of the \fBCODE_SIGN_IDENTITY\fP environment variable, which is set by Xcode for script build phases, or \fBNone\fP if that variable is not set. .UNINDENT .INDENT 0.0 .TP .B applehelp_codesign_flags .INDENT 7.0 .TP .B Type \fBlist[str]\fP.TP .B Default The value of \fBOTHER_CODE_SIGN_FLAGS\fP.UNINDENT .sp A \fIlist\fP of additional arguments to pass to \fBcodesign\fP when signing the help book. .sp Defaults to a list based on the value of the \fBOTHER_CODE_SIGN_FLAGS\fP environment variable, which is set by Xcode for script build phases, or the empty list if that variable is not set. .UNINDENT .INDENT 0.0 .TP .B applehelp_codesign_path .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq/usr/bin/codesign\(aq\fP.UNINDENT .sp The path to the \fBcodesign\fP program. .UNINDENT .INDENT 0.0 .TP .B applehelp_indexer_path .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq/usr/bin/hiutil\(aq\fP.UNINDENT .sp The path to the \fBhiutil\fP program. .UNINDENT .INDENT 0.0 .TP .B applehelp_disable_external_tools .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Do not run the indexer or the code signing tool, no matter what other settings are specified. .sp This is mainly useful for testing, or where you want to run the Sphinx build on a non\-macOS platform and then complete the final steps on a Mac for some reason. .UNINDENT .SS Options for EPUB output .sp These options influence EPUB output. This builder derives from the HTML builder, so the HTML options also apply where appropriate. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The actual value for some of these options is not important, but they are required for the Dublin Core metadata \%<https://\:dublincore\:.org/>\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B epub_basename .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBproject\fP.UNINDENT .sp The basename for the EPUB file. .UNINDENT .INDENT 0.0 .TP .B epub_theme .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqepub\(aq\fP.UNINDENT .sp The HTML theme for the EPUB output. Since the default themes are not optimised for small screen space, using the same theme for HTML and EPUB output is usually not wise. This defaults to \fB\(aqepub\(aq\fP, a theme designed to save visual space. .UNINDENT .INDENT 0.0 .TP .B epub_theme_options .INDENT 7.0 .TP .B Type \fBdict[str, Any]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary of options that influence the look and feel of the selected theme. These are theme\-specific. The options understood by the builtin themes \%<#\:builtin-themes> are described here \%<#\:builtin-themes>\&. .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B epub_title .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBproject\fP.UNINDENT .sp The title of the document. .sp Changed in version 2.0: It defaults to the \fBproject\fP option (previously \fBhtml_title\fP). .UNINDENT .INDENT 0.0 .TP .B epub_description .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqunknown\(aq\fP.UNINDENT .sp The description of the document. .sp Added in version 1.4. .sp Changed in version 1.5: Renamed from \fBepub3_description\fP .UNINDENT .INDENT 0.0 .TP .B epub_author .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBauthor\fP.UNINDENT .sp The author of the document. This is put in the Dublin Core metadata. .UNINDENT .INDENT 0.0 .TP .B epub_contributor .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqunknown\(aq\fP.UNINDENT .sp The name of a person, organisation, etc. that played a secondary role in the creation of the content of an EPUB Publication. .sp Added in version 1.4. .sp Changed in version 1.5: Renamed from \fBepub3_contributor\fP .UNINDENT .INDENT 0.0 .TP .B epub_language .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBlanguage\fP.UNINDENT .sp The language of the document. This is put in the Dublin Core metadata. .UNINDENT .INDENT 0.0 .TP .B epub_publisher .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBauthor\fP.UNINDENT .sp The publisher of the document. This is put in the Dublin Core metadata. You may use any sensible string, e.g. the project homepage. .UNINDENT .INDENT 0.0 .TP .B epub_copyright .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBcopyright\fP.UNINDENT .sp The copyright of the document. See \fBcopyright\fP for permitted formats. .UNINDENT .INDENT 0.0 .TP .B epub_identifier .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqunknown\(aq\fP.UNINDENT .sp An identifier for the document. This is put in the Dublin Core metadata. For published documents this is the ISBN number, but you can also use an alternative scheme, e.g. the project homepage. .UNINDENT .INDENT 0.0 .TP .B epub_scheme .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqunknown\(aq\fP.UNINDENT .sp The publication scheme for the \fBepub_identifier\fP\&. This is put in the Dublin Core metadata. For published books the scheme is \fB\(aqISBN\(aq\fP\&. If you use the project homepage, \fB\(aqURL\(aq\fP seems reasonable. .UNINDENT .INDENT 0.0 .TP .B epub_uid .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqunknown\(aq\fP.UNINDENT .sp A unique identifier for the document. This is put in the Dublin Core metadata. You may use a XML\(aqs Name format \%<https://\:www\:.w3\:.org/\:TR/\:REC-xml/#\:NT-NameStartChar> string. You can\(aqt use hyphen, period, numbers as a first character. .UNINDENT .INDENT 0.0 .TP .B epub_cover .INDENT 7.0 .TP .B Type \fBtuple[str, str]\fP.TP .B Default \fB()\fP.UNINDENT .sp The cover page information. This is a tuple containing the filenames of the cover image and the html template. The rendered html cover page is inserted as the first item in the spine in \fBcontent.opf\fP\&. If the template filename is empty, no html cover page is created. No cover at all is created if the tuple is empty. .sp Examples: .INDENT 7.0 .INDENT 3.5 .sp .EX epub_cover = (\(aq_static/cover.png\(aq, \(aqepub\-cover.html\(aq) epub_cover = (\(aq_static/cover.png\(aq, \(aq\(aq) epub_cover = () .EE .UNINDENT .UNINDENT .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B epub_css_files .INDENT 7.0 .TP .B Type \fBSequence[str | tuple[str, dict[str, str]]]\fP.TP .B Default \fB[]\fP.UNINDENT .sp A list of CSS files. The entry must be a \fIfilename\fP string or a tuple containing the \fIfilename\fP string and the \fIattributes\fP dictionary. The \fIfilename\fP must be relative to the \fBhtml_static_path\fP, or a full URI with scheme like \fB\(aqhttps://example.org/style.css\(aq\fP\&. The \fIattributes\fP dictionary is used for the \fB<link>\fP tag\(aqs attributes. For more information, see \fBhtml_css_files\fP\&. .sp Added in version 1.8. .UNINDENT .INDENT 0.0 .TP .B epub_guide .INDENT 7.0 .TP .B Type \fBSequence[tuple[str, str, str]]\fP.TP .B Default \fB()\fP.UNINDENT .sp Meta data for the guide element of \fBcontent.opf\fP\&. This is a sequence of tuples containing the \fItype\fP, the \fIuri\fP and the \fItitle\fP of the optional guide information. See the OPF documentation \%<https://\:idpf\:.org/\:epub> for details. If possible, default entries for the \fIcover\fP and \fItoc\fP types are automatically inserted. However, the types can be explicitly overwritten if the default entries are not appropriate. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX epub_guide = ( (\(aqcover\(aq, \(aqcover.html\(aq, \(aqCover Page\(aq), ) .EE .UNINDENT .UNINDENT .sp The default value is \fB()\fP\&. .UNINDENT .INDENT 0.0 .TP .B epub_pre_files .INDENT 7.0 .TP .B Type \fBSequence[tuple[str, str]]\fP.TP .B Default \fB()\fP.UNINDENT .sp Additional files that should be inserted before the text generated by Sphinx. It is a list of tuples containing the file name and the title. If the title is empty, no entry is added to \fBtoc.ncx\fP\&. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX epub_pre_files = [ (\(aqindex.html\(aq, \(aqWelcome\(aq), ] .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B epub_post_files .INDENT 7.0 .TP .B Type \fBSequence[tuple[str, str]]\fP.TP .B Default \fB()\fP.UNINDENT .sp Additional files that should be inserted after the text generated by Sphinx. It is a list of tuples containing the file name and the title. This option can be used to add an appendix. If the title is empty, no entry is added to \fBtoc.ncx\fP\&. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX epub_post_files = [ (\(aqappendix.xhtml\(aq, \(aqAppendix\(aq), ] .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B epub_exclude_files .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB[]\fP.UNINDENT .sp A sequence of files that are generated/copied in the build directory but should not be included in the EPUB file. .UNINDENT .INDENT 0.0 .TP .B epub_tocdepth .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fB3\fP.UNINDENT .sp The depth of the table of contents in the file \fBtoc.ncx\fP\&. It should be an integer greater than zero. .sp \fBTip:\fP .INDENT 7.0 .INDENT 3.5 A deeply nested table of contents may be difficult to navigate. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B epub_tocdup .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp This flag determines if a ToC entry is inserted again at the beginning of its nested ToC listing. This allows easier navigation to the top of a chapter, but can be confusing because it mixes entries of different depth in one list. .UNINDENT .INDENT 0.0 .TP .B epub_tocscope .INDENT 7.0 .TP .B Type \fB\(aqdefault\(aq | \(aqincludehidden\(aq\fP.TP .B Default \fB\(aqdefault\(aq\fP.UNINDENT .sp This setting control the scope of the EPUB table of contents. The setting can have the following values: .INDENT 7.0 .TP .B \fB\(aqdefault\(aq\fP Include all ToC entries that are not hidden .TP .B \fB\(aqincludehidden\(aq\fP Include all ToC entries .UNINDENT .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B epub_fix_images .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Try and fix image formats that are not supported by some EPUB readers. At the moment palette images with a small colour table are upgraded. This is disabled by default because the automatic conversion may lose information. You need the Python Image Library (Pillow \%<https://\:pypi\:.org/\:project/\:Pillow/>) installed to use this option. .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B epub_max_image_width .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fB0\fP.UNINDENT .sp This option specifies the maximum width of images. If it is set to a valuevgreater than zero, images with a width larger than the given value are scaled accordingly. If it is zero, no scaling is performed. You need the Python Image Library (Pillow \%<https://\:pypi\:.org/\:project/\:Pillow/>) installed to use this option. .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B epub_show_urls .INDENT 7.0 .TP .B Type \fB\(aqfootnote\(aq | \(aqno\(aq | \(aqinline\(aq\fP.TP .B Default \fB\(aqfootnote\(aq\fP.UNINDENT .sp Control how to display URL addresses. This is very useful for readers that have no other means to display the linked URL. The setting can have the following values: .INDENT 7.0 .TP .B \fB\(aqinline\(aq\fP Display URLs inline in parentheses. .TP .B \fB\(aqfootnote\(aq\fP Display URLs in footnotes. .TP .B \fB\(aqno\(aq\fP Do not display URLs. .UNINDENT .sp The display of inline URLs can be customised by adding CSS rules for the class \fBlink\-target\fP\&. .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B epub_use_index .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default The value of \fBhtml_use_index\fP.UNINDENT .sp Add an index to the EPUB document. .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B epub_writing_mode .INDENT 7.0 .TP .B Type \fB\(aqhorizontal\(aq | \(aqvertical\(aq\fP.TP .B Default \fB\(aqhorizontal\(aq\fP.UNINDENT .sp It specifies writing direction. It can accept \fB\(aqhorizontal\(aq\fP and \fB\(aqvertical\(aq\fP .TS box center; l|l|l. T{ \fBepub_writing_mode\fP T} T{ \fB\(aqhorizontal\(aq\fP T} T{ \fB\(aqvertical\(aq\fP T} _ T{ writing\-mode \%<https://\:developer\:.mozilla\:.org/\:en-US/\:docs/\:Web/\:CSS/\:writing-mode> T} T{ \fBhorizontal\-tb\fP T} T{ \fBvertical\-rl\fP T} _ T{ page progression T} T{ left to right T} T{ right to left T} _ T{ iBook\(aqs Scroll Theme support T} T{ scroll\-axis is vertical. T} T{ scroll\-axis is horizontal. T} .TE .UNINDENT .SS Options for LaTeX output .sp These options influence LaTeX output. .INDENT 0.0 .TP .B latex_engine .INDENT 7.0 .TP .B Type \fB\(aqpdflatex\(aq | \(aqxelatex\(aq | \(aqlualatex\(aq | \(aqplatex\(aq | \(aquplatex\(aq\fP.TP .B Default \fB\(aqpdflatex\(aq\fP.UNINDENT .sp The LaTeX engine to build the documentation. The setting can have the following values: .INDENT 7.0 .IP \(bu 2 \fB\(aqpdflatex\(aq\fP \-\- PDFLaTeX (default) .IP \(bu 2 \fB\(aqxelatex\(aq\fP \-\- XeLaTeX (default if \fBlanguage\fP is one of \fBel\fP, \fBzh_CN\fP, or \fBzh_TW\fP) .IP \(bu 2 \fB\(aqlualatex\(aq\fP \-\- LuaLaTeX .IP \(bu 2 \fB\(aqplatex\(aq\fP \-\- pLaTeX .IP \(bu 2 \fB\(aquplatex\(aq\fP \-\- upLaTeX (default if \fBlanguage\fP is \fB\(aqja\(aq\fP) .UNINDENT .sp \fBImportant:\fP .INDENT 7.0 .INDENT 3.5 \fB\(aqpdflatex\(aq\fP\(aqs support for Unicode characters is limited. If your project uses Unicode characters, setting the engine to \fB\(aqxelatex\(aq\fP or \fB\(aqlualatex\(aq\fP and making sure to use an OpenType font with wide\-enough glyph coverage is often easier than trying to make \fB\(aqpdflatex\(aq\fP work with the extra Unicode characters. Since Sphinx 2.0, the default typeface is GNU FreeFont, which has good coverage of Latin, Cyrillic, and Greek glyphs. .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 Sphinx 2.0 adds support for occasional Cyrillic and Greek letters or words in documents using a Latin language and \fB\(aqpdflatex\(aq\fP\&. To enable this, the \(aqfontenc\(aq \%<#\:fontenc> key of latex_elements \%<#\:latex-elements-confval> must be used appropriately. .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 Contrarily to MathJaX math rendering in HTML output \%<#\:math-support>, LaTeX requires some extra configuration to support Unicode literals in \fBmath\fP \%<#\:directive-math>: the only comprehensive solution (as far as we know) is to use \fB\(aqxelatex\(aq\fP or \fB\(aqlualatex\(aq\fP \fIand\fP to add \fBr\(aq\eusepackage{unicode\-math}\(aq\fP (e.g. via the \(aqpreamble\(aq \%<#\:preamble> key of latex_elements \%<#\:latex-elements-confval>). You may prefer \fBr\(aq\eusepackage[math\-style=literal]{unicode\-math}\(aq\fP to keep a Unicode literal such as \fBα\fP (U+03B1) as\-is in output, rather than being rendered as \ealpha\&. .UNINDENT .UNINDENT .sp Changed in version 2.1.0: Use \fB\(aqxelatex\(aq\fP (and LaTeX package \fBxeCJK\fP) by default for Chinese documents. .sp Changed in version 2.2.1: Use \fB\(aqxelatex\(aq\fP by default for Greek documents. .sp Changed in version 2.3: Add \fB\(aquplatex\(aq\fP support. .sp Changed in version 4.0: Use \fB\(aquplatex\(aq\fP by default for Japanese documents. .UNINDENT .INDENT 0.0 .TP .B latex_documents .INDENT 7.0 .TP .B Type \fBSequence[tuple[str, str, str, str, str, bool]]\fP.TP .B Default The default LaTeX documents.UNINDENT .sp This value determines how to group the document tree into LaTeX source files. It must be a list of tuples \fB(startdocname, targetname, title, author, theme, toctree_only)\fP, where the items are: .INDENT 7.0 .TP .B \fIstartdocname\fP String that specifies the document name \%<#\:term-document-name> of the LaTeX file\(aqs master document. All documents referenced by the \fIstartdoc\fP document in ToC trees will be included in the LaTeX file. (If you want to use the default master document for your LaTeX build, provide your \fBmaster_doc\fP here.) .TP .B \fItargetname\fP File name of the LaTeX file in the output directory. .TP .B \fItitle\fP LaTeX document title. Can be empty to use the title of the \fIstartdoc\fP document. This is inserted as LaTeX markup, so special characters like a backslash or ampersand must be represented by the proper LaTeX commands if they are to be inserted literally. .TP .B \fIauthor\fP Author for the LaTeX document. The same LaTeX markup caveat as for \fItitle\fP applies. Use \fB\e\eand\fP to separate multiple authors, as in: \fB\(aqJohn \e\eand Sarah\(aq\fP (backslashes must be Python\-escaped to reach LaTeX). .TP .B \fItheme\fP LaTeX theme. See \fBlatex_theme\fP\&. .TP .B \fItoctree_only\fP Must be \fBTrue\fP or \fBFalse\fP\&. If True, the \fIstartdoc\fP document itself is not included in the output, only the documents referenced by it via ToC trees. With this option, you can put extra stuff in the master document that shows up in the HTML, but not the LaTeX output. .UNINDENT .sp Added in version 0.3: The 6th item \fBtoctree_only\fP\&. Tuples with 5 items are still accepted. .sp Added in version 1.2: In the past including your own document class required you to prepend the document class name with the string \(dqsphinx\(dq. This is not necessary anymore. .UNINDENT .INDENT 0.0 .TP .B latex_logo .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp If given, this must be the name of an image file (path relative to the configuration directory \%<#\:term-configuration-directory>) that is the logo of the documentation. It is placed at the top of the title page. .UNINDENT .INDENT 0.0 .TP .B latex_toplevel_sectioning .INDENT 7.0 .TP .B Type \fB\(aqpart\(aq | \(aqchapter\(aq | \(aqsection\(aq\fP.TP .B Default \fBNone\fP.UNINDENT .sp This value determines the topmost sectioning unit. The default setting is \fB\(aqsection\(aq\fP if \fBlatex_theme\fP is \fB\(aqhowto\(aq\fP, and \fB\(aqchapter\(aq\fP if it is \fB\(aqmanual\(aq\fP\&. The alternative in both cases is to specify \fB\(aqpart\(aq\fP, which means that LaTeX document will use the \fB\epart\fP command. .sp In that case the numbering of sectioning units one level deep gets off\-sync with HTML numbering, as by default LaTeX does not reset \fB\echapter\fP numbering (or \fB\esection\fP for \fB\(aqhowto\(aq\fP theme) when encountering \fB\epart\fP command. .sp Added in version 1.4. .UNINDENT .INDENT 0.0 .TP .B latex_appendices .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A list of document names to append as an appendix to all manuals. This is ignored if \fBlatex_theme\fP is set to \fB\(aqhowto\(aq\fP\&. .UNINDENT .INDENT 0.0 .TP .B latex_domain_indices .INDENT 7.0 .TP .B Type \fBbool | Sequence[str]\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If True, generate domain\-specific indices in addition to the general index. For e.g. the Python domain, this is the global module index. .sp This value can be a Boolean or a list of index names that should be generated. To find out the index name for a specific index, look at the HTML file name. For example, the Python module index has the name \fB\(aqpy\-modindex\(aq\fP\&. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX latex_domain_indices = { \(aqpy\-modindex\(aq, } .EE .UNINDENT .UNINDENT .sp Added in version 1.0. .sp Changed in version 7.4: Permit and prefer a set type. .UNINDENT .INDENT 0.0 .TP .B latex_show_pagerefs .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Add page references after internal references. This is very useful for printed copies of the manual. .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B latex_show_urls .INDENT 7.0 .TP .B Type \fB\(aqno\(aq | \(aqfootnote\(aq | \(aqinline\(aq\fP.TP .B Default \fB\(aqno\(aq\fP.UNINDENT .sp Control how to display URL addresses. This is very useful for printed copies of the manual. The setting can have the following values: .INDENT 7.0 .TP .B \fB\(aqno\(aq\fP Do not display URLs .TP .B \fB\(aqfootnote\(aq\fP Display URLs in footnotes .TP .B \fB\(aqinline\(aq\fP Display URLs inline in parentheses .UNINDENT .sp Added in version 1.0. .sp Changed in version 1.1: This value is now a string; previously it was a boolean value, and a true value selected the \fB\(aqinline\(aq\fP display. For backwards compatibility, \fBTrue\fP is still accepted. .UNINDENT .INDENT 0.0 .TP .B latex_use_latex_multicolumn .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Use standard LaTeX\(aqs \fB\emulticolumn\fP for merged cells in tables. .INDENT 7.0 .TP .B \fBFalse\fP Sphinx\(aqs own macros are used for merged cells from grid tables. They allow general contents (literal blocks, lists, blockquotes, ...) but may have problems if the \fBtabularcolumns\fP \%<#\:directive-tabularcolumns> directive was used to inject LaTeX mark\-up of the type \fB>{..}\fP, \fB<{..}\fP, \fB@{..}\fP as column specification. .TP .B \fBTrue\fP Use LaTeX\(aqs standard \fB\emulticolumn\fP; this is incompatible with literal blocks in horizontally merged cells, and also with multiple paragraphs in such cells if the table is rendered using \fBtabulary\fP\&. .UNINDENT .sp Added in version 1.6. .UNINDENT .INDENT 0.0 .TP .B latex_table_style .INDENT 7.0 .TP .B Type \fBlist[str]\fP.TP .B Default \fB[\(aqbooktabs\(aq, \(aqcolorrows\(aq]\fP.UNINDENT .sp A list of styling classes (strings). Currently supported: .INDENT 7.0 .TP .B \fB\(aqbooktabs\(aq\fP No vertical lines, and only 2 or 3 horizontal lines (the latter if there is a header), using the booktabs \%<https://\:ctan\:.org/\:pkg/\:booktabs> package. .TP .B \fB\(aqborderless\(aq\fP No lines whatsoever. .TP .B \fB\(aqcolorrows\(aq\fP The table rows are rendered with alternating background colours. The interface to customise them is via dedicated keys \%<#\:tablecolors> of The sphinxsetup configuration setting \%<#\:latexsphinxsetup>\&. .sp \fBImportant:\fP .INDENT 7.0 .INDENT 3.5 With the \fB\(aqcolorrows\(aq\fP style, the \fB\erowcolors\fP LaTeX command becomes a no\-op (this command has limitations and has never correctly supported all types of tables Sphinx produces in LaTeX). Please use the latex table color configuration \%<#\:tablecolors> keys instead. .UNINDENT .UNINDENT .UNINDENT .sp To customise the styles for a table, use the \fB:class:\fP option if the table is defined using a directive, or otherwise insert a rst\-class \%<#\:rstclass> directive before the table (cf. Tables \%<#\:table-directives>). .sp Currently recognised classes are \fBbooktabs\fP, \fBborderless\fP, \fBstandard\fP, \fBcolorrows\fP, \fBnocolorrows\fP\&. The latter two can be combined with any of the first three. The \fBstandard\fP class produces tables with both horizontal and vertical lines (as had been the default prior to Sphinx 6.0.0). .sp A single\-row multi\-column merged cell will obey the row colour, if it is set. See also \fBTableMergeColor{Header,Odd,Even}\fP in the The sphinxsetup configuration setting \%<#\:latexsphinxsetup> section. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 It is hard\-coded in LaTeX that a single cell will obey the row colour even if there is a column colour set via \fB\ecolumncolor\fP from a column specification (see \fBtabularcolumns\fP \%<#\:directive-tabularcolumns>). Sphinx provides \fB\esphinxnorowcolor\fP which can be used in a table column specification like this: .INDENT 2.0 .INDENT 3.5 .sp .EX >{\ecolumncolor{blue}\esphinxnorowcolor} .EE .UNINDENT .UNINDENT .IP \(bu 2 Sphinx also provides \fB\esphinxcolorblend\fP, which however requires the xcolor \%<https://\:ctan\:.org/\:pkg/\:xcolor> package. Here is an example: .INDENT 2.0 .INDENT 3.5 .sp .EX >{\esphinxcolorblend{!95!red}} .EE .UNINDENT .UNINDENT .sp It means that in this column, the row colours will be slightly tinted by red; refer to xcolor \%<https://\:ctan\:.org/\:pkg/\:xcolor> documentation for more on the syntax of its \fB\eblendcolors\fP command (a \fB\eblendcolors\fP in place of \fB\esphinxcolorblend\fP would modify colours of the cell \fIcontents\fP, not of the cell \fIbackground colour panel\fP\&...). You can find an example of usage in the Deprecated APIs \%<#\:dev-deprecated-apis> section of this document in PDF format. .sp \fBHint:\fP .INDENT 2.0 .INDENT 3.5 If you want to use a special colour for the \fIcontents\fP of the cells of a given column use \fB>{\enoindent\ecolor{<color>}}\fP, possibly in addition to the above. .UNINDENT .UNINDENT .IP \(bu 2 Multi\-row merged cells, whether single column or multi\-column currently ignore any set column, row, or cell colour. .IP \(bu 2 It is possible for a simple cell to set a custom colour via the raw \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:raw> directive and the \fB\ecellcolor\fP LaTeX command used anywhere in the cell contents. This currently is without effect in a merged cell, whatever its kind. .UNINDENT .UNINDENT .UNINDENT .sp \fBHint:\fP .INDENT 7.0 .INDENT 3.5 In a document not using \fB\(aqbooktabs\(aq\fP globally, it is possible to style an individual table via the \fBbooktabs\fP class, but it will be necessary to add \fBr\(aq\eusepackage{booktabs}\(aq\fP to the LaTeX preamble. .sp On the other hand one can use \fBcolorrows\fP class for individual tables with no extra package (as Sphinx since 5.3.0 always loads colortbl \%<https://\:ctan\:.org/\:pkg/\:colortbl>). .UNINDENT .UNINDENT .sp Added in version 5.3.0. .sp Changed in version 6.0.0: Modify default from \fB[]\fP to \fB[\(aqbooktabs\(aq, \(aqcolorrows\(aq]\fP\&. .UNINDENT .INDENT 0.0 .TP .B latex_use_xindy .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue if latex_engine in {\(aqxelatex\(aq, \(aqlualatex\(aq} else False\fP.UNINDENT .sp Use Xindy \%<https://\:xindy\:.sourceforge\:.net/> to prepare the index of general terms. By default, the LaTeX builder uses \fBmakeindex\fP for preparing the index of general terms . Using Xindy \%<https://\:xindy\:.sourceforge\:.net/> means that words with UTF\-8 characters will be ordered correctly for the \fBlanguage\fP\&. .INDENT 7.0 .IP \(bu 2 This option is ignored if \fBlatex_engine\fP is \fB\(aqplatex\(aq\fP (Japanese documents; \fBmendex\fP replaces \fBmakeindex\fP then). .IP \(bu 2 The default is \fBTrue\fP for \fB\(aqxelatex\(aq\fP or \fB\(aqlualatex\(aq\fP as \fBmakeindex\fP creates \fB\&.ind\fP files containing invalid bytes for the UTF\-8 encoding if any indexed term starts with a non\-ASCII character. With \fB\(aqlualatex\(aq\fP this then breaks the PDF build. .IP \(bu 2 The default is \fBFalse\fP for \fB\(aqpdflatex\(aq\fP, but \fBTrue\fP is recommended for non\-English documents as soon as some indexed terms use non\-ASCII characters from the language script. Attempting to index a term whose first character is non\-ASCII will break the build, if \fBlatex_use_xindy\fP is left to its default \fBFalse\fP\&. .UNINDENT .sp Sphinx adds some dedicated support to the \fBxindy\fP base distribution for using \fB\(aqpdflatex\(aq\fP engine with Cyrillic scripts. With both \fB\(aqpdflatex\(aq\fP and Unicode engines, Cyrillic documents handle the indexing of Latin names correctly, even those having diacritics. .sp Added in version 1.8. .UNINDENT .INDENT 0.0 .TP .B latex_elements .INDENT 7.0 .TP .B Type \fBdict[str, str]\fP.TP .B Default \fB{}\fP.UNINDENT .sp Added in version 0.5. .sp See the full documentation for latex_elements \%<#\:latex-elements-confval>\&. .UNINDENT .INDENT 0.0 .TP .B latex_docclass .INDENT 7.0 .TP .B Type \fBdict[str, str]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary mapping \fB\(aqhowto\(aq\fP and \fB\(aqmanual\(aq\fP to names of real document classes that will be used as the base for the two Sphinx classes. Default is to use \fB\(aqarticle\(aq\fP for \fB\(aqhowto\(aq\fP and \fB\(aqreport\(aq\fP for \fB\(aqmanual\(aq\fP\&. .sp Added in version 1.0. .sp Changed in version 1.5: In Japanese documentation (\fBlanguage\fP is \fB\(aqja\(aq\fP), by default \fB\(aqjreport\(aq\fP is used for \fB\(aqhowto\(aq\fP and \fB\(aqjsbook\(aq\fP for \fB\(aqmanual\(aq\fP\&. .UNINDENT .INDENT 0.0 .TP .B latex_additional_files .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A list of file names, relative to the configuration directory \%<#\:term-configuration-directory>, to copy to the build directory when building LaTeX output. This is useful to copy files that Sphinx doesn\(aqt copy automatically, or to overwrite Sphinx LaTeX support files with custom versions. Image files that are referenced in source files (e.g. via \fB\&.. image::\fP) are copied automatically and should not be listed there. .sp \fBAttention:\fP .INDENT 7.0 .INDENT 3.5 Filenames with the \fB\&.tex\fP extension will be automatically handed over to the PDF build process triggered by \fBsphinx\-build \-M latexpdf\fP \%<#\:cmdoption-sphinx-build-M> or by \fBmake latexpdf\fP\&. If the file was added only to be \fB\einput{}\fP from a modified preamble, you must add a further suffix such as \fB\&.txt\fP to the filename and adjust the \fB\einput{}\fP macro accordingly. .UNINDENT .UNINDENT .sp Added in version 0.6. .sp Changed in version 1.2: This overrides the files provided from Sphinx such as \fBsphinx.sty\fP\&. .UNINDENT .INDENT 0.0 .TP .B latex_theme .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqmanual\(aq\fP.UNINDENT .sp The \(dqtheme\(dq that the LaTeX output should use. It is a collection of settings for LaTeX output (e.g. document class, top level sectioning unit and so on). .sp The bundled first\-party LaTeX themes are \fImanual\fP and \fIhowto\fP: .INDENT 7.0 .TP .B \fBmanual\fP A LaTeX theme for writing a manual. It imports the \fBreport\fP document class (Japanese documents use \fBjsbook\fP). .TP .B \fBhowto\fP A LaTeX theme for writing an article. It imports the \fBarticle\fP document class (Japanese documents use \fBjreport\fP). \fBlatex_appendices\fP is only available for this theme. .UNINDENT .sp Added in version 3.0. .UNINDENT .INDENT 0.0 .TP .B latex_theme_options .INDENT 7.0 .TP .B Type \fBdict[str, Any]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary of options that influence the look and feel of the selected theme. These are theme\-specific. .sp Added in version 3.1. .UNINDENT .INDENT 0.0 .TP .B latex_theme_path .INDENT 7.0 .TP .B Type \fBlist[str]\fP.TP .B Default \fB[]\fP.UNINDENT .sp A list of paths that contain custom LaTeX themes as subdirectories. Relative paths are taken as relative to the configuration directory \%<#\:term-configuration-directory>\&. .sp Added in version 3.0. .UNINDENT .SS Options for text output .sp These options influence text output. .INDENT 0.0 .TP .B text_add_secnumbers .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Include section numbers in text output. .sp Added in version 1.7. .UNINDENT .INDENT 0.0 .TP .B text_newlines .INDENT 7.0 .TP .B Type \fB\(aqunix\(aq | \(aqwindows\(aq | \(aqnative\(aq\fP.TP .B Default \fB\(aqunix\(aq\fP.UNINDENT .sp Determines which end\-of\-line character(s) are used in text output. .INDENT 7.0 .TP .B \fB\(aqunix\(aq\fP Use Unix\-style line endings (\fB\en\fP). .TP .B \fB\(aqwindows\(aq\fP Use Windows\-style line endings (\fB\er\en\fP). .TP .B \fB\(aqnative\(aq\fP Use the line ending style of the platform the documentation is built on. .UNINDENT .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B text_secnumber_suffix .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq. \(aq\fP.UNINDENT .sp Suffix for section numbers in text output. Set to \fB\(aq \(aq\fP to suppress the final dot on section numbers. .sp Added in version 1.7. .UNINDENT .INDENT 0.0 .TP .B text_sectionchars .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq*=\-~\(dq+\(ga\(aq\fP.UNINDENT .sp A string of 7 characters that should be used for underlining sections. The first character is used for first\-level headings, the second for second\-level headings and so on. .sp Added in version 1.1. .UNINDENT .SS Options for manual page output .sp These options influence manual page output. .INDENT 0.0 .TP .B man_pages .INDENT 7.0 .TP .B Type \fBSequence[tuple[str, str, str, str, str]]\fP.TP .B Default The default manual pages.UNINDENT .sp This value determines how to group the document tree into manual pages. It must be a list of tuples \fB(startdocname, name, description, authors, section)\fP, where the items are: .INDENT 7.0 .TP .B \fIstartdocname\fP String that specifies the document name \%<#\:term-document-name> of the manual page\(aqs master document. All documents referenced by the \fIstartdoc\fP document in ToC trees will be included in the manual page. (If you want to use the default master document for your manual pages build, provide your \fBmaster_doc\fP here.) .TP .B \fIname\fP Name of the manual page. This should be a short string without spaces or special characters. It is used to determine the file name as well as the name of the manual page (in the NAME section). .TP .B \fIdescription\fP Description of the manual page. This is used in the NAME section. Can be an empty string if you do not want to automatically generate the NAME section. .TP .B \fIauthors\fP A list of strings with authors, or a single string. Can be an empty string or list if you do not want to automatically generate an AUTHORS section in the manual page. .TP .B \fIsection\fP The manual page section. Used for the output file name as well as in the manual page header. .UNINDENT .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B man_show_urls .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Add URL addresses after links. .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B man_make_section_directory .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Make a section directory on build man page. .sp Added in version 3.3. .sp Changed in version 4.0: The default is now \fBFalse\fP (previously \fBTrue\fP). .sp Changed in version 4.0.2: Revert the change in the default. .UNINDENT .SS Options for Texinfo output .sp These options influence Texinfo output. .INDENT 0.0 .TP .B texinfo_documents .INDENT 7.0 .TP .B Type \fBSequence[tuple[str, str, str, str, str, str, str, bool]]\fP.TP .B Default The default Texinfo documents.UNINDENT .sp This value determines how to group the document tree into Texinfo source files. It must be a list of tuples \fB(startdocname, targetname, title, author, dir_entry, description, category, toctree_only)\fP, where the items are: .INDENT 7.0 .TP .B \fIstartdocname\fP String that specifies the document name \%<#\:term-document-name> of the Texinfo file\(aqs master document. All documents referenced by the \fIstartdoc\fP document in ToC trees will be included in the Texinfo file. (If you want to use the default master document for your Texinfo build, provide your \fBmaster_doc\fP here.) .TP .B \fItargetname\fP File name (no extension) of the Texinfo file in the output directory. .TP .B \fItitle\fP Texinfo document title. Can be empty to use the title of the \fIstartdoc\fP document. Inserted as Texinfo markup, so special characters like \fB@\fP and \fB{}\fP will need to be escaped to be inserted literally. .TP .B \fIauthor\fP Author for the Texinfo document. Inserted as Texinfo markup. Use \fB@*\fP to separate multiple authors, as in: \fB\(aqJohn@*Sarah\(aq\fP\&. .TP .B \fIdir_entry\fP The name that will appear in the top\-level \fBDIR\fP menu file. .TP .B \fIdescription\fP Descriptive text to appear in the top\-level \fBDIR\fP menu file. .TP .B \fIcategory\fP Specifies the section which this entry will appear in the top\-level \fBDIR\fP menu file. .TP .B \fItoctree_only\fP Must be \fBTrue\fP or \fBFalse\fP\&. If True, the \fIstartdoc\fP document itself is not included in the output, only the documents referenced by it via ToC trees. With this option, you can put extra stuff in the master document that shows up in the HTML, but not the Texinfo output. .UNINDENT .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B texinfo_appendices .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB[]\fP.UNINDENT .sp A list of document names to append as an appendix to all manuals. .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B texinfo_cross_references .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Generate inline references in a document. Disabling inline references can make an info file more readable with a stand\-alone reader (\fBinfo\fP). .sp Added in version 4.4. .UNINDENT .INDENT 0.0 .TP .B texinfo_domain_indices .INDENT 7.0 .TP .B Type \fBbool | Sequence[str]\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If True, generate domain\-specific indices in addition to the general index. For e.g. the Python domain, this is the global module index. .sp This value can be a Boolean or a list of index names that should be generated. To find out the index name for a specific index, look at the HTML file name. For example, the Python module index has the name \fB\(aqpy\-modindex\(aq\fP\&. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX texinfo_domain_indices = { \(aqpy\-modindex\(aq, } .EE .UNINDENT .UNINDENT .sp Added in version 1.1. .sp Changed in version 7.4: Permit and prefer a set type. .UNINDENT .INDENT 0.0 .TP .B texinfo_elements .INDENT 7.0 .TP .B Type \fBdict[str, Any]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary that contains Texinfo snippets that override those that Sphinx usually puts into the generated \fB\&.texi\fP files. .INDENT 7.0 .IP \(bu 2 Keys that you may want to override include: .INDENT 2.0 .TP .B \fB\(aqparagraphindent\(aq\fP Number of spaces to indent the first line of each paragraph, default \fB2\fP\&. Specify \fB0\fP for no indentation. .TP .B \fB\(aqexampleindent\(aq\fP Number of spaces to indent the lines for examples or literal blocks, default \fB4\fP\&. Specify \fB0\fP for no indentation. .TP .B \fB\(aqpreamble\(aq\fP Texinfo markup inserted near the beginning of the file. .TP .B \fB\(aqcopying\(aq\fP Texinfo markup inserted within the \fB@copying\fP block and displayed after the title. The default value consists of a simple title page identifying the project. .UNINDENT .IP \(bu 2 Keys that are set by other options and therefore should not be overridden are \fB\(aqauthor\(aq\fP, \fB\(aqbody\(aq\fP, \fB\(aqdate\(aq\fP, \fB\(aqdirentry\(aq\fP \fB\(aqfilename\(aq\fP, \fB\(aqproject\(aq\fP, \fB\(aqrelease\(aq\fP, and \fB\(aqtitle\(aq\fP\&. .UNINDENT .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B texinfo_no_detailmenu .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Do not generate a \fB@detailmenu\fP in the \(dqTop\(dq node\(aqs menu containing entries for each sub\-node in the document. .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B texinfo_show_urls .INDENT 7.0 .TP .B Type \fB\(aqfootnote\(aq | \(aqno\(aq | \(aqinline\(aq\fP.TP .B Default \fB\(aqfootnote\(aq\fP.UNINDENT .sp Control how to display URL addresses. The setting can have the following values: .INDENT 7.0 .TP .B \fB\(aqfootnote\(aq\fP Display URLs in footnotes. .TP .B \fB\(aqno\(aq\fP Do not display URLs. .TP .B \fB\(aqinline\(aq\fP Display URLs inline in parentheses. .UNINDENT .sp Added in version 1.1. .UNINDENT .SS Options for QtHelp output .sp These options influence qthelp output. This builder derives from the HTML builder, so the HTML options also apply where appropriate. .INDENT 0.0 .TP .B qthelp_basename .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default The value of \fBproject\fP.UNINDENT .sp The basename for the qthelp file. .UNINDENT .INDENT 0.0 .TP .B qthelp_namespace .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqorg.sphinx.{project_name}.{project_version}\(aq\fP.UNINDENT .sp The namespace for the qthelp file. .UNINDENT .INDENT 0.0 .TP .B qthelp_theme .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqnonav\(aq\fP.UNINDENT .sp The HTML theme for the qthelp output. .UNINDENT .INDENT 0.0 .TP .B qthelp_theme_options .INDENT 7.0 .TP .B Type \fBdict[str, Any]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary of options that influence the look and feel of the selected theme. These are theme\-specific. The options understood by the builtin themes \%<#\:builtin-themes> are described here \%<#\:builtin-themes>\&. .UNINDENT .SS Options for XML output .INDENT 0.0 .TP .B xml_pretty .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Pretty\-print the XML. .sp Added in version 1.2. .UNINDENT .SS Options for the linkcheck builder .SS Filtering .sp These options control which links the \fIlinkcheck\fP builder checks, and which failures and redirects it ignores. .INDENT 0.0 .TP .B linkcheck_allowed_redirects .INDENT 7.0 .TP .B Type \fBdict[str, str]\fP.UNINDENT .sp A dictionary that maps a pattern of the source URI to a pattern of the canonical URI. The \fIlinkcheck\fP builder treats the redirected link as \(dqworking\(dq when: .INDENT 7.0 .IP \(bu 2 the link in the document matches the source URI pattern, and .IP \(bu 2 the redirect location matches the canonical URI pattern. .UNINDENT .sp The \fIlinkcheck\fP builder will emit a warning when it finds redirected links that don\(aqt meet the rules above. It can be useful to detect unexpected redirects when using \fBthe fail\-on\-warnings mode\fP \%<#\:cmdoption-sphinx-build-W>\&. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX linkcheck_allowed_redirects = { # All HTTP redirections from the source URI to # the canonical URI will be treated as \(dqworking\(dq. r\(aqhttps://sphinx\-doc\e.org/.*\(aq: r\(aqhttps://sphinx\-doc\e.org/en/master/.*\(aq } .EE .UNINDENT .UNINDENT .sp Added in version 4.1. .sp Changed in version 9.0: Setting \fBlinkcheck_allowed_redirects\fP to an empty dictionary may now be used to warn on all redirects encountered by the \fIlinkcheck\fP builder. .UNINDENT .INDENT 0.0 .TP .B linkcheck_anchors .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Check the validity of \fB#anchor\fPs in links. Since this requires downloading the whole document, it is considerably slower when enabled. .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B linkcheck_anchors_ignore .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB[\(dq^!\(dq]\fP.UNINDENT .sp A list of regular expressions that match anchors that the \fIlinkcheck\fP builder should skip when checking the validity of anchors in links. For example, this allows skipping anchors added by a website\(aqs JavaScript. .sp \fBTip:\fP .INDENT 7.0 .INDENT 3.5 Use \fBlinkcheck_anchors_ignore_for_url\fP to check a URL, but skip verifying that the anchors exist. .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 If you want to ignore anchors of a specific page or of pages that match a specific pattern (but still check occurrences of the same page(s) that don\(aqt have anchors), use \fBlinkcheck_ignore\fP instead, for example as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX linkcheck_ignore = [ \(aqhttps://www.sphinx\-doc.org/en/1.7/intro.html#\(aq, ] .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp Added in version 1.5. .UNINDENT .INDENT 0.0 .TP .B linkcheck_anchors_ignore_for_url .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A list or tuple of regular expressions matching URLs for which the \fIlinkcheck\fP builder should not check the validity of anchors. This allows skipping anchor checks on a per\-page basis while still checking the validity of the page itself. .sp Added in version 7.1. .UNINDENT .INDENT 0.0 .TP .B linkcheck_exclude_documents .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A list of regular expressions that match documents in which the \fIlinkcheck\fP builder should not check the validity of links. This can be used for permitting link decay in legacy or historical sections of the documentation. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX # ignore all links in documents located in a subdirectory named \(aqlegacy\(aq linkcheck_exclude_documents = [r\(aq.*/legacy/.*\(aq] .EE .UNINDENT .UNINDENT .sp Added in version 4.4. .UNINDENT .INDENT 0.0 .TP .B linkcheck_ignore .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A list of regular expressions that match URIs that should not be checked when doing a \fBlinkcheck\fP build. .sp Server\-issued redirects that match \fBignored URIs\fP will not be followed. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX linkcheck_ignore = [r\(aqhttps://localhost:\ed+/\(aq] .EE .UNINDENT .UNINDENT .sp Added in version 1.1. .UNINDENT .SS HTTP Requests .sp These options control how the \fIlinkcheck\fP builder makes HTTP requests, including how it handles redirects and authentication, and the number of workers to use. .INDENT 0.0 .TP .B linkcheck_auth .INDENT 7.0 .TP .B Type \fBSequence[tuple[str, Any]]\fP.TP .B Default \fB[]\fP.UNINDENT .sp Pass authentication information when doing a \fBlinkcheck\fP build. .sp A list of \fB(regex_pattern, auth_info)\fP tuples where the items are: .INDENT 7.0 .TP .B \fIregex_pattern\fP A regular expression that matches a URI. .TP .B \fIauth_info\fP Authentication information to use for that URI. The value can be anything that is understood by the \fBrequests\fP library (see requests authentication \%<https://\:requests\:.readthedocs\:.io/\:en/\:latest/\:user/\:authentication/#\:authentication> for details). .UNINDENT .sp The \fIlinkcheck\fP builder will use the first matching \fBauth_info\fP value it can find in the \fBlinkcheck_auth\fP list, so values earlier in the list have higher priority. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX linkcheck_auth = [ (\(aqhttps://foo\e.yourcompany\e.com/.+\(aq, (\(aqjohndoe\(aq, \(aqsecret\(aq)), (\(aqhttps://.+\e.yourcompany\e.com/.+\(aq, HTTPDigestAuth(...)), ] .EE .UNINDENT .UNINDENT .sp Added in version 2.3. .UNINDENT .INDENT 0.0 .TP .B linkcheck_allow_unauthorized .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp When a webserver responds with an HTTP 401 (unauthorised) response, the current default behaviour of the \fIlinkcheck\fP builder is to treat the link as \(dqbroken\(dq. To change that behaviour, set this option to \fBTrue\fP\&. .sp Changed in version 8.0: The default value for this option changed to \fBFalse\fP, meaning HTTP 401 responses to checked hyperlinks are treated as \(dqbroken\(dq by default. .sp Added in version 7.3. .UNINDENT .INDENT 0.0 .TP .B linkcheck_case_insensitive_urls .INDENT 7.0 .TP .B Type \fBSet[str] | Sequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A collection of regular expressions that match URLs for which the \fIlinkcheck\fP builder should perform case\-insensitive comparisons. This is useful for links to websites that are case\-insensitive or normalise URL casing. .sp By default, \fIlinkcheck\fP requires the destination URL to match the documented URL case\-sensitively. For example, a link to \fBhttp://example.org/PATH\fP that redirects to \fBhttp://example.org/path\fP will be reported as \fBredirected\fP\&. .sp If the URL matches a pattern contained in \fBlinkcheck_case_insensitive_urls\fP, it would instead be reported as \fBworking\fP\&. .sp For example, to treat all GitHub URLs as case\-insensitive: .INDENT 7.0 .INDENT 3.5 .sp .EX linkcheck_case_insensitive_urls = [ r\(aqhttps://github\e.com/.*\(aq, ] .EE .UNINDENT .UNINDENT .sp Or, to treat all URLs as case\-insensitive: .INDENT 7.0 .INDENT 3.5 .sp .EX linkcheck_case_insensitive_urls = [\(aq.*\(aq] .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 URI fragments (HTML anchors) are not affected by this option. They are always checked with case\-sensitive comparisons. .UNINDENT .UNINDENT .sp Added in version 9.0. .UNINDENT .INDENT 0.0 .TP .B linkcheck_rate_limit_timeout .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fB300\fP.UNINDENT .sp The \fIlinkcheck\fP builder may issue a large number of requests to the same site over a short period of time. This setting controls the builder behaviour when servers indicate that requests are rate\-limited, by setting the maximum duration (in seconds) that the builder will wait for between each attempt before recording a failure. .sp The \fIlinkcheck\fP builder always respects a server\(aqs direction of when to retry (using the Retry\-After \%<https://\:datatracker\:.ietf\:.org/\:doc/\:html/\:rfc7231#\:section-7\:.1.3> header). Otherwise, \fBlinkcheck\fP waits for a minute before to retry and keeps doubling the wait time between attempts until it succeeds or exceeds the \fBlinkcheck_rate_limit_timeout\fP (in seconds). Custom timeouts should be given as a number of seconds. .sp Added in version 3.4. .UNINDENT .INDENT 0.0 .TP .B linkcheck_report_timeouts_as_broken .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If \fBlinkcheck_timeout\fP expires while waiting for a response from a hyperlink, the \fIlinkcheck\fP builder will report the link as a \fBtimeout\fP by default. To report timeouts as \fBbroken\fP instead, you can set \fBlinkcheck_report_timeouts_as_broken\fP to \fBTrue\fP\&. .sp Changed in version 8.0: The default value for this option changed to \fBFalse\fP, meaning timeouts that occur while checking hyperlinks will be reported using the new \(aqtimeout\(aq status code. .sp Added in version 7.3. .UNINDENT .INDENT 0.0 .TP .B linkcheck_request_headers .INDENT 7.0 .TP .B Type \fBdict[str, dict[str, str]]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary that maps URL (without paths) to HTTP request headers. .sp The key is a URL base string like \fB\(aqhttps://www.sphinx\-doc.org/\(aq\fP\&. To specify headers for other hosts, \fB\(dq*\(dq\fP can be used. It matches all hosts only when the URL does not match other settings. .sp The value is a dictionary that maps header name to its value. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX linkcheck_request_headers = { \(dqhttps://www.sphinx\-doc.org/\(dq: { \(dqAccept\(dq: \(dqtext/html\(dq, \(dqAccept\-Encoding\(dq: \(dqutf\-8\(dq, }, \(dq*\(dq: { \(dqAccept\(dq: \(dqtext/html,application/xhtml+xml\(dq, } } .EE .UNINDENT .UNINDENT .sp Added in version 3.1. .UNINDENT .INDENT 0.0 .TP .B linkcheck_retries .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fB1\fP.UNINDENT .sp The number of times the \fIlinkcheck\fP builder will attempt to check a URL before declaring it broken. .sp Added in version 1.4. .UNINDENT .INDENT 0.0 .TP .B linkcheck_timeout .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fB30\fP.UNINDENT .sp The duration, in seconds, that the \fIlinkcheck\fP builder will wait for a response after each hyperlink request. .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B linkcheck_workers .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fB5\fP.UNINDENT .sp The number of worker threads to use when checking links. .sp Added in version 1.1. .UNINDENT .SS Domain options .SS Options for the C domain .INDENT 0.0 .TP .B c_extra_keywords .INDENT 7.0 .TP .B Type \fBSet[str] | Sequence[str]\fP.TP .B Default \fB[\(aqalignas\(aq, \(aqalignof\(aq, \(aqbool\(aq, \(aqcomplex\(aq, \(aqimaginary\(aq, \(aqnoreturn\(aq, \(aqstatic_assert\(aq, \(aqthread_local\(aq]\fP.UNINDENT .sp A list of identifiers to be recognised as keywords by the C parser. .sp Added in version 4.0.3. .sp Changed in version 7.4: \fBc_extra_keywords\fP can now be a set. .UNINDENT .INDENT 0.0 .TP .B c_id_attributes .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A sequence of strings that the parser should additionally accept as attributes. For example, this can be used when \fB#define\fP has been used for attributes, for portability. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX c_id_attributes = [ \(aqmy_id_attribute\(aq, ] .EE .UNINDENT .UNINDENT .sp Added in version 3.0. .sp Changed in version 7.4: \fBc_id_attributes\fP can now be a tuple. .UNINDENT .INDENT 0.0 .TP .B c_maximum_signature_line_length .INDENT 7.0 .TP .B Type \fBint | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp If a signature\(aqs length in characters exceeds the number set, each parameter within the signature will be displayed on an individual logical line. .sp When \fBNone\fP, there is no maximum length and the entire signature will be displayed on a single logical line. .sp This is a domain\-specific setting, overriding \fBmaximum_signature_line_length\fP\&. .sp Added in version 7.1. .UNINDENT .INDENT 0.0 .TP .B c_paren_attributes .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A sequence of strings that the parser should additionally accept as attributes with one argument. That is, if \fBmy_align_as\fP is in the list, then \fBmy_align_as(X)\fP is parsed as an attribute for all strings \fBX\fP that have balanced braces (\fB()\fP, \fB[]\fP, and \fB{}\fP). For example, this can be used when \fB#define\fP has been used for attributes, for portability. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX c_paren_attributes = [ \(aqmy_align_as\(aq, ] .EE .UNINDENT .UNINDENT .sp Added in version 3.0. .sp Changed in version 7.4: \fBc_paren_attributes\fP can now be a tuple. .UNINDENT .SS Options for the C++ domain .INDENT 0.0 .TP .B cpp_id_attributes .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A sequence of strings that the parser should additionally accept as attributes. For example, this can be used when \fB#define\fP has been used for attributes, for portability. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX cpp_id_attributes = [ \(aqmy_id_attribute\(aq, ] .EE .UNINDENT .UNINDENT .sp Added in version 1.5. .sp Changed in version 7.4: \fBcpp_id_attributes\fP can now be a tuple. .UNINDENT .INDENT 0.0 .TP .B cpp_index_common_prefix .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A list of prefixes that will be ignored when sorting C++ objects in the global index. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX cpp_index_common_prefix = [ \(aqawesome_lib::\(aq, ] .EE .UNINDENT .UNINDENT .sp Added in version 1.5. .UNINDENT .INDENT 0.0 .TP .B cpp_maximum_signature_line_length .INDENT 7.0 .TP .B Type \fBint | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp If a signature\(aqs length in characters exceeds the number set, each parameter within the signature will be displayed on an individual logical line. .sp When \fBNone\fP, there is no maximum length and the entire signature will be displayed on a single logical line. .sp This is a domain\-specific setting, overriding \fBmaximum_signature_line_length\fP\&. .sp Added in version 7.1. .UNINDENT .INDENT 0.0 .TP .B cpp_paren_attributes .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A sequence of strings that the parser should additionally accept as attributes with one argument. That is, if \fBmy_align_as\fP is in the list, then \fBmy_align_as(X)\fP is parsed as an attribute for all strings \fBX\fP that have balanced braces (\fB()\fP, \fB[]\fP, and \fB{}\fP). For example, this can be used when \fB#define\fP has been used for attributes, for portability. .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX cpp_paren_attributes = [ \(aqmy_align_as\(aq, ] .EE .UNINDENT .UNINDENT .sp Added in version 1.5. .sp Changed in version 7.4: \fBcpp_paren_attributes\fP can now be a tuple. .UNINDENT .SS Options for the Javascript domain .INDENT 0.0 .TP .B javascript_maximum_signature_line_length .INDENT 7.0 .TP .B Type \fBint | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp If a signature\(aqs length in characters exceeds the number set, each parameter within the signature will be displayed on an individual logical line. .sp When \fBNone\fP, there is no maximum length and the entire signature will be displayed on a single logical line. .sp This is a domain\-specific setting, overriding \fBmaximum_signature_line_length\fP\&. .sp Added in version 7.1. .UNINDENT .INDENT 0.0 .TP .B javascript_trailing_comma_in_multi_line_signatures .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Use a trailing comma in parameter lists spanning multiple lines, if true. .sp Added in version 8.2. .UNINDENT .SS Options for the Python domain .INDENT 0.0 .TP .B add_module_names .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp A boolean that decides whether module names are prepended to all object \%<#\:term-object> names (for object types where a \(dqmodule\(dq of some kind is defined), e.g. for \fBpy:function\fP \%<#\:directive-py-function> directives. .UNINDENT .INDENT 0.0 .TP .B modindex_common_prefix .INDENT 7.0 .TP .B Type \fBlist[str]\fP.TP .B Default \fB[]\fP.UNINDENT .sp A list of prefixes that are ignored for sorting the Python module index (e.g., if this is set to \fB[\(aqfoo.\(aq]\fP, then \fBfoo.bar\fP is shown under \fBB\fP, not \fBF\fP). This can be handy if you document a project that consists of a single package. .sp \fBCaution:\fP .INDENT 7.0 .INDENT 3.5 Works only for the HTML builder currently. .UNINDENT .UNINDENT .sp Added in version 0.6. .UNINDENT .INDENT 0.0 .TP .B python_display_short_literal_types .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp This value controls how \fBLiteral\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:typing\:.html#\:typing\:.Literal> types are displayed. .SS Examples .sp The examples below use the following \fBpy:function\fP \%<#\:directive-py-function> directive: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:function:: serve_food(item: Literal[\(dqegg\(dq, \(dqspam\(dq, \(dqlobster thermidor\(dq]) \-> None .EE .UNINDENT .UNINDENT .sp When \fBFalse\fP, \fBLiteral\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:typing\:.html#\:typing\:.Literal> types display as per standard Python syntax, i.e.: .INDENT 7.0 .INDENT 3.5 .sp .EX serve_food(item: Literal[\(dqegg\(dq, \(dqspam\(dq, \(dqlobster thermidor\(dq]) \-> None .EE .UNINDENT .UNINDENT .sp When \fBTrue\fP, \fBLiteral\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:typing\:.html#\:typing\:.Literal> types display with a short, \fBPEP 604\fP \%<https://\:peps\:.python\:.org/\:pep-0604/>\-inspired syntax, i.e.: .INDENT 7.0 .INDENT 3.5 .sp .EX serve_food(item: \(dqegg\(dq | \(dqspam\(dq | \(dqlobster thermidor\(dq) \-> None .EE .UNINDENT .UNINDENT .sp Added in version 6.2. .UNINDENT .INDENT 0.0 .TP .B python_maximum_signature_line_length .INDENT 7.0 .TP .B Type \fBint | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp If a signature\(aqs length in characters exceeds the number set, each parameter within the signature will be displayed on an individual logical line. .sp When \fBNone\fP, there is no maximum length and the entire signature will be displayed on a single logical line. .sp This is a domain\-specific setting, overriding \fBmaximum_signature_line_length\fP\&. .sp For the Python domain, the signature length depends on whether the type parameters or the list of arguments are being formatted. For the former, the signature length ignores the length of the arguments list; for the latter, the signature length ignores the length of the type parameters list. .sp For instance, with \fBpython_maximum_signature_line_length = 20\fP, only the list of type parameters will be wrapped while the arguments list will be rendered on a single line .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:function:: add[T: VERY_LONG_SUPER_TYPE, U: VERY_LONG_SUPER_TYPE](a: T, b: U) .EE .UNINDENT .UNINDENT .sp Added in version 7.1. .UNINDENT .INDENT 0.0 .TP .B python_trailing_comma_in_multi_line_signatures .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Use a trailing comma in parameter lists spanning multiple lines, if true. .sp Added in version 8.2. .UNINDENT .INDENT 0.0 .TP .B python_use_unqualified_type_names .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Suppress the module name of the python reference if it can be resolved. .sp Added in version 4.0. .sp \fBCaution:\fP .INDENT 7.0 .INDENT 3.5 This feature is experimental. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B trim_doctest_flags .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Remove doctest flags (comments looking like \fB# doctest: FLAG, ...\fP) at the ends of lines and \fB<BLANKLINE>\fP markers for all code blocks showing interactive Python sessions (i.e. doctests). See the extension \fBdoctest\fP \%<#\:module-sphinx\:.ext\:.doctest> for more possibilities of including doctests. .sp Added in version 1.0. .sp Changed in version 1.1: Now also removes \fB<BLANKLINE>\fP\&. .UNINDENT .SS Extension options .sp Extensions frequently have their own configuration options. Those for Sphinx\(aqs first\-party extensions are documented in each extension\(aqs page \%<>\&. .SS Example configuration file .INDENT 0.0 .INDENT 3.5 .sp .EX # \-\- Project information \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- # https://www.sphinx\-doc.org/en/master/usage/configuration.html#project\-information project = \(aqTest Project\(aq copyright = \(aq2000\-2042, The Test Project Authors\(aq author = \(aqThe Authors\(aq version = release = \(aq4.16\(aq # \-\- General configuration \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- # https://www.sphinx\-doc.org/en/master/usage/configuration.html#general\-configuration exclude_patterns = [ \(aq_build\(aq, \(aqThumbs.db\(aq, \(aq.DS_Store\(aq, ] extensions = [] language = \(aqen\(aq master_doc = \(aqindex\(aq pygments_style = \(aqsphinx\(aq source_suffix = \(aq.rst\(aq templates_path = [\(aq_templates\(aq] # \-\- Options for HTML output \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- # https://www.sphinx\-doc.org/en/master/usage/configuration.html#options\-for\-html\-output html_theme = \(aqalabaster\(aq html_static_path = [\(aq_static\(aq] .EE .UNINDENT .UNINDENT .SS Builders .sp These are the built\-in Sphinx builders. More builders can be added by extensions \%<>\&. .sp The builder\(aqs \(dqname\(dq must be given to the \fB\-M\fP or \fB\-b\fP command\-line options of \fBsphinx\-build\fP to select a builder. .sp The most common builders are: .INDENT 0.0 .TP \fBhtml\fP Build HTML pages. This is the default builder. .TP \fBdirhtml\fP Build HTML pages, but with a single directory per document. Makes for prettier URLs (no \fB\&.html\fP) if served from a webserver. .TP \fBsinglehtml\fP Build a single HTML with the whole content. .TP \fBhtmlhelp\fP, \fBqthelp\fP, \fBdevhelp\fP, \fBepub\fP Build HTML files with additional information for building a documentation collection in one of these formats. .TP \fBapplehelp\fP Build an Apple Help Book. Requires \fBhiutil\fP and \fBcodesign\fP, which are not Open Source and presently only available on Mac OS X 10.6 and higher. .TP \fBlatex\fP Build LaTeX sources that can be compiled to a PDF document using \fBpdflatex\fP\&. .TP \fBman\fP Build manual pages in groff format for UNIX systems. .TP \fBtexinfo\fP Build Texinfo files that can be processed into Info files using \fBmakeinfo\fP\&. .TP \fBtext\fP Build plain text files. .TP \fBgettext\fP Build gettext\-style message catalogs (\fB\&.pot\fP files). .TP \fBdoctest\fP Run all doctests in the documentation, if the \fBdoctest\fP \%<#\:module-sphinx\:.ext\:.doctest> extension is enabled. .TP \fBlinkcheck\fP Check the integrity of all external links. .TP \fBxml\fP Build Docutils\-native XML files. .TP \fBpseudoxml\fP Build compact pretty\-printed \(dqpseudo\-XML\(dq files displaying the internal structure of the intermediate document trees. .UNINDENT .sp .ce ---- .ce 0 .sp .INDENT 0.0 .TP .B class sphinx.builders.html.StandaloneHTMLBuilder This is the standard HTML builder. Its output is a directory with HTML files, complete with style sheets and optionally the reStructuredText sources. There are quite a few configuration values that customize the output of this builder, see the chapter Options for HTML output \%<#\:html-options> for details. .INDENT 7.0 .TP .B name = \(aqhtml\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqhtml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqimage/svg+xml\(aq, \(aqimage/png\(aq, \(aqimage/gif\(aq, \(aqimage/jpeg\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.dirhtml.DirectoryHTMLBuilder This is a subclass of the standard HTML builder. Its output is a directory with HTML files, where each file is called \fBindex.html\fP and placed in a subdirectory named like its page name. For example, the document \fBmarkup/rest.rst\fP will not result in an output file \fBmarkup/rest.html\fP, but \fBmarkup/rest/index.html\fP\&. When generating links between pages, the \fBindex.html\fP is omitted, so that the URL would look like \fBmarkup/rest/\fP\&. .INDENT 7.0 .TP .B name = \(aqdirhtml\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqhtml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqimage/svg+xml\(aq, \(aqimage/png\(aq, \(aqimage/gif\(aq, \(aqimage/jpeg\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Added in version 0.6. .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.singlehtml.SingleFileHTMLBuilder This is an HTML builder that combines the whole project in one output file. (Obviously this only works with smaller projects.) The file is named like the root document. No indices will be generated. .INDENT 7.0 .TP .B name = \(aqsinglehtml\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqhtml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqimage/svg+xml\(aq, \(aqimage/png\(aq, \(aqimage/gif\(aq, \(aqimage/jpeg\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B class sphinxcontrib.htmlhelp.HTMLHelpBuilder This builder produces the same output as the standalone HTML builder, but also generates HTML Help support files that allow the Microsoft HTML Help Workshop to compile them into a CHM file. .INDENT 7.0 .TP .B name = \(aqhtmlhelp\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqhtml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqimage/png\(aq, \(aqimage/gif\(aq, \(aqimage/jpeg\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinxcontrib.qthelp.QtHelpBuilder This builder produces the same output as the standalone HTML builder, but also generates Qt help \%<https://\:doc\:.qt\:.io/\:qt-4\:.8/\:qthelp-framework\:.html> collection support files that allow the Qt collection generator to compile them. .sp Changed in version 2.0: Moved to sphinxcontrib.qthelp from sphinx.builders package. .INDENT 7.0 .TP .B name = \(aqqthelp\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqhtml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqimage/svg+xml\(aq, \(aqimage/png\(aq, \(aqimage/gif\(aq, \(aqimage/jpeg\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinxcontrib.applehelp.AppleHelpBuilder This builder produces an Apple Help Book based on the same output as the standalone HTML builder. .sp If the source directory contains any \fB\&.lproj\fP folders, the one corresponding to the selected language will have its contents merged with the generated output. These folders will be ignored by all other documentation types. .sp In order to generate a valid help book, this builder requires the command line tool \fBhiutil\fP, which is only available on Mac OS X 10.6 and above. You can disable the indexing step by setting \fBapplehelp_disable_external_tools\fP \%<#\:confval-applehelp_disable_external_tools> to \fBTrue\fP, in which case the output will not be valid until \fBhiutil\fP has been run on all of the \fB\&.lproj\fP folders within the bundle. .INDENT 7.0 .TP .B name = \(aqapplehelp\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqhtml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqimage/png\(aq, \(aqimage/gif\(aq, \(aqimage/jpeg\(aq, \(aqimage/tiff\(aq, \(aqimage/jp2\(aq, \(aqimage/svg+xml\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Added in version 1.3. .sp Changed in version 2.0: Moved to sphinxcontrib.applehelp from sphinx.builders package. .UNINDENT .INDENT 0.0 .TP .B class sphinxcontrib.devhelp.DevhelpBuilder This builder produces the same output as the standalone HTML builder, but also generates GNOME Devhelp \%<https://\:wiki\:.gnome\:.org/\:Apps/\:Devhelp> support file that allows the GNOME Devhelp reader to view them. .INDENT 7.0 .TP .B name = \(aqdevhelp\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqhtml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqimage/png\(aq, \(aqimage/gif\(aq, \(aqimage/jpeg\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Changed in version 2.0: Moved to sphinxcontrib.devhelp from sphinx.builders package. .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.epub3.Epub3Builder This builder produces the same output as the standalone HTML builder, but also generates an \fIepub\fP file for ebook readers. See Epub info \%<#\:epub-faq> for details about it. For definition of the epub format, have a look at \%<https://\:idpf\:.org/\:epub> or \%<https://\:en\:.wikipedia\:.org/\:wiki/\:EPUB>\&. The builder creates \fIEPUB 3\fP files. .INDENT 7.0 .TP .B name = \(aqepub\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqhtml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqimage/svg+xml\(aq, \(aqimage/png\(aq, \(aqimage/gif\(aq, \(aqimage/jpeg\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Added in version 1.4. .sp Changed in version 1.5: Since Sphinx 1.5, the epub3 builder is used as the default epub builder. .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.latex.LaTeXBuilder This builder produces LaTeX source files in the output directory. The actual PDF builds happen inside this output directory and need to be triggered in a second step. This can be done via \fBmake all\-pdf\fP there. To combine the two steps into only one, use \fBsphinx\-build \-M\fP \%<#\:cmdoption-sphinx-build-M> (i.e. \fB\-M latexpdf\fP not \fB\-b latexpdf\fP) or \fBmake latexpdf\fP at the project root. .sp See \fBlatex_documents\fP \%<#\:confval-latex_documents> and the chapter Options for LaTeX output \%<#\:latex-options> for available options. .sp PDF builds need a sufficiently complete LaTeX installation. The testing is currently (since 5.3.0) done on Ubuntu 22.04LTS, whose LaTeX distribution matches upstream TeXLive 2021 as of 2022/02/04, but PDF builds can be successfully done on much older LaTeX installations. .sp At any rate, on Ubuntu for example, following packages must all be present: .INDENT 7.0 .IP \(bu 2 \fBtexlive\-latex\-recommended\fP .IP \(bu 2 \fBtexlive\-fonts\-recommended\fP .IP \(bu 2 \fBtexlive\-fonts\-extra\fP (needed for \fBfontawesome5\fP, see the 7.4.0 change notice below) .IP \(bu 2 \fBtex\-gyre\fP (if \fBlatex_engine\fP \%<#\:confval-latex_engine> left to default) .IP \(bu 2 \fBtexlive\-latex\-extra\fP .IP \(bu 2 \fBlatexmk\fP .UNINDENT .sp Changed in version 4.0.0: TeX Gyre fonts now required for \fB\(aqpdflatex\(aq\fP engine (default). .sp Changed in version 7.4.0: LaTeX package \fBxcolor\fP is now required (it is part of Ubuntu \fBtexlive\-latex\-recommended\fP anyhow). The LaTeX package \fBfontawesome5\fP is recommended. See the \(aqsphinxsetup\(aq \%<#\:latexsphinxsetup> \fBiconpackage\fP key for more. .sp Additional packages are needed in some circumstances: .INDENT 7.0 .IP \(bu 2 \fBtexlive\-lang\-cyrillic\fP for Cyrillic (and also then \fBcm\-super\fP if using the default fonts), .IP \(bu 2 \fBtexlive\-lang\-greek\fP for Greek (and also then \fBcm\-super\fP if using the default fonts), .IP \(bu 2 \fBtexlive\-xetex\fP if \fBlatex_engine\fP \%<#\:confval-latex_engine> is \fB\(aqxelatex\(aq\fP, .IP \(bu 2 \fBtexlive\-luatex\fP if \fBlatex_engine\fP \%<#\:confval-latex_engine> is \fB\(aqlualatex\(aq\fP, .IP \(bu 2 \fBfonts\-freefont\-otf\fP if \fBlatex_engine\fP \%<#\:confval-latex_engine> is either \fB\(aqxelatex\(aq\fP or \fB\(aqlualatex\(aq\fP\&. .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 Since 1.6, \fBmake latexpdf\fP uses on GNU/Linux and macOS \fBlatexmk\fP, as it makes sure the needed number of runs is automatically executed. On Windows the PDF builds execute a fix number of LaTeX runs (three, then \fBmakeindex\fP, then two more). .sp One can pass to \fBlatexmk\fP options via the \fBLATEXMKOPTS\fP Makefile variable. For example: .INDENT 0.0 .INDENT 3.5 .sp .EX make latexpdf LATEXMKOPTS=\(dq\-silent\(dq .EE .UNINDENT .UNINDENT .sp reduces console output to a minimum. .sp Also, if \fBlatexmk\fP is at version 4.52b or higher (January 2017) \fBLATEXMKOPTS=\(dq\-xelatex\(dq\fP speeds up PDF builds via XeLateX in case of numerous graphics inclusions. .sp To pass options directly to the \fB(pdf|xe|lua)latex\fP binary, use variable \fBLATEXOPTS\fP, for example: .INDENT 0.0 .INDENT 3.5 .sp .EX make latexpdf LATEXOPTS=\(dq\-\-halt\-on\-error\(dq .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B name = \(aqlatex\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqlatex\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqapplication/pdf\(aq, \(aqimage/png\(aq, \(aqimage/jpeg\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .UNINDENT .sp Note that a direct PDF builder is being provided by rinohtype \%<https://\:github\:.com/\:brechtm/\:rinohtype>\&. The builder\(aqs name is \fBrinoh\fP\&. Refer to the rinohtype manual \%<https://\:www\:.mos6581\:.org/\:rinohtype/\:master/\:quickstart\:.html#\:sphinx-builder> for details. .INDENT 0.0 .TP .B class sphinx.builders.text.TextBuilder This builder produces a text file for each reStructuredText file. This is almost the same as the reStructuredText source, but with much of the markup stripped for better readability. .INDENT 7.0 .TP .B name = \(aqtext\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqtext\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Added in version 0.4. .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.manpage.ManualPageBuilder This builder produces manual pages in the groff format. You have to specify which documents are to be included in which manual pages via the \fBman_pages\fP \%<#\:confval-man_pages> configuration value. .INDENT 7.0 .TP .B name = \(aqman\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqman\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.texinfo.TexinfoBuilder This builder produces Texinfo files that can be processed into Info files by the \fBmakeinfo\fP program. You have to specify which documents are to be included in which Texinfo files via the \fBtexinfo_documents\fP \%<#\:confval-texinfo_documents> configuration value. .sp The Info format is the basis of the on\-line help system used by GNU Emacs and the terminal\-based program \fBinfo\fP\&. See Texinfo info \%<#\:texinfo-faq> for more details. The Texinfo format is the official documentation system used by the GNU project. More information on Texinfo can be found at \%<https://\:www\:.gnu\:.org/\:software/\:texinfo/>\&. .INDENT 7.0 .TP .B name = \(aqtexinfo\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqtexinfo\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqimage/png\(aq, \(aqimage/jpeg\(aq, \(aqimage/gif\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B class sphinxcontrib.serializinghtml.SerializingHTMLBuilder This builder uses a module that implements the Python serialization API (\fBpickle\fP, \fBsimplejson\fP, \fBphpserialize\fP, and others) to dump the generated HTML documentation. The pickle builder is a subclass of it. .sp A concrete subclass of this builder serializing to the PHP serialization \%<https://\:pypi\:.org/\:project/\:phpserialize/> format could look like this: .INDENT 7.0 .INDENT 3.5 .sp .EX import phpserialize class PHPSerializedBuilder(SerializingHTMLBuilder): name = \(aqphpserialized\(aq implementation = phpserialize out_suffix = \(aq.file.phpdump\(aq globalcontext_filename = \(aqglobalcontext.phpdump\(aq searchindex_filename = \(aqsearchindex.phpdump\(aq .EE .UNINDENT .UNINDENT .INDENT 7.0 .TP .B implementation A module that implements \fBdump()\fP, \fBload()\fP, \fBdumps()\fP and \fBloads()\fP functions that conform to the functions with the same names from the pickle module. Known modules implementing this interface are \fBsimplejson\fP, \fBphpserialize\fP, \fBplistlib\fP, and others. .UNINDENT .INDENT 7.0 .TP .B out_suffix The suffix for all regular files. .UNINDENT .INDENT 7.0 .TP .B globalcontext_filename The filename for the file that contains the \(dqglobal context\(dq. This is a dict with some general configuration values such as the name of the project. .UNINDENT .INDENT 7.0 .TP .B searchindex_filename The filename for the search index Sphinx generates. .UNINDENT .sp See Serialization builder details for details about the output format. .sp Added in version 0.5. .UNINDENT .INDENT 0.0 .TP .B class sphinxcontrib.serializinghtml.PickleHTMLBuilder This builder produces a directory with pickle files containing mostly HTML fragments and TOC information, for use of a web application (or custom postprocessing tool) that doesn\(aqt use the standard HTML templates. .sp See Serialization builder details for details about the output format. .INDENT 7.0 .TP .B name = \(aqpickle\(aq The builder\(aqs name. This is the value used to select builders on the command line. .sp The old name \fBweb\fP still works as well. .UNINDENT .INDENT 7.0 .TP .B format = \(aqhtml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqimage/svg+xml\(aq, \(aqimage/png\(aq, \(aqimage/gif\(aq, \(aqimage/jpeg\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp The file suffix is \fB\&.fpickle\fP\&. The global context is called \fBglobalcontext.pickle\fP, the search index \fBsearchindex.pickle\fP\&. .UNINDENT .INDENT 0.0 .TP .B class sphinxcontrib.serializinghtml.JSONHTMLBuilder This builder produces a directory with JSON files containing mostly HTML fragments and TOC information, for use of a web application (or custom postprocessing tool) that doesn\(aqt use the standard HTML templates. .sp See Serialization builder details for details about the output format. .INDENT 7.0 .TP .B name = \(aqjson\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqhtml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [\(aqimage/svg+xml\(aq, \(aqimage/png\(aq, \(aqimage/gif\(aq, \(aqimage/jpeg\(aq] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp The file suffix is \fB\&.fjson\fP\&. The global context is called \fBglobalcontext.json\fP, the search index \fBsearchindex.json\fP\&. .sp Added in version 0.5. .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.gettext.MessageCatalogBuilder This builder produces gettext\-style message catalogs. Each top\-level file or subdirectory grows a single \fB\&.pot\fP catalog template. .sp See the documentation on Internationalization \%<#\:intl> for further reference. .INDENT 7.0 .TP .B name = \(aqgettext\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aq\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.changes.ChangesBuilder This builder produces an HTML overview of all \fBversionadded\fP \%<#\:directive-versionadded>, \fBversionchanged\fP \%<#\:directive-versionchanged>, \fBdeprecated\fP \%<#\:directive-deprecated> and \fBversionremoved\fP \%<#\:directive-versionremoved> directives for the current \fBversion\fP \%<#\:confval-version>\&. This is useful to generate a changelog file, for example. .INDENT 7.0 .TP .B name = \(aqchanges\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aq\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.dummy.DummyBuilder This builder produces no output. The input is only parsed and checked for consistency. This is useful for linting purposes. .INDENT 7.0 .TP .B name = \(aqdummy\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Added in version 1.4. .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.linkcheck.CheckExternalLinksBuilder This builder scans all documents for external links, tries to open them with \fBrequests\fP, and writes an overview which ones are broken and redirected to standard output and to \fBoutput.txt\fP in the output directory. .INDENT 7.0 .TP .B name = \(aqlinkcheck\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aq\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Changed in version 1.5: Since Sphinx 1.5, the linkcheck builder uses the requests module. .sp Changed in version 3.4: The linkcheck builder retries links when servers apply rate limits. .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.xml.XMLBuilder This builder produces Docutils\-native XML files. The output can be transformed with standard XML tools such as XSLT processors into arbitrary final forms. .INDENT 7.0 .TP .B name = \(aqxml\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqxml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B class sphinx.builders.xml.PseudoXMLBuilder This builder is used for debugging the Sphinx/Docutils \(dqReader to Transform to Writer\(dq pipeline. It produces compact pretty\-printed \(dqpseudo\-XML\(dq, files where nesting is indicated by indentation (no end\-tags). External attributes for all elements are output, and internal attributes for any leftover \(dqpending\(dq elements are also given. .INDENT 7.0 .TP .B name = \(aqpseudoxml\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format = \(aqpseudoxml\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B supported_image_types = [] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .sp Added in version 1.2. .UNINDENT .sp Built\-in Sphinx extensions that offer more builders are: .INDENT 0.0 .IP \(bu 2 \fBdoctest\fP \%<#\:module-sphinx\:.ext\:.doctest> .IP \(bu 2 \fBcoverage\fP \%<#\:module-sphinx\:.ext\:.coverage> .UNINDENT .SS Serialization builder details .sp All serialization builders outputs one file per source file and a few special files. They also copy the reStructuredText source files to the \fB_sources\fP directory under the output directory. .sp The \fBPickleHTMLBuilder\fP is a builtin subclass that implements the pickle serialization interface. .sp The files per source file have the extensions of \fBout_suffix\fP, and are arranged in directories just as the source files are. They unserialize to a dictionary (or dictionary like structure) with these keys: .INDENT 0.0 .TP .B \fBbody\fP The HTML \(dqbody\(dq (that is, the HTML rendering of the source file), as rendered by the HTML translator. .TP .B \fBtitle\fP The title of the document, as HTML (may contain markup). .TP .B \fBtoc\fP The table of contents for the file, rendered as an HTML \fB<ul>\fP\&. .TP .B \fBdisplay_toc\fP A boolean that is \fBTrue\fP if the \fBtoc\fP contains more than one entry. .TP .B \fBcurrent_page_name\fP The document name of the current file. .TP .B \fBparents\fP, \fBprev\fP and \fBnext\fP Information about related chapters in the TOC tree. Each relation is a dictionary with the keys \fBlink\fP (HREF for the relation) and \fBtitle\fP (title of the related document, as HTML). \fBparents\fP is a list of relations, while \fBprev\fP and \fBnext\fP are a single relation. .TP .B \fBsourcename\fP The name of the source file under \fB_sources\fP\&. .UNINDENT .sp The special files are located in the root output directory. They are: .INDENT 0.0 .TP .B \fBSerializingHTMLBuilder.globalcontext_filename\fP A pickled dict with these keys: .INDENT 7.0 .TP .B \fBproject\fP, \fBcopyright\fP, \fBrelease\fP, \fBversion\fP The same values as given in the configuration file. .TP .B \fBstyle\fP \fBhtml_style\fP \%<#\:confval-html_style>\&. .TP .B \fBlast_updated\fP Date of last build. .TP .B \fBbuilder\fP Name of the used builder, in the case of pickles this is always \fB\(aqpickle\(aq\fP\&. .TP .B \fBtitles\fP A dictionary of all documents\(aq titles, as HTML strings. .UNINDENT .TP .B \fBSerializingHTMLBuilder.searchindex_filename\fP An index that can be used for searching the documentation. It is a pickled list with these entries: .INDENT 7.0 .IP \(bu 2 A list of indexed docnames. .IP \(bu 2 A list of document titles, as HTML strings, in the same order as the first list. .IP \(bu 2 A dict mapping word roots (processed by an English\-language stemmer) to a list of integers, which are indices into the first list. .UNINDENT .TP .B \fBenvironment.pickle\fP The build environment. This is always a pickle file, independent of the builder and a copy of the environment that was used when the builder was started. .INDENT 7.0 .INDENT 3.5 .SS Todo .sp Document common members. .UNINDENT .UNINDENT .sp Unlike the other pickle files this pickle file requires that the \fBsphinx\fP package is available on unpickling. .UNINDENT .SS Domains .sp Added in version 1.0. .sp Originally, Sphinx was conceived for a single project, the documentation of the Python language. Shortly afterwards, it was made available for everyone as a documentation tool, but the documentation of Python modules remained deeply built in \-\- the most fundamental directives, like \fBfunction\fP, were designed for Python objects. Since Sphinx has become somewhat popular, interest developed in using it for many different purposes: C/C++ projects, JavaScript, or even reStructuredText markup (like in this documentation). .sp While this was always possible, it is now much easier to easily support documentation of projects using different programming languages or even ones not supported by the main Sphinx distribution, by providing a \fBdomain\fP for every such purpose. .sp A domain is a collection of markup (reStructuredText directive \%<#\:term-directive>s and role \%<#\:term-role>s) to describe and link to object \%<#\:term-object>s belonging together, e.g. elements of a programming language. Directive and role names in a domain have names like \fBdomain:name\fP, e.g. \fBpy:function\fP\&. Domains can also provide custom indices (like the Python Module Index). .sp Having domains means that there are no naming problems when one set of documentation wants to refer to e.g. C++ and Python classes. It also means that extensions that support the documentation of whole new languages are much easier to write. .sp This section describes what the domains that are included with Sphinx provide. The domain API is documented as well, in the section Domain API \%<#\:domain-api>\&. .SS Built\-in domains .sp The following domains are included within Sphinx: .SS The Standard Domain .sp Added in version 1.0. .sp The so\-called \(dqstandard\(dq domain collects all markup that doesn\(aqt warrant a domain of its own. Its directives and roles are not prefixed with a domain name. .sp The standard domain is also where custom object descriptions, added using the \fBadd_object_type()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_object_type> API, are placed. .sp There is a set of directives allowing documenting command\-line programs: .INDENT 0.0 .TP .B \&.. option:: name args, name args, ... Describes a command line argument or switch. Option argument names should be enclosed in angle brackets. Examples: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. option:: dest_dir Destination directory. \&.. option:: \-m <module>, \-\-module <module> Run a module as a script. .EE .UNINDENT .UNINDENT .sp The directive will create cross\-reference targets for the given options, referenceable by \fBoption\fP \%<#\:role-option> (in the example case, you\(aqd use something like \fB:option:\(gadest_dir\(ga\fP, \fB:option:\(ga\-m\(ga\fP, or \fB:option:\(ga\-\-module\(ga\fP). .sp Changed in version 5.3: One can cross\-reference including an option value: \fB:option:\(ga\-\-module=foobar\(ga\fP, ,\(ga\(ga:option:\fI\-\-module[=foobar]\(ga\(ga\fP or \fB:option:\(ga\-\-module foobar\(ga\fP\&. .sp Use \fBoption_emphasise_placeholders\fP \%<#\:confval-option_emphasise_placeholders> for parsing of \(dqvariable part\(dq of a literal text (similarly to the \fBsamp\fP \%<#\:role-samp> role). .sp \fBcmdoption\fP directive is a deprecated alias for the \fBoption\fP directive. .UNINDENT .INDENT 0.0 .TP .B \&.. confval:: name Added in version 7.4. .sp Describes a configuration value or setting that the documented code or program uses or defines. Referenceable by \fBconfval\fP \%<#\:role-confval>\&. .INDENT 7.0 .TP .B :type: (text) Describes the type of the configuration value. This is optional, and if specified will be interpreted as reStructuredText. .UNINDENT .INDENT 7.0 .TP .B :default: (text) Describes the default value of the configuration value. This is optional, and if specified will be interpreted as reStructuredText. .UNINDENT .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. confval:: the_answer :type: \(ga\(gaint\(ga\(ga (a *number*) :default: **42** This is a setting that controls the value of the answer. .EE .UNINDENT .UNINDENT .sp will be rendered as follows: .INDENT 7.0 .TP .B the_answer .INDENT 7.0 .TP .B Type \fBint\fP (a \fInumber\fP).TP .B Default \fB42\fP.UNINDENT .sp This is a setting that controls the value of the answer. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. envvar:: name Describes an environment variable that the documented code or program uses or defines. Referenceable by \fBenvvar\fP \%<#\:role-envvar>\&. .UNINDENT .INDENT 0.0 .TP .B \&.. program:: name Like \fBpy:currentmodule\fP \%<#\:directive-py-currentmodule>, this directive produces no output. Instead, it serves to notify Sphinx that all following \fBoption\fP directives document options for the program called \fIname\fP\&. .sp If you use \fBprogram\fP, you have to qualify the references in your \fBoption\fP \%<#\:role-option> roles by the program name, so if you have the following situation .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. program:: rm \&.. option:: \-r Work recursively. \&.. program:: svn \&.. option:: \-r <revision> Specify the revision to work upon. .EE .UNINDENT .UNINDENT .sp then \fB:option:\(garm \-r\(ga\fP would refer to the first option, while \fB:option:\(gasvn \-r\(ga\fP would refer to the second one. .sp If \fBNone\fP is passed to the argument, the directive will reset the current program name. .sp The program name may contain spaces (in case you want to document subcommands like \fBsvn add\fP and \fBsvn commit\fP separately). .sp Added in version 0.5. .UNINDENT .sp There is also a very generic object description directive, which is not tied to any domain: .INDENT 0.0 .TP .B \&.. describe:: text .TP .B \&.. object:: text This directive produces the same formatting as the specific ones provided by domains, but does not create index entries or cross\-referencing targets. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. describe:: PAPER You can set this variable to select a paper size. .EE .UNINDENT .UNINDENT .UNINDENT .SS The C Domain .sp Added in version 1.0. .sp The C domain (name \fBc\fP) is suited for documentation of C API. .INDENT 0.0 .TP .B \&.. c:member:: declaration .TP .B \&.. c:var:: declaration Describes a C struct member or variable. Example signature: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. c:member:: PyObject *PyTypeObject.tp_bases .EE .UNINDENT .UNINDENT .sp The difference between the two directives is only cosmetic. .UNINDENT .INDENT 0.0 .TP .B \&.. c:function:: function prototype Describes a C function. The signature should be given as in C, e.g.: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. c:function:: PyObject *PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems) .EE .UNINDENT .UNINDENT .sp Note that you don\(aqt have to backslash\-escape asterisks in the signature, as it is not parsed by the reStructuredText inliner. .sp In the description of a function you can use the following info fields (see also Info field lists \%<#\:info-field-lists>). .INDENT 7.0 .IP \(bu 2 \fBparam\fP, \fBparameter\fP, \fBarg\fP, \fBargument\fP, Description of a parameter. .IP \(bu 2 \fBtype\fP: Type of a parameter, written as if passed to the \fBc:expr\fP role. .IP \(bu 2 \fBreturns\fP, \fBreturn\fP: Description of the return value. .IP \(bu 2 \fBrtype\fP: Return type, written as if passed to the \fBc:expr\fP role. .IP \(bu 2 \fBretval\fP, \fBretvals\fP: An alternative to \fBreturns\fP for describing the result of the function. .UNINDENT .sp Added in version 4.3: The \fBretval\fP field type. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. c:function:: PyObject *PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems) :param type: description of the first parameter. :param nitems: description of the second parameter. :returns: a result. :retval NULL: under some conditions. :retval NULL: under some other conditions as well. .EE .UNINDENT .UNINDENT .sp which renders as .INDENT 7.0 .TP .B PyObject \%<https://\:docs\:.python\:.org/\:3/\:c-api/\:structures\:.html#\:c\:.PyObject> *PyType_GenericAlloc(PyTypeObject \%<https://\:docs\:.python\:.org/\:3/\:c-api/\:type\:.html#\:c\:.PyTypeObject> *type, Py_ssize_t \%<https://\:docs\:.python\:.org/\:3/\:c-api/\:intro\:.html#\:c\:.Py_ssize_t> nitems) .INDENT 7.0 .TP .B No\-contents\-entry .TP .B No\-index\-entry .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtype\fP \-\- description of the first parameter. .IP \(bu 2 \fBnitems\fP \-\- description of the second parameter. .UNINDENT .TP .B Returns a result. .TP .B Return values .INDENT 7.0 .IP \(bu 2 \fBNULL\fP \-\- under some conditions. .IP \(bu 2 \fBNULL\fP \-\- under some other conditions as well. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :single\-line\-parameter\-list: (no value) Ensures that the function\(aqs parameters will be emitted on a single logical line, overriding \fBc_maximum_signature_line_length\fP \%<#\:confval-c_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.1. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. c:macro:: name .TP .B \&.. c:macro:: name(arg list) Describes a C macro, i.e., a C\-language \fB#define\fP, without the replacement text. .sp In the description of a macro you can use the same info fields as for the \fBc:function\fP directive. .sp Added in version 3.0: The function style variant. .INDENT 7.0 .TP .B :single\-line\-parameter\-list: (no value) Ensures that the macro\(aqs parameters will be emitted on a single logical line, overriding \fBc_maximum_signature_line_length\fP \%<#\:confval-c_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.1. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. c:struct:: name Describes a C struct. .sp Added in version 3.0. .UNINDENT .INDENT 0.0 .TP .B \&.. c:union:: name Describes a C union. .sp Added in version 3.0. .UNINDENT .INDENT 0.0 .TP .B \&.. c:enum:: name Describes a C enum. .sp Added in version 3.0. .UNINDENT .INDENT 0.0 .TP .B \&.. c:enumerator:: name Describes a C enumerator. .sp Added in version 3.0. .UNINDENT .INDENT 0.0 .TP .B \&.. c:type:: typedef\-like declaration .TP .B \&.. c:type:: name Describes a C type, either as a typedef, or the alias for an unspecified type. .UNINDENT .SS Cross\-referencing C constructs .sp The following roles create cross\-references to C\-language constructs if they are defined in the documentation: .INDENT 0.0 .TP .B :c:member: .TP .B :c:data: .TP .B :c:var: .TP .B :c:func: .TP .B :c:macro: .TP .B :c:struct: .TP .B :c:union: .TP .B :c:enum: .TP .B :c:enumerator: .TP .B :c:type: Reference a C declaration, as defined above. Note that \fBc:member\fP, \fBc:data\fP, and \fBc:var\fP are equivalent. .sp Added in version 3.0: The var, struct, union, enum, and enumerator roles. .UNINDENT .SS Anonymous Entities .sp C supports anonymous structs, enums, and unions. For the sake of documentation they must be given some name that starts with \fB@\fP, e.g., \fB@42\fP or \fB@data\fP\&. These names can also be used in cross\-references, though nested symbols will be found even when omitted. The \fB@...\fP name will always be rendered as \fB[anonymous]\fP (possibly as a link). .sp Example: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. c:struct:: Data .. c:union:: @data .. c:var:: int a .. c:var:: double b Explicit ref: :c:var:\(gaData.@data.a\(ga. Short\-hand ref: :c:var:\(gaData.a\(ga. .EE .UNINDENT .UNINDENT .sp This will be rendered as: .INDENT 0.0 .TP .B struct Data .INDENT 7.0 .TP .B union [anonymous] .INDENT 7.0 .TP .B int a .UNINDENT .INDENT 7.0 .TP .B double b .UNINDENT .UNINDENT .UNINDENT .sp Explicit ref: \fBData.[anonymous].a\fP\&. Short\-hand ref: \fBData.a\fP\&. .sp Added in version 3.0. .SS Aliasing Declarations .sp Sometimes it may be helpful list declarations elsewhere than their main documentation, e.g., when creating a synopsis of an interface. The following directive can be used for this purpose. .INDENT 0.0 .TP .B \&.. c:alias:: name Insert one or more alias declarations. Each entity can be specified as they can in the \fBc:any\fP role. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. c:var:: int data \&.. c:function:: int f(double k) \&.. c:alias:: data f .EE .UNINDENT .UNINDENT .sp becomes .INDENT 7.0 .TP .B int data .UNINDENT .INDENT 7.0 .TP .B int f(double k) .UNINDENT .INDENT 7.0 .TP .B int data \%<#\:c\:.@\:alias\:.data> .TP .B int f \%<#\:c\:.@\:alias.f>(double k) .UNINDENT .sp Added in version 3.2. .sp Options .INDENT 7.0 .TP .B :maxdepth: int Insert nested declarations as well, up to the total depth given. Use 0 for infinite depth and 1 for just the mentioned declaration. Defaults to 1. .sp Added in version 3.3. .UNINDENT .INDENT 7.0 .TP .B :noroot: Skip the mentioned declarations and only render nested declarations. Requires \fBmaxdepth\fP either 0 or at least 2. .sp Added in version 3.5. .UNINDENT .UNINDENT .SS Inline Expressions and Types .INDENT 0.0 .TP .B :c:expr: .TP .B :c:texpr: Insert a C expression or type either as inline code (\fBcpp:expr\fP) or inline text (\fBcpp:texpr\fP). For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. c:var:: int a = 42 \&.. c:function:: int f(int i) An expression: :c:expr:\(gaa * f(a)\(ga (or as text: :c:texpr:\(gaa * f(a)\(ga). A type: :c:expr:\(gaconst Data*\(ga (or as text :c:texpr:\(gaconst Data*\(ga). .EE .UNINDENT .UNINDENT .sp will be rendered as follows: .INDENT 7.0 .TP .B int a = 42 .UNINDENT .INDENT 7.0 .TP .B int f(int i) .UNINDENT .sp An expression: a \%<#\:c.a> * f \%<#\:c.f>(a \%<#\:c.a>) (or as text: a \%<#\:c.a> * f \%<#\:c.f>(a \%<#\:c.a>)). .sp A type: const Data \%<#\:c\:.Data>* (or as text const Data \%<#\:c\:.Data>*). .sp Added in version 3.0. .UNINDENT .SS Namespacing .sp Added in version 3.1. .sp The C language it self does not support namespacing, but it can sometimes be useful to emulate it in documentation, e.g., to show alternate declarations. The feature may also be used to document members of structs/unions/enums separate from their parent declaration. .sp The current scope can be changed using three namespace directives. They manage a stack declarations where \fBc:namespace\fP resets the stack and changes a given scope. .sp The \fBc:namespace\-push\fP directive changes the scope to a given inner scope of the current one. .sp The \fBc:namespace\-pop\fP directive undoes the most recent \fBc:namespace\-push\fP directive. .INDENT 0.0 .TP .B \&.. c:namespace:: scope specification Changes the current scope for the subsequent objects to the given scope, and resets the namespace directive stack. Note that nested scopes can be specified by separating with a dot, e.g.: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. c:namespace:: Namespace1.Namespace2.SomeStruct.AnInnerStruct .EE .UNINDENT .UNINDENT .sp All subsequent objects will be defined as if their name were declared with the scope prepended. The subsequent cross\-references will be searched for starting in the current scope. .sp Using \fBNULL\fP or \fB0\fP as the scope will change to global scope. .UNINDENT .INDENT 0.0 .TP .B \&.. c:namespace\-push:: scope specification Change the scope relatively to the current scope. For example, after: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. c:namespace:: A.B \&.. c:namespace\-push:: C.D .EE .UNINDENT .UNINDENT .sp the current scope will be \fBA.B.C.D\fP\&. .UNINDENT .INDENT 0.0 .TP .B \&.. c:namespace\-pop:: Undo the previous \fBc:namespace\-push\fP directive (\fInot\fP just pop a scope). For example, after: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. c:namespace:: A.B \&.. c:namespace\-push:: C.D \&.. c:namespace\-pop:: .EE .UNINDENT .UNINDENT .sp the current scope will be \fBA.B\fP (\fInot\fP \fBA.B.C\fP). .sp If no previous \fBc:namespace\-push\fP directive has been used, but only a \fBc:namespace\fP directive, then the current scope will be reset to global scope. That is, \fB\&.. c:namespace:: A.B\fP is equivalent to: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. c:namespace:: NULL \&.. c:namespace\-push:: A.B .EE .UNINDENT .UNINDENT .UNINDENT .SS Configuration Variables .sp See Options for the C domain \%<#\:c-config>\&. .SS The C++ Domain .sp Added in version 1.0. .sp The C++ domain (name \fBcpp\fP) supports documenting C++ projects. .SS Directives for Declaring Entities .sp The following directives are available. All declarations can start with a visibility statement (\fBpublic\fP, \fBprivate\fP or \fBprotected\fP). .INDENT 0.0 .TP .B \&.. cpp:class:: class specifier .TP .B \&.. cpp:struct:: class specifier Describe a class/struct, possibly with specification of inheritance, e.g.,: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:class:: MyClass : public MyBase, MyOtherBase .EE .UNINDENT .UNINDENT .sp The difference between \fBcpp:class\fP and \fBcpp:struct\fP is only cosmetic: the prefix rendered in the output, and the specifier shown in the index. .sp The class can be directly declared inside a nested scope, e.g.,: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:class:: OuterScope::MyClass : public MyBase, MyOtherBase .EE .UNINDENT .UNINDENT .sp A class template can be declared: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:class:: template<typename T, std::size_t N> std::array .EE .UNINDENT .UNINDENT .sp or with a line break: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:class:: template<typename T, std::size_t N> \e std::array .EE .UNINDENT .UNINDENT .sp Full and partial template specialisations can be declared: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:class:: template<> \e std::array<bool, 256> \&.. cpp:class:: template<typename T> \e std::array<T, 42> .EE .UNINDENT .UNINDENT .sp Added in version 2.0: The \fBcpp:struct\fP directive. .UNINDENT .INDENT 0.0 .TP .B \&.. cpp:function:: (member) function prototype Describe a function or member function, e.g.,: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:function:: bool myMethod(int arg1, std::string arg2) A function with parameters and types. \&.. cpp:function:: bool myMethod(int, double) A function with unnamed parameters. \&.. cpp:function:: const T &MyClass::operator[](std::size_t i) const An overload for the indexing operator. \&.. cpp:function:: operator bool() const A casting operator. \&.. cpp:function:: constexpr void foo(std::string &bar[2]) noexcept A constexpr function. \&.. cpp:function:: MyClass::MyClass(const MyClass&) = default A copy constructor with default implementation. .EE .UNINDENT .UNINDENT .sp Function templates can also be described: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:function:: template<typename U> \e void print(U &&u) .EE .UNINDENT .UNINDENT .sp and function template specialisations: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:function:: template<> \e void print(int i) .EE .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :single\-line\-parameter\-list: (no value) Ensures that the function\(aqs parameters will be emitted on a single logical line, overriding \fBcpp_maximum_signature_line_length\fP \%<#\:confval-cpp_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.1. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. cpp:member:: (member) variable declaration .TP .B \&.. cpp:var:: (member) variable declaration Describe a variable or member variable, e.g.,: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:member:: std::string MyClass::myMember \&.. cpp:var:: std::string MyClass::myOtherMember[N][M] \&.. cpp:member:: int a = 42 .EE .UNINDENT .UNINDENT .sp Variable templates can also be described: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:member:: template<class T> \e constexpr T pi = T(3.1415926535897932385) .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. cpp:type:: typedef declaration .TP .B \&.. cpp:type:: name .TP .B \&.. cpp:type:: type alias declaration Describe a type as in a typedef declaration, a type alias declaration, or simply the name of a type with unspecified type, e.g.,: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:type:: std::vector<int> MyList A typedef\-like declaration of a type. \&.. cpp:type:: MyContainer::const_iterator Declaration of a type alias with unspecified type. \&.. cpp:type:: MyType = std::unordered_map<int, std::string> Declaration of a type alias. .EE .UNINDENT .UNINDENT .sp A type alias can also be templated: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:type:: template<typename T> \e MyContainer = std::vector<T> .EE .UNINDENT .UNINDENT .sp The example are rendered as follows. .INDENT 7.0 .TP .B typedef std::vector<int> MyList A typedef\-like declaration of a type. .UNINDENT .INDENT 7.0 .TP .B type MyContainer::const_iterator Declaration of a type alias with unspecified type. .UNINDENT .INDENT 7.0 .TP .B using MyType = std::unordered_map<int, std::string> Declaration of a type alias. .UNINDENT .INDENT 7.0 .TP .B template<typename T> using MyContainer = std::vector<T \%<#\:_CPPv4I0E11MyContainer>> .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. cpp:enum:: unscoped enum declaration .TP .B \&.. cpp:enum\-struct:: scoped enum declaration .TP .B \&.. cpp:enum\-class:: scoped enum declaration Describe a (scoped) enum, possibly with the underlying type specified. Any enumerators declared inside an unscoped enum will be declared both in the enum scope and in the parent scope. Examples: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:enum:: MyEnum An unscoped enum. \&.. cpp:enum:: MySpecificEnum : long An unscoped enum with specified underlying type. \&.. cpp:enum\-class:: MyScopedEnum A scoped enum. \&.. cpp:enum\-struct:: protected MyScopedVisibilityEnum : std::underlying_type<MySpecificEnum>::type A scoped enum with non\-default visibility, and with a specified underlying type. .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. cpp:enumerator:: name .TP .B \&.. cpp:enumerator:: name = constant Describe an enumerator, optionally with its value defined, e.g.,: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:enumerator:: MyEnum::myEnumerator \&.. cpp:enumerator:: MyEnum::myOtherEnumerator = 42 .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. cpp:union:: name Describe a union. .sp Added in version 1.8. .UNINDENT .INDENT 0.0 .TP .B \&.. cpp:concept:: template\-parameter\-list name .sp \fBWarning:\fP .INDENT 7.0 .INDENT 3.5 The support for concepts is experimental. It is based on the current draft standard and the Concepts Technical Specification. The features may change as they evolve. .UNINDENT .UNINDENT .sp Describe a concept. It must have exactly 1 template parameter list. The name may be a nested name. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:concept:: template<typename It> std::Iterator Proxy to an element of a notional sequence that can be compared, indirected, or incremented. **Notation** .. cpp:var:: It r An lvalue. **Valid Expressions** \- :cpp:expr:\(ga*r\(ga, when :cpp:expr:\(gar\(ga is dereferenceable. \- :cpp:expr:\(ga++r\(ga, with return type :cpp:expr:\(gaIt&\(ga, when :cpp:expr:\(gar\(ga is incrementable. .EE .UNINDENT .UNINDENT .sp This will render as follows: .INDENT 7.0 .TP .B template<typename It> concept std::Iterator Proxy to an element of a notional sequence that can be compared, indirected, or incremented. .sp \fBNotation\fP .INDENT 7.0 .TP .B It \%<#\:_CPPv4I0ENSt8IteratorE> r An lvalue. .UNINDENT .sp \fBValid Expressions\fP .INDENT 7.0 .IP \(bu 2 *r \%<#\:_CPPv4NSt8Iterator1rE>, when r \%<#\:_CPPv4NSt8Iterator1rE> is dereferenceable. .IP \(bu 2 ++r \%<#\:_CPPv4NSt8Iterator1rE>, with return type It \%<#\:_CPPv4I0ENSt8IteratorE>&, when r \%<#\:_CPPv4NSt8Iterator1rE> is incrementable. .UNINDENT .UNINDENT .sp Added in version 1.5. .UNINDENT .SS Options .sp Some directives support options: .INDENT 0.0 .IP \(bu 2 \fB:no\-index\-entry:\fP and \fB:no\-contents\-entry:\fP, see Basic Markup \%<#\:basic-domain-markup>\&. .IP \(bu 2 \fB:tparam\-line\-spec:\fP, for templated declarations. If specified, each template parameter will be rendered on a separate line. .sp Added in version 1.6. .UNINDENT .SS Anonymous Entities .sp C++ supports anonymous namespaces, classes, enums, and unions. For the sake of documentation they must be given some name that starts with \fB@\fP, e.g., \fB@42\fP or \fB@data\fP\&. These names can also be used in cross\-references and (type) expressions, though nested symbols will be found even when omitted. The \fB@...\fP name will always be rendered as \fB[anonymous]\fP (possibly as a link). .sp Example: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. cpp:class:: Data .. cpp:union:: @data .. cpp:var:: int a .. cpp:var:: double b Explicit ref: :cpp:var:\(gaData::@data::a\(ga. Short\-hand ref: :cpp:var:\(gaData::a\(ga. .EE .UNINDENT .UNINDENT .sp This will be rendered as: .INDENT 0.0 .TP .B class Data .INDENT 7.0 .TP .B union [anonymous] .INDENT 7.0 .TP .B int a .UNINDENT .INDENT 7.0 .TP .B double b .UNINDENT .UNINDENT .UNINDENT .sp Explicit ref: \fBData::[anonymous]::a\fP\&. Short\-hand ref: \fBData::a\fP\&. .sp Added in version 1.8. .SS Aliasing Declarations .sp Sometimes it may be helpful list declarations elsewhere than their main documentation, e.g., when creating a synopsis of a class interface. The following directive can be used for this purpose. .INDENT 0.0 .TP .B \&.. cpp:alias:: name or function signature Insert one or more alias declarations. Each entity can be specified as they can in the \fBcpp:any\fP role. If the name of a function is given (as opposed to the complete signature), then all overloads of the function will be listed. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:alias:: Data::a overload_example::C::f .EE .UNINDENT .UNINDENT .sp becomes .INDENT 7.0 .TP .B int a \%<#\:_CPPv4N4DataUt4_data1aE> .TP .B void f \%<#\:_CPPv4NK16overload_example1C1fEd>(double d) const .TP .B void f \%<#\:_CPPv4N16overload_example1C1fEd>(double d) .TP .B void f \%<#\:_CPPv4N16overload_example1C1fEi>(int i) .TP .B void f \%<#\:_CPPv4N16overload_example1C1fEv>() .UNINDENT .sp whereas: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:alias:: void overload_example::C::f(double d) const void overload_example::C::f(double d) .EE .UNINDENT .UNINDENT .sp becomes .INDENT 7.0 .TP .B void f \%<#\:_CPPv4NK16overload_example1C1fEd>(double d) const .TP .B void f \%<#\:_CPPv4N16overload_example1C1fEd>(double d) .UNINDENT .sp Added in version 2.0. .sp Options .INDENT 7.0 .TP .B :maxdepth: int Insert nested declarations as well, up to the total depth given. Use 0 for infinite depth and 1 for just the mentioned declaration. Defaults to 1. .sp Added in version 3.5. .UNINDENT .INDENT 7.0 .TP .B :noroot: Skip the mentioned declarations and only render nested declarations. Requires \fBmaxdepth\fP either 0 or at least 2. .sp Added in version 3.5. .UNINDENT .UNINDENT .SS Constrained Templates .sp \fBWarning:\fP .INDENT 0.0 .INDENT 3.5 The support for concepts is experimental. It is based on the current draft standard and the Concepts Technical Specification. The features may change as they evolve. .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Sphinx does not currently support \fBrequires\fP clauses. .UNINDENT .UNINDENT .SS Placeholders .sp Declarations may use the name of a concept to introduce constrained template parameters, or the keyword \fBauto\fP to introduce unconstrained template parameters: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. cpp:function:: void f(auto &&arg) A function template with a single unconstrained template parameter. \&.. cpp:function:: void f(std::Iterator it) A function template with a single template parameter, constrained by the Iterator concept. .EE .UNINDENT .UNINDENT .SS Template Introductions .sp Simple constrained function or class templates can be declared with a \fItemplate introduction\fP instead of a template parameter list: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. cpp:function:: std::Iterator{It} void advance(It &it) A function template with a template parameter constrained to be an Iterator. \&.. cpp:class:: std::LessThanComparable{T} MySortedContainer A class template with a template parameter constrained to be LessThanComparable. .EE .UNINDENT .UNINDENT .sp They are rendered as follows. .INDENT 0.0 .TP .B std::Iterator \%<#\:_CPPv4I0ENSt8IteratorE>{It} void advance(It \%<#\:_CPPv4I0EXNSt8IteratorEI2ItEE7advancevR2It> &it) A function template with a template parameter constrained to be an Iterator. .UNINDENT .INDENT 0.0 .TP .B std::LessThanComparable{T} class MySortedContainer A class template with a template parameter constrained to be LessThanComparable. .UNINDENT .sp Note however that no checking is performed with respect to parameter compatibility. E.g., \fBIterator{A, B, C}\fP will be accepted as an introduction even though it would not be valid C++. .SS Inline Expressions and Types .INDENT 0.0 .TP .B :cpp:expr: .TP .B :cpp:texpr: Insert a C++ expression or type either as inline code (\fBcpp:expr\fP) or inline text (\fBcpp:texpr\fP). For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:var:: int a = 42 \&.. cpp:function:: int f(int i) An expression: :cpp:expr:\(gaa * f(a)\(ga (or as text: :cpp:texpr:\(gaa * f(a)\(ga). A type: :cpp:expr:\(gaconst MySortedContainer<int>&\(ga (or as text :cpp:texpr:\(gaconst MySortedContainer<int>&\(ga). .EE .UNINDENT .UNINDENT .sp will be rendered as follows: .INDENT 7.0 .TP .B int a = 42 .UNINDENT .INDENT 7.0 .TP .B int f(int i) .UNINDENT .sp An expression: a \%<#\:_CPPv41a> * f \%<#\:_CPPv41fi>(a \%<#\:_CPPv41a>) (or as text: a \%<#\:_CPPv41a> * f \%<#\:_CPPv41fi>(a \%<#\:_CPPv41a>)). .sp A type: const MySortedContainer \%<#\:_CPPv4I0EXNSt18LessThanComparableEI1TEE17MySortedContainer><int>& (or as text const MySortedContainer \%<#\:_CPPv4I0EXNSt18LessThanComparableEI1TEE17MySortedContainer><int>&). .sp Added in version 1.7: The \fBcpp:expr\fP role. .sp Added in version 1.8: The \fBcpp:texpr\fP role. .UNINDENT .SS Namespacing .sp Declarations in the C++ domain are as default placed in global scope. The current scope can be changed using three namespace directives. They manage a stack declarations where \fBcpp:namespace\fP resets the stack and changes a given scope. .sp The \fBcpp:namespace\-push\fP directive changes the scope to a given inner scope of the current one. .sp The \fBcpp:namespace\-pop\fP directive undoes the most recent \fBcpp:namespace\-push\fP directive. .INDENT 0.0 .TP .B \&.. cpp:namespace:: scope specification Changes the current scope for the subsequent objects to the given scope, and resets the namespace directive stack. Note that the namespace does not need to correspond to C++ namespaces, but can end in names of classes, e.g.,: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:namespace:: Namespace1::Namespace2::SomeClass::AnInnerClass .EE .UNINDENT .UNINDENT .sp All subsequent objects will be defined as if their name were declared with the scope prepended. The subsequent cross\-references will be searched for starting in the current scope. .sp Using \fBNULL\fP, \fB0\fP, or \fBnullptr\fP as the scope will change to global scope. .sp A namespace declaration can also be templated, e.g.,: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:class:: template<typename T> \e std::vector \&.. cpp:namespace:: template<typename T> std::vector \&.. cpp:function:: std::size_t size() const .EE .UNINDENT .UNINDENT .sp declares \fBsize\fP as a member function of the class template \fBstd::vector\fP\&. Equivalently this could have been declared using: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:class:: template<typename T> \e std::vector .. cpp:function:: std::size_t size() const .EE .UNINDENT .UNINDENT .sp or: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:class:: template<typename T> \e std::vector .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. cpp:namespace\-push:: scope specification Change the scope relatively to the current scope. For example, after: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:namespace:: A::B \&.. cpp:namespace\-push:: C::D .EE .UNINDENT .UNINDENT .sp the current scope will be \fBA::B::C::D\fP\&. .sp Added in version 1.4. .UNINDENT .INDENT 0.0 .TP .B \&.. cpp:namespace\-pop:: Undo the previous \fBcpp:namespace\-push\fP directive (\fInot\fP just pop a scope). For example, after: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:namespace:: A::B \&.. cpp:namespace\-push:: C::D \&.. cpp:namespace\-pop:: .EE .UNINDENT .UNINDENT .sp the current scope will be \fBA::B\fP (\fInot\fP \fBA::B::C\fP). .sp If no previous \fBcpp:namespace\-push\fP directive has been used, but only a \fBcpp:namespace\fP directive, then the current scope will be reset to global scope. That is, \fB\&.. cpp:namespace:: A::B\fP is equivalent to: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. cpp:namespace:: nullptr \&.. cpp:namespace\-push:: A::B .EE .UNINDENT .UNINDENT .sp Added in version 1.4. .UNINDENT .SS Info field lists .sp All the C++ directives for declaring entities support the following info fields (see also Info field lists \%<#\:info-field-lists>): .INDENT 0.0 .IP \(bu 2 \fBtparam\fP: Description of a template parameter. .UNINDENT .sp The \fBcpp:function\fP directive additionally supports the following fields: .INDENT 0.0 .IP \(bu 2 \fBparam\fP, \fBparameter\fP, \fBarg\fP, \fBargument\fP: Description of a parameter. .IP \(bu 2 \fBreturns\fP, \fBreturn\fP: Description of a return value. .IP \(bu 2 \fBretval\fP, \fBretvals\fP: An alternative to \fBreturns\fP for describing the result of the function. .IP \(bu 2 \fBthrows\fP, \fBthrow\fP, \fBexception\fP: Description of a possibly thrown exception. .UNINDENT .sp Added in version 4.3: The \fBretval\fP field type. .SS Cross\-referencing .sp These roles link to the given declaration types: .INDENT 0.0 .TP .B :cpp:any: .TP .B :cpp:class: .TP .B :cpp:struct: .TP .B :cpp:func: .TP .B :cpp:member: .TP .B :cpp:var: .TP .B :cpp:type: .TP .B :cpp:concept: .TP .B :cpp:enum: .TP .B :cpp:enumerator: Reference a C++ declaration by name (see below for details). The name must be properly qualified relative to the position of the link. .sp Added in version 2.0: The \fBcpp:struct\fP role as alias for the \fBcpp:class\fP role. .UNINDENT .INDENT 0.0 .INDENT 3.5 .IP "Note on References with Templates Parameters/Arguments" .sp These roles follow the Sphinx Syntax \%<#\:xref-syntax> rules. This means care must be taken when referencing a (partial) template specialization, e.g. if the link looks like this: \fB:cpp:class:\(gaMyClass<int>\(ga\fP\&. This is interpreted as a link to \fBint\fP with a title of \fBMyClass\fP\&. In this case, escape the opening angle bracket with a backslash, like this: \fB:cpp:class:\(gaMyClass\e<int>\(ga\fP\&. .sp When a custom title is not needed it may be useful to use the roles for inline expressions, \fBcpp:expr\fP and \fBcpp:texpr\fP, where angle brackets do not need escaping. .UNINDENT .UNINDENT .SS Declarations without template parameters and template arguments .sp For linking to non\-templated declarations the name must be a nested name, e.g., \fBf\fP or \fBMyClass::f\fP\&. .SS Overloaded (member) functions .sp When a (member) function is referenced using just its name, the reference will point to an arbitrary matching overload. The \fBcpp:any\fP and \fBcpp:func\fP roles use an alternative format, which simply is a complete function declaration. This will resolve to the exact matching overload. As example, consider the following class declaration: .INDENT 0.0 .TP .B class C .INDENT 7.0 .TP .B void f(double d) const .UNINDENT .INDENT 7.0 .TP .B void f(double d) .UNINDENT .INDENT 7.0 .TP .B void f(int i) .UNINDENT .INDENT 7.0 .TP .B void f() .UNINDENT .UNINDENT .sp References using the \fBcpp:func\fP role: .INDENT 0.0 .IP \(bu 2 Arbitrary overload: \fBC::f\fP, \fBC::f()\fP .IP \(bu 2 Also arbitrary overload: \fBC::f()\fP, \fBC::f()\fP .IP \(bu 2 Specific overload: \fBvoid C::f()\fP, \fBvoid C::f()\fP .IP \(bu 2 Specific overload: \fBvoid C::f(int)\fP, \fBvoid C::f(int)\fP .IP \(bu 2 Specific overload: \fBvoid C::f(double)\fP, \fBvoid C::f(double)\fP .IP \(bu 2 Specific overload: \fBvoid C::f(double) const\fP, \fBvoid C::f(double) const\fP .UNINDENT .sp Note that the \fBadd_function_parentheses\fP \%<#\:confval-add_function_parentheses> configuration variable does not influence specific overload references. .SS Templated declarations .sp Assume the following declarations. .INDENT 0.0 .TP .B class Wrapper .INDENT 7.0 .TP .B template<typename TOuter> class Outer .INDENT 7.0 .TP .B template<typename TInner> class Inner .UNINDENT .UNINDENT .UNINDENT .sp In general the reference must include the template parameter declarations, and template arguments for the prefix of qualified names. For example: .INDENT 0.0 .IP \(bu 2 \fBtemplate\e<typename TOuter> Wrapper::Outer\fP (\fBtemplate<typename TOuter> Wrapper::Outer\fP) .IP \(bu 2 \fBtemplate\e<typename TOuter> template\e<typename TInner> Wrapper::Outer<TOuter>::Inner\fP (\fBtemplate<typename TOuter> template<typename TInner> Wrapper::Outer<TOuter>::Inner\fP) .UNINDENT .sp Currently the lookup only succeed if the template parameter identifiers are equal strings. That is, \fBtemplate\e<typename UOuter> Wrapper::Outer\fP will not work. .sp As a shorthand notation, if a template parameter list is omitted, then the lookup will assume either a primary template or a non\-template, but not a partial template specialisation. This means the following references work as well: .INDENT 0.0 .IP \(bu 2 \fBWrapper::Outer\fP (\fBWrapper::Outer\fP) .IP \(bu 2 \fBWrapper::Outer::Inner\fP (\fBWrapper::Outer::Inner\fP) .IP \(bu 2 \fBtemplate\e<typename TInner> Wrapper::Outer::Inner\fP (\fBtemplate<typename TInner> Wrapper::Outer::Inner\fP) .UNINDENT .SS (Full) Template Specialisations .sp Assume the following declarations. .INDENT 0.0 .TP .B template<typename TOuter> class Outer .INDENT 7.0 .TP .B template<typename TInner> class Inner .UNINDENT .UNINDENT .INDENT 0.0 .TP .B template<> class Outer<int> .INDENT 7.0 .TP .B template<typename TInner> class Inner .UNINDENT .INDENT 7.0 .TP .B template<> class Inner<bool> .UNINDENT .UNINDENT .sp In general the reference must include a template parameter list for each template argument list. The full specialisation above can therefore be referenced with \fBtemplate\e<> Outer\e<int>\fP (\fBtemplate<> Outer<int>\fP) and \fBtemplate\e<> template\e<> Outer\e<int>::Inner\e<bool>\fP (\fBtemplate<> template<> Outer<int>::Inner<bool>\fP). As a shorthand the empty template parameter list can be omitted, e.g., \fBOuter\e<int>\fP (\fBOuter<int>\fP) and \fBOuter\e<int>::Inner\e<bool>\fP (\fBOuter<int>::Inner<bool>\fP). .SS Partial Template Specialisations .sp Assume the following declaration. .INDENT 0.0 .TP .B template<typename T> class Outer<T \%<#\:_CPPv4I0E5OuterIP1TE>*> .UNINDENT .sp References to partial specialisations must always include the template parameter lists, e.g., \fBtemplate\e<typename T> Outer\e<T*>\fP (\fBtemplate<typename T> Outer<T*>\fP). Currently the lookup only succeed if the template parameter identifiers are equal strings. .SS Configuration Variables .sp See Options for the C++ domain \%<#\:cpp-config>\&. .SS The JavaScript Domain .sp Added in version 1.0. .sp The JavaScript domain (name \fBjs\fP) provides the following directives: .INDENT 0.0 .TP .B \&.. js:module:: name This directive sets the module name for object declarations that follow after. The module name is used in the global module index and in cross references. This directive does not create an object heading like \fBpy:class\fP \%<#\:directive-py-class> would, for example. .sp By default, this directive will create a linkable entity and will cause an entry in the global module index, unless the \fBno\-index\fP option is specified. If this option is specified, the directive will only update the current module name. .sp Added in version 1.6. .sp Changed in version 5.2: Module directives support body content. .UNINDENT .INDENT 0.0 .TP .B \&.. js:function:: name(signature) Describes a JavaScript function or method. If you want to describe arguments as optional use square brackets as documented \%<#\:signatures> for Python signatures. .sp You can use fields to give more details about arguments and their expected types, errors which may be thrown by the function, and the value being returned: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. js:function:: $.getJSON(href, callback[, errback]) :param string href: An URI to the location of the resource. :param callback: Gets called with the object. :param errback: Gets called in case the request fails. And a lot of other text so we need multiple lines. :throws SomeError: For whatever reason in that case. :returns: Something. .EE .UNINDENT .UNINDENT .sp This is rendered as: .INDENT 7.0 .TP .B $\&.getJSON(href, callback[, errback]) .INDENT 7.0 .TP .B Arguments .INDENT 7.0 .IP \(bu 2 \fBhref\fP (\fBstring\fP) \-\- An URI to the location of the resource. .IP \(bu 2 \fBcallback\fP \-\- Gets called with the object. .IP \(bu 2 \fBerrback\fP \-\- Gets called in case the request fails. And a lot of other text so we need multiple lines. .UNINDENT .TP .B Throws \fBSomeError\fP \-\- For whatever reason in that case. .TP .B Returns Something. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :single\-line\-parameter\-list: (no value) Ensures that the function\(aqs parameters will be emitted on a single logical line, overriding \fBjavascript_maximum_signature_line_length\fP \%<#\:confval-javascript_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.1. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. js:method:: name(signature) This directive is an alias for \fBjs:function\fP, however it describes a function that is implemented as a method on a class object. .sp Added in version 1.6. .INDENT 7.0 .TP .B :single\-line\-parameter\-list: (no value) Ensures that the function\(aqs parameters will be emitted on a single logical line, overriding \fBjavascript_maximum_signature_line_length\fP \%<#\:confval-javascript_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.1. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. js:class:: name Describes a constructor that creates an object. This is basically like a function but will show up with a \fIclass\fP prefix: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. js:class:: MyAnimal(name[, age]) :param string name: The name of the animal :param number age: an optional age for the animal .EE .UNINDENT .UNINDENT .sp This is rendered as: .INDENT 7.0 .TP .B class MyAnimal(name[, age]) .INDENT 7.0 .TP .B Arguments .INDENT 7.0 .IP \(bu 2 \fBname\fP (\fBstring\fP) \-\- The name of the animal .IP \(bu 2 \fBage\fP (\fBnumber\fP) \-\- an optional age for the animal .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :single\-line\-parameter\-list: (no value) Ensures that the function\(aqs parameters will be emitted on a single logical line, overriding \fBjavascript_maximum_signature_line_length\fP \%<#\:confval-javascript_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.1. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. js:data:: name Describes a global variable or constant. .UNINDENT .INDENT 0.0 .TP .B \&.. js:attribute:: object.name Describes the attribute \fIname\fP of \fIobject\fP\&. .UNINDENT .sp These roles are provided to refer to the described objects: .INDENT 0.0 .TP .B :js:mod: .TP .B :js:func: .TP .B :js:meth: .TP .B :js:class: .TP .B :js:data: .TP .B :js:attr: .UNINDENT .SS The Mathematics Domain .sp Added in version 1.8. .sp The math domain (name \fBmath\fP) provides the following roles: .INDENT 0.0 .TP .B :math:numref: Role for cross\-referencing equations defined by \fBmath\fP \%<#\:directive-math> directive via their label. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. math:: e^{i\epi} + 1 = 0 :label: euler Euler\(aqs identity, equation :math:numref:\(gaeuler\(ga, was elected one of the most beautiful mathematical formulas. .EE .UNINDENT .UNINDENT .sp Added in version 1.8. .UNINDENT .SS The Python Domain .sp Added in version 1.0. .sp The Python domain (name \fBpy\fP) provides the following directives for module declarations: .INDENT 0.0 .TP .B \&.. py:module:: name This directive marks the beginning of the description of a module (or package submodule, in which case the name should be fully qualified, including the package name). A description of the module such as the docstring can be placed in the body of the directive. .sp This directive will also cause an entry in the global module index. .sp Changed in version 5.2: Module directives support body content. .sp options .INDENT 7.0 .TP .B :platform: platforms (comma separated list) Indicate platforms which the module is available (if it is available on all platforms, the option should be omitted). The keys are short identifiers; examples that are in use include \(dqIRIX\(dq, \(dqMac\(dq, \(dqWindows\(dq and \(dqUnix\(dq. It is important to use a key which has already been used when applicable. .UNINDENT .INDENT 7.0 .TP .B :synopsis: purpose (text) Consist of one sentence describing the module\(aqs purpose \-\- it is currently only used in the Global Module Index. .UNINDENT .INDENT 7.0 .TP .B :deprecated: (no argument) Mark a module as deprecated; it will be designated as such in various locations then. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. py:currentmodule:: name This directive tells Sphinx that the classes, functions etc. documented from here are in the given module (like \fBpy:module\fP), but it will not create index entries, an entry in the Global Module Index, or a link target for \fBpy:mod\fP\&. This is helpful in situations where documentation for things in a module is spread over multiple files or sections \-\- one location has the \fBpy:module\fP directive, the others only \fBpy:currentmodule\fP\&. .UNINDENT .sp The following directives are provided for module and class contents: .INDENT 0.0 .TP .B \&.. py:function:: name(parameters) .TP .B \&.. py:function:: name[type parameters](parameters) Describes a module\-level function. The signature should include the parameters, together with optional type parameters, as given in the Python function definition, see Python Signatures\&. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:function:: Timer.repeat(repeat=3, number=1_000_000) \&.. py:function:: add[T](a: T, b: T) \-> T .EE .UNINDENT .UNINDENT .sp For methods you should use \fBpy:method\fP\&. .sp The description normally includes information about the parameters required and how they are used (especially whether mutable objects passed as parameters are modified), side effects, and possible exceptions. .sp This information can (in any \fBpy\fP directive) optionally be given in a structured form, see Info field lists\&. .sp options .INDENT 7.0 .TP .B :async: (no value) Indicate the function is an async function. .sp Added in version 2.1. .UNINDENT .INDENT 7.0 .TP .B :canonical: (full qualified name including module name) Describe the location where the object is defined if the object is imported from other modules .sp Added in version 4.0. .UNINDENT .INDENT 7.0 .TP .B :single\-line\-parameter\-list: (no value) Ensures that the function\(aqs arguments will be emitted on a single logical line, overriding \fBpython_maximum_signature_line_length\fP \%<#\:confval-python_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.1. .UNINDENT .INDENT 7.0 .TP .B :single\-line\-type\-parameter\-list: (no value) Ensure that the function\(aqs type parameters are emitted on a single logical line, overriding \fBpython_maximum_signature_line_length\fP \%<#\:confval-python_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.1. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. py:data:: name Describes global data in a module, including both variables and values used as \(dqdefined constants.\(dq Consider using \fBpy:type\fP for type aliases instead and \fBpy:attribute\fP for class variables and instance attributes. .sp options .INDENT 7.0 .TP .B :type: type of the variable (text) This will be parsed as a Python expression for cross\-referencing the type annotation. As such, the argument to \fB:type:\fP should be a valid annotation expression \%<https://\:typing\:.readthedocs\:.io/\:en/\:latest/\:spec/\:annotations\:.html#\:type-and-annotation-expressions>\&. .sp \fBCaution:\fP .INDENT 7.0 .INDENT 3.5 The valid syntax for the \fB:type:\fP directive option differs from the syntax for the \fB:type:\fP info field\&. The \fB:type:\fP directive option does not understand reStructuredText markup or the \fBor\fP or \fBof\fP keywords, meaning unions must use \fB|\fP and sequences must use square brackets, and roles such as \fB:ref:\(ga...\(ga\fP cannot be used. .UNINDENT .UNINDENT .sp Added in version 2.4. .UNINDENT .INDENT 7.0 .TP .B :value: initial value of the variable (text) Added in version 2.4. .UNINDENT .INDENT 7.0 .TP .B :canonical: (full qualified name including module name) Describe the location where the object is defined if the object is imported from other modules .sp Added in version 4.0. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. py:exception:: name .TP .B \&.. py:exception:: name(parameters) .TP .B \&.. py:exception:: name[type parameters](parameters) Describes an exception class. The signature can, but need not include parentheses with constructor arguments, or may optionally include type parameters (see \fBPEP 695\fP \%<https://\:peps\:.python\:.org/\:pep-0695/>). .sp options .INDENT 7.0 .TP .B :final: (no value) Indicate the class is a final class. .sp Added in version 3.1. .UNINDENT .INDENT 7.0 .TP .B :single\-line\-parameter\-list: (no value) See \fBpy:class:single\-line\-parameter\-list\fP\&. .sp Added in version 7.1. .UNINDENT .INDENT 7.0 .TP .B :single\-line\-type\-parameter\-list: (no value) See \fBpy:class:single\-line\-type\-parameter\-list\fP\&. .sp Added in version 7.1. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. py:class:: name .TP .B \&.. py:class:: name(parameters) .TP .B \&.. py:class:: name[type parameters](parameters) Describes a class. The signature can optionally include type parameters (see \fBPEP 695\fP \%<https://\:peps\:.python\:.org/\:pep-0695/>) or parentheses with parameters which will be shown as the constructor arguments. See also Python Signatures\&. .sp Methods and attributes belonging to the class should be placed in this directive\(aqs body. If they are placed outside, the supplied name should contain the class name so that cross\-references still work. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:class:: Foo .. py:method:: quux() \-\- or \-\- \&.. py:class:: Bar \&.. py:method:: Bar.quux() .EE .UNINDENT .UNINDENT .sp The first way is the preferred one. .sp options .INDENT 7.0 .TP .B :abstract: (no value) Indicate that the class is an abstract base class. This produces the following output: .INDENT 7.0 .TP .B abstract class Cheese A cheesy representation. .UNINDENT .sp Added in version 8.2. .UNINDENT .INDENT 7.0 .TP .B :canonical: (full qualified name including module name) Describe the location where the object is defined if the object is imported from other modules .sp Added in version 4.0. .UNINDENT .INDENT 7.0 .TP .B :final: (no value) Indicate the class is a final class. .sp Added in version 3.1. .UNINDENT .INDENT 7.0 .TP .B :single\-line\-parameter\-list: (no value) Ensures that the class constructor\(aqs arguments will be emitted on a single logical line, overriding \fBpython_maximum_signature_line_length\fP \%<#\:confval-python_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.1. .UNINDENT .INDENT 7.0 .TP .B :single\-line\-type\-parameter\-list: (no value) Ensure that the class type parameters are emitted on a single logical line, overriding \fBpython_maximum_signature_line_length\fP \%<#\:confval-python_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. py:attribute:: name Describes an object data attribute. The description should include information about the type of the data to be expected and whether it may be changed directly. Type aliases should be documented with \fBpy:type\fP\&. .sp options .INDENT 7.0 .TP .B :type: type of the attribute (text) This will be parsed as a Python expression for cross\-referencing the type annotation. As such, the argument to \fB:type:\fP should be a valid annotation expression \%<https://\:typing\:.readthedocs\:.io/\:en/\:latest/\:spec/\:annotations\:.html#\:type-and-annotation-expressions>\&. .sp \fBCaution:\fP .INDENT 7.0 .INDENT 3.5 The valid syntax for the \fB:type:\fP directive option differs from the syntax for the \fB:type:\fP info field\&. The \fB:type:\fP directive option does not understand reStructuredText markup or the \fBor\fP or \fBof\fP keywords, meaning unions must use \fB|\fP and sequences must use square brackets, and roles such as \fB:ref:\(ga...\(ga\fP cannot be used. .UNINDENT .UNINDENT .sp Added in version 2.4. .UNINDENT .INDENT 7.0 .TP .B :value: initial value of the attribute (text) Added in version 2.4. .UNINDENT .INDENT 7.0 .TP .B :canonical: (full qualified name including module name) Describe the location where the object is defined if the object is imported from other modules .sp Added in version 4.0. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. py:property:: name Describes an object property. .sp Added in version 4.0. .sp options .INDENT 7.0 .TP .B :abstract: (no value) .TP .B :abstractmethod: (no value) Indicate the property is abstract. This produces the following output: .INDENT 7.0 .TP .B abstract property Cheese.amount_in_stock Cheese levels at the \fINational Cheese Emporium\fP\&. .UNINDENT .sp Changed in version 8.2: The \fB:abstract:\fP alias is also supported. .UNINDENT .INDENT 7.0 .TP .B :classmethod: (no value) Indicate the property is a classmethod. .sp Added in version 4.2. .UNINDENT .INDENT 7.0 .TP .B :type: type of the property (text) This will be parsed as a Python expression for cross\-referencing the type annotation. As such, the argument to \fB:type:\fP should be a valid annotation expression \%<https://\:typing\:.readthedocs\:.io/\:en/\:latest/\:spec/\:annotations\:.html#\:type-and-annotation-expressions>\&. .sp \fBCaution:\fP .INDENT 7.0 .INDENT 3.5 The valid syntax for the \fB:type:\fP directive option differs from the syntax for the \fB:type:\fP info field\&. The \fB:type:\fP directive option does not understand reStructuredText markup or the \fBor\fP or \fBof\fP keywords, meaning unions must use \fB|\fP and sequences must use square brackets, and roles such as \fB:ref:\(ga...\(ga\fP cannot be used. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. py:type:: name Describe a type alias \%<https://\:docs\:.python\:.org/\:3/\:library/\:typing\:.html#\:type-aliases>\&. .sp The type that the alias represents should be described with the \fBcanonical\fP option. This directive supports an optional description body. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:type:: UInt64 Represent a 64\-bit positive integer. .EE .UNINDENT .UNINDENT .sp will be rendered as follows: .INDENT 7.0 .TP .B type UInt64 Represent a 64\-bit positive integer. .UNINDENT .sp options .INDENT 7.0 .TP .B :canonical: (text) The canonical type represented by this alias, for example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:type:: StrPattern :canonical: str | re.Pattern[str] Represent a regular expression or a compiled pattern. .EE .UNINDENT .UNINDENT .sp This is rendered as: .INDENT 7.0 .TP .B type StrPattern = str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | re.Pattern \%<https://\:docs\:.python\:.org/\:3/\:library/\:re\:.html#\:re\:.Pattern>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] Represent a regular expression or a compiled pattern. .UNINDENT .UNINDENT .sp Added in version 7.4. .UNINDENT .INDENT 0.0 .TP .B \&.. py:method:: name(parameters) .TP .B \&.. py:method:: name[type parameters](parameters) Describes an object method. The parameters should not include the \fBself\fP parameter. The description should include similar information to that described for \fBfunction\fP\&. See also Python Signatures and Info field lists\&. .sp options .INDENT 7.0 .TP .B :abstract: (no value) .TP .B :abstractmethod: (no value) Indicate the method is an abstract method. This produces the following output: .INDENT 7.0 .TP .B abstractmethod Cheese.order_more_stock() Order more cheese (we\(aqre fresh out!). .UNINDENT .sp Added in version 2.1. .sp Changed in version 8.2: The \fB:abstract:\fP alias is also supported. .UNINDENT .INDENT 7.0 .TP .B :async: (no value) Indicate the method is an async method. .sp Added in version 2.1. .UNINDENT .INDENT 7.0 .TP .B :canonical: (full qualified name including module name) Describe the location where the object is defined if the object is imported from other modules .sp Added in version 4.0. .UNINDENT .INDENT 7.0 .TP .B :classmethod: (no value) Indicate the method is a class method. .sp Added in version 2.1. .UNINDENT .INDENT 7.0 .TP .B :final: (no value) Indicate the method is a final method. .sp Added in version 3.1. .UNINDENT .INDENT 7.0 .TP .B :single\-line\-parameter\-list: (no value) Ensures that the method\(aqs arguments will be emitted on a single logical line, overriding \fBpython_maximum_signature_line_length\fP \%<#\:confval-python_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.1. .UNINDENT .INDENT 7.0 .TP .B :single\-line\-type\-parameter\-list: (no value) Ensure that the method\(aqs type parameters are emitted on a single logical line, overriding \fBpython_maximum_signature_line_length\fP \%<#\:confval-python_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.2. .UNINDENT .INDENT 7.0 .TP .B :staticmethod: (no value) Indicate the method is a static method. .sp Added in version 2.1. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. py:staticmethod:: name(parameters) .TP .B \&.. py:staticmethod:: name[type parameters](parameters) Like \fBpy:method\fP, but indicates that the method is a static method. .sp Added in version 0.4. .UNINDENT .INDENT 0.0 .TP .B \&.. py:classmethod:: name(parameters) .TP .B \&.. py:classmethod:: name[type parameters](parameters) Like \fBpy:method\fP, but indicates that the method is a class method. .sp Added in version 0.6. .UNINDENT .INDENT 0.0 .TP .B \&.. py:decorator:: name .TP .B \&.. py:decorator:: name(parameters) .TP .B \&.. py:decorator:: name[type parameters](parameters) Describes a decorator function. The signature should represent the usage as a decorator. For example, given the functions .INDENT 7.0 .INDENT 3.5 .sp .EX def removename(func): func.__name__ = \(aq\(aq return func def setnewname(name): def decorator(func): func.__name__ = name return func return decorator .EE .UNINDENT .UNINDENT .sp the descriptions should look like this: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:decorator:: removename Remove name of the decorated function. \&.. py:decorator:: setnewname(name) Set name of the decorated function to *name*. .EE .UNINDENT .UNINDENT .sp (as opposed to \fB\&.. py:decorator:: removename(func)\fP\&.) .sp Refer to a decorator function using the \fBpy:deco\fP role. .INDENT 7.0 .TP .B :single\-line\-parameter\-list: (no value) Ensures that the decorator\(aqs arguments will be emitted on a single logical line, overriding \fBpython_maximum_signature_line_length\fP \%<#\:confval-python_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.1. .UNINDENT .INDENT 7.0 .TP .B :single\-line\-type\-parameter\-list: (no value) Ensure that the decorator\(aqs type parameters are emitted on a single logical line, overriding \fBpython_maximum_signature_line_length\fP \%<#\:confval-python_maximum_signature_line_length> and \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>\&. .sp Added in version 7.2. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. py:decoratormethod:: name .TP .B \&.. py:decoratormethod:: name(signature) .TP .B \&.. py:decoratormethod:: name[type parameters](signature) Same as \fBpy:decorator\fP, but for decorators that are methods. .sp Refer to a decorator method using the \fBpy:deco\fP role. .UNINDENT .SS Python Signatures .sp Signatures of functions, methods and class constructors can be given like they would be written in Python. This can include default values, positional\-only or keyword\-only parameters, type annotations, and type parameters. For example: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. py:function:: compile(source: str, filename: Path, symbol: str = \(aqfile\(aq) \-> ast.AST .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B compile(source: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, filename: Path, symbol: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aqfile\(aq) -> ast.AST \%<https://\:docs\:.python\:.org/\:3/\:library/\:ast\:.html#\:ast\:.AST> .UNINDENT .sp For functions with optional parameters that don\(aqt have default values (typically functions implemented in C extension modules without keyword argument support), you can list multiple versions of the same signature in a single directive: .INDENT 0.0 .TP .B compile(source) .TP .B compile(source, filename) .TP .B compile(source, filename, symbol) .UNINDENT .sp Another approach is to use square brackets to specify the optional parts. When using square brackets, it is customary to place the opening bracket before the comma (\fB[,\fP). .INDENT 0.0 .TP .B compile(source[, filename[, symbol]]) .UNINDENT .sp Python 3.12 introduced \fItype parameters\fP, which are type variables declared directly within the class or function definition: .INDENT 0.0 .INDENT 3.5 .sp .EX class AnimalList[AnimalT](list[AnimalT]): ... def add[T](a: T, b: T) \-> T: return a + b .EE .UNINDENT .UNINDENT .sp The corresponding reStructuredText markup would be: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. py:class:: AnimalList[AnimalT] \&.. py:function:: add[T](a: T, b: T) \-> T .EE .UNINDENT .UNINDENT .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 \fBPEP 695\fP \%<https://\:peps\:.python\:.org/\:pep-0695/> and \fBPEP 696\fP \%<https://\:peps\:.python\:.org/\:pep-0696/>, for details and the full specification. .UNINDENT .UNINDENT .SS Info field lists .sp Added in version 0.4. .sp Changed in version 3.0: meta fields are added. .sp Inside Python object description directives, reStructuredText field lists with these fields are recognized and formatted nicely: .INDENT 0.0 .IP \(bu 2 \fBparam\fP, \fBparameter\fP, \fBarg\fP, \fBargument\fP, \fBkey\fP, \fBkeyword\fP: Description of a parameter. .IP \(bu 2 \fBtype\fP: Type of a parameter. Creates a link if possible. .IP \(bu 2 \fBraises\fP, \fBraise\fP, \fBexcept\fP, \fBexception\fP: That (and when) a specific exception is raised. .IP \(bu 2 \fBvar\fP, \fBivar\fP, \fBcvar\fP: Description of a variable. .IP \(bu 2 \fBvartype\fP: Type of a variable. Creates a link if possible. .IP \(bu 2 \fBreturns\fP, \fBreturn\fP: Description of the return value. .IP \(bu 2 \fBrtype\fP: Return type. Creates a link if possible. .IP \(bu 2 \fBmeta\fP: Add metadata to description of the python object. The metadata will not be shown on output document. For example, \fB:meta private:\fP indicates the python object is private member. It is used in \fBsphinx.ext.autodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> for filtering members. .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 In current release, all \fBvar\fP, \fBivar\fP and \fBcvar\fP are represented as \(dqVariable\(dq. There is no difference at all. .UNINDENT .UNINDENT .sp The field names must consist of one of these keywords and an argument (except for \fBreturns\fP and \fBrtype\fP, which do not need an argument). This is best explained by an example: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. py:function:: send_message(sender, recipient, message_body, [priority=1]) Send a message to a recipient :param str sender: The person sending the message :param str recipient: The recipient of the message :param str message_body: The body of the message :param priority: The priority of the message, can be a number 1\-5 :type priority: int or None :return: the message id :rtype: int :raises ValueError: if the message_body exceeds 160 characters :raises TypeError: if the message_body is not a basestring .EE .UNINDENT .UNINDENT .sp This will render like this: .INDENT 0.0 .TP .B send_message(sender, recipient, message_body[, priority=1]) Send a message to a recipient .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBsender\fP (\fIstr\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) \-\- The person sending the message .IP \(bu 2 \fBrecipient\fP (\fIstr\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) \-\- The recipient of the message .IP \(bu 2 \fBmessage_body\fP (\fIstr\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) \-\- The body of the message .IP \(bu 2 \fBpriority\fP (\fIint\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>\fI or \fP\fINone\fP) \-\- The priority of the message, can be a number 1\-5 .UNINDENT .TP .B Returns the message id .TP .B Return type int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Raises .INDENT 7.0 .IP \(bu 2 \fBValueError\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:ValueError> \-\- if the message_body exceeds 160 characters .IP \(bu 2 \fBTypeError\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:TypeError> \-\- if the message_body is not a basestring .UNINDENT .UNINDENT .UNINDENT .sp It is also possible to combine parameter type and description, if the type is a single word, like this: .INDENT 0.0 .INDENT 3.5 .sp .EX :param int priority: The priority of the message, can be a number 1\-5 .EE .UNINDENT .UNINDENT .sp Added in version 1.5. .sp Container types such as lists and dictionaries can be linked automatically using the following syntax: .INDENT 0.0 .INDENT 3.5 .sp .EX :type priorities: list(int) :type priorities: list[int] :type mapping: dict(str, int) :type mapping: dict[str, int] :type point: tuple(float, float) :type point: tuple[float, float] .EE .UNINDENT .UNINDENT .sp Multiple types in a type field will be linked automatically if separated by either the vertical bar (\fB|\fP) or the word \(dqor\(dq: .INDENT 0.0 .INDENT 3.5 .sp .EX :type an_arg: int or None :vartype a_var: str or int :rtype: float or str :type an_arg: int | None :vartype a_var: str | int :rtype: float | str .EE .UNINDENT .UNINDENT .SS Cross\-referencing Python objects .sp The following roles refer to objects in modules and are possibly hyperlinked if a matching identifier is found: .INDENT 0.0 .TP .B :py:mod: Reference a module; a dotted name may be used. This should also be used for package names. .UNINDENT .INDENT 0.0 .TP .B :py:func: Reference a Python function; dotted names may be used. The role text needs not include trailing parentheses to enhance readability; they will be added automatically by Sphinx if the \fBadd_function_parentheses\fP \%<#\:confval-add_function_parentheses> config value is \fBTrue\fP (the default). .UNINDENT .INDENT 0.0 .TP .B :py:deco: Reference a Python decorator; dotted names may be used. The rendered output will be prepended with an at\-sign (\fB@\fP), for example: \fB:py:deco:\(garemovename\(ga\fP produces \fB@removename\fP\&. .UNINDENT .INDENT 0.0 .TP .B :py:data: Reference a module\-level variable. .UNINDENT .INDENT 0.0 .TP .B :py:const: Reference a \(dqdefined\(dq constant. This may be a Python variable that is not intended to be changed. .UNINDENT .INDENT 0.0 .TP .B :py:class: Reference a class; a dotted name may be used. .UNINDENT .INDENT 0.0 .TP .B :py:meth: Reference a method of an object. The role text can include the type name and the method name; if it occurs within the description of a type, the type name can be omitted. A dotted name may be used. .UNINDENT .INDENT 0.0 .TP .B :py:attr: Reference a data attribute of an object. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The role is also able to refer to property. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B :py:type: Reference a type alias. .UNINDENT .INDENT 0.0 .TP .B :py:exc: Reference an exception. A dotted name may be used. .UNINDENT .INDENT 0.0 .TP .B :py:obj: Reference an object of unspecified type. Useful e.g. as the \fBdefault_role\fP \%<#\:confval-default_role>\&. .sp Added in version 0.4. .UNINDENT .SS Target specification .sp The target can be specified as a fully qualified name (e.g. \fB:py:meth:\(gamy_module.MyClass.my_method\(ga\fP) or any shortened version (e.g. \fB:py:meth:\(gaMyClass.my_method\(ga\fP or \fB:py:meth:\(gamy_method\(ga\fP). See target resolution for details on the resolution of shortened names. .sp Cross\-referencing modifiers \%<#\:xref-modifiers> can be applied. In short: .INDENT 0.0 .IP \(bu 2 You may supply an explicit title and reference target: \fB:py:mod:\(gamathematical functions <math>\(ga\fP will refer to the \fBmath\fP module, but the link text will be \(dqmathematical functions\(dq. .IP \(bu 2 If you prefix the content with an exclamation mark (\fB!\fP), no reference/hyperlink will be created. .IP \(bu 2 If you prefix the content with \fB~\fP, the link text will only be the last component of the target. For example, \fB:py:meth:\(ga~queue.Queue.get\(ga\fP will refer to \fBqueue.Queue.get\fP but only display \fBget\fP as the link text. .UNINDENT .SS Target resolution .sp A given link target name is resolved to an object using the following strategy: .sp Names in these roles are searched first without any further qualification, then with the current module name prepended, then with the current module and class name (if any) prepended. .sp If you prefix the name with a dot (\fB\&.\fP), this order is reversed. For example, in the documentation of Python\(aqs \fBcodecs\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:codecs\:.html#\:module-codecs> module, \fB:py:func:\(gaopen\(ga\fP always refers to the built\-in function, while \fB:py:func:\(ga.open\(ga\fP refers to \fBcodecs.open()\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:codecs\:.html#\:codecs\:.open>\&. .sp A similar heuristic is used to determine whether the name is an attribute of the currently documented class. .sp Also, if the name is prefixed with a dot, and no exact match is found, the target is taken as a suffix and all object names with that suffix are searched. For example, \fB:py:meth:\(ga.TarFile.close\(ga\fP references the \fBtarfile.TarFile.close()\fP function, even if the current module is not \fBtarfile\fP\&. Since this can get ambiguous, if there is more than one possible match, you will get a warning from Sphinx. .sp Note that you can combine the \fB~\fP and \fB\&.\fP prefixes: \fB:py:meth:\(ga~.TarFile.close\(ga\fP will reference the \fBtarfile.TarFile.close()\fP method, but the visible link caption will only be \fBclose()\fP\&. .SS The reStructuredText Domain .sp Added in version 1.0. .sp The reStructuredText domain (name \fBrst\fP) provides the following directives: .INDENT 0.0 .TP .B \&.. rst:directive:: name Describes a reStructuredText directive. The \fIname\fP can be a single directive name or actual directive syntax (\fI\&..\fP prefix and \fI::\fP suffix) with arguments that will be rendered differently. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. rst:directive:: foo Foo description. \&.. rst:directive:: .. bar:: baz Bar description. .EE .UNINDENT .UNINDENT .sp will be rendered as: .INDENT 7.0 .TP .B \&.. foo:: Foo description. .UNINDENT .INDENT 7.0 .TP .B \&.. bar:: baz Bar description. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. rst:directive:option:: name Describes an option for reStructuredText directive. The \fIname\fP can be a single option name or option name with arguments which separated with colon (\fB:\fP). For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. rst:directive:: toctree .. rst:directive:option:: caption: caption of ToC .. rst:directive:option:: glob .EE .UNINDENT .UNINDENT .sp will be rendered as: .INDENT 7.0 .TP .B \&.. toctree:: .INDENT 7.0 .TP .B :caption: caption of ToC .UNINDENT .INDENT 7.0 .TP .B :glob: .UNINDENT .UNINDENT .sp options .INDENT 7.0 .TP .B :type: description of argument (text) Describe the type of option value. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. rst:directive:: toctree .. rst:directive:option:: maxdepth :type: integer or no value .EE .UNINDENT .UNINDENT .sp Added in version 2.1. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. rst:role:: name Describes a reStructuredText role. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. rst:role:: foo Foo description. .EE .UNINDENT .UNINDENT .sp will be rendered as: .INDENT 7.0 .TP .B :foo: Foo description. .UNINDENT .UNINDENT .sp These roles are provided to refer to the described objects: .INDENT 0.0 .TP .B :rst:dir: Reference directives and directive options. Examples: .INDENT 7.0 .IP \(bu 2 Use \fB:rst:dir:\(gamy\-directive\(ga\fP to reference a directive. .IP \(bu 2 Use \fB:rst:dir:\(gamy\-directive:my\-option\(ga\fP to reference a directive option. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B :rst:role: Reference a role. Example: \fB:rst:role:\(gamy\-role\(ga\fP\&. .UNINDENT .SS Third\-party domains .sp Several third\-party domains are available as extensions, including: .INDENT 0.0 .IP \(bu 2 Ada \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-adadomain/> .IP \(bu 2 Antlr4 \%<https://\:pypi\:.org/\:project/\:sphinx-syntax/> .IP \(bu 2 Bazel \%<https://\:pypi\:.org/\:project/\:sphinx-bazel/> .IP \(bu 2 BibTex \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-bibtex/> .IP \(bu 2 Bison/YACC \%<https://\:pypi\:.org/\:project/\:sphinx-syntax/> .IP \(bu 2 Chapel \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-chapeldomain/> .IP \(bu 2 CMake \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-moderncmakedomain/> .IP \(bu 2 Common Lisp \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-cldomain/> .IP \(bu 2 Erlang \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-erlangdomain/> .IP \(bu 2 Fortran \%<https://\:pypi\:.org/\:project/\:sphinx-fortran/> .IP \(bu 2 GraphQL \%<https://\:pypi\:.org/\:project/\:graphqldomain/> .IP \(bu 2 Go \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-golangdomain/> .IP \(bu 2 HTTP \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-httpdomain/> .IP \(bu 2 Hy \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-hydomain/> .IP \(bu 2 Lua \%<https://\:pypi\:.org/\:project/\:sphinx-lua-ls/> .IP \(bu 2 MATLAB \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-matlabdomain/> .IP \(bu 2 PHP \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-phpdomain/> .IP \(bu 2 Ruby \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-rubydomain/> .IP \(bu 2 Rust \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-rust/> .IP \(bu 2 Verilog \%<https://\:pypi\:.org/\:project/\:sphinx-verilog-domain/> .IP \(bu 2 VHDL \%<https://\:pypi\:.org/\:project/\:sphinx-vhdl/> .IP \(bu 2 Visual Basic \%<https://\:pypi\:.org/\:project/\:sphinx-vb-domain/> .UNINDENT .sp Other domains may be found on the Python Package Index (via the Framework :: Sphinx :: Domain \%<https://\:pypi\:.org/\:search/?\:c=Framework+%3A%3A+Sphinx+%3A%3A+Domain> classifier), GitHub \%<https://\:github\:.com/\:search?\:q=sphinx%20domain&\:type=repositories>, or GitLab \%<https://\:gitlab\:.com/\:explore/\:projects?\:name=sphinx%20domain>\&. .SS Basic Markup .sp Most domains provide a number of \fIobject description directives\fP, used to describe specific objects provided by modules. Each directive requires one or more signatures to provide basic information about what is being described, and the content should be the description. .sp A domain will typically keep an internal index of all entities to aid cross\-referencing. Typically, it will also add entries in the shown general index. If you want to suppress the addition of an entry in the shown index, you can give the directive option flag \fB:no\-index\-entry:\fP\&. If you want to exclude the object description from the table of contents, you can give the directive option flag \fB:no\-contents\-entry:\fP\&. If you want to typeset an object description, without even making it available for cross\-referencing, you can give the directive option flag \fB:no\-index:\fP (which implies \fB:no\-index\-entry:\fP). If you do not want to typeset anything, you can give the directive option flag \fB:no\-typesetting:\fP\&. This can for example be used to create only a target and index entry for later reference. Though, note that not every directive in every domain may support these options. .sp Added in version 3.2: The directive option \fBnoindexentry\fP in the Python, C, C++, and Javascript domains. .sp Added in version 5.2.3: The directive option \fB:nocontentsentry:\fP in the Python, C, C++, Javascript, and reStructuredText domains. .sp Added in version 7.2: The directive option \fBno\-typesetting\fP in the Python, C, C++, Javascript, and reStructuredText domains. .sp Changed in version 7.2: .INDENT 0.0 .IP \(bu 2 The directive option \fB:noindex:\fP was renamed to \fB:no\-index:\fP\&. .IP \(bu 2 The directive option \fB:noindexentry:\fP was renamed to \fB:no\-index\-entry:\fP\&. .IP \(bu 2 The directive option \fB:nocontentsentry:\fP was renamed to \fB:no\-contents\-entry:\fP\&. .UNINDENT .sp The previous names are retained as aliases, but will be deprecated and removed in a future version of Sphinx. .sp An example using a Python domain directive: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. py:function:: spam(eggs) ham(eggs) Spam or ham the foo. .EE .UNINDENT .UNINDENT .sp This describes the two Python functions \fBspam\fP and \fBham\fP\&. (Note that when signatures become too long, you can break them if you add a backslash to lines that are continued in the next line. Example: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. py:function:: filterwarnings(action, message=\(aq\(aq, category=Warning, \e module=\(aq\(aq, lineno=0, append=False) :no\-index: .EE .UNINDENT .UNINDENT .sp (This example also shows how to use the \fB:no\-index:\fP flag.) .sp The domains also provide roles that link back to these object descriptions. For example, to link to one of the functions described in the example above, you could say .INDENT 0.0 .INDENT 3.5 .sp .EX The function :py:func:\(gaspam\(ga does a similar thing. .EE .UNINDENT .UNINDENT .sp As you can see, both directive and role names contain the domain name and the directive name. .sp The directive option \fB:no\-typesetting:\fP can be used to create a target (and index entry) which can later be referenced by the roles provided by the domain. This is particularly useful for literate programming: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. py:function:: spam(eggs) :no\-typesetting: \&.. code:: python def spam(eggs): pass The function :py:func:\(gaspam\(ga does nothing. .EE .UNINDENT .UNINDENT .sp Default Domain .sp For documentation describing objects from solely one domain, authors will not have to state again its name at each directive, role, etc... after having specified a default. This can be done either via the config value \fBprimary_domain\fP \%<#\:confval-primary_domain> or via this directive: .INDENT 0.0 .TP .B \&.. default\-domain:: name Select a new default domain. While the \fBprimary_domain\fP \%<#\:confval-primary_domain> selects a global default, this only has an effect within the same file. .UNINDENT .sp If no other default is selected, the Python domain (named \fBpy\fP) is the default one, mostly for compatibility with documentation written for older versions of Sphinx. .sp Directives and roles that belong to the default domain can be mentioned without giving the domain name, i.e. .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. function:: pyfunc() Describes a Python function. Reference to :func:\(gapyfunc\(ga. .EE .UNINDENT .UNINDENT .SS Cross\-referencing syntax .sp For cross\-reference roles provided by domains, the same cross\-referencing modifiers \%<#\:xref-modifiers> exist as for general cross\-references. In short: .INDENT 0.0 .IP \(bu 2 You may supply an explicit title and reference target: \fB:py:mod:\(gamathematical functions <math>\(ga\fP will refer to the \fBmath\fP module, but the link text will be \(dqmathematical functions\(dq. .IP \(bu 2 If you prefix the content with an exclamation mark (\fB!\fP), no reference/hyperlink will be created. .IP \(bu 2 If you prefix the content with \fB~\fP, the link text will only be the last component of the target. For example, \fB:py:meth:\(ga~queue.Queue.get\(ga\fP will refer to \fBqueue.Queue.get\fP but only display \fBget\fP as the link text. .UNINDENT .SS Extensions .sp Since many projects will need special features in their documentation, Sphinx allows adding \(dqextensions\(dq to the build process, each of which can modify almost any aspect of document processing. .sp This chapter describes the extensions bundled with Sphinx. For the API documentation on writing your own extension, refer to Sphinx API \%<#\:dev-extensions>\&. .SS Built\-in extensions .sp These extensions are built in and can be activated by respective entries in the \fBextensions\fP \%<#\:confval-extensions> configuration value: .SS \fBsphinx.ext.apidoc\fP \-\- Generate API documentation from Python packages .sp Added in version 8.2. .sp \fBsphinx.ext.apidoc\fP is a tool for automatic generation of Sphinx sources from Python packages. It provides the \fBsphinx\-apidoc\fP command\-line tool as an extension, allowing it to be run during the Sphinx build process. .sp The extension writes generated source files to a provided directory, which are then read by Sphinx using the \fBsphinx.ext.autodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> extension. .sp \fBWarning:\fP .INDENT 0.0 .INDENT 3.5 \fBsphinx.ext.apidoc\fP generates source files that use \fBsphinx.ext.autodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> to document all found modules. If any modules have side effects on import, these will be executed by \fBautodoc\fP when \fBsphinx\-build\fP is run. .sp If you document scripts (as opposed to library modules), make sure their main routine is protected by an \fBif __name__ == \(aq__main__\(aq\fP condition. .UNINDENT .UNINDENT .SS Configuration .sp The apidoc extension uses the following configuration values: .INDENT 0.0 .TP .B apidoc_modules .INDENT 7.0 .TP .B Type \fBSequence[dict[str, str | int | bool | Sequence[str] | Set[str]]\fP.TP .B Default \fB()\fP.UNINDENT .sp A list or sequence of dictionaries describing modules to document. If a value is left unspecified in any dictionary, the general configuration value is used as the default. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX apidoc_modules = [ {\(aqpath\(aq: \(aqpath/to/module\(aq, \(aqdestination\(aq: \(aqsource/\(aq}, { \(aqpath\(aq: \(aqpath/to/another_module\(aq, \(aqdestination\(aq: \(aqsource/\(aq, \(aqexclude_patterns\(aq: [\(aq**/test*\(aq], \(aqmax_depth\(aq: 4, \(aqfollow_links\(aq: False, \(aqseparate_modules\(aq: False, \(aqinclude_private\(aq: False, \(aqno_headings\(aq: False, \(aqmodule_first\(aq: False, \(aqimplicit_namespaces\(aq: False, \(aqautomodule_options\(aq: { \(aqmembers\(aq, \(aqshow\-inheritance\(aq, \(aqundoc\-members\(aq }, }, ] .EE .UNINDENT .UNINDENT .sp Valid keys are: .INDENT 7.0 .TP .B \fB\(aqpath\(aq\fP The path to the module to document (\fBrequired\fP). This must be absolute or relative to the configuration directory. .TP .B \fB\(aqdestination\(aq\fP The output directory for generated files (\fBrequired\fP). This must be relative to the source directory, and will be created if it does not exist. .TP .B \fB\(aqexclude_patterns\(aq\fP See \fBapidoc_exclude_patterns\fP\&. .TP .B \fB\(aqmax_depth\(aq\fP See \fBapidoc_max_depth\fP\&. .TP .B \fB\(aqfollow_links\(aq\fP See \fBapidoc_follow_links\fP\&. .TP .B \fB\(aqseparate_modules\(aq\fP See \fBapidoc_separate_modules\fP\&. .TP .B \fB\(aqinclude_private\(aq\fP See \fBapidoc_include_private\fP\&. .TP .B \fB\(aqno_headings\(aq\fP See \fBapidoc_no_headings\fP\&. .TP .B \fB\(aqmodule_first\(aq\fP See \fBapidoc_module_first\fP\&. .TP .B \fB\(aqimplicit_namespaces\(aq\fP See \fBapidoc_implicit_namespaces\fP\&. .TP .B \fB\(aqautomodule_options\(aq\fP See \fBapidoc_automodule_options\fP\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B apidoc_exclude_patterns .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A sequence of patterns to exclude from generation. These may be literal paths or \fBfnmatch\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:fnmatch\:.html#\:module-fnmatch>\-style patterns. .UNINDENT .INDENT 0.0 .TP .B apidoc_max_depth .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fB4\fP.UNINDENT .sp The maximum depth of submodules to show in the generated table of contents. .UNINDENT .INDENT 0.0 .TP .B apidoc_follow_links .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Follow symbolic links. .UNINDENT .INDENT 0.0 .TP .B apidoc_separate_modules .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Put documentation for each module on an individual page. .UNINDENT .INDENT 0.0 .TP .B apidoc_include_private .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Generate documentation for \(aq_private\(aq modules with leading underscores. .UNINDENT .INDENT 0.0 .TP .B apidoc_no_headings .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Do not create headings for the modules/packages. Useful when source docstrings already contain headings. .UNINDENT .INDENT 0.0 .TP .B apidoc_module_first .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Place module documentation before submodule documentation. .UNINDENT .INDENT 0.0 .TP .B apidoc_implicit_namespaces .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp By default sphinx\-apidoc processes sys.path searching for modules only. Python 3.3 introduced \fBPEP 420\fP \%<https://\:peps\:.python\:.org/\:pep-0420/> implicit namespaces that allow module path structures such as \fBfoo/bar/module.py\fP or \fBfoo/bar/baz/__init__.py\fP (notice that \fBbar\fP and \fBfoo\fP are namespaces, not modules). .sp Interpret module paths using \fBPEP 420\fP \%<https://\:peps\:.python\:.org/\:pep-0420/> implicit namespaces. .UNINDENT .INDENT 0.0 .TP .B apidoc_automodule_options .INDENT 7.0 .TP .B Type \fBSet[str]\fP.TP .B Default \fB{\(aqmembers\(aq, \(aqshow\-inheritance\(aq, \(aqundoc\-members\(aq}\fP.UNINDENT .sp Options to pass to generated \fBautomodule\fP \%<#\:directive-automodule> directives. .UNINDENT .SS \fBsphinx.ext.autodoc\fP \-\- Include documentation from docstrings .sp This extension can import the modules you are documenting, and pull in documentation from docstrings in a semi\-automatic way. .sp \fBWarning:\fP .INDENT 0.0 .INDENT 3.5 \fBautodoc\fP \fBimports\fP the modules to be documented. If any modules have side effects on import, these will be executed by \fBautodoc\fP when \fBsphinx\-build\fP is run. .sp If you document scripts (as opposed to library modules), make sure that the main routine is protected by an \fBif __name__ == \(aq__main__\(aq\fP condition. .UNINDENT .UNINDENT .sp For this to work, the docstrings must of course be written in correct reStructuredText. You can then use all of the usual Sphinx markup in the docstrings, and it will end up correctly in the documentation. Together with hand\-written documentation, this technique eases the pain of having to maintain two locations for documentation, while at the same time avoiding auto\-generated\-looking pure API documentation. .sp If you prefer NumPy \%<https://\:numpydoc\:.readthedocs\:.io/\:en/\:latest/\:format\:.html#\:docstring-standard> or Google \%<https://\:google\:.github\:.io/\:styleguide/\:pyguide\:.html#\:38-comments-and-docstrings> style docstrings over reStructuredText, you can also enable the \fBnapoleon\fP \%<#\:module-sphinx\:.ext\:.napoleon> extension. \fBnapoleon\fP is a preprocessor that converts docstrings to correct reStructuredText before \fBautodoc\fP processes them. .SS Getting started .SS Setup .sp Activate the plugin by adding \fB\(aqsphinx.ext.autodoc\(aq\fP to the \fBextensions\fP \%<#\:confval-extensions> list in \fBconf.py\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX extensions = [ ... \(aqsphinx.ext.autodoc\(aq, ] .EE .UNINDENT .UNINDENT .SS Ensuring the code can be imported .sp \fBautodoc\fP analyses the code and docstrings by introspection after \fBimporting the modules\fP\&. For importing to work, you have to make sure that your modules can be found by Sphinx and that dependencies can be resolved (if your module does \fBimport foo\fP, but \fBfoo\fP is not available in the python environment that Sphinx runs in, your module import will fail). .sp There are two ways to ensure this: .INDENT 0.0 .IP 1. 3 Use an environment that contains your package and Sphinx. This can e.g. be your local development environment (with an editable install), or an environment in CI in which you install Sphinx and your package. The regular installation process ensures that your package can be found by Sphinx and that all dependencies are available. .IP 2. 3 It is alternatively possible to patch the Sphinx run so that it can operate directly on the sources; e.g. if you want to be able to do a Sphinx build from a source checkout. .INDENT 3.0 .IP \(bu 2 Patch \fBsys.path\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:sys\:.html#\:sys\:.path> in \fBconf.py\fP to include your source path. For example if you have a repository structure with \fBdoc/conf.py\fP and your package is at \fBsrc/my_package\fP, then you should add the following to your \fBconf.py\fP\&. .INDENT 3.0 .INDENT 3.5 .sp .EX import sys from pathlib import Path sys.path.insert(0, str(Path(\(aq..\(aq, \(aqsrc\(aq).resolve())) .EE .UNINDENT .UNINDENT .IP \(bu 2 To cope with missing dependencies, specify the missing modules in the \fBautodoc_mock_imports\fP setting. .UNINDENT .UNINDENT .SS Usage .sp You can now use the Directives to add formatted documentation for Python code elements like functions, classes, modules, etc. For example, to document the function \fBio.open()\fP, reading its signature and docstring from the source file, you\(aqd write: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. autofunction:: io.open .EE .UNINDENT .UNINDENT .sp You can also document whole classes or even modules automatically, using member options for the auto directives, like: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. automodule:: io :members: .EE .UNINDENT .UNINDENT .sp \fBTip:\fP .INDENT 0.0 .INDENT 3.5 As a hint to autodoc extension, you can put a \fB::\fP separator between the module name and the object name to let autodoc know the correct module, if it is ambiguous: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. autoclass:: module.name::Noodle .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS Marking objects as public or private .INDENT 0.0 .IP \(bu 2 autodoc considers a member private if its docstring contains \fB:meta private:\fP in its Info field lists \%<#\:info-field-lists>\&. For example: .INDENT 2.0 .INDENT 3.5 .sp .EX def my_function(my_arg, my_other_arg): \(dq\(dq\(dqblah blah blah :meta private: \(dq\(dq\(dq .EE .UNINDENT .UNINDENT .sp Added in version 3.0. .IP \(bu 2 autodoc considers a member public if its docstring contains \fB:meta public:\fP in its Info field lists \%<#\:info-field-lists>, even if it starts with an underscore. For example: .INDENT 2.0 .INDENT 3.5 .sp .EX def _my_function(my_arg, my_other_arg): \(dq\(dq\(dqblah blah blah :meta public: \(dq\(dq\(dq .EE .UNINDENT .UNINDENT .sp Added in version 3.1. .IP \(bu 2 autodoc considers a variable member does not have any default value if its docstring contains \fB:meta hide\-value:\fP in its Info field lists \%<#\:info-field-lists>\&. Example: .INDENT 2.0 .INDENT 3.5 .sp .EX var1 = None #: :meta hide\-value: .EE .UNINDENT .UNINDENT .sp Added in version 3.5. .UNINDENT .SS Doc comments and docstrings .sp Python has no built\-in support for docstrings for module data members or class attributes. To allow documenting these, \fBautodoc\fP recognises a special format of comment \%<https://\:docs\:.python\:.org/\:3/\:reference/\:lexical_analysis\:.html#\:comments> called a \(aqdoc comment\(aq or \(aqdocumentation comment\(aq. .sp These comments start with a colon and an optional space character, \fB\(aq#:\(aq\fP or \fB\(aq#:\ \(aq\fP\&. To be recognised, the comments must appear either on the same line as the variable or on one or more lines before the variable. Multi\-line doc\-comments must always appear on the lines before the variable\(aqs definition. .sp For example, all three of the following variables have valid doc\-comments: .INDENT 0.0 .INDENT 3.5 .sp .EX egg_and_spam = 1.50 #: A simple meal #: Spam! Lovely spam! Lovely spam! egg_bacon_sausage_and_spam = 2.49 #: Truly gourmet cuisine for madam; Lobster Thermidor #: aux Crevettes with a mornay sauce garnished with #: truffle pate, brandy and a fried egg on top and spam. lobster_thermidor = 35.00 .EE .UNINDENT .UNINDENT .sp Alternatively, \fBautodoc\fP can recognise a docstring on the line immediately following the definition. .sp In the the following class definition, all attributes have documentation recognised by \fBautodoc\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX class Foo: \(dq\(dq\(dqDocstring for class Foo.\(dq\(dq\(dq #: Doc comment for class attribute Foo.bar. #: It can have multiple lines. bar = 1 flox = 1.5 #: Doc comment for Foo.flox. One line only. baz = 2 \(dq\(dq\(dqDocstring for class attribute Foo.baz.\(dq\(dq\(dq def __init__(self): #: Doc comment for instance attribute qux. self.qux = 3 self.spam = 4 \(dq\(dq\(dqDocstring for instance attribute spam.\(dq\(dq\(dq .EE .UNINDENT .UNINDENT .SS Directives .sp \fBautodoc\fP provides several directives that are versions of the usual \fBpy:module\fP \%<#\:directive-py-module>, \fBpy:class\fP \%<#\:directive-py-class> and so forth. On parsing time, they import the corresponding module and extract the docstring of the given objects, inserting them into the page source under a suitable \fBpy:module\fP \%<#\:directive-py-module>, \fBpy:class\fP \%<#\:directive-py-class> etc. directive. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Just as \fBpy:class\fP \%<#\:directive-py-class> respects the current \fBpy:module\fP \%<#\:directive-py-module>, \fBautoclass\fP will also do so. Likewise, \fBautomethod\fP will respect the current \fBpy:class\fP \%<#\:directive-py-class>\&. .UNINDENT .UNINDENT .SS Default directive options .sp To make any of the options described below the default, use the \fBautodoc_default_options\fP dictionary in \fBconf.py\fP\&. .sp If using defaults for the \fB:members:\fP, \fB:exclude\-members:\fP, \fB:private\-members:\fP, or \fB:special\-members:\fP options, setting the option on a directive will override the default. Instead, to extend the default list with the per\-directive option, the list may be prepended with a plus sign (\fB+\fP), as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. autoclass:: Noodle :members: eat :private\-members: +_spicy, _garlickly .EE .UNINDENT .UNINDENT .sp \fBTip:\fP .INDENT 0.0 .INDENT 3.5 If using \fBautodoc_default_options\fP, the defaults can be disabled per\-directive with the negated form, \fB:no\-\fP\fIoption\fP\fB:\fP as an option of the directive For example: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. automodule:: foo :no\-undoc\-members: .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS Automatically document modules .INDENT 0.0 .TP .B \&.. automodule:: Document a module. By default, the directive only inserts the docstring of the module itself: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. automodule:: noodles .EE .UNINDENT .UNINDENT .sp will produce source like this: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:module:: noodles The noodles module. .EE .UNINDENT .UNINDENT .sp The directive can also contain content of its own, which will be inserted into the resulting non\-auto directive source after the docstring (but before any automatic member documentation). .sp Therefore, you can also mix automatic and non\-automatic member documentation, as follows: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. automodule:: noodles :members: Noodle .. py:function:: boiled_noodle(time=10) Create a noodle that has been boiled for *time* minutes. .EE .UNINDENT .UNINDENT .sp Options .INDENT 7.0 .TP .B :no\-index: Do not generate an index entry for the documented module or any auto\-documented members. .sp Added in version 0.4. .UNINDENT .INDENT 7.0 .TP .B :no\-index\-entry: Do not generate an index entry for the documented module or any auto\-documented members. Unlike \fB:no\-index:\fP, cross\-references are still created. .sp Added in version 8.2. .UNINDENT .INDENT 7.0 .TP .B :platform: platforms (comma separated list) Indicate platforms on which the module is available. This is identical to \fBpy:module\fP \%<#\:directive-py-module>\(aqs \fB:platform:\fP option. .UNINDENT .INDENT 7.0 .TP .B :synopsis: purpose (text) A sentence describing the module\(aqs purpose. This is identical to \fBpy:module\fP \%<#\:directive-py-module>\(aqs \fB:synopsis:\fP option. .sp Added in version 0.5. .UNINDENT .INDENT 7.0 .TP .B :deprecated: Mark a module as deprecated. This is identical to \fBpy:module\fP \%<#\:directive-py-module>\(aqs \fB:deprecated:\fP option. .sp Added in version 0.5. .UNINDENT .INDENT 7.0 .TP .B :ignore\-module\-all: (no value) Do not use \fB__all__\fP when analysing the module to document. .sp Added in version 1.7. .UNINDENT .sp Options for selecting members to document .INDENT 7.0 .TP .B :members: (no value or comma separated list) Generate automatic documentation for all members of the target module: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. automodule:: noodles :members: .EE .UNINDENT .UNINDENT .sp By default, \fBautodoc\fP only includes public members with a docstring or doc\-comment (\fB#:\fP). If \fB__all__\fP exists, it will be used to define which members are public, unless the \fB:ignore\-module\-all:\fP option is set. .sp To only document certain members, an explicit comma\-separated list may be used as the argument to \fB:members:\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. automodule:: noodles :members: Noodle .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :exclude\-members: (comma separated list) Exclude the given names from the members to document. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. automodule:: noodles :members: :exclude\-members: NoodleBase .EE .UNINDENT .UNINDENT .sp Added in version 0.6. .UNINDENT .INDENT 7.0 .TP .B :imported\-members: (no value) To prevent documentation of imported classes or functions, in an \fBautomodule\fP directive with the \fBmembers\fP option set, only module members where the \fB__module__\fP attribute is equal to the module name given to \fBautomodule\fP will be documented. .sp Set the \fBimported\-members\fP option if you want to prevent this behavior and document all available members. .sp Note that attributes from imported modules will not be documented, because attribute documentation is discovered by parsing the source file of the current module. .sp Added in version 1.2. .UNINDENT .INDENT 7.0 .TP .B :undoc\-members: Generate automatic documentation for members of the target module that don\(aqt have a docstring or doc\-comment. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. automodule:: noodles :members: :undoc\-members: .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :private\-members: (no value or comma separated list) Generate automatic documentation for private members of the target module. This includes names with a leading underscore (e.g. \fB_private\fP) and those members explicitly marked as private with \fB:meta private:\fP\&. .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. automodule:: noodles :members: :private\-members: .EE .UNINDENT .UNINDENT .sp To only document certain private members, an explicit comma\-separated list may be used as the argument to \fB:private\-members:\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. automodule:: noodles :members: :private\-members: _spicy, _garlickly .EE .UNINDENT .UNINDENT .sp Added in version 1.1. .sp Changed in version 3.2: The option can now take a comma\-separated list of arguments. .UNINDENT .INDENT 7.0 .TP .B :special\-members: (no value or comma separated list) Generate automatic documentation for special members of the target module, also known as \(aqdunder\(aq names \%<https://\:docs\:.python\:.org/\:3/\:reference/\:datamodel\:.html#\:specialnames>\&. This includes all names enclosed with a double\-underscore, e.g. \fB__special__\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. automodule:: my.Class :members: :special\-members: .EE .UNINDENT .UNINDENT .sp To only document certain special members, an explicit comma\-separated list may be used as the argument to \fB:special\-members:\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. automodule:: noodles :members: :special\-members: __version__ .EE .UNINDENT .UNINDENT .sp Added in version 1.1. .sp Changed in version 1.2: The option can now take a comma\-separated list of arguments. .UNINDENT .sp Options for documented members .INDENT 7.0 .TP .B :member\-order: (alphabetical, bysource, or groupwise) Choose the ordering of automatically documented members (default: \fBalphabetical\fP). This overrides the \fBautodoc_member_order\fP setting. .INDENT 7.0 .IP \(bu 2 \fBalphabetical\fP: Use simple alphabetical order. .IP \(bu 2 \fBgroupwise\fP: Group by object type (class, function, etc), use alphabetical order within groups. .IP \(bu 2 \fBbysource\fP: Use the order of objects in the module\(aqs source. The \fB__all__\fP variable can be used to override this order. .UNINDENT .sp Note that for source order, the module must be a Python module with the source code available. .sp Added in version 0.6. .sp Changed in version 1.0: Support the \fB\(aqbysource\(aq\fP option. .UNINDENT .INDENT 7.0 .TP .B :show\-inheritance: (no value) Enable the \fB:show\-inheritance:\fP option for all members of the module, if \fB:members:\fP is enabled. .sp Added in version 0.4. .UNINDENT .UNINDENT .SS Automatically document classes or exceptions .INDENT 0.0 .TP .B \&.. autoclass:: .TP .B \&.. autoexception:: Document a class. For exception classes, prefer \fB\&.. autoexception::\fP\&. By default, the directive only inserts the docstring of the class itself: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle .EE .UNINDENT .UNINDENT .sp will produce source like this: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:class:: Noodle The Noodle class\(aqs docstring. .EE .UNINDENT .UNINDENT .sp The directive can also contain content of its own, which will be inserted into the resulting non\-auto directive source after the docstring (but before any automatic member documentation). .sp Therefore, you can also mix automatic and non\-automatic member documentation, as follows: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle :members: eat, slurp .. py:method:: boil(time=10) Boil the noodle for *time* minutes. .EE .UNINDENT .UNINDENT .sp Advanced usage .INDENT 7.0 .IP \(bu 2 It is possible to override the signature for explicitly documented callable objects (functions, methods, classes) with the regular syntax that will override the signature gained from introspection: .INDENT 2.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle(type) .. automethod:: eat(persona) .EE .UNINDENT .UNINDENT .sp This is useful if the signature from the method is hidden by a decorator. .sp Added in version 0.4. .UNINDENT .sp Options .INDENT 7.0 .TP .B :no\-index: Do not generate an index entry for the documented class or any auto\-documented members. .sp Added in version 0.4. .UNINDENT .INDENT 7.0 .TP .B :no\-index\-entry: Do not generate an index entry for the documented class or any auto\-documented members. Unlike \fB:no\-index:\fP, cross\-references are still created. .sp Added in version 8.2. .UNINDENT .INDENT 7.0 .TP .B :class\-doc\-from: (class, init, or both) Select which docstring will be used for the main body of the directive. This overrides the global value of \fBautoclass_content\fP\&. The possible values are: .INDENT 7.0 .IP \(bu 2 \fBclass\fP: Only use the class\(aqs docstring. The \fB__init__()\fP method can be separately documented using the \fB:members:\fP option or \fBautomethod\fP\&. .IP \(bu 2 \fBinit\fP: Only use the docstring of the \fB__init__()\fP method. .IP \(bu 2 \fBboth\fP: Use both, appending the docstring of the \fB__init__()\fP method to the class\(aqs docstring. .UNINDENT .sp If the \fB__init__()\fP method doesn\(aqt exist or has a blank docstring, \fBautodoc\fP will attempt to use the \fB__new__()\fP method\(aqs docstring, if it exists and is not blank. .sp Added in version 4.1. .UNINDENT .sp Options for selecting members to document .INDENT 7.0 .TP .B :members: (no value or comma separated list) Generate automatic documentation for all members of the target class: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle :members: .EE .UNINDENT .UNINDENT .sp By default, \fBautodoc\fP only includes public members with a docstring or doc\-comment (\fB#:\fP) that are attributes of the target class (i.e. not inherited). .sp To only document certain members, an explicit comma\-separated list may be used as the argument to \fB:members:\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle :members: eat, slurp .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :exclude\-members: (comma separated list) Exclude the given names from the members to document. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle :members: :exclude\-members: prepare .EE .UNINDENT .UNINDENT .sp Added in version 0.6. .UNINDENT .INDENT 7.0 .TP .B :inherited\-members: (comma separated list) To generate automatic documentation for members inherited from base classes, use the \fB:inherited\-members:\fP option: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle :members: :inherited\-members: .EE .UNINDENT .UNINDENT .sp This can be combined with the \fB:undoc\-members:\fP option to generate automatic documentation for \fIall\fP available members of the class. .sp The members of classes listed in the argument to \fB:inherited\-members:\fP are excluded from the automatic documentation. This defaults to \fBobject\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:object> if no argument is provided, meaning that members of the \fBobject\fP class are not documented. To include these, use \fBNone\fP as the argument. .sp For example; If your class \fBMyList\fP is derived from \fBlist\fP class and you don\(aqt want to document \fBlist.__len__()\fP, you should specify a option \fB:inherited\-members: list\fP to avoid special members of list class. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 Should any of the inherited members use a format other than reStructuredText for their docstrings, there may be markup warnings or errors. .UNINDENT .UNINDENT .sp Added in version 0.3. .sp Changed in version 3.0: \fB:inherited\-members:\fP now takes the name of a base class to exclude as an argument. .sp Changed in version 5.0: A comma separated list of base class names can be used. .UNINDENT .INDENT 7.0 .TP .B :undoc\-members: (no value) Generate automatic documentation for members of the target class that don\(aqt have a docstring or doc\-comment. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle :members: :undoc\-members: .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B :private\-members: (no value or comma separated list) Generate automatic documentation for private members of the target class. This includes names with a leading underscore (e.g. \fB_private\fP) and those members explicitly marked as private with \fB:meta private:\fP\&. .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle :members: :private\-members: .EE .UNINDENT .UNINDENT .sp To only document certain private members, an explicit comma\-separated list may be used as the argument to \fB:private\-members:\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle :members: :private\-members: _spicy, _garlickly .EE .UNINDENT .UNINDENT .sp Added in version 1.1. .sp Changed in version 3.2: The option can now take arguments. .UNINDENT .INDENT 7.0 .TP .B :special\-members: (no value or comma separated list) Generate automatic documentation for special members of the target class, also known as \(aqdunder\(aq names \%<https://\:docs\:.python\:.org/\:3/\:reference/\:datamodel\:.html#\:specialnames>\&. This includes all names enclosed with a double\-underscore, e.g. \fB__special__\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle :members: :special\-members: .EE .UNINDENT .UNINDENT .sp To only document certain special members, an explicit comma\-separated list may be used as the argument to \fB:special\-members:\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autoclass:: noodles.Noodle :members: :special\-members: __init__, __name__ .EE .UNINDENT .UNINDENT .sp Added in version 1.1. .sp Changed in version 1.2: The option can now take a comma\-separated list of arguments. .UNINDENT .sp Options for documented members .INDENT 7.0 .TP .B :member\-order: (alphabetical, bysource, or groupwise) Choose the ordering of automatically documented members (default: \fBalphabetical\fP). This overrides the \fBautodoc_member_order\fP setting. .INDENT 7.0 .IP \(bu 2 \fB\(aqalphabetical\(aq\fP: Use simple alphabetical order. .IP \(bu 2 \fB\(aqgroupwise\(aq\fP: Group by object type (class, function, etc), use alphabetical order within groups. .IP \(bu 2 \fB\(aqbysource\(aq\fP: Use the order of objects in the module\(aqs source. The \fB__all__\fP variable can be used to override this order. .UNINDENT .sp Note that for source order, the module must be a Python module with the source code available. .sp Added in version 0.6. .sp Changed in version 1.0: Support the \fB\(aqbysource\(aq\fP option. .UNINDENT .INDENT 7.0 .TP .B :show\-inheritance: (no value) Insert the class\(aqs base classes after the class signature. .sp Added in version 0.4. .UNINDENT .UNINDENT .SS Automatically document function\-like objects .INDENT 0.0 .TP .B \&.. autofunction:: .TP .B \&.. automethod:: .TP .B \&.. autoproperty:: .TP .B \&.. autodecorator:: Document a function, method, property, or decorator. By default, the directive only inserts the docstring of the function itself: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autofunction:: noodles.average_noodle .EE .UNINDENT .UNINDENT .sp will produce source like this: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:function:: noodles.average_noodle The average_noodle function\(aqs docstring. .EE .UNINDENT .UNINDENT .sp The directive can also contain content of its own, which will be inserted into the resulting non\-auto directive source after the docstring. .sp Therefore, you can also mix automatic and non\-automatic documentation, as follows: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autofunction:: noodles.average_noodle .. note:: For more flexibility, use the :py:class:\(ga!Noodle\(ga class. .EE .UNINDENT .UNINDENT .sp Added in version 2.0: \fBautodecorator\fP\&. .sp Added in version 2.1: \fBautoproperty\fP\&. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 If you document decorated functions or methods, keep in mind that \fBautodoc\fP retrieves its docstrings by importing the module and inspecting the \fB__doc__\fP attribute of the given function or method. That means that if a decorator replaces the decorated function with another, it must copy the original \fB__doc__\fP to the new function. .UNINDENT .UNINDENT .sp Advanced usage .INDENT 7.0 .IP \(bu 2 It is possible to override the signature for explicitly documented callable objects (functions, methods, classes) with the regular syntax that will override the signature gained from introspection: .INDENT 2.0 .INDENT 3.5 .sp .EX \&.. autoclass:: Noodle(type) .. automethod:: eat(persona) .EE .UNINDENT .UNINDENT .sp This is useful if the signature from the method is hidden by a decorator. .sp Added in version 0.4. .UNINDENT .sp Options .INDENT 7.0 .TP .B :no\-index: Do not generate an index entry for the documented function. .sp Added in version 0.4. .UNINDENT .INDENT 7.0 .TP .B :no\-index\-entry: Do not generate an index entry for the documented function. Unlike \fB:no\-index:\fP, cross\-references are still created. .sp Added in version 8.2. .UNINDENT .UNINDENT .SS Automatically document attributes or data .INDENT 0.0 .TP .B \&.. autodata:: .TP .B \&.. autoattribute:: Document a module level variable or constant (\(aqdata\(aq) or class attribute. By default, the directive only inserts the docstring of the variable itself: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autodata:: noodles.FLOUR_TYPE .EE .UNINDENT .UNINDENT .sp will produce source like this: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:data:: noodles.FLOUR_TYPE The FLOUR_TYPE constant\(aqs docstring. .EE .UNINDENT .UNINDENT .sp The directive can also contain content of its own, which will be inserted into the resulting non\-auto directive source after the docstring. .sp Therefore, you can also mix automatic and non\-automatic member documentation, as follows: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autodata:: noodles.FLOUR_TYPE .. hint:: Cooking time can vary by which flour type is used. .EE .UNINDENT .UNINDENT .sp Changed in version 0.6: \fBautodata\fP and \fBautoattribute\fP can now extract docstrings. .sp Changed in version 1.1: Doc\-comments are now allowed on the same line of an assignment. .sp Options .INDENT 7.0 .TP .B :no\-index: Do not generate an index entry for the documented variable or constant. .sp Added in version 0.4. .UNINDENT .INDENT 7.0 .TP .B :no\-index\-entry: Do not generate an index entry for the documented variable or constant. Unlike \fB:no\-index:\fP, cross\-references are still created. .sp Added in version 8.2. .UNINDENT .INDENT 7.0 .TP .B :annotation: value (string) Added in version 1.2. .sp By default, \fBautodoc\fP attempts to obtain the type annotation and value of the variable by introspection, displaying it after the variable\(aqs name. To override this, a custom string for the variable\(aqs value may be used as the argument to \fBannotation\fP\&. .sp For example, if the runtime value of \fBFILE_MODE\fP is \fB0o755\fP, the displayed value will be \fB493\fP (as \fBoct(493) == \(aq0o755\(aq\fP). This can be fixed by setting \fB:annotation: = 0o755\fP\&. .sp If \fB:annotation:\fP is used without arguments, no value or type hint will be shown for the variable. .UNINDENT .INDENT 7.0 .TP .B :no\-value: Added in version 3.4. .sp To display the type hint of the variable without a value, use the \fB:no\-value:\fP option. If both the \fB:annotation:\fP and \fB:no\-value:\fP options are used, \fB:no\-value:\fP has no effect. .UNINDENT .UNINDENT .SS Automatically document type aliases .INDENT 0.0 .TP .B \&.. autotype:: Added in version 9.0. .sp Document a \fBPEP 695\fP \%<https://\:peps\:.python\:.org/\:pep-0695/> type alias (the \fBtype\fP \%<https://\:docs\:.python\:.org/\:3/\:reference/\:simple_stmts\:.html#\:type> statement). By default, the directive only inserts the docstring of the alias itself: .sp The directive can also contain content of its own, which will be inserted into the resulting non\-auto directive source after the docstring (but before any automatic member documentation). .sp Therefore, you can also mix automatic and non\-automatic member documentation. .sp Options .INDENT 7.0 .TP .B :no\-index: Do not generate an index entry for the documented class or any auto\-documented members. .UNINDENT .INDENT 7.0 .TP .B :no\-index\-entry: Do not generate an index entry for the documented class or any auto\-documented members. Unlike \fB:no\-index:\fP, cross\-references are still created. .UNINDENT .UNINDENT .SS Configuration .sp There are also config values that you can set: .INDENT 0.0 .TP .B autodoc_use_legacy_class_based .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If true, autodoc will use the legacy class\-based implementation. This is the behaviour prior to Sphinx 9.0. It is based on the \fBDocumenter\fP class hierarchy. .sp This setting is provided for backwards compatibility if your documentation or an extension you use uses or monkeypatches the legacy class\-based API in Python code. If this is the case, set \fBautodoc_use_legacy_class_based = True\fP in your \fBconf.py\fP\&. Please also add a comment to the tracking issue on GitHub \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:issues/\:14089> so that the maintainers are aware of your use case, for possible future improvements. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The legacy class\-based implementation does not support PEP 695 type aliases. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B autoclass_content .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqclass\(aq\fP.UNINDENT .sp This value selects what content will be inserted into the main body of an \fBautoclass\fP directive. The possible values are: .INDENT 7.0 .TP .B \fB\(aqclass\(aq\fP Only the class\(aq docstring is inserted. You can still document \fB__init__\fP as a separate method using \fBautomethod\fP or the \fBmembers\fP option to \fBautoclass\fP\&. .TP .B \fB\(aqboth\(aq\fP Both the class\(aq and the \fB__init__\fP method\(aqs docstring are concatenated and inserted. .TP .B \fB\(aqinit\(aq\fP Only the \fB__init__\fP method\(aqs docstring is inserted. .UNINDENT .sp Added in version 0.3. .sp If the class has no \fB__init__\fP method or if the \fB__init__\fP method\(aqs docstring is empty, but the class has a \fB__new__\fP method\(aqs docstring, it is used instead. .sp Added in version 1.4. .UNINDENT .INDENT 0.0 .TP .B autodoc_class_signature .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqmixed\(aq\fP.UNINDENT .sp This value selects how the signature will be displayed for the class defined by \fBautoclass\fP directive. The possible values are: .INDENT 7.0 .TP .B \fB\(aqmixed\(aq\fP Display the signature with the class name. .TP .B \fB\(aqseparated\(aq\fP Display the signature as a method. .UNINDENT .sp Added in version 4.1. .UNINDENT .INDENT 0.0 .TP .B autodoc_member_order .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqalphabetical\(aq\fP.UNINDENT .sp Define the order in which \fBautomodule\fP and \fBautoclass\fP members are listed. Supported values are: .INDENT 7.0 .IP \(bu 2 \fB\(aqalphabetical\(aq\fP: Use alphabetical order. .IP \(bu 2 \fB\(aqgroupwise\(aq\fP: order by member type. The order is: .INDENT 2.0 .IP \(bu 2 for modules, exceptions, classes, functions, data .IP \(bu 2 .INDENT 2.0 .TP .B for classes: class methods, static methods, methods, and properties/attributes .UNINDENT .UNINDENT .sp Members are ordered alphabetically within groups. .IP \(bu 2 \fB\(aqbysource\(aq\fP: Use the order in which the members appear in the source code. This requires that the module must be a Python module with the source code available. .UNINDENT .sp Added in version 0.6. .sp Changed in version 1.0: Support for \fB\(aqbysource\(aq\fP\&. .UNINDENT .INDENT 0.0 .TP .B autodoc_default_options .INDENT 7.0 .TP .B Type \fBdict[str, str | bool]\fP.TP .B Default \fB{}\fP.UNINDENT .sp The default options for autodoc directives. They are applied to all autodoc directives automatically. It must be a dictionary which maps option names to the values. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX autodoc_default_options = { \(aqmembers\(aq: \(aqvar1, var2\(aq, \(aqmember\-order\(aq: \(aqbysource\(aq, \(aqspecial\-members\(aq: \(aq__init__\(aq, \(aqundoc\-members\(aq: True, \(aqexclude\-members\(aq: \(aq__weakref__\(aq } .EE .UNINDENT .UNINDENT .sp Setting \fBNone\fP or \fBTrue\fP to the value is equivalent to giving only the option name to the directives. .sp The supported options are: .INDENT 7.0 .IP \(bu 2 \fB\(aqmembers\(aq\fP: See \fBautomodule:members\fP\&. .IP \(bu 2 \fB\(aqundoc\-members\(aq\fP See \fBautomodule:undoc\-members\fP\&. .IP \(bu 2 \fB\(aqprivate\-members\(aq\fP: See \fBautomodule:private\-members\fP\&. .IP \(bu 2 \fB\(aqspecial\-members\(aq\fP: See \fBautomodule:special\-members\fP\&. .IP \(bu 2 \fB\(aqinherited\-members\(aq\fP: See \fBautoclass:inherited\-members\fP\&. .IP \(bu 2 \fB\(aqimported\-members\(aq\fP: See \fBautomodule:imported\-members\fP\&. .IP \(bu 2 \fB\(aqexclude\-members\(aq\fP: See \fBautomodule:exclude\-members\fP\&. .IP \(bu 2 \fB\(aqignore\-module\-all\(aq\fP: See \fBautomodule:ignore\-module\-all\fP\&. .IP \(bu 2 \fB\(aqmember\-order\(aq\fP: See \fBautomodule:member\-order\fP\&. .IP \(bu 2 \fB\(aqshow\-inheritance\(aq\fP: See \fBautoclass:show\-inheritance\fP\&. .IP \(bu 2 \fB\(aqclass\-doc\-from\(aq\fP: See \fBautoclass:class\-doc\-from\fP\&. .IP \(bu 2 \fB\(aqno\-value\(aq\fP: See \fBautodata:no\-value\fP\&. .IP \(bu 2 \fB\(aqno\-index\(aq\fP: See \fBautomodule:no\-index\fP\&. .IP \(bu 2 \fB\(aqno\-index\-entry\(aq\fP: See \fBautomodule:no\-index\-entry\fP\&. .UNINDENT .sp Added in version 1.8. .sp Changed in version 2.0: Accepts \fBTrue\fP as a value. .sp Changed in version 2.1: Added \fB\(aqimported\-members\(aq\fP\&. .sp Changed in version 4.1: Added \fB\(aqclass\-doc\-from\(aq\fP\&. .sp Changed in version 4.5: Added \fB\(aqno\-value\(aq\fP\&. .UNINDENT .INDENT 0.0 .TP .B autodoc_docstring_signature .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Functions imported from C modules cannot be introspected, and therefore the signature for such functions cannot be automatically determined. However, it is an often\-used convention to put the signature into the first line of the function\(aqs docstring. .sp If this boolean value is set to \fBTrue\fP (which is the default), autodoc will look at the first line of the docstring for functions and methods, and if it looks like a signature, use the line as the signature and remove it from the docstring content. .sp autodoc will continue to look for multiple signature lines, stopping at the first line that does not look like a signature. This is useful for declaring overloaded function signatures. .sp Added in version 1.1. .sp Changed in version 3.1: Support overloaded signatures .sp Changed in version 4.0: Overloaded signatures do not need to be separated by a backslash .UNINDENT .INDENT 0.0 .TP .B autodoc_mock_imports .INDENT 7.0 .TP .B Type \fBlist[str]\fP.TP .B Default \fB[]\fP.UNINDENT .sp This value contains a list of modules to be mocked up. This is useful when some external dependencies are not met at build time and break the building process. You may only specify the root package of the dependencies themselves and omit the sub\-modules: .INDENT 7.0 .INDENT 3.5 .sp .EX autodoc_mock_imports = [\(aqdjango\(aq] .EE .UNINDENT .UNINDENT .sp Will mock all imports under the \fBdjango\fP package. .sp Added in version 1.3. .sp Changed in version 1.6: This config value only requires to declare the top\-level modules that should be mocked. .UNINDENT .INDENT 0.0 .TP .B autodoc_typehints .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqsignature\(aq\fP.UNINDENT .sp This value controls how to represent typehints. The setting takes the following values: .INDENT 7.0 .IP \(bu 2 \fB\(aqsignature\(aq\fP \-\- Show typehints in the signature .IP \(bu 2 \fB\(aqdescription\(aq\fP \-\- Show typehints as content of the function or method The typehints of overloaded functions or methods will still be represented in the signature. .IP \(bu 2 \fB\(aqnone\(aq\fP \-\- Do not show typehints .IP \(bu 2 \fB\(aqboth\(aq\fP \-\- Show typehints in the signature and as content of the function or method .UNINDENT .sp Overloaded functions or methods will not have typehints included in the description because it is impossible to accurately represent all possible overloads as a list of parameters. .sp Added in version 2.1. .sp Added in version 3.0: New option \fB\(aqdescription\(aq\fP is added. .sp Added in version 4.1: New option \fB\(aqboth\(aq\fP is added. .UNINDENT .INDENT 0.0 .TP .B autodoc_typehints_description_target .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqall\(aq\fP.UNINDENT .sp This value controls whether the types of undocumented parameters and return values are documented when \fBautodoc_typehints\fP is set to \fB\(aqdescription\(aq\fP\&. Supported values: .INDENT 7.0 .IP \(bu 2 \fB\(aqall\(aq\fP: Types are documented for all parameters and return values, whether they are documented or not. .IP \(bu 2 \fB\(aqdocumented\(aq\fP: Types will only be documented for a parameter or a return value that is already documented by the docstring. .IP \(bu 2 \fB\(aqdocumented_params\(aq\fP: Parameter types will only be annotated if the parameter is documented in the docstring. The return type is always annotated (except if it is \fBNone\fP). .UNINDENT .sp Added in version 4.0. .sp Added in version 5.0: New option \fB\(aqdocumented_params\(aq\fP is added. .UNINDENT .INDENT 0.0 .TP .B autodoc_type_aliases .INDENT 7.0 .TP .B Type \fBdict[str, str]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary for users defined type aliases \%<https://\:mypy\:.readthedocs\:.io/\:en/\:latest/\:kinds_of_types\:.html#\:type-aliases> that maps a type name to the full\-qualified object name. It is used to keep type aliases not evaluated in the document. .sp The type aliases are only available if your program enables \fBPostponed Evaluation of Annotations (PEP 563)\fP \%<https://\:peps\:.python\:.org/\:pep-0563/> feature via \fBfrom __future__ import annotations\fP\&. .sp For example, there is code using a type alias: .INDENT 7.0 .INDENT 3.5 .sp .EX from __future__ import annotations AliasType = Union[List[Dict[Tuple[int, str], Set[int]]], Tuple[str, List[str]]] def f() \-> AliasType: ... .EE .UNINDENT .UNINDENT .sp If \fBautodoc_type_aliases\fP is not set, autodoc will generate internal mark\-up from this code as following: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:function:: f() \-> Union[List[Dict[Tuple[int, str], Set[int]]], Tuple[str, List[str]]] ... .EE .UNINDENT .UNINDENT .sp If you set \fBautodoc_type_aliases\fP as \fB{\(aqAliasType\(aq: \(aqyour.module.AliasType\(aq}\fP, it generates the following document internally: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. py:function:: f() \-> your.module.AliasType: ... .EE .UNINDENT .UNINDENT .sp Added in version 3.3. .UNINDENT .INDENT 0.0 .TP .B autodoc_typehints_format .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqshort\(aq\fP.UNINDENT .sp This value controls the format of typehints. The setting takes the following values: .INDENT 7.0 .IP \(bu 2 \fB\(aqfully\-qualified\(aq\fP \-\- Show the module name and its name of typehints .IP \(bu 2 \fB\(aqshort\(aq\fP \-\- Suppress the leading module names of the typehints (e.g. \fBio.StringIO\fP \-> \fBStringIO\fP) .UNINDENT .sp Added in version 4.4. .sp Changed in version 5.0: The default setting was changed to \fB\(aqshort\(aq\fP .UNINDENT .INDENT 0.0 .TP .B autodoc_preserve_defaults .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If True, the default argument values of functions will be not evaluated on generating document. It preserves them as is in the source code. .sp Added in version 4.0: Added as an experimental feature. This will be integrated into autodoc core in the future. .UNINDENT .INDENT 0.0 .TP .B autodoc_use_type_comments .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Attempt to read \fB# type: ...\fP comments from source code to supplement missing type annotations, if True. .sp This can be disabled if your source code does not use type comments, for example if it exclusively uses type annotations or does not use type hints of any kind. .sp Added in version 8.2: Added the option to disable the use of type comments in via the new \fBautodoc_use_type_comments\fP option, which defaults to \fBTrue\fP for backwards compatibility. The default will change to \fBFalse\fP in Sphinx 10. .UNINDENT .INDENT 0.0 .TP .B autodoc_warningiserror .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp This value controls the behavior of \fBsphinx\-build \-\-fail\-on\-warning\fP \%<#\:cmdoption-sphinx-build-W> during importing modules. If \fBFalse\fP is given, autodoc forcedly suppresses the error if the imported module emits warnings. .sp Changed in version 8.1: This option now has no effect as \fB\-\-fail\-on\-warning\fP no longer exits early. .UNINDENT .INDENT 0.0 .TP .B autodoc_inherit_docstrings .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp This value controls the docstrings inheritance. If set to True the docstring for classes or methods, if not explicitly set, is inherited from parents. .sp Added in version 1.7. .UNINDENT .INDENT 0.0 .TP .B suppress_warnings .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp \fBautodoc\fP supports suppressing warning messages via \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings>\&. It defines the following additional warnings types: .INDENT 7.0 .IP \(bu 2 autodoc .IP \(bu 2 autodoc.import_object .UNINDENT .UNINDENT .SS Docstring preprocessing .sp autodoc provides the following additional events: .INDENT 0.0 .TP .B autodoc\-process\-docstring(app, obj_type, name, obj, options, lines) Added in version 0.4. .sp Emitted when autodoc has read and processed a docstring. \fIlines\fP is a list of strings \-\- the lines of the processed docstring \-\- that the event handler can modify \fBin place\fP to change what Sphinx puts into the output. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- the Sphinx application object .IP \(bu 2 \fBobj_type\fP \-\- the type of the object which the docstring belongs to (one of \fB\(aqmodule\(aq\fP, \fB\(aqclass\(aq\fP, \fB\(aqexception\(aq\fP, \fB\(aqfunction\(aq\fP, \fB\(aqdecorator\(aq\fP, \fB\(aqmethod\(aq\fP, \fB\(aqproperty\(aq\fP, \fB\(aqattribute\(aq\fP, \fB\(aqdata\(aq\fP, or \fB\(aqtype\(aq\fP) .IP \(bu 2 \fBname\fP \-\- the fully qualified name of the object .IP \(bu 2 \fBobj\fP \-\- the object itself .IP \(bu 2 \fBoptions\fP \-\- the options given to the directive: an object with attributes corresponding to the options used in the auto directive, e.g. \fBinherited_members\fP, \fBundoc_members\fP, or \fBshow_inheritance\fP\&. .IP \(bu 2 \fBlines\fP \-\- the lines of the docstring, see above .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B autodoc\-before\-process\-signature(app, obj, bound_method) Added in version 2.4. .sp Emitted before autodoc formats a signature for an object. The event handler can modify an object to change its signature. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- the Sphinx application object .IP \(bu 2 \fBobj\fP \-\- the object itself .IP \(bu 2 \fBbound_method\fP \-\- a boolean indicates an object is bound method or not .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B autodoc\-process\-signature(app, obj_type, name, obj, options, signature, return_annotation) Added in version 0.5. .sp Emitted when autodoc has formatted a signature for an object. The event handler can return a new tuple \fB(signature, return_annotation)\fP to change what Sphinx puts into the output. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- the Sphinx application object .IP \(bu 2 \fBobj_type\fP \-\- the type of the object which the docstring belongs to (one of \fB\(aqmodule\(aq\fP, \fB\(aqclass\(aq\fP, \fB\(aqexception\(aq\fP, \fB\(aqfunction\(aq\fP, \fB\(aqdecorator\(aq\fP, \fB\(aqmethod\(aq\fP, \fB\(aqproperty\(aq\fP, \fB\(aqattribute\(aq\fP, \fB\(aqdata\(aq\fP, or \fB\(aqtype\(aq\fP) .IP \(bu 2 \fBname\fP \-\- the fully qualified name of the object .IP \(bu 2 \fBobj\fP \-\- the object itself .IP \(bu 2 \fBoptions\fP \-\- the options given to the directive: an object with attributes corresponding to the options used in the auto directive, e.g. \fBinherited_members\fP, \fBundoc_members\fP, or \fBshow_inheritance\fP\&. .IP \(bu 2 \fBsignature\fP \-\- function signature, as a string of the form \fB\(aq(parameter_1, parameter_2)\(aq\fP, or \fBNone\fP if introspection didn\(aqt succeed and signature wasn\(aqt specified in the directive. .IP \(bu 2 \fBreturn_annotation\fP \-\- function return annotation as a string of the form \fB\(aqannotation\(aq\fP, or \fB\(aq\(aq\fP if there is no return annotation. .UNINDENT .UNINDENT .UNINDENT .sp The \fBsphinx.ext.autodoc\fP module provides factory functions for commonly needed docstring processing in event \fBautodoc\-process\-docstring\fP: .INDENT 0.0 .TP .B sphinx.ext.autodoc.cut_lines(pre: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>, post: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 0, what: Sequence[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None) -> _AutodocProcessDocstringListener Return a listener that removes the first \fIpre\fP and last \fIpost\fP lines of every docstring. If \fIwhat\fP is a sequence of strings, only docstrings of a type in \fIwhat\fP will be processed. .sp Use like this (e.g. in the \fBsetup()\fP function of \fBconf.py\fP): .INDENT 7.0 .INDENT 3.5 .sp .EX from sphinx.ext.autodoc import cut_lines app.connect(\(aqautodoc\-process\-docstring\(aq, cut_lines(4, what={\(aqmodule\(aq})) .EE .UNINDENT .UNINDENT .sp This can (and should) be used in place of \fBautomodule_skip_lines\fP\&. .UNINDENT .INDENT 0.0 .TP .B sphinx.ext.autodoc.between(marker: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, what: Sequence[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, keepempty: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False, exclude: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> _AutodocProcessDocstringListener Return a listener that either keeps, or if \fIexclude\fP is True excludes, lines between lines that match the \fImarker\fP regular expression. If no line matches, the resulting docstring would be empty, so no change will be made unless \fIkeepempty\fP is true. .sp If \fIwhat\fP is a sequence of strings, only docstrings of a type in \fIwhat\fP will be processed. .UNINDENT .INDENT 0.0 .TP .B autodoc\-process\-bases(app, name, obj, _unused, bases) Emitted when autodoc has read and processed a class to determine the base\-classes. \fIbases\fP is a list of classes that the event handler can modify \fBin place\fP to change what Sphinx puts into the output. It\(aqs emitted only if the \fBshow\-inheritance\fP option is given. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- the Sphinx application object .IP \(bu 2 \fBname\fP \-\- the fully qualified name of the object .IP \(bu 2 \fBobj\fP \-\- the object itself .IP \(bu 2 \fB_unused\fP \-\- unused placeholder .IP \(bu 2 \fBbases\fP \-\- the list of base classes signature. see above. .UNINDENT .UNINDENT .sp Added in version 4.1. .sp Changed in version 4.3: \fBbases\fP can contain a string as a base class name. It will be processed as reStructuredText. .UNINDENT .SS Skipping members .sp autodoc allows the user to define a custom method for determining whether a member should be included in the documentation by using the following event: .INDENT 0.0 .TP .B autodoc\-skip\-member(app, obj_type, name, obj, skip, options) Added in version 0.5. .sp Emitted when autodoc has to decide whether a member should be included in the documentation. The member is excluded if a handler returns \fBTrue\fP\&. It is included if the handler returns \fBFalse\fP\&. .sp If more than one enabled extension handles the \fBautodoc\-skip\-member\fP event, autodoc will use the first non\-\fBNone\fP value returned by a handler. Handlers should return \fBNone\fP to fall back to the skipping behavior of autodoc and other enabled extensions. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- the Sphinx application object .IP \(bu 2 \fBobj_type\fP \-\- the type of the object which the docstring belongs to (one of \fB\(aqmodule\(aq\fP, \fB\(aqclass\(aq\fP, \fB\(aqexception\(aq\fP, \fB\(aqfunction\(aq\fP, \fB\(aqdecorator\(aq\fP, \fB\(aqmethod\(aq\fP, \fB\(aqproperty\(aq\fP, \fB\(aqattribute\(aq\fP, \fB\(aqdata\(aq\fP, or \fB\(aqtype\(aq\fP) .IP \(bu 2 \fBname\fP \-\- the fully qualified name of the object .IP \(bu 2 \fBobj\fP \-\- the object itself .IP \(bu 2 \fBskip\fP \-\- a boolean indicating if autodoc will skip this member if the user handler does not override the decision .IP \(bu 2 \fBoptions\fP \-\- the options given to the directive: an object with attributes corresponding to the options used in the auto directive, e.g. \fBinherited_members\fP, \fBundoc_members\fP, or \fBshow_inheritance\fP\&. .UNINDENT .UNINDENT .UNINDENT .SS \fBsphinx.ext.autosectionlabel\fP \-\- Allow referencing sections by their title .sp Added in version 1.4. .sp By default, cross\-references to sections use labels (see \fBref\fP \%<#\:role-ref>). This extension allows you to instead refer to sections by their title. .sp For example: .INDENT 0.0 .INDENT 3.5 .sp .EX A Plain Title \-\-\-\-\-\-\-\-\-\-\-\-\- This is the text of the section. It refers to the section title, see :ref:\(gaA Plain Title\(ga. .EE .UNINDENT .UNINDENT .sp Internally, this extension generates the labels for each section. If same section names are used in whole of document, any one is used for a target by default. The \fBautosectionlabel_prefix_document\fP configuration variable can be used to make headings which appear multiple times but in different documents unique. .SS Configuration .INDENT 0.0 .TP .B autosectionlabel_prefix_document .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp True to prefix each section label with the name of the document it is in, followed by a colon. For example, \fBindex:Introduction\fP for a section called \fBIntroduction\fP that appears in document \fBindex.rst\fP\&. Useful for avoiding ambiguity when the same section heading appears in different documents. .UNINDENT .INDENT 0.0 .TP .B autosectionlabel_maxdepth .INDENT 7.0 .TP .B Type \fBint | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp If set, autosectionlabel chooses the sections for labeling by its depth. For example, when set 1 to \fBautosectionlabel_maxdepth\fP, labels are generated only for top level sections, and deeper sections are not labeled. It defaults to \fBNone\fP (i.e. all sections are labeled). .UNINDENT .SS Debugging .sp The \fBWARNING: undefined label\fP indicates that your reference in \fBref\fP \%<#\:role-ref> is mis\-spelled. Invoking \fBsphinx\-build\fP with \fB\-vvv\fP (see \fB\-v\fP \%<https://\:docs\:.python\:.org/\:3/\:using/\:cmdline\:.html#\:cmdoption-v>) will print all section names and the labels that have been generated for them. This output can help finding the right reference label. .SS \fBsphinx.ext.autosummary\fP \-\- Generate autodoc summaries .sp Added in version 0.6. .sp This extension generates function/method/attribute summary lists, similar to those output e.g. by Epydoc and other API doc generation tools. This is especially useful when your docstrings are long and detailed, and putting each one of them on a separate page makes them easier to read. .sp The \fBsphinx.ext.autosummary\fP extension does this in two parts: .INDENT 0.0 .IP 1. 3 There is an \fBautosummary\fP directive for generating summary listings that contain links to the documented items, and short summary blurbs extracted from their docstrings. .IP 2. 3 A \fBautosummary\fP directive also generates short \(dqstub\(dq files for the entries listed in its content. These files by default contain only the corresponding \fBsphinx.ext.autodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> directive, but can be customized with templates. .sp The \fBsphinx\-autogen\fP script is also able to generate \(dqstub\(dq files from command line. .UNINDENT .INDENT 0.0 .TP .B \&.. autosummary:: Insert a table that contains links to documented items, and a short summary blurb (the first sentence of the docstring) for each of them. .sp The \fBautosummary\fP directive can also optionally serve as a \fBtoctree\fP \%<#\:directive-toctree> entry for the included items. Optionally, stub \fB\&.rst\fP files for these items can also be automatically generated when \fBautosummary_generate\fP is \fITrue\fP\&. .sp For example, .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. currentmodule:: sphinx \&.. autosummary:: environment.BuildEnvironment util.relative_uri .EE .UNINDENT .UNINDENT .sp produces a table like this: .TS box center; l|l. T{ \fBenvironment.BuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment>(app) T} T{ The environment in which the ReST files are translated. T} _ T{ \fButil.relative_uri\fP(base, to) T} T{ Return a relative URL from \fBbase\fP to \fBto\fP\&. T} .TE .sp Autosummary preprocesses the docstrings and signatures with the same \fBautodoc\-process\-docstring\fP \%<#\:event-autodoc-process-docstring> and \fBautodoc\-process\-signature\fP \%<#\:event-autodoc-process-signature> hooks as \fBautodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc>\&. .sp Options .INDENT 7.0 .TP .B :class: class names (a list of class names, separated by spaces) Assign class attributes \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:doctree\:.html#\:classes> to the table. This is a common option \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:common-options>\&. .sp Added in version 8.2. .UNINDENT .INDENT 7.0 .TP .B :toctree: optional directory name If you want the \fBautosummary\fP table to also serve as a \fBtoctree\fP \%<#\:directive-toctree> entry, use the \fBtoctree\fP option, for example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autosummary:: :toctree: DIRNAME sphinx.environment.BuildEnvironment sphinx.util.relative_uri .EE .UNINDENT .UNINDENT .sp The \fBtoctree\fP option also signals to the \fBsphinx\-autogen\fP script that stub pages should be generated for the entries listed in this directive. The option accepts a directory name as an argument; \fBsphinx\-autogen\fP will by default place its output in this directory. If no argument is given, output is placed in the same directory as the file that contains the directive. .sp Added in version 0.6. .UNINDENT .INDENT 7.0 .TP .B :caption: caption of ToC Add a caption to the toctree. .sp Added in version 3.1. .UNINDENT .INDENT 7.0 .TP .B :signatures: format How to display signatures. Valid values are .INDENT 7.0 .IP \(bu 2 \fBlong\fP (\fIdefault\fP): use a long signature. This is still cut off so that name plus signature do not exceed a certain length. .IP \(bu 2 \fBshort\fP: Function and class signatures are displayed as \fB(…)\fP if they have arguments and as \fB()\fP if they don\(aqt have arguments. .IP \(bu 2 \fBnone\fP: do not show signatures. .UNINDENT .sp Added in version 8.2. .UNINDENT .INDENT 7.0 .TP .B :nosignatures: Do not show function signatures in the summary. .sp This is equivalent to \fB:signatures: none\fP\&. .sp Added in version 0.6. .sp Changed in version 8.2: The directive option is superseded by the more general \fB:signatures: none\fP\&. .sp It will be deprecated and removed in a future version of Sphinx. .UNINDENT .INDENT 7.0 .TP .B :template: filename Specify a custom template for rendering the summary. For example, .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autosummary:: :template: mytemplate.rst sphinx.environment.BuildEnvironment .EE .UNINDENT .UNINDENT .sp would use the template \fBmytemplate.rst\fP in your \fBtemplates_path\fP \%<#\:confval-templates_path> to generate the pages for all entries listed. See Customizing templates below. .sp Added in version 1.0. .UNINDENT .INDENT 7.0 .TP .B :recursive: Generate documents for modules and sub\-packages recursively. For example, .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. autosummary:: :recursive: sphinx.environment.BuildEnvironment .EE .UNINDENT .UNINDENT .sp Added in version 3.1. .UNINDENT .UNINDENT .SS \fBsphinx\-autogen\fP \-\- generate autodoc stub pages .sp The \fBsphinx\-autogen\fP script can be used to conveniently generate stub documentation pages for items included in \fBautosummary\fP listings. .sp For example, the command .INDENT 0.0 .INDENT 3.5 .sp .EX $ sphinx\-autogen \-o generated *.rst .EE .UNINDENT .UNINDENT .sp will read all \fBautosummary\fP tables in the \fB*.rst\fP files that have the \fB:toctree:\fP option set, and output corresponding stub pages in directory \fBgenerated\fP for all documented items. The generated pages by default contain text of the form: .INDENT 0.0 .INDENT 3.5 .sp .EX sphinx.util.relative_uri ======================== \&.. autofunction:: sphinx.util.relative_uri .EE .UNINDENT .UNINDENT .sp If the \fB\-o\fP option is not given, the script will place the output files in the directories specified in the \fB:toctree:\fP options. .sp For more information, refer to the sphinx\-autogen documentation \%<> .SS Generating stub pages automatically .sp If you do not want to create stub pages with \fBsphinx\-autogen\fP, you can also use these config values: .INDENT 0.0 .TP .B autosummary_context .INDENT 7.0 .TP .B Type \fBdict[str, Any]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary of values to pass into the template engine\(aqs context for autosummary stubs files. .sp Added in version 3.1. .UNINDENT .INDENT 0.0 .TP .B autosummary_generate .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Boolean indicating whether to scan all found documents for autosummary directives, and to generate stub pages for each. .sp Can also be a list of documents for which stub pages should be generated. .sp The new files will be placed in the directories specified in the \fB:toctree:\fP options of the directives. .sp Changed in version 2.3: Emits \fBautodoc\-skip\-member\fP \%<#\:event-autodoc-skip-member> event as \fBautodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> does. .sp Changed in version 4.0: Enabled by default. .UNINDENT .INDENT 0.0 .TP .B autosummary_generate_overwrite .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If true, autosummary overwrites existing files by generated stub pages. .sp Added in version 3.0. .UNINDENT .INDENT 0.0 .TP .B autosummary_mock_imports .INDENT 7.0 .TP .B Type \fBlist[str]\fP.TP .B Default \fB[]\fP.UNINDENT .sp This value contains a list of modules to be mocked up. See \fBautodoc_mock_imports\fP \%<#\:confval-autodoc_mock_imports> for more details. It defaults to \fBautodoc_mock_imports\fP \%<#\:confval-autodoc_mock_imports>\&. .sp Added in version 2.0. .UNINDENT .INDENT 0.0 .TP .B autosummary_imported_members .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp A boolean flag indicating whether to document classes and functions imported in modules. .sp Added in version 2.1. .sp Changed in version 4.4: If \fBautosummary_ignore_module_all\fP is \fBFalse\fP, this configuration value is ignored for members listed in \fB__all__\fP\&. .UNINDENT .INDENT 0.0 .TP .B autosummary_ignore_module_all .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If \fBFalse\fP and a module has the \fB__all__\fP attribute set, autosummary documents every member listed in \fB__all__\fP and no others. .sp Note that if an imported member is listed in \fB__all__\fP, it will be documented regardless of the value of \fBautosummary_imported_members\fP\&. To match the behaviour of \fBfrom module import *\fP, set \fBautosummary_ignore_module_all\fP to False and \fBautosummary_imported_members\fP to True. .sp Added in version 4.4. .UNINDENT .INDENT 0.0 .TP .B autosummary_filename_map .INDENT 7.0 .TP .B Type \fBdict[str, str]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dict mapping object names to filenames. This is necessary to avoid filename conflicts where multiple objects have names that are indistinguishable when case is ignored, on file systems where filenames are case\-insensitive. .sp Added in version 3.2. .UNINDENT .SS Customizing templates .sp Added in version 1.0. .sp You can customize the stub page templates, in a similar way as the HTML Jinja templates, see Templating \%<#\:templating>\&. (\fBTemplateBridge\fP \%<#\:sphinx\:.application\:.TemplateBridge> is not supported.) .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 If you find yourself spending much time tailoring the stub templates, this may indicate that it\(aqs a better idea to write custom narrative documentation instead. .UNINDENT .UNINDENT .sp Autosummary uses the following Jinja template files: .INDENT 0.0 .IP \(bu 2 \fBautosummary/base.rst\fP \-\- fallback template .IP \(bu 2 \fBautosummary/module.rst\fP \-\- template for modules .IP \(bu 2 \fBautosummary/class.rst\fP \-\- template for classes .IP \(bu 2 \fBautosummary/function.rst\fP \-\- template for functions .IP \(bu 2 \fBautosummary/attribute.rst\fP \-\- template for class attributes .IP \(bu 2 \fBautosummary/method.rst\fP \-\- template for class methods .UNINDENT .sp The following variables are available in the templates: .INDENT 0.0 .TP .B name Name of the documented object, excluding the module and class parts. .UNINDENT .INDENT 0.0 .TP .B objname Name of the documented object, excluding the module parts. .UNINDENT .INDENT 0.0 .TP .B fullname Full name of the documented object, including module and class parts. .UNINDENT .INDENT 0.0 .TP .B objtype Type of the documented object, one of \fB\(dqmodule\(dq\fP, \fB\(dqfunction\(dq\fP, \fB\(dqclass\(dq\fP, \fB\(dqmethod\(dq\fP, \fB\(dqattribute\(dq\fP, \fB\(dqdata\(dq\fP, \fB\(dqobject\(dq\fP, \fB\(dqexception\(dq\fP, \fB\(dqnewvarattribute\(dq\fP, \fB\(dqnewtypedata\(dq\fP, \fB\(dqproperty\(dq\fP\&. .UNINDENT .INDENT 0.0 .TP .B module Name of the module the documented object belongs to. .UNINDENT .INDENT 0.0 .TP .B class Name of the class the documented object belongs to. Only available for methods and attributes. .UNINDENT .INDENT 0.0 .TP .B underline A string containing \fBlen(full_name) * \(aq=\(aq\fP\&. Use the \fBunderline\fP filter instead. .UNINDENT .INDENT 0.0 .TP .B members List containing names of all members of the module or class. Only available for modules and classes. .UNINDENT .INDENT 0.0 .TP .B inherited_members List containing names of all inherited members of class. Only available for classes. .sp Added in version 1.8.0. .UNINDENT .INDENT 0.0 .TP .B functions List containing names of \(dqpublic\(dq functions in the module. Here, \(dqpublic\(dq means that the name does not start with an underscore. Only available for modules. .UNINDENT .INDENT 0.0 .TP .B classes List containing names of \(dqpublic\(dq classes in the module. Only available for modules. .UNINDENT .INDENT 0.0 .TP .B exceptions List containing names of \(dqpublic\(dq exceptions in the module. Only available for modules. .UNINDENT .INDENT 0.0 .TP .B methods List containing names of \(dqpublic\(dq methods in the class. Only available for classes. .UNINDENT .INDENT 0.0 .TP .B attributes List containing names of \(dqpublic\(dq attributes in the class/module. Only available for classes and modules. .sp Changed in version 3.1: Attributes of modules are supported. .UNINDENT .INDENT 0.0 .TP .B modules List containing names of \(dqpublic\(dq modules in the package. Only available for modules that are packages and the \fBrecursive\fP option is on. .sp Added in version 3.1. .UNINDENT .sp Additionally, the following filters are available .INDENT 0.0 .TP .B escape(s) Escape any special characters in the text to be used in formatting RST contexts. For instance, this prevents asterisks making things bold. This replaces the builtin Jinja escape filter \%<https://\:jinja\:.palletsprojects\:.com/\:en/\:3\:.0\:.x/\:templates/#\:jinja-filters\:.escape> that does html\-escaping. .UNINDENT .INDENT 0.0 .TP .B underline(s, line=\(aq=\(aq) Add a title underline to a piece of text. .UNINDENT .sp For instance, \fB{{ fullname | escape | underline }}\fP should be used to produce the title of a page. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 You can use the \fBautosummary\fP directive in the stub pages. Stub pages are generated also based on these directives. .UNINDENT .UNINDENT .SS Autolink role .INDENT 0.0 .TP .B :autolink: The \fB:autolink:\fP role functions as \fB:py:obj:\fP when the referenced \fIname\fP can be resolved to a Python object, and otherwise it becomes simple emphasis. .sp There are some known design flaws. For example, in the case of multiple objects having the same name, \fBautolink\fP could resolve to the wrong object. It will fail silently if the referenced object is not found, for example due to a spelling mistake or renaming. This is sometimes unwanted behaviour. .sp Some users choose to configure their \fBdefault_role\fP \%<#\:confval-default_role> to \fBautolink\fP for \(aqsmart\(aq referencing using the default interpreted text role (\fB\(gacontent\(ga\fP). .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBany\fP \%<#\:role-any> .sp \fBpy:obj\fP \%<#\:role-py-obj> .UNINDENT .UNINDENT .UNINDENT .SS \fBsphinx.ext.coverage\fP \-\- Collect doc coverage stats .sp This extension features one additional builder, the \fBCoverageBuilder\fP\&. .INDENT 0.0 .INDENT 3.5 .SS Todo .sp Write this section. .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The sphinx\-apidoc \%<> command can be used to automatically generate API documentation for all code in a project, avoiding the need to manually author these documents and keep them up\-to\-date. .UNINDENT .UNINDENT .sp \fBWarning:\fP .INDENT 0.0 .INDENT 3.5 \fBcoverage\fP \fBimports\fP the modules to be documented. If any modules have side effects on import, these will be executed by the coverage builder when \fBsphinx\-build\fP is run. .sp If you document scripts (as opposed to library modules), make sure their main routine is protected by a \fBif __name__ == \(aq__main__\(aq\fP condition. .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 For Sphinx (actually, the Python interpreter that executes Sphinx) to find your module, it must be importable. That means that the module or the package must be in one of the directories on \fBsys.path\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:sys\:.html#\:sys\:.path> \-\- adapt your \fBsys.path\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:sys\:.html#\:sys\:.path> in the configuration file accordingly. .UNINDENT .UNINDENT .sp To use this builder, activate the coverage extension in your configuration file and run \fBsphinx\-build \-M coverage\fP on the command line. .SS Builder .INDENT 0.0 .TP .B class sphinx.ext.coverage.CoverageBuilder .UNINDENT .SS Configuration .sp Several configuration values can be used to specify what the builder should check: .INDENT 0.0 .TP .B coverage_modules .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp List of Python packages or modules to test coverage for. When this is provided, Sphinx will introspect each package or module provided in this list as well as all sub\-packages and sub\-modules found in each. When this is not provided, Sphinx will only provide coverage for Python packages and modules that it is aware of: that is, any modules documented using the \fBpy:module\fP \%<#\:directive-py-module> directive provided in the Python domain \%<> or the \fBautomodule\fP \%<#\:directive-automodule> directive provided by the \fBautodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> extension. .sp Added in version 7.4. .UNINDENT .INDENT 0.0 .TP .B coverage_ignore_modules .TP .B coverage_ignore_functions .TP .B coverage_ignore_classes .TP .B coverage_ignore_pyobjects .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp List of Python regular expressions \%<https://\:docs\:.python\:.org/\:library/re>\&. .sp If any of these regular expressions matches any part of the full import path of a Python object, that Python object is excluded from the documentation coverage report. .sp Added in version 2.1. .UNINDENT .INDENT 0.0 .TP .B coverage_c_path .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .UNINDENT .INDENT 0.0 .TP .B coverage_c_regexes .INDENT 7.0 .TP .B Type \fBdict[str, str]\fP.TP .B Default \fB{}\fP.UNINDENT .UNINDENT .INDENT 0.0 .TP .B coverage_ignore_c_items .INDENT 7.0 .TP .B Type \fBdict[str, Sequence[str]]\fP.TP .B Default \fB{}\fP.UNINDENT .UNINDENT .INDENT 0.0 .TP .B coverage_write_headline .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Set to \fBFalse\fP to not write headlines. .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B coverage_skip_undoc_in_source .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Skip objects that are not documented in the source with a docstring. .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B coverage_show_missing_items .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Print objects that are missing to standard output also. .sp Added in version 3.1. .UNINDENT .INDENT 0.0 .TP .B coverage_statistics_to_report .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Print a tabular report of the coverage statistics to the coverage report. .sp Example output: .INDENT 7.0 .INDENT 3.5 .sp .EX +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | Module | Coverage | Undocumented | +=======================+==========+==============+ | package.foo_module | 100.00% | 0 | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | package.bar_module | 83.33% | 1 | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ .EE .UNINDENT .UNINDENT .sp Added in version 7.2. .UNINDENT .INDENT 0.0 .TP .B coverage_statistics_to_stdout .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Print a tabular report of the coverage statistics to standard output. .sp Example output: .INDENT 7.0 .INDENT 3.5 .sp .EX +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | Module | Coverage | Undocumented | +=======================+==========+==============+ | package.foo_module | 100.00% | 0 | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | package.bar_module | 83.33% | 1 | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ .EE .UNINDENT .UNINDENT .sp Added in version 7.2. .UNINDENT .SS \fBsphinx.ext.doctest\fP \-\- Test snippets in the documentation .sp It is often helpful to include snippets of code in your documentation and demonstrate the results of executing them. But it is important to ensure that the documentation stays up\-to\-date with the code. .sp This extension allows you to test such code snippets in the documentation in a natural way. If you mark the code blocks as shown here, the \fBdoctest\fP builder will collect them and run them as doctest tests. .sp Within each document, you can assign each snippet to a \fIgroup\fP\&. Each group consists of: .INDENT 0.0 .IP \(bu 2 zero or more \fIsetup code\fP blocks (e.g. importing the module to test) .IP \(bu 2 one or more \fItest\fP blocks .UNINDENT .sp When building the docs with the \fBdoctest\fP builder, groups are collected for each document and run one after the other, first executing setup code blocks, then the test blocks in the order they appear in the file. .sp There are two kinds of test blocks: .INDENT 0.0 .IP \(bu 2 \fIdoctest\-style\fP blocks mimic interactive sessions by interleaving Python code (including the interpreter prompt) and output. .IP \(bu 2 \fIcode\-output\-style\fP blocks consist of an ordinary piece of Python code, and optionally, a piece of output for that code. .UNINDENT .SS Directives .sp The \fIgroup\fP argument below is interpreted as follows: if it is empty, the block is assigned to the group named \fBdefault\fP\&. If it is \fB*\fP, the block is assigned to all groups (including the \fBdefault\fP group). Otherwise, it must be a comma\-separated list of group names. .INDENT 0.0 .TP .B \&.. testsetup:: [group] A setup code block. This code is not shown in the output for other builders, but executed before the doctests of the group(s) it belongs to. .sp Options .INDENT 7.0 .TP .B :skipif: condition (text) Skip the directive if the python expression \fIcondition\fP is True. See skipping tests conditionally\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. testcleanup:: [group] A cleanup code block. This code is not shown in the output for other builders, but executed after the doctests of the group(s) it belongs to. .sp Added in version 1.1. .sp Options .INDENT 7.0 .TP .B :skipif: condition (text) Skip the directive if the python expression \fIcondition\fP is True. See skipping tests conditionally\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. doctest:: [group] A doctest\-style code block. You can use standard \fBdoctest\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:doctest\:.html#\:module-doctest> flags for controlling how actual output is compared with what you give as output. The default set of flags is specified by the \fBdoctest_default_flags\fP configuration variable. .sp Options .INDENT 7.0 .TP .B :hide: Hide the doctest block in other builders. By default it is shown as a highlighted doctest block. .UNINDENT .INDENT 7.0 .TP .B :options: doctest flags (comma separated list) A comma\-separated list of doctest flags that apply to each example in the tests. (You still can give explicit flags per example, with doctest comments, but they will show up in other builders too.) .sp Alternatively, you can give inline doctest options, like in doctest: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> datetime.date.now() datetime.date(2008, 1, 1) .EE .UNINDENT .UNINDENT .sp They will be respected when the test is run, but by default will be stripped from presentation output. You can prevent stripping using the option \fBdoctest:no\-trim\-doctest\-flags\fP\&. .UNINDENT .INDENT 7.0 .TP .B :pyversion: (text) Specify the required Python version for the example to be tested. For instance, in the following case the example will be tested only for Python versions greater than 3.14: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. doctest:: :pyversion: > 3.14 .EE .UNINDENT .UNINDENT .sp The following operands are supported: .INDENT 7.0 .IP \(bu 2 \fB~=\fP: Compatible release clause .IP \(bu 2 \fB==\fP: Version matching clause .IP \(bu 2 \fB!=\fP: Version exclusion clause .IP \(bu 2 \fB<=\fP, \fB>=\fP: Inclusive ordered comparison clause .IP \(bu 2 \fB<\fP, \fB>\fP: Exclusive ordered comparison clause .IP \(bu 2 \fB===\fP: Arbitrary equality clause. .UNINDENT .sp \fBpyversion\fP option is followed \fBPEP\-440: Version Specifiers\fP \%<https://\:peps\:.python\:.org/\:pep-0440/#\:version-specifiers>\&. .sp Added in version 1.6. .sp Changed in version 1.7: Supported PEP\-440 operands and notations .UNINDENT .INDENT 7.0 .TP .B :trim\-doctest\-flags: .TP .B :no\-trim\-doctest\-flags: Whether to trim remove doctest flags (comments looking like \fB# doctest: FLAG, ...\fP) at the ends of lines and \fB<BLANKLINE>\fP markers individually. Default is \fBtrim\-doctest\-flags\fP\&. .sp Note that like with standard doctests, you have to use \fB<BLANKLINE>\fP to signal a blank line in the expected output. The \fB<BLANKLINE>\fP is removed when building presentation output (HTML, LaTeX etc.). .UNINDENT .INDENT 7.0 .TP .B :skipif: condition (text) Skip the directive if the python expression \fIcondition\fP is True. See skipping tests conditionally\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. testcode:: [group] A code block for a code\-output\-style test. .sp Options .INDENT 7.0 .TP .B :hide: Hide the code block in other builders. By default it is shown as a highlighted code block. .UNINDENT .INDENT 7.0 .TP .B :trim\-doctest\-flags: .TP .B :no\-trim\-doctest\-flags: Whether to trim remove doctest flags (comments looking like \fB# doctest: FLAG, ...\fP) at the ends of lines and \fB<BLANKLINE>\fP markers individually. Default is \fBtrim\-doctest\-flags\fP\&. .UNINDENT .INDENT 7.0 .TP .B :skipif: condition (text) Skip the directive if the python expression \fIcondition\fP is True. See skipping tests conditionally\&. .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 Code in a \fBtestcode\fP block is always executed all at once, no matter how many statements it contains. Therefore, output will \fInot\fP be generated for bare expressions \-\- use \fBprint\fP\&. Example: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. testcode:: 1+1 # this will give no output! print(2+2) # this will give output \&.. testoutput:: 4 .EE .UNINDENT .UNINDENT .sp Also, please be aware that since the doctest module does not support mixing regular output and an exception message in the same snippet, this applies to testcode/testoutput as well. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. testoutput:: [group] The corresponding output, or the exception message, for the last \fBtestcode\fP block. .INDENT 7.0 .TP .B :hide: Hide the doctest block in other builders. By default it is shown as a highlighted doctest block. .UNINDENT .INDENT 7.0 .TP .B :options: doctest flags (comma separated list) A comma\-separated list of doctest flags. .UNINDENT .INDENT 7.0 .TP .B :trim\-doctest\-flags: .TP .B :no\-trim\-doctest\-flags: Whether to trim remove doctest flags (comments looking like \fB# doctest: FLAG, ...\fP) at the ends of lines and \fB<BLANKLINE>\fP markers individually. Default is \fBtrim\-doctest\-flags\fP\&. .UNINDENT .INDENT 7.0 .TP .B :skipif: condition (text) Skip the directive if the python expression \fIcondition\fP is True. See skipping tests conditionally\&. .UNINDENT .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. testcode:: print(\(aqOutput text.\(aq) \&.. testoutput:: :hide: :options: \-ELLIPSIS, +NORMALIZE_WHITESPACE Output text. .EE .UNINDENT .UNINDENT .UNINDENT .sp The following is an example for the usage of the directives. The test via \fBdoctest\fP and the test via \fBtestcode\fP and \fBtestoutput\fP are equivalent. .INDENT 0.0 .INDENT 3.5 .sp .EX The parrot module ================= \&.. testsetup:: * import parrot The parrot module is a module about parrots. Doctest example: \&.. doctest:: >>> parrot.voom(3000) This parrot wouldn\(aqt voom if you put 3000 volts through it! Test\-Output example: \&.. testcode:: parrot.voom(3000) This would output: \&.. testoutput:: This parrot wouldn\(aqt voom if you put 3000 volts through it! .EE .UNINDENT .UNINDENT .SS Skipping tests conditionally .sp \fBskipif\fP, a string option, can be used to skip directives conditionally. This may be useful e.g. when a different set of tests should be run depending on the environment (hardware, network/VPN, optional dependencies or different versions of dependencies). The \fBskipif\fP option is supported by all of the doctest directives. Below are typical use cases for \fBskipif\fP when used for different directives: .INDENT 0.0 .IP \(bu 2 \fBtestsetup\fP and \fBtestcleanup\fP .INDENT 2.0 .IP \(bu 2 conditionally skip test setup and/or cleanup .IP \(bu 2 customize setup/cleanup code per environment .UNINDENT .IP \(bu 2 \fBdoctest\fP .INDENT 2.0 .IP \(bu 2 conditionally skip both a test and its output verification .UNINDENT .IP \(bu 2 \fBtestcode\fP .INDENT 2.0 .IP \(bu 2 conditionally skip a test .IP \(bu 2 customize test code per environment .UNINDENT .IP \(bu 2 \fBtestoutput\fP .INDENT 2.0 .IP \(bu 2 conditionally skip output assertion for a skipped test .IP \(bu 2 expect different output depending on the environment .UNINDENT .UNINDENT .sp The value of the \fBskipif\fP option is evaluated as a Python expression. If the result is a true value, the directive is omitted from the test run just as if it wasn\(aqt present in the file at all. .sp Instead of repeating an expression, the \fBdoctest_global_setup\fP configuration option can be used to assign it to a variable which can then be used instead. .sp Here\(aqs an example which skips some tests if Pandas is not installed: .sp conf.py .INDENT 0.0 .INDENT 3.5 .sp .EX extensions = [\(aqsphinx.ext.doctest\(aq] doctest_global_setup = \(aq\(aq\(aq try: import pandas as pd except ImportError: pd = None \(aq\(aq\(aq .EE .UNINDENT .UNINDENT .sp contents.rst .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. testsetup:: :skipif: pd is None data = pd.Series([42]) \&.. doctest:: :skipif: pd is None >>> data.iloc[0] 42 \&.. testcode:: :skipif: pd is None print(data.iloc[\-1]) \&.. testoutput:: :skipif: pd is None 42 .EE .UNINDENT .UNINDENT .SS Configuration .sp The doctest extension uses the following configuration values: .INDENT 0.0 .TP .B doctest_default_flags .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fBELLIPSIS | IGNORE_EXCEPTION_DETAIL | DONT_ACCEPT_TRUE_FOR_1\fP.UNINDENT .sp By default, these options are enabled: .INDENT 7.0 .IP \(bu 2 \fBELLIPSIS\fP, allowing you to put ellipses in the expected output that match anything in the actual output; .IP \(bu 2 \fBIGNORE_EXCEPTION_DETAIL\fP, causing everything following the leftmost colon and any module information in the exception name to be ignored; .IP \(bu 2 \fBDONT_ACCEPT_TRUE_FOR_1\fP, rejecting \(dqTrue\(dq in the output where \(dq1\(dq is given \-\- the default behavior of accepting this substitution is a relic of pre\-Python 2.2 times. .UNINDENT .sp Added in version 1.5. .UNINDENT .INDENT 0.0 .TP .B doctest_show_successes .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Controls whether successes are reported. .sp For a project with many doctests, it may be useful to set this to \fBFalse\fP to only highlight failures. .sp Added in version 7.2. .UNINDENT .INDENT 0.0 .TP .B doctest_path .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp A list of directories that will be added to \fBsys.path\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:sys\:.html#\:sys\:.path> when the doctest builder is used. (Make sure it contains absolute paths.) .UNINDENT .INDENT 0.0 .TP .B doctest_global_setup .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp Python code that is treated like it were put in a \fBtestsetup\fP directive for \fIevery\fP file that is tested, and for every group. You can use this to e.g. import modules you will always need in your doctests. .sp Added in version 0.6. .UNINDENT .INDENT 0.0 .TP .B doctest_global_cleanup .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp Python code that is treated like it were put in a \fBtestcleanup\fP directive for \fIevery\fP file that is tested, and for every group. You can use this to e.g. remove any temporary files that the tests leave behind. .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B doctest_test_doctest_blocks .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqdefault\(aq\fP.UNINDENT .sp If this is a nonempty string, standard reStructuredText doctest blocks will be tested too. They will be assigned to the group name given. .sp reStructuredText doctest blocks are simply doctests put into a paragraph of their own, like so: .INDENT 7.0 .INDENT 3.5 .sp .EX Some documentation text. >>> print(1) 1 Some more documentation text. .EE .UNINDENT .UNINDENT .sp (Note that no special \fB::\fP is used to introduce a doctest block; docutils recognizes them from the leading \fB>>>\fP\&. Also, no additional indentation is used, though it doesn\(aqt hurt.) .sp If this value is left at its default value, the above snippet is interpreted by the doctest builder exactly like the following: .INDENT 7.0 .INDENT 3.5 .sp .EX Some documentation text. \&.. doctest:: >>> print(1) 1 Some more documentation text. .EE .UNINDENT .UNINDENT .sp This feature makes it easy for you to test doctests in docstrings included with the \fBautodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> extension without marking them up with a special directive. .sp Note though that you can\(aqt have blank lines in reStructuredText doctest blocks. They will be interpreted as one block ending and another one starting. Also, removal of \fB<BLANKLINE>\fP and \fB# doctest:\fP options only works in \fBdoctest\fP blocks, though you may set \fBtrim_doctest_flags\fP \%<#\:confval-trim_doctest_flags> to achieve that in all code blocks with Python console content. .UNINDENT .INDENT 0.0 .TP .B doctest_fail_fast .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp Exit when the first failure is encountered. .sp Added in version 9.0. .UNINDENT .SS \fBsphinx.ext.duration\fP \-\- Measure durations of Sphinx processing .sp Added in version 2.4. .sp This extension measures durations of Sphinx processing when reading documents and is useful for inspecting what document is slowly built. Durations are printed to console at the end of the build and saved to a JSON file in the output directory by default. .sp Enable this extension by adding \fB\(aqsphinx.ext.duration\(aq\fP to the \fBextensions\fP \%<#\:confval-extensions> list in your \fBconf.py\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX extensions = [ ... \(aqsphinx.ext.duration\(aq, ] .EE .UNINDENT .UNINDENT .SS Configuration .INDENT 0.0 .TP .B duration_print_total .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Show the total reading duration in the build summary, e.g.: .INDENT 7.0 .INDENT 3.5 .sp .EX ====================== total reading duration ========================== Total time reading 31 files: 0m 3.142s .EE .UNINDENT .UNINDENT .sp Added in version 9.0. .UNINDENT .INDENT 0.0 .TP .B duration_print_slowest .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp Show the slowest durations in the build summary. The durations are sorted in order from slowest to fastest. This prints up to \fBduration_n_slowest\fP durations, e.g.: .INDENT 7.0 .INDENT 3.5 .sp .EX ====================== slowest 5 reading durations ======================= 0.012s spam 0.011s ham 0.011s eggs 0.006s lobster 0.005s beans .EE .UNINDENT .UNINDENT .sp Added in version 9.0. .UNINDENT .INDENT 0.0 .TP .B duration_n_slowest .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fB5\fP.UNINDENT .sp Maximum number of slowest durations to show in the build summary when \fBduration_print_slowest\fP is enabled. By default, only the \fB5\fP slowest durations are shown. Set this to \fB0\fP to show all durations. .sp Added in version 9.0. .UNINDENT .INDENT 0.0 .TP .B duration_write_json .INDENT 7.0 .TP .B Type \fBstr | None\fP.TP .B Default \fB\(aqsphinx\-reading\-durations.json\(aq\fP.UNINDENT .sp Write all reading durations to a JSON file in the output directory The file contents are a map of the document names to reading durations, where document names are strings and durations are floats in seconds. Set this value to an empty string or \fBNone\fP to disable writing the file, or set it to a relative path to customize it. .sp This may be useful for testing and setting a limit on reading times. .sp Added in version 9.0. .UNINDENT .INDENT 0.0 .TP .B duration_limit .INDENT 7.0 .TP .B Type \fBfloat | int | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp Set a duration limit (in seconds) for reading a document. If any duration exceeds this value, a warning is emitted. .sp Added in version 9.0. .UNINDENT .SS \fBsphinx.ext.extlinks\fP \-\- Markup to shorten external links .sp \fIModule author: Georg Brandl\fP .sp Added in version 1.0. .sp This extension is meant to help with the common pattern of having many external links that point to URLs on one and the same site, e.g. links to bug trackers, version control web interfaces, or simply subpages in other websites. It does so by providing aliases to base URLs, so that you only need to give the subpage name when creating a link. .sp Let\(aqs assume that you want to include many links to issues at the Sphinx tracker, at \fBhttps://github.com/sphinx\-doc/sphinx/issues/\fP\fInum\fP\&. Typing this URL again and again is tedious, so you can use \fBextlinks\fP to avoid repeating yourself. .sp The extension adds a config value: .INDENT 0.0 .TP .B extlinks .INDENT 7.0 .TP .B Type \fBdict[str, tuple[str, str | None]]\fP.TP .B Default \fB{}\fP.UNINDENT .sp This config value must be a dictionary of external sites, mapping unique short alias names to a \fIbase URL\fP and a \fIcaption\fP\&. For example, to create an alias for the above mentioned issues, you would add .INDENT 7.0 .INDENT 3.5 .sp .EX extlinks = {\(aqissue\(aq: (\(aqhttps://github.com/sphinx\-doc/sphinx/issues/%s\(aq, \(aqissue %s\(aq)} .EE .UNINDENT .UNINDENT .sp Now, you can use the alias name as a new role, e.g. \fB:issue:\(ga123\(ga\fP\&. This then inserts a link to \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:issues/\:123>\&. As you can see, the target given in the role is substituted in the \fIbase URL\fP in the place of \fB%s\fP\&. .sp The link caption depends on the second item in the tuple, the \fIcaption\fP: .INDENT 7.0 .IP \(bu 2 If \fIcaption\fP is \fBNone\fP, the link caption is the full URL. .IP \(bu 2 If \fIcaption\fP is a string, then it must contain \fB%s\fP exactly once. In this case the link caption is \fIcaption\fP with the partial URL substituted for \fB%s\fP \-\- in the above example, the link caption would be \fBissue 123\fP\&. .UNINDENT .sp To produce a literal \fB%\fP in either \fIbase URL\fP or \fIcaption\fP, use \fB%%\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX extlinks = {\(aqKnR\(aq: (\(aqhttps://example.org/K%%26R/page/%s\(aq, \(aq[K&R; page %s]\(aq)} .EE .UNINDENT .UNINDENT .sp You can also use the usual \(dqexplicit title\(dq syntax supported by other roles that generate links, i.e. \fB:issue:\(gathis issue <123>\(ga\fP\&. In this case, the \fIcaption\fP is not relevant. .sp Changed in version 4.0: Support to substitute by \(aq%s\(aq in the caption. .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Since links are generated from the role in the reading stage, they appear as ordinary links to e.g. the \fBlinkcheck\fP builder. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B extlinks_detect_hardcoded_links .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If enabled, extlinks emits a warning if a hardcoded link is replaceable by an extlink, and suggests a replacement via warning. .sp Added in version 4.5. .UNINDENT .SS \fBsphinx.ext.githubpages\fP \-\- Publish HTML docs in GitHub Pages .sp Added in version 1.4. .sp Changed in version 2.0: Support \fBCNAME\fP file .sp This extension creates \fB\&.nojekyll\fP file on generated HTML directory to publish the document on GitHub Pages. .sp It also creates a \fBCNAME\fP file for custom domains when \fBhtml_baseurl\fP \%<#\:confval-html_baseurl> set. .SS \fBsphinx.ext.graphviz\fP \-\- Add Graphviz graphs .sp Added in version 0.6. .sp This extension allows you to embed Graphviz \%<https://\:graphviz\:.org/> graphs in your documents. .sp It adds these directives: .INDENT 0.0 .TP .B \&.. graphviz:: Directive to embed graphviz code. The input code for \fBdot\fP is given as the content. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. graphviz:: digraph foo { \(dqbar\(dq \-> \(dqbaz\(dq; } .EE .UNINDENT .UNINDENT .sp In HTML output, the code will be rendered to a PNG or SVG image (see \fBgraphviz_output_format\fP). In LaTeX output, the code will be rendered to an embeddable PDF file. .sp You can also embed external dot files, by giving the file name as an argument to \fBgraphviz\fP and no additional content: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. graphviz:: external.dot .EE .UNINDENT .UNINDENT .sp As for all file references in Sphinx, if the filename is absolute, it is taken as relative to the source directory. .sp Changed in version 1.1: Added support for external files. .sp options .INDENT 7.0 .TP .B :alt: alternate text (text) The alternate text of the graph. By default, the graph code is used to the alternate text. .sp Added in version 1.0. .UNINDENT .INDENT 7.0 .TP .B :align: alignment of the graph (left, center or right) The horizontal alignment of the graph. .sp Added in version 1.5. .UNINDENT .INDENT 7.0 .TP .B :caption: caption of the graph (text) The caption of the graph. .sp Added in version 1.1. .UNINDENT .INDENT 7.0 .TP .B :layout: layout type of the graph (text) The layout of the graph (e.g. \fBdot\fP, \fBneato\fP and so on). A path to the graphviz commands are also allowed. By default, \fBgraphviz_dot\fP is used. .sp Added in version 1.4. .sp Changed in version 2.2: Renamed from \fBgraphviz_dot\fP .UNINDENT .INDENT 7.0 .TP .B :name: label (text) The label of the graph. .sp Added in version 1.6. .UNINDENT .INDENT 7.0 .TP .B :class: class names (a list of class names separated by spaces) The class name of the graph. .sp Added in version 2.4. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. graph:: Directive for embedding a single undirected graph. The name is given as a directive argument, the contents of the graph are the directive content. This is a convenience directive to generate \fBgraph <name> { <content> }\fP\&. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. graph:: foo \(dqbar\(dq \-\- \(dqbaz\(dq; .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The graph name is passed unchanged to Graphviz. If it contains non\-alphanumeric characters (e.g. a dash), you will have to double\-quote it. .UNINDENT .UNINDENT .sp options .sp Same as \fBgraphviz\fP\&. .INDENT 7.0 .TP .B :alt: alternate text (text) Added in version 1.0. .UNINDENT .INDENT 7.0 .TP .B :align: alignment of the graph (left, center or right) Added in version 1.5. .UNINDENT .INDENT 7.0 .TP .B :caption: caption of the graph (text) Added in version 1.1. .UNINDENT .INDENT 7.0 .TP .B :layout: layout type of the graph (text) Added in version 1.4. .sp Changed in version 2.2: Renamed from \fBgraphviz_dot\fP .UNINDENT .INDENT 7.0 .TP .B :name: label (text) Added in version 1.6. .UNINDENT .INDENT 7.0 .TP .B :class: class names (a list of class names separated by spaces) The class name of the graph. .sp Added in version 2.4. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. digraph:: Directive for embedding a single directed graph. The name is given as a directive argument, the contents of the graph are the directive content. This is a convenience directive to generate \fBdigraph <name> { <content> }\fP\&. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. digraph:: foo \(dqbar\(dq \-> \(dqbaz\(dq \-> \(dqquux\(dq; .EE .UNINDENT .UNINDENT .sp options .sp Same as \fBgraphviz\fP\&. .INDENT 7.0 .TP .B :alt: alternate text (text) Added in version 1.0. .UNINDENT .INDENT 7.0 .TP .B :align: alignment of the graph (left, center or right) Added in version 1.5. .UNINDENT .INDENT 7.0 .TP .B :caption: caption of the graph (text) Added in version 1.1. .UNINDENT .INDENT 7.0 .TP .B :layout: layout type of the graph (text) Added in version 1.4. .sp Changed in version 2.2: Renamed from \fBgraphviz_dot\fP .UNINDENT .INDENT 7.0 .TP .B :name: label (text) Added in version 1.6. .UNINDENT .INDENT 7.0 .TP .B :class: class names (a list of class names separated by spaces) The class name of the graph. .sp Added in version 2.4. .UNINDENT .UNINDENT .sp There are also these config values: .INDENT 0.0 .TP .B graphviz_dot .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqdot\(aq\fP.UNINDENT .sp The command name with which to invoke \fBdot\fP\&. You may need to set this to a full path if \fBdot\fP is not in the executable search path. .sp Since this setting is not portable from system to system, it is normally not useful to set it in \fBconf.py\fP; rather, giving it on the \fBsphinx\-build\fP command line via the \fB\-D\fP \%<#\:cmdoption-sphinx-build-D> option should be preferable, like this: .INDENT 7.0 .INDENT 3.5 .sp .EX sphinx\-build \-M html \-D graphviz_dot=C:\egraphviz\ebin\edot.exe . _build .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B graphviz_dot_args .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp Additional command\-line arguments to give to dot, as a list. This is the right place to set global graph, node or edge attributes via dot\(aqs \fB\-G\fP, \fB\-N\fP and \fB\-E\fP options. .UNINDENT .INDENT 0.0 .TP .B graphviz_output_format .INDENT 7.0 .TP .B Type \fB\(aqpng\(aq | \(aqsvg\(aq\fP.TP .B Default \fB\(aqpng\(aq\fP.UNINDENT .sp The output format for Graphviz when building HTML files. This must be either \fB\(aqpng\(aq\fP or \fB\(aqsvg\(aq\fP\&. If \fB\(aqsvg\(aq\fP is used, in order to make the URL links work properly, an appropriate \fBtarget\fP attribute must be set, such as \fB\(dq_top\(dq\fP and \fB\(dq_blank\(dq\fP\&. For example, the link in the following graph should work in the svg output: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. graphviz:: digraph example { a [label=\(dqsphinx\(dq, href=\(dqhttps://www.sphinx\-doc.org/\(dq, target=\(dq_top\(dq]; b [label=\(dqother\(dq]; a \-> b; } .EE .UNINDENT .UNINDENT .sp Added in version 1.0: Previously, output always was PNG. .UNINDENT .SS \fBsphinx.ext.ifconfig\fP \-\- Include content based on configuration .sp This extension is quite simple, and features only one directive: .sp \fBWarning:\fP .INDENT 0.0 .INDENT 3.5 This directive is designed to control only content of document. It could not control sections, labels and so on. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \&.. ifconfig:: Include content of the directive only if the Python expression given as an argument is \fBTrue\fP, evaluated in the namespace of the project\(aqs configuration (that is, all registered variables from \fBconf.py\fP are available). .sp For example, one could write .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. ifconfig:: releaselevel in (\(aqalpha\(aq, \(aqbeta\(aq, \(aqrc\(aq) This stuff is only included in the built docs for unstable versions. .EE .UNINDENT .UNINDENT .sp To make a custom config value known to Sphinx, use \fBadd_config_value()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_config_value> in the setup function in \fBconf.py\fP, e.g.: .INDENT 7.0 .INDENT 3.5 .sp .EX def setup(app): app.add_config_value(\(aqreleaselevel\(aq, \(aq\(aq, \(aqenv\(aq) .EE .UNINDENT .UNINDENT .sp The second argument is the default value, the third should always be \fB\(aqenv\(aq\fP for such values (it selects if Sphinx re\-reads the documents if the value changes). .UNINDENT .SS \fBsphinx.ext.imgconverter\fP \-\- A reference image converter using Imagemagick .sp Added in version 1.6. .sp This extension converts images in your document to appropriate format for builders. For example, it allows you to use SVG images with LaTeX builder. As a result, you don\(aqt mind what image format the builder supports. .sp By default the extension uses ImageMagick \%<https://\:www\:.imagemagick\:.org> to perform conversions, and will not work if ImageMagick is not installed. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 ImageMagick rasterizes a SVG image on conversion. As a result, the image becomes not scalable. To avoid that, please use other image converters like sphinxcontrib\-svg2pdfconverter \%<https://\:github\:.com/\:missinglinkelectronics/\:sphinxcontrib-svg2pdfconverter> (which uses Inkscape or \fBrsvg\-convert\fP). .UNINDENT .UNINDENT .SS Configuration .INDENT 0.0 .TP .B image_converter .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqconvert\(aq\fP on Unix; \fB\(aqmagick\(aq\fP on Windows.UNINDENT .sp A path to a conversion command. By default, the imgconverter finds the command from search paths. .sp Changed in version 3.1: Use \fBmagick\fP command by default on windows .UNINDENT .INDENT 0.0 .TP .B image_converter_args .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB[\(aqconvert\(aq]\fP on Windows; \fB()\fP on Unix.UNINDENT .sp Additional command\-line arguments to give to \fBconvert\fP, as a list. .sp Changed in version 3.1: Use \fB[\(aqconvert\(aq]\fP by default on Windows .UNINDENT .SS \fBsphinx.ext.inheritance_diagram\fP \-\- Include inheritance diagrams .sp Added in version 0.6. .sp This extension allows you to include inheritance diagrams, rendered via the \fBGraphviz extension\fP \%<#\:module-sphinx\:.ext\:.graphviz>\&. .sp It adds this directive: .INDENT 0.0 .TP .B \&.. inheritance\-diagram:: This directive has one or more arguments, each giving a module or class name. Class names can be unqualified; in that case they are taken to exist in the currently described module (see \fBpy:module\fP \%<#\:directive-py-module>). .sp For each given class, and each class in each given module, the base classes are determined. Then, from all classes and their base classes, a graph is generated which is then rendered via the graphviz extension to a directed graph. .sp This directive supports an option called \fBparts\fP that, if given, must be an integer, advising the directive to keep that many dot\-separated parts in the displayed names (from right to left). For example, \fBparts=1\fP will only display class names, without the names of the modules that contain them. .sp Changed in version 2.0: The value of for \fBparts\fP can also be negative, indicating how many parts to drop from the left. For example, if all your class names start with \fBlib.\fP, you can give \fB:parts: \-1\fP to remove that prefix from the displayed node names. .sp The directive also supports a \fBprivate\-bases\fP flag option; if given, private base classes (those whose name starts with \fB_\fP) will be included. .sp You can use \fBcaption\fP option to give a caption to the diagram. .sp Changed in version 1.1: Added \fBprivate\-bases\fP option; previously, all bases were always included. .sp Changed in version 1.5: Added \fBcaption\fP option .sp It also supports a \fBtop\-classes\fP option which requires one or more class names separated by comma. If specified inheritance traversal will stop at the specified class names. Given the following Python module: .INDENT 7.0 .INDENT 3.5 .sp .EX \(dq\(dq\(dq A / \e B C / \e / \e E D F \(dq\(dq\(dq class A: pass class B(A): pass class C(A): pass class D(B, C): pass class E(B): pass class F(C): pass .EE .UNINDENT .UNINDENT .sp If you have specified a module in the inheritance diagram like this: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. inheritance\-diagram:: dummy.test :top\-classes: dummy.test.B, dummy.test.C .EE .UNINDENT .UNINDENT .sp any base classes which are ancestors to \fBtop\-classes\fP and are also defined in the same module will be rendered as stand alone nodes. In this example class A will be rendered as stand alone node in the graph. This is a known issue due to how this extension works internally. .sp If you don\(aqt want class A (or any other ancestors) to be visible then specify only the classes you would like to generate the diagram for like this: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. inheritance\-diagram:: dummy.test.D dummy.test.E dummy.test.F :top\-classes: dummy.test.B, dummy.test.C .EE .UNINDENT .UNINDENT .sp Changed in version 1.7: Added \fBtop\-classes\fP option to limit the scope of inheritance graphs. .INDENT 7.0 .TP .B :include\-subclasses: (no value) Added in version 8.2. .sp If given, any subclass of the classes will be added to the diagram too. .sp Given the Python module from above, you can specify your inheritance diagram like this: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. inheritance\-diagram:: dummy.test.A :include\-subclasses: .EE .UNINDENT .UNINDENT .sp This will include the classes A, B, C, D, E and F in the inheritance diagram but no other classes in the module \fBdummy.test\fP\&. .UNINDENT .UNINDENT .SS Examples .sp The following are different inheritance diagrams for the internal \fBInheritanceDiagram\fP class that implements the directive. .sp With full names: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. inheritance\-diagram:: sphinx.ext.inheritance_diagram.InheritanceDiagram .EE .UNINDENT .UNINDENT .sp Showing class names only: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. inheritance\-diagram:: sphinx.ext.inheritance_diagram.InheritanceDiagram :parts: 1 .EE .UNINDENT .UNINDENT .sp Stopping the diagram at \fBsphinx.util.docutils.SphinxDirective\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxDirective> (the highest superclass still part of Sphinx), and dropping the common left\-most part (\fBsphinx\fP) from all names: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. inheritance\-diagram:: sphinx.ext.inheritance_diagram.InheritanceDiagram :top\-classes: sphinx.util.docutils.SphinxDirective :parts: \-1 .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.ext.inheritance_diagram.InheritanceDiagram The internal class that implements the \fBinheritance\-diagram\fP directive. .UNINDENT .SS Configuration .INDENT 0.0 .TP .B inheritance_graph_attrs .INDENT 7.0 .TP .B Type \fBdict[str, str | int | float | bool]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary of graphviz graph attributes for inheritance diagrams. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX inheritance_graph_attrs = dict(rankdir=\(dqLR\(dq, size=\(aq\(dq6.0, 8.0\(dq\(aq, fontsize=14, ratio=\(aqcompress\(aq) .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B inheritance_node_attrs .INDENT 7.0 .TP .B Type \fBdict[str, str | int | float | bool]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary of graphviz node attributes for inheritance diagrams. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX inheritance_node_attrs = dict(shape=\(aqellipse\(aq, fontsize=14, height=0.75, color=\(aqdodgerblue1\(aq, style=\(aqfilled\(aq) .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B inheritance_edge_attrs .INDENT 7.0 .TP .B Type \fBdict[str, str | int | float | bool]\fP.TP .B Default \fB{}\fP.UNINDENT .sp A dictionary of graphviz edge attributes for inheritance diagrams. .UNINDENT .INDENT 0.0 .TP .B inheritance_alias .INDENT 7.0 .TP .B Type \fBdict[str, str]\fP.TP .B Default \fB{}\fP.UNINDENT .sp Allows mapping the full qualified name of the class to custom values (useful when exposing the underlying path of a class is not desirable, e.g. it\(aqs a private class and should not be instantiated by the user). .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX inheritance_alias = {\(aq_pytest.Magic\(aq: \(aqpytest.Magic\(aq} .EE .UNINDENT .UNINDENT .UNINDENT .SS \fBsphinx.ext.intersphinx\fP \-\- Link to other projects\(aq documentation .sp Added in version 0.5. .sp This extension can generate links to the documentation of objects in external projects, either explicitly through the \fBexternal\fP role, or as a fallback resolution for any other cross\-reference. .sp Usage for fallback resolution is simple: whenever Sphinx encounters a cross\-reference that has no matching target in the current documentation set, it looks for targets in the external documentation sets configured in \fBintersphinx_mapping\fP\&. A reference like \fB:py:class:\(gazipfile.ZipFile\(ga\fP can then link to the Python documentation for the ZipFile class, without you having to specify where it is located exactly. .sp When using the \fBexternal\fP role, you can force lookup to any external projects, and optionally to a specific external project. A link like \fB:external:ref:\(gacomparison manual <comparisons>\(ga\fP will then link to the label \(dqcomparisons\(dq in whichever configured external project, if it exists, and a link like \fB:external+python:ref:\(gacomparison manual <comparisons>\(ga\fP will link to the label \(dqcomparisons\(dq only in the doc set \(dqpython\(dq, if it exists. .sp Behind the scenes, this works as follows: .INDENT 0.0 .IP \(bu 2 Each Sphinx HTML build creates a file named \fBobjects.inv\fP that contains a mapping from object names to URIs relative to the HTML set\(aqs root. .IP \(bu 2 Projects using the Intersphinx extension can specify the location of such mapping files in the \fBintersphinx_mapping\fP config value. The mapping will then be used to resolve both \fBexternal\fP references, and also otherwise missing references to objects into links to the other documentation. .IP \(bu 2 By default, the mapping file is assumed to be at the same location as the rest of the documentation; however, the location of the mapping file can also be specified individually, e.g. if the docs should be buildable without Internet access. .UNINDENT .SS Configuration .sp To use Intersphinx linking, add \fB\(aqsphinx.ext.intersphinx\(aq\fP to your \fBextensions\fP \%<#\:confval-extensions> config value, and use these config values to activate linking: .INDENT 0.0 .TP .B intersphinx_mapping .INDENT 7.0 .TP .B Type \fBdict[str, tuple[str, tuple[str, tuple[str | None, ...]]]]\fP.TP .B Default \fB{}\fP.UNINDENT .sp This config value contains the locations and names of other projects that should be linked to in this documentation. .sp Relative local paths for target locations are taken as relative to the base of the built documentation, while relative local paths for inventory locations are taken as relative to the source directory. .sp When fetching remote inventory files, proxy settings will be read from the \fB$HTTP_PROXY\fP environment variable. .sp \fBFormat\fP .sp Added in version 1.0. .sp A dictionary mapping unique identifiers to a tuple \fB(target, inventory)\fP\&. Each \fBtarget\fP is the base URI of a foreign Sphinx documentation set and can be a local path or an HTTP URI. The \fBinventory\fP indicates where the inventory file can be found: it can be \fBNone\fP (an \fBobjects.inv\fP file at the same location as the base URI) or another local file path or a full HTTP URI to an inventory file. .sp The unique identifier can be used in the \fBexternal\fP role, so that it is clear which intersphinx set the target belongs to. A link like \fB:external+python:ref:\(gacomparison manual <comparisons>\(ga\fP will link to the label \(dqcomparisons\(dq in the doc set \(dqpython\(dq, if it exists. .sp \fBExample\fP .sp To add links to modules and objects in the Python standard library documentation, use: .INDENT 7.0 .INDENT 3.5 .sp .EX intersphinx_mapping = {\(aqpython\(aq: (\(aqhttps://docs.python.org/3\(aq, None)} .EE .UNINDENT .UNINDENT .sp This will download the corresponding \fBobjects.inv\fP file from the Internet and generate links to the pages under the given URI. The downloaded inventory is cached in the Sphinx environment, so it must be re\-downloaded whenever you do a full rebuild. .sp A second example, showing the meaning of a non\-\fBNone\fP value of the second tuple item: .INDENT 7.0 .INDENT 3.5 .sp .EX intersphinx_mapping = {\(aqpython\(aq: (\(aqhttps://docs.python.org/3\(aq, \(aqpython\-inv.txt\(aq)} .EE .UNINDENT .UNINDENT .sp This will read the inventory from \fBpython\-inv.txt\fP in the source directory, but still generate links to the pages under \fBhttps://docs.python.org/3\fP\&. It is up to you to update the inventory file as new objects are added to the Python documentation. .sp \fBMultiple targets for the inventory\fP .sp Added in version 1.3. .sp Alternative files can be specified for each inventory. One can give a tuple for the second inventory tuple item as shown in the following example. This will read the inventory iterating through the (second) tuple items until the first successful fetch. The primary use case for this to specify mirror sites for server downtime of the primary inventory: .INDENT 7.0 .INDENT 3.5 .sp .EX intersphinx_mapping = {\(aqpython\(aq: (\(aqhttps://docs.python.org/3\(aq, (None, \(aqpython\-inv.txt\(aq))} .EE .UNINDENT .UNINDENT .sp For a set of books edited and tested locally and then published together, it could be helpful to try a local inventory file first, to check references before publication: .INDENT 7.0 .INDENT 3.5 .sp .EX intersphinx_mapping = { \(aqotherbook\(aq: (\(aqhttps://myproj.readthedocs.io/projects/otherbook/en/latest\(aq, (\(aq../../otherbook/build/html/objects.inv\(aq, None)), } .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B intersphinx_resolve_self .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp If provided, \fBintersphinx_resolve_self\fP overrides intersphinx\(aqs resolution mechanism to resolve all references to the current project, rather than an external reference. This is useful when documentation is shared between projects, with the \(aqupstream\(aq or \(aqparent\(aq project using intersphinx\-style references in its documentation. For example, a project such as \fIAstropy\fP might set: .INDENT 7.0 .INDENT 3.5 .sp .EX intersphinx_resolve_self = \(aqastropy\(aq .EE .UNINDENT .UNINDENT .sp Projects re\-using \fIAstropy\fP\(aqs documentation or inheriting their docstrings would then configure their \fBintersphinx_mapping\fP with an \fB\(aqastropy\(aq\fP key, pointing to \fIastropy\fP\(aqs \fBobjects.inv\fP\&. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX intersphinx_mapping = { \(aqastropy\(aq: (\(aqhttps://docs.astropy.org/en/stable/\(aq, None), } .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B intersphinx_cache_limit .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fB5\fP (five days).UNINDENT .sp The maximum number of days to cache remote inventories. Set this to a negative value to cache inventories for unlimited time. .UNINDENT .INDENT 0.0 .TP .B intersphinx_timeout .INDENT 7.0 .TP .B Type \fBint | float | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp The number of seconds for timeout. Use \fBNone\fP for no timeout. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 timeout is not a time limit on the entire response download; rather, an exception is raised if the server has not issued a response for \fItimeout\fP seconds. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B intersphinx_disabled_reftypes .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB[\(aqstd:doc\(aq]\fP.UNINDENT .sp Added in version 4.3. .sp Changed in version 5.0: Changed default value from an empty list to \fB[\(aqstd:doc\(aq]\fP\&. .sp A list of strings being either: .INDENT 7.0 .IP \(bu 2 the name of a specific reference type in a domain, e.g., \fBstd:doc\fP, \fBpy:func\fP, or \fBcpp:class\fP, .IP \(bu 2 the name of a domain, and a wildcard, e.g., \fBstd:*\fP, \fBpy:*\fP, or \fBcpp:*\fP, or .IP \(bu 2 simply a wildcard \fB*\fP\&. .UNINDENT .sp When a non\-\fBexternal\fP cross\-reference is being resolved by intersphinx, skip resolution if it matches one of the specifications in this list. .sp For example, with \fBintersphinx_disabled_reftypes = [\(aqstd:doc\(aq]\fP a cross\-reference \fB:doc:\(gainstallation\(ga\fP will not be attempted to be resolved by intersphinx, but \fB:external+otherbook:doc:\(gainstallation\(ga\fP will be attempted to be resolved in the inventory named \fBotherbook\fP in \fBintersphinx_mapping\fP\&. At the same time, all cross\-references generated in, e.g., Python, declarations will still be attempted to be resolved by intersphinx. .sp If \fB*\fP is in the list of domains, then no non\-\fBexternal\fP references will be resolved by intersphinx. .UNINDENT .SS Explicitly Reference External Objects .sp The Intersphinx extension provides the following role. .INDENT 0.0 .TP .B :external: Added in version 4.4. .sp Use Intersphinx to perform lookup only in external projects, and not the current project. Intersphinx still needs to know the type of object you would like to find, so the general form of this role is to write the cross\-refererence as if the object is in the current project, but then prefix it with \fB:external\fP\&. The two forms are then .INDENT 7.0 .IP \(bu 2 \fB:external:domain:reftype:\(gatarget\(ga\fP, e.g., \fB:external:py:class:\(gazipfile.ZipFile\(ga\fP, or .IP \(bu 2 \fB:external:reftype:\(gatarget\(ga\fP, e.g., \fB:external:doc:\(gainstallation\(ga\fP\&. With this shorthand, the domain is assumed to be \fBstd\fP\&. .UNINDENT .sp If you would like to constrain the lookup to a specific external project, then the key of the project, as specified in \fBintersphinx_mapping\fP, is added as well to get the two forms .INDENT 7.0 .IP \(bu 2 \fB:external+invname:domain:reftype:\(gatarget\(ga\fP, e.g., \fB:external+python:py:class:\(gazipfile.ZipFile\(ga\fP, or .IP \(bu 2 \fB:external+invname:reftype:\(gatarget\(ga\fP, e.g., \fB:external+python:doc:\(gainstallation\(ga\fP\&. .UNINDENT .UNINDENT .SS Showing all links of an Intersphinx mapping file .sp To show all Intersphinx links and their targets of an Intersphinx mapping file, run \fBpython \-m sphinx.ext.intersphinx url\-or\-path\fP\&. This is helpful when searching for the root cause of a broken Intersphinx link in a documentation project. The following example prints the Intersphinx mapping of the Python documentation: .INDENT 0.0 .INDENT 3.5 .sp .EX $ python \-m sphinx.ext.intersphinx https://docs.python.org/3/objects.inv .EE .UNINDENT .UNINDENT .SS Using Intersphinx with inventory file under Basic Authorization .sp Intersphinx supports Basic Authorization like this: .INDENT 0.0 .INDENT 3.5 .sp .EX intersphinx_mapping = {\(aqpython\(aq: (\(aqhttps://user:password@docs.python.org/3\(aq, None)} .EE .UNINDENT .UNINDENT .sp The user and password will be stripped from the URL when generating the links. .SS \fBsphinx.ext.linkcode\fP \-\- Add external links to source code .sp \fIModule author: Pauli Virtanen\fP .sp Added in version 1.2. .sp This extension looks at your object descriptions (\fB\&.. class::\fP, \fB\&.. function::\fP etc.) and adds external links to code hosted somewhere on the web. The intent is similar to the \fBsphinx.ext.viewcode\fP extension, but assumes the source code can be found somewhere on the Internet. .sp In your configuration, you need to specify a \fBlinkcode_resolve\fP function that returns an URL based on the object. .SS Configuration .INDENT 0.0 .TP .B linkcode_resolve .INDENT 7.0 .TP .B Type \fBCallable[[str, dict[str, str]], str | None] | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp This is a function \fBlinkcode_resolve(domain, info)\fP, which should return the URL to source code corresponding to the object in given domain with given information. .sp The function should return \fBNone\fP if no link is to be added. .sp The argument \fBdomain\fP specifies the language domain the object is in. \fBinfo\fP is a dictionary with the following keys guaranteed to be present (dependent on the domain): .INDENT 7.0 .IP \(bu 2 \fBpy\fP: \fBmodule\fP (name of the module), \fBfullname\fP (name of the object) .IP \(bu 2 \fBc\fP: \fBnames\fP (list of names for the object) .IP \(bu 2 \fBcpp\fP: \fBnames\fP (list of names for the object) .IP \(bu 2 \fBjavascript\fP: \fBobject\fP (name of the object), \fBfullname\fP (name of the item) .UNINDENT .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX def linkcode_resolve(domain, info): if domain != \(aqpy\(aq: return None if not info[\(aqmodule\(aq]: return None filename = info[\(aqmodule\(aq].replace(\(aq.\(aq, \(aq/\(aq) return \(dqhttps://somesite/sourcerepo/%s.py\(dq % filename .EE .UNINDENT .UNINDENT .UNINDENT .SS Third\-party domains .sp Support for other domains can be added by extensions with \fBadd_linkcode_domain()\fP\&. For example, a Sphinx extension that provides a \fBphp\fP domain could use the following code to support \fBlinkcode\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX from sphinx.ext.linkcode import add_linkcode_domain def setup(app): add_linkcode_domain(\(aqphp\(aq, [\(aqnamespace\(aq, \(aqclass\(aq, \(aqfullname\(aq]) .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B sphinx.ext.linkcode.add_linkcode_domain(domain: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, keys: list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a new list of keys to use for a domain. .sp Added in version 8.2. .UNINDENT .SS Math support for HTML outputs in Sphinx .sp Added in version 0.5. .sp Changed in version 1.8: Math support for non\-HTML builders is integrated to sphinx\-core. So mathbase extension is no longer needed. .sp Since mathematical notation isn\(aqt natively supported by HTML in any way, Sphinx gives a math support to HTML document with several extensions. These use the reStructuredText math \fBdirective\fP \%<#\:directive-math> and \fBrole\fP \%<#\:role-math>\&. .SS \fBsphinx.ext.imgmath\fP \-\- Render math as images .sp Added in version 1.4. .sp This extension renders math via LaTeX and dvipng \%<https://\:savannah\:.nongnu\:.org/\:projects/\:dvipng/> or dvisvgm \%<https://\:dvisvgm\:.de/> into PNG or SVG images. This of course means that the computer where the docs are built must have both programs available. .sp There are various configuration values you can set to influence how the images are built: .INDENT 0.0 .TP .B imgmath_image_format .INDENT 7.0 .TP .B Type \fB\(aqpng\(aq | \(aqsvg\(aq\fP.TP .B Default \fB\(aqpng\(aq\fP.UNINDENT .sp The output image format. It should be either \fB\(aqpng\(aq\fP or \fB\(aqsvg\(aq\fP\&. The image is produced by first executing \fBlatex\fP on the TeX mathematical mark\-up then (depending on the requested format) either dvipng \%<https://\:savannah\:.nongnu\:.org/\:projects/\:dvipng/> or dvisvgm \%<https://\:dvisvgm\:.de/>\&. .UNINDENT .INDENT 0.0 .TP .B imgmath_use_preview .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp \fBdvipng\fP and \fBdvisvgm\fP both have the ability to collect from LaTeX the \(dqdepth\(dq of the rendered math: an inline image should use this \(dqdepth\(dq in a \fBvertical\-align\fP style to get correctly aligned with surrounding text. .sp This mechanism requires the LaTeX preview package \%<https://\:www\:.gnu\:.org/\:software/\:auctex/\:preview-latex\:.html> (available as \fBpreview\-latex\-style\fP on Ubuntu xenial). Therefore, the default for this option is \fBFalse\fP but it is strongly recommended to set it to \fBTrue\fP\&. .sp Changed in version 2.2: This option can be used with the \fB\(aqsvg\(aq\fP \fBimgmath_image_format\fP\&. .UNINDENT .INDENT 0.0 .TP .B imgmath_add_tooltips .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If false, do not add the LaTeX code as an \(dqalt\(dq attribute for math images. .UNINDENT .INDENT 0.0 .TP .B imgmath_font_size .INDENT 7.0 .TP .B Type \fBint\fP.TP .B Default \fB12\fP.UNINDENT .sp The font size (in \fBpt\fP) of the displayed math. This must be a positive integer. .UNINDENT .INDENT 0.0 .TP .B imgmath_latex .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqlatex\(aq\fP.UNINDENT .sp The command name with which to invoke LaTeX. You may need to set this to a full path if \fBlatex\fP is not in the executable search path. .sp Since this setting is not portable from system to system, it is normally not useful to set it in \fBconf.py\fP; rather, giving it on the \fBsphinx\-build\fP command line via the \fB\-D\fP \%<#\:cmdoption-sphinx-build-D> option should be preferable, like this: .INDENT 7.0 .INDENT 3.5 .sp .EX sphinx\-build \-M html \-D imgmath_latex=C:\etex\elatex.exe . _build .EE .UNINDENT .UNINDENT .sp This value should only contain the path to the latex executable, not further arguments; use \fBimgmath_latex_args\fP for that purpose. .sp \fBHint:\fP .INDENT 7.0 .INDENT 3.5 To use OpenType Math fonts \%<https://\:tex\:.stackexchange\:.com/\:questions/\:425098/\:which-opentype-math-fonts-are-available> with \fBunicode\-math\fP, via a custom \fBimgmath_latex_preamble\fP, you can set \fBimgmath_latex\fP to \fB\(aqdvilualatex\(aq\fP, but must then set \fBimgmath_image_format\fP to \fB\(aqsvg\(aq\fP\&. Note: this has only been tested with \fBdvisvgm 3.0.3\fP\&. It significantly increases image production duration compared to using standard \fB\(aqlatex\(aq\fP with traditional TeX math fonts. .UNINDENT .UNINDENT .sp \fBHint:\fP .INDENT 7.0 .INDENT 3.5 Some fancy LaTeX mark\-up (an example was reported which used TikZ to add various decorations to the equation) require multiple runs of the LaTeX executable. To handle this, set this configuration setting to \fB\(aqlatexmk\(aq\fP (or a full path to it) as this Perl script reliably chooses dynamically how many latex runs are needed. .UNINDENT .UNINDENT .sp Changed in version 6.2.0: Using \fB\(aqxelatex\(aq\fP (or a full path to it) is now supported. But you must then add \fB\(aq\-no\-pdf\(aq\fP to the \fBimgmath_latex_args\fP list of the command options. The \fB\(aqsvg\(aq\fP \fBimgmath_image_format\fP is required. Also, you may need the \fBdvisvgm\fP binary to be relatively recent (testing was done only with its \fB3.0.3\fP release). .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 Regarding the previous note, it is currently not supported to use \fBlatexmk\fP with option \fB\-xelatex\fP\&. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B imgmath_latex_args .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB()\fP.UNINDENT .sp Additional arguments to give to latex, as a list. .UNINDENT .INDENT 0.0 .TP .B imgmath_latex_preamble .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp Additional LaTeX code to put into the preamble of the LaTeX files used to translate the math snippets. Use it e.g. to add packages which modify the fonts used for math, such as \fB\(aq\e\eusepackage{newtxsf}\(aq\fP for sans\-serif fonts, or \fB\(aq\e\eusepackage{fouriernc}\(aq\fP for serif fonts. Indeed, the default LaTeX math fonts have rather thin glyphs which (in HTML output) often do not match well with the font for text. .UNINDENT .INDENT 0.0 .TP .B imgmath_dvipng .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqdvipng\(aq\fP.UNINDENT .sp The command name to invoke \fBdvipng\fP\&. You may need to set this to a full path if \fBdvipng\fP is not in the executable search path. This option is only used when \fBimgmath_image_format\fP is set to \fB\(aqpng\(aq\fP\&. .UNINDENT .INDENT 0.0 .TP .B imgmath_dvipng_args .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB(\(aq\-gamma\(aq, \(aq1.5\(aq, \(aq\-D\(aq, \(aq110\(aq, \(aq\-bg\(aq, \(aqTransparent\(aq)\fP.UNINDENT .sp Additional arguments to give to dvipng, as a list. The default value makes the image a bit darker and larger than it is by default (this compensates somewhat for the thinness of default LaTeX math fonts), and produces PNGs with a transparent background. This option is used only when \fBimgmath_image_format\fP is \fB\(aqpng\(aq\fP\&. .UNINDENT .INDENT 0.0 .TP .B imgmath_dvisvgm .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqdvisvgm\(aq\fP.UNINDENT .sp The command name to invoke \fBdvisvgm\fP\&. You may need to set this to a full path if \fBdvisvgm\fP is not in the executable search path. This option is only used when \fBimgmath_image_format\fP is \fB\(aqsvg\(aq\fP\&. .UNINDENT .INDENT 0.0 .TP .B imgmath_dvisvgm_args .INDENT 7.0 .TP .B Type \fBSequence[str]\fP.TP .B Default \fB(\(aq\-\-no\-fonts\(aq,)\fP.UNINDENT .sp Additional arguments to give to dvisvgm, as a list. The default value means that \fBdvisvgm\fP will render glyphs as path elements (cf the dvisvgm FAQ \%<https://\:dvisvgm\:.de/\:FAQ>). This option is used only when \fBimgmath_image_format\fP is \fB\(aqsvg\(aq\fP\&. .UNINDENT .INDENT 0.0 .TP .B imgmath_embed .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If true, encode LaTeX output images within HTML files (base64 encoded) and do not save separate png/svg files to disk. .sp Added in version 5.2. .UNINDENT .SS \fBsphinx.ext.mathjax\fP \-\- Render math via JavaScript .sp \fBAttention:\fP .INDENT 0.0 .INDENT 3.5 The default version of MathJax changed from version 2 to version 3 in Sphinx 4.0, and from version 3 to version 4 in Sphinx 9.0. .sp You may need to override \fBmathjax_path\fP to load an older version, or update your \fBconfiguration options\fP\&. In general, MathJax v3 and v4 options are compatible. .UNINDENT .UNINDENT .sp Added in version 1.1. .sp This extension puts math as\-is into the HTML files. The JavaScript package MathJax \%<https://\:www\:.mathjax\:.org/> is then loaded and transforms the LaTeX markup to readable math live in the browser. .sp Because MathJax (and the necessary fonts) is very large, it is not included in Sphinx but is set to automatically include it from a third\-party site. .sp \fBAttention:\fP .INDENT 0.0 .INDENT 3.5 You should use the math \fBdirective\fP \%<#\:directive-math> and \fBrole\fP \%<#\:role-math>, not the native MathJax \fB$$\fP, \fB\e(\fP, etc. .UNINDENT .UNINDENT .sp \fBTip:\fP .INDENT 0.0 .INDENT 3.5 MathJax configuration can be supplied in a JavaScript file by using the \fBmathjax_config_path\fP option. This is useful for more complex configurations that are hard to express only using a Python dictionary, for example JavaScript functions. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B mathjax_path .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aqhttps://cdn.jsdelivr.net/npm/mathjax@4/tex\-mml\-chtml.js\(aq\fP.UNINDENT .sp The path to the JavaScript file to include in the HTML files in order to load MathJax. .sp The default is the \fBhttps://\fP URL that loads the JS files from the jsdelivr \%<https://\:www\:.jsdelivr\:.com/> Content Delivery Network. See the MathJax Getting Started page \%<https://\:www\:.mathjax\:.org/#\:gettingstarted> for details. If you want MathJax to be available offline or without including resources from a third\-party site, you have to download it and set this value to a different path. .sp The path can be absolute or relative; if it is relative, it is relative to the \fB_static\fP directory of the built docs. .sp For example, if you put MathJax into the static path of the Sphinx docs, this value would be \fBMathJax/MathJax.js\fP\&. If you host more than one Sphinx documentation set on one server, it is advisable to install MathJax in a shared location. .sp You can also give a full \fBhttps://\fP URL different from the CDN URL. .sp Changed in version 4.0: The default version of MathJax is now version 3. To keep using MathJax v2, you must explicitly load it via this option. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX mathjax_path = \(aqhttps://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX\-AMS\-MML_HTMLorMML\(aq .EE .UNINDENT .UNINDENT .sp Changed in version 9.0: The default version of MathJax is now version 4. To keep using MathJax v3, you must explicitly load it via this option. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX mathjax_path = \(aqhttps://cdn.jsdelivr.net/npm/mathjax@3/es5/tex\-mml\-chtml.js\(aq .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B mathjax_options .INDENT 7.0 .TP .B Type \fBdict[str, Any]\fP.TP .B Default \fB{}\fP.UNINDENT .sp The options to script tag for mathjax. For example, you can set integrity option with following setting: .INDENT 7.0 .INDENT 3.5 .sp .EX mathjax_options = { \(aqintegrity\(aq: \(aqsha384\-......\(aq, } .EE .UNINDENT .UNINDENT .sp Added in version 1.8. .sp Changed in version 4.4.1: Allow to change the loading method (async or defer) of MathJax if \(dqasync\(dq or \(dqdefer\(dq key is set. .UNINDENT .INDENT 0.0 .TP .B mathjax4_config .INDENT 7.0 .TP .B Type \fBdict[str, Any] | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp The configuration options for MathJax v4 (which is used by default). The given dictionary is assigned to the JavaScript variable \fBwindow.MathJax\fP\&. For more information, please read Configuring MathJax \%<https://\:docs\:.mathjax\:.org/\:en/\:stable/\:web/\:configuration\:.html#\:configuration>\&. .sp For help converting your old MathJax configuration to to the new \fBmathjax4_config\fP, see Converting your old Configuration to v4 \%<https://\:docs\:.mathjax\:.org/\:en/\:stable/\:web/\:configuration\:.html#\:converting-your-old-configuration-to-v4>\&. .sp Added in version 9.0. .UNINDENT .INDENT 0.0 .TP .B mathjax3_config .INDENT 7.0 .TP .B Type \fBdict[str, Any] | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp The configuration options for MathJax v3 (which can be loaded via \fBmathjax_path\fP). If given, the dictionary is converted to a JSON object and assigned to the JavaScript variable \fBwindow.MathJax\fP\&. .sp For more information, please read Configuring MathJax \%<https://\:docs\:.mathjax\:.org/\:en/\:v3\:.2/\:web/\:configuration\:.html#\:configuration>\&. .sp Added in version 4.0. .UNINDENT .INDENT 0.0 .TP .B mathjax2_config .INDENT 7.0 .TP .B Type \fBdict[str, Any] | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp The configuration options for MathJax v2 (which can be loaded via \fBmathjax_path\fP). The value is used as a parameter of \fBMathJax.Hub.Config()\fP\&. For more information, please read Using in\-line configuration options \%<https://\:docs\:.mathjax\:.org/\:en/\:v2\:.7/\:configuration\:.html#\:using-in-line-configuration-options>\&. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX mathjax2_config = { \(aqextensions\(aq: [\(aqtex2jax.js\(aq], \(aqjax\(aq: [\(aqinput/TeX\(aq, \(aqoutput/HTML\-CSS\(aq], } .EE .UNINDENT .UNINDENT .sp For help converting your old MathJax configuration to to the new \fBmathjax3_config\fP, see Converting Your v2 Configuration to v3 \%<https://\:docs\:.mathjax\:.org/\:en/\:v3\:.2/\:web/\:configuration\:.html#\:converting-your-v2-configuration-to-v3>\&. .sp Added in version 4.0: \fBmathjax_config\fP has been renamed to \fBmathjax2_config\fP\&. .UNINDENT .INDENT 0.0 .TP .B mathjax_config .INDENT 7.0 .TP .B Type \fBdict[str, Any] | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp Former name of \fBmathjax2_config\fP\&. .sp Added in version 1.8. .sp Changed in version 4.0: This has been renamed to \fBmathjax2_config\fP\&. \fBmathjax_config\fP is still supported for backwards compatibility. .UNINDENT .INDENT 0.0 .TP .B mathjax_config_path .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp If given, this must be the path of a JavaScript (\fB\&.js\fP) file (path relative to the configuration directory \%<#\:term-configuration-directory>) that contains the configuration options for MathJax. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX mathjax_config_path = \(aqmathjax\-config.js\(aq .EE .UNINDENT .UNINDENT .sp \fBImportant:\fP .INDENT 7.0 .INDENT 3.5 The user is responsible for ensuring that the given file is compatible with the version of MathJax being used. .UNINDENT .UNINDENT .sp For more information, please read Configuring MathJax \%<https://\:docs\:.mathjax\:.org/\:en/\:latest/\:web/\:configuration\:.html#\:configuration>\&. .sp Added in version 9.0. .UNINDENT .SS \fBsphinxcontrib.jsmath\fP \-\- Render math via JavaScript .sp This extension works just as the MathJax extension does, but uses the older package jsMath \%<https://\:www\:.math\:.union\:.edu/\:~dpvc/\:jsMath/>\&. jsMath is no longer actively developed, but it has the advantage that the size of the JavaScript package is much smaller than MathJax. .sp Added in version 0.5: The \fBsphinx.ext.jsmath\fP extension. .sp Changed in version 2.0: \fBsphinx.ext.jsmath\fP was moved to \fBsphinxcontrib.jsmath\fP\&. .sp Removed in version 4.0: The alias from \fBsphinx.ext.jsmath\fP to \fBsphinxcontrib.jsmath\fP\&. .sp Config value: .INDENT 0.0 .TP .B jsmath_path .INDENT 7.0 .TP .B Type \fBstr\fP.TP .B Default \fB\(aq\(aq\fP.UNINDENT .sp The path to the JavaScript file to include in the HTML files in order to load JSMath. .sp The path can be absolute or relative; if it is relative, it is relative to the \fB_static\fP directory of the built docs. .sp For example, if you put jsMath into the static path of the Sphinx docs, this value would be \fBjsMath/easy/load.js\fP\&. If you host more than one Sphinx documentation set on one server, it is advisable to install jsMath in a shared location. .UNINDENT .SS \fBsphinx.ext.napoleon\fP \-\- Support for NumPy and Google style docstrings .sp \fIModule author: Rob Ruana\fP .sp Added in version 1.3. .SS Overview .sp Are you tired of writing docstrings that look like this: .INDENT 0.0 .INDENT 3.5 .sp .EX :param path: The path of the file to wrap :type path: str :param field_storage: The :class:\(gaFileStorage\(ga instance to wrap :type field_storage: FileStorage :param temporary: Whether or not to delete the file when the File instance is destructed :type temporary: bool :returns: A buffered writable file descriptor :rtype: BufferedFileStorage .EE .UNINDENT .UNINDENT .sp reStructuredText \%<https://\:docutils\:.sourceforge\:.io/\:rst\:.html> is great, but it creates visually dense, hard to read \fBdocstrings\fP \%<https://\:peps\:.python\:.org/\:pep-0287/>\&. Compare the jumble above to the same thing rewritten according to the Google Python Style Guide \%<https://\:google\:.github\:.io/\:styleguide/\:pyguide\:.html>: .INDENT 0.0 .INDENT 3.5 .sp .EX Args: path (str): The path of the file to wrap field_storage (FileStorage): The :class:\(gaFileStorage\(ga instance to wrap temporary (bool): Whether or not to delete the file when the File instance is destructed Returns: BufferedFileStorage: A buffered writable file descriptor .EE .UNINDENT .UNINDENT .sp Much more legible, no? .sp Napoleon is a extension \%<#\:term-extension> that enables Sphinx to parse both NumPy \%<https://\:numpydoc\:.readthedocs\:.io/\:en/\:latest/\:format\:.html#\:docstring-standard> and Google \%<https://\:google\:.github\:.io/\:styleguide/\:pyguide\:.html#\:38-comments-and-docstrings> style docstrings \- the style recommended by Khan Academy \%<https://\:github\:.com/\:Khan/\:style-guides/\:blob/\:master/\:style/\:python\:.md#\:docstrings>\&. .sp Napoleon is a pre\-processor that parses NumPy \%<https://\:numpydoc\:.readthedocs\:.io/\:en/\:latest/\:format\:.html#\:docstring-standard> and Google \%<https://\:google\:.github\:.io/\:styleguide/\:pyguide\:.html#\:38-comments-and-docstrings> style docstrings and converts them to reStructuredText before Sphinx attempts to parse them. This happens in an intermediate step while Sphinx is processing the documentation, so it doesn\(aqt modify any of the docstrings in your actual source code files. .SS Getting Started .INDENT 0.0 .IP 1. 3 After setting up Sphinx \%<> to build your docs, enable napoleon in the Sphinx \fBconf.py\fP file: .INDENT 3.0 .INDENT 3.5 .sp .EX # conf.py # Add napoleon to the extensions list extensions = [\(aqsphinx.ext.napoleon\(aq] .EE .UNINDENT .UNINDENT .IP 2. 3 Use \fBsphinx\-apidoc\fP to build your API documentation: .INDENT 3.0 .INDENT 3.5 .sp .EX $ sphinx\-apidoc \-f \-o docs/source projectdir .EE .UNINDENT .UNINDENT .UNINDENT .SS Docstrings .sp Napoleon interprets every docstring that \fBautodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> can find, including docstrings on: \fBmodules\fP, \fBclasses\fP, \fBattributes\fP, \fBmethods\fP, \fBfunctions\fP, and \fBvariables\fP\&. Inside each docstring, specially formatted Sections are parsed and converted to reStructuredText. .sp All standard reStructuredText formatting still works as expected. .SS Docstring Sections .sp All of the following section headers are supported: .INDENT 0.0 .IP \(bu 2 \fBArgs\fP \fI(alias of Parameters)\fP .IP \(bu 2 \fBArguments\fP \fI(alias of Parameters)\fP .IP \(bu 2 \fBAttention\fP .IP \(bu 2 \fBAttributes\fP .IP \(bu 2 \fBCaution\fP .IP \(bu 2 \fBDanger\fP .IP \(bu 2 \fBError\fP .IP \(bu 2 \fBExample\fP .IP \(bu 2 \fBExamples\fP .IP \(bu 2 \fBHint\fP .IP \(bu 2 \fBImportant\fP .IP \(bu 2 \fBKeyword Args\fP \fI(alias of Keyword Arguments)\fP .IP \(bu 2 \fBKeyword Arguments\fP .IP \(bu 2 \fBMethods\fP .IP \(bu 2 \fBNote\fP .IP \(bu 2 \fBNotes\fP .IP \(bu 2 \fBOther Parameters\fP .IP \(bu 2 \fBParameters\fP .IP \(bu 2 \fBReturn\fP \fI(alias of Returns)\fP .IP \(bu 2 \fBReturns\fP .IP \(bu 2 \fBRaise\fP \fI(alias of Raises)\fP .IP \(bu 2 \fBRaises\fP .IP \(bu 2 \fBReferences\fP .IP \(bu 2 \fBSee Also\fP .IP \(bu 2 \fBTip\fP .IP \(bu 2 \fBTodo\fP .IP \(bu 2 \fBWarning\fP .IP \(bu 2 \fBWarnings\fP \fI(alias of Warning)\fP .IP \(bu 2 \fBWarn\fP \fI(alias of Warns)\fP .IP \(bu 2 \fBWarns\fP .IP \(bu 2 \fBYield\fP \fI(alias of Yields)\fP .IP \(bu 2 \fBYields\fP .UNINDENT .SS Google vs NumPy .sp Napoleon supports two styles of docstrings: Google \%<https://\:google\:.github\:.io/\:styleguide/\:pyguide\:.html#\:38-comments-and-docstrings> and NumPy \%<https://\:numpydoc\:.readthedocs\:.io/\:en/\:latest/\:format\:.html#\:docstring-standard>\&. The main difference between the two styles is that Google uses indentation to separate sections, whereas NumPy uses underlines. .sp Google style: .INDENT 0.0 .INDENT 3.5 .sp .EX def func(arg1, arg2): \(dq\(dq\(dqSummary line. Extended description of function. Args: arg1 (int): Description of arg1 arg2 (str): Description of arg2 Returns: bool: Description of return value \(dq\(dq\(dq return True .EE .UNINDENT .UNINDENT .sp NumPy style: .INDENT 0.0 .INDENT 3.5 .sp .EX def func(arg1, arg2): \(dq\(dq\(dqSummary line. Extended description of function. Parameters \-\-\-\-\-\-\-\-\-\- arg1 : int Description of arg1 arg2 : str Description of arg2 Returns \-\-\-\-\-\-\- bool Description of return value \(dq\(dq\(dq return True .EE .UNINDENT .UNINDENT .sp NumPy style tends to require more vertical space, whereas Google style tends to use more horizontal space. Google style tends to be easier to read for short and simple docstrings, whereas NumPy style tends be easier to read for long and in\-depth docstrings. .sp The choice between styles is largely aesthetic, but the two styles should not be mixed. Choose one style for your project and be consistent with it. .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 For complete examples: .INDENT 0.0 .IP \(bu 2 Example Google Style Python Docstrings \%<#\:example-google> .IP \(bu 2 Example NumPy Style Python Docstrings \%<#\:example-numpy> .UNINDENT .UNINDENT .UNINDENT .SS Type Annotations .sp \fBPEP 484\fP \%<https://\:peps\:.python\:.org/\:pep-0484/> introduced a standard way to express types in Python code. This is an alternative to expressing types directly in docstrings. One benefit of expressing types according to \fBPEP 484\fP \%<https://\:peps\:.python\:.org/\:pep-0484/> is that type checkers and IDEs can take advantage of them for static code analysis. \fBPEP 484\fP \%<https://\:peps\:.python\:.org/\:pep-0484/> was then extended by \fBPEP 526\fP \%<https://\:peps\:.python\:.org/\:pep-0526/> which introduced a similar way to annotate variables (and attributes). .sp Google style with type annotations: .INDENT 0.0 .INDENT 3.5 .sp .EX def func(arg1: int, arg2: str) \-> bool: \(dq\(dq\(dqSummary line. Extended description of function. Args: arg1: Description of arg1 arg2: Description of arg2 Returns: Description of return value \(dq\(dq\(dq return True class Class: \(dq\(dq\(dqSummary line. Extended description of class Attributes: attr1: Description of attr1 attr2: Description of attr2 \(dq\(dq\(dq attr1: int attr2: str .EE .UNINDENT .UNINDENT .sp Google style with types in docstrings: .INDENT 0.0 .INDENT 3.5 .sp .EX def func(arg1, arg2): \(dq\(dq\(dqSummary line. Extended description of function. Args: arg1 (int): Description of arg1 arg2 (str): Description of arg2 Returns: bool: Description of return value \(dq\(dq\(dq return True class Class: \(dq\(dq\(dqSummary line. Extended description of class Attributes: attr1 (int): Description of attr1 attr2 (str): Description of attr2 \(dq\(dq\(dq .EE .UNINDENT .UNINDENT .SS Configuration .sp Listed below are all the settings used by napoleon and their default values. These settings can be changed in the Sphinx \fBconf.py\fP file. Make sure that \(dqsphinx.ext.napoleon\(dq is enabled in \fBconf.py\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX # conf.py # Add any Sphinx extension module names here, as strings extensions = [\(aqsphinx.ext.napoleon\(aq] # Napoleon settings napoleon_google_docstring = True napoleon_numpy_docstring = True napoleon_include_init_with_doc = False napoleon_include_private_with_doc = False napoleon_include_special_with_doc = True napoleon_use_admonition_for_examples = False napoleon_use_admonition_for_notes = False napoleon_use_admonition_for_references = False napoleon_use_ivar = False napoleon_use_param = True napoleon_use_rtype = True napoleon_preprocess_types = False napoleon_type_aliases = None napoleon_attr_annotations = True .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B napoleon_google_docstring .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp True to parse Google style \%<https://\:google\:.github\:.io/\:styleguide/\:pyguide\:.html#\:38-comments-and-docstrings> docstrings. False to disable support for Google style docstrings. .UNINDENT .INDENT 0.0 .TP .B napoleon_numpy_docstring .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp True to parse NumPy style \%<https://\:numpydoc\:.readthedocs\:.io/\:en/\:latest/\:format\:.html#\:docstring-standard> docstrings. False to disable support for NumPy style docstrings. .UNINDENT .INDENT 0.0 .TP .B napoleon_include_init_with_doc .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp True to list \fB__init___\fP docstrings separately from the class docstring. False to fall back to Sphinx\(aqs default behavior, which considers the \fB__init___\fP docstring as part of the class documentation. .sp \fBIf True\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX def __init__(self): \(dq\(dq\(dq This will be included in the docs because it has a docstring \(dq\(dq\(dq def __init__(self): # This will NOT be included in the docs .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B napoleon_include_private_with_doc .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp True to include private members (like \fB_membername\fP) with docstrings in the documentation. False to fall back to Sphinx\(aqs default behavior. .sp \fBIf True\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX def _included(self): \(dq\(dq\(dq This will be included in the docs because it has a docstring \(dq\(dq\(dq pass def _skipped(self): # This will NOT be included in the docs pass .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B napoleon_include_special_with_doc .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp True to include special members (like \fB__membername__\fP) with docstrings in the documentation. False to fall back to Sphinx\(aqs default behavior. .sp \fBIf True\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX def __str__(self): \(dq\(dq\(dq This will be included in the docs because it has a docstring \(dq\(dq\(dq return unicode(self).encode(\(aqutf\-8\(aq) def __unicode__(self): # This will NOT be included in the docs return unicode(self.__class__.__name__) .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B napoleon_use_admonition_for_examples .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp True to use the \fB\&.. admonition::\fP directive for the \fBExample\fP and \fBExamples\fP sections. False to use the \fB\&.. rubric::\fP directive instead. One may look better than the other depending on what HTML theme is used. .sp This NumPy style \%<https://\:numpydoc\:.readthedocs\:.io/\:en/\:latest/\:format\:.html#\:docstring-standard> snippet will be converted as follows: .INDENT 7.0 .INDENT 3.5 .sp .EX Example \-\-\-\-\-\-\- This is just a quick example .EE .UNINDENT .UNINDENT .sp \fBIf True\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. admonition:: Example This is just a quick example .EE .UNINDENT .UNINDENT .sp \fBIf False\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. rubric:: Example This is just a quick example .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B napoleon_use_admonition_for_notes .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp True to use the \fB\&.. admonition::\fP directive for \fBNotes\fP sections. False to use the \fB\&.. rubric::\fP directive instead. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The singular \fBNote\fP section will always be converted to a \fB\&.. note::\fP directive. .UNINDENT .UNINDENT .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBnapoleon_use_admonition_for_examples\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B napoleon_use_admonition_for_references .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp True to use the \fB\&.. admonition::\fP directive for \fBReferences\fP sections. False to use the \fB\&.. rubric::\fP directive instead. .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBnapoleon_use_admonition_for_examples\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B napoleon_use_ivar .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp True to use the \fB:ivar:\fP role for instance variables. False to use the \fB\&.. attribute::\fP directive instead. .sp This NumPy style \%<https://\:numpydoc\:.readthedocs\:.io/\:en/\:latest/\:format\:.html#\:docstring-standard> snippet will be converted as follows: .INDENT 7.0 .INDENT 3.5 .sp .EX Attributes \-\-\-\-\-\-\-\-\-\- attr1 : int Description of \(gaattr1\(ga .EE .UNINDENT .UNINDENT .sp \fBIf True\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX :ivar attr1: Description of \(gaattr1\(ga :vartype attr1: int .EE .UNINDENT .UNINDENT .sp \fBIf False\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. attribute:: attr1 Description of \(gaattr1\(ga :type: int .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B napoleon_use_param .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp True to use a \fB:param:\fP role for each function parameter. False to use a single \fB:parameters:\fP role for all the parameters. .sp This NumPy style \%<https://\:numpydoc\:.readthedocs\:.io/\:en/\:latest/\:format\:.html#\:docstring-standard> snippet will be converted as follows: .INDENT 7.0 .INDENT 3.5 .sp .EX Parameters \-\-\-\-\-\-\-\-\-\- arg1 : str Description of \(gaarg1\(ga arg2 : int, optional Description of \(gaarg2\(ga, defaults to 0 .EE .UNINDENT .UNINDENT .sp \fBIf True\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX :param arg1: Description of \(gaarg1\(ga :type arg1: str :param arg2: Description of \(gaarg2\(ga, defaults to 0 :type arg2: :class:\(gaint\(ga, *optional* .EE .UNINDENT .UNINDENT .sp \fBIf False\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX :parameters: * **arg1** (*str*) \-\- Description of \(gaarg1\(ga * **arg2** (*int, optional*) \-\- Description of \(gaarg2\(ga, defaults to 0 .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B napoleon_use_keyword .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp True to use a \fB:keyword:\fP role for each function keyword argument. False to use a single \fB:keyword arguments:\fP role for all the keywords. .sp This behaves similarly to \fBnapoleon_use_param\fP\&. Note unlike docutils, \fB:keyword:\fP and \fB:param:\fP will not be treated the same way \- there will be a separate \(dqKeyword Arguments\(dq section, rendered in the same fashion as \(dqParameters\(dq section (type links created if possible) .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBnapoleon_use_param\fP .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B napoleon_use_rtype .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp True to use the \fB:rtype:\fP role for the return type. False to output the return type inline with the description. .sp This NumPy style \%<https://\:numpydoc\:.readthedocs\:.io/\:en/\:latest/\:format\:.html#\:docstring-standard> snippet will be converted as follows: .INDENT 7.0 .INDENT 3.5 .sp .EX Returns \-\-\-\-\-\-\- bool True if successful, False otherwise .EE .UNINDENT .UNINDENT .sp \fBIf True\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX :returns: True if successful, False otherwise :rtype: bool .EE .UNINDENT .UNINDENT .sp \fBIf False\fP: .INDENT 7.0 .INDENT 3.5 .sp .EX :returns: *bool* \-\- True if successful, False otherwise .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B napoleon_preprocess_types .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp True to convert the type definitions in the docstrings as references. .sp Added in version 3.2.1. .sp Changed in version 3.5: Do preprocess the Google style docstrings also. .UNINDENT .INDENT 0.0 .TP .B napoleon_type_aliases .INDENT 7.0 .TP .B Type \fBdict[str, str] | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp A mapping to translate type names to other names or references. Works only when \fBnapoleon_use_param = True\fP\&. .sp With: .INDENT 7.0 .INDENT 3.5 .sp .EX napoleon_type_aliases = { \(dqCustomType\(dq: \(dqmypackage.CustomType\(dq, \(dqdict\-like\(dq: \(dq:term:\(gadict\-like <mapping>\(ga\(dq, } .EE .UNINDENT .UNINDENT .sp This NumPy style \%<https://\:numpydoc\:.readthedocs\:.io/\:en/\:latest/\:format\:.html#\:docstring-standard> snippet: .INDENT 7.0 .INDENT 3.5 .sp .EX Parameters \-\-\-\-\-\-\-\-\-\- arg1 : CustomType Description of \(gaarg1\(ga arg2 : dict\-like Description of \(gaarg2\(ga .EE .UNINDENT .UNINDENT .sp becomes: .INDENT 7.0 .INDENT 3.5 .sp .EX :param arg1: Description of \(gaarg1\(ga :type arg1: mypackage.CustomType :param arg2: Description of \(gaarg2\(ga :type arg2: :term:\(gadict\-like <mapping>\(ga .EE .UNINDENT .UNINDENT .sp Added in version 3.2. .UNINDENT .INDENT 0.0 .TP .B napoleon_attr_annotations .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp True to allow using \fBPEP 526\fP \%<https://\:peps\:.python\:.org/\:pep-0526/> attributes annotations in classes. If an attribute is documented in the docstring without a type and has an annotation in the class body, that type is used. .sp Added in version 3.4. .UNINDENT .INDENT 0.0 .TP .B napoleon_custom_sections .INDENT 7.0 .TP .B Type \fBSequence[str | tuple[str, str]] | None\fP.TP .B Default \fBNone\fP.UNINDENT .sp Add a list of custom sections to include, expanding the list of parsed sections. .sp The entries can either be strings or tuples, depending on the intention: .INDENT 7.0 .IP \(bu 2 To create a custom \(dqgeneric\(dq section, just pass a string. .IP \(bu 2 To create an alias for an existing section, pass a tuple containing the alias name and the original, in that order. .IP \(bu 2 To create a custom section that displays like the parameters or returns section, pass a tuple containing the custom section name and a string value, \(dqparams_style\(dq or \(dqreturns_style\(dq. .UNINDENT .sp If an entry is just a string, it is interpreted as a header for a generic section. If the entry is a tuple/list/indexed container, the first entry is the name of the section, the second is the section key to emulate. If the second entry value is \(dqparams_style\(dq or \(dqreturns_style\(dq, the custom section will be displayed like the parameters section or returns section. .sp Added in version 1.8. .sp Changed in version 3.5: Support \fBparams_style\fP and \fBreturns_style\fP .UNINDENT .SS \fBsphinx.ext.todo\fP \-\- Support for todo items .sp \fIModule author: Daniel Bültmann\fP .sp Added in version 0.5. .sp There are two additional directives when using this extension: .INDENT 0.0 .TP .B \&.. todo:: Use this directive like, for example, \fBnote\fP \%<#\:directive-note>\&. .sp It will only show up in the output if \fBtodo_include_todos\fP is \fBTrue\fP\&. .sp Added in version 1.3.2: This directive supports an \fBclass\fP option that determines the class attribute for HTML output. If not given, the class defaults to \fBadmonition\-todo\fP\&. .UNINDENT .INDENT 0.0 .TP .B \&.. todolist:: This directive is replaced by a list of all todo directives in the whole documentation, if \fBtodo_include_todos\fP is \fBTrue\fP\&. .UNINDENT .sp These can be configured as seen below. .SS Configuration .INDENT 0.0 .TP .B todo_include_todos .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If this is \fBTrue\fP, \fBtodo\fP and \fBtodolist\fP produce output, else they produce nothing. .UNINDENT .INDENT 0.0 .TP .B todo_emit_warnings .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If this is \fBTrue\fP, \fBtodo\fP emits a warning for each TODO entries. .sp Added in version 1.5. .UNINDENT .INDENT 0.0 .TP .B todo_link_only .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If this is \fBTrue\fP, \fBtodolist\fP produce output without file path and line. .sp Added in version 1.4. .UNINDENT .sp autodoc provides the following an additional event: .INDENT 0.0 .TP .B todo\-defined(app, node) Added in version 1.5. .sp Emitted when a todo is defined. \fInode\fP is the defined \fBsphinx.ext.todo.todo_node\fP node. .UNINDENT .SS \fBsphinx.ext.viewcode\fP \-\- Add links to highlighted source code .sp \fIModule author: Georg Brandl\fP .sp Added in version 1.0. .sp This extension looks at your Python object descriptions (\fB\&.. class::\fP, \fB\&.. function::\fP etc.) and tries to find the source files where the objects are contained. When found, a separate HTML page will be output for each module with a highlighted version of the source code, and a link will be added to all object descriptions that leads to the source code of the described object. A link back from the source to the description will also be inserted. .sp \fBWarning:\fP .INDENT 0.0 .INDENT 3.5 Basically, \fBviewcode\fP extension will import the modules being linked to. If any modules have side effects on import, these will be executed when \fBsphinx\-build\fP is run. .sp If you document scripts (as opposed to library modules), make sure their main routine is protected by a \fBif __name__ == \(aq__main__\(aq\fP condition. .sp In addition, if you don\(aqt want to import the modules by \fBviewcode\fP, you can tell the location of the location of source code to \fBviewcode\fP using the \fBviewcode\-find\-source\fP event. .sp If \fBviewcode_follow_imported_members\fP is enabled, you will also need to resolve imported attributes using the \fBviewcode\-follow\-imported\fP event. .UNINDENT .UNINDENT .sp This extension works only on HTML related builders like \fBhtml\fP, \fBapplehelp\fP, \fBdevhelp\fP, \fBhtmlhelp\fP, \fBqthelp\fP and so on except \fBsinglehtml\fP\&. By default \fBepub\fP builder doesn\(aqt support this extension (see \fBviewcode_enable_epub\fP). .SS Configuration .INDENT 0.0 .TP .B viewcode_follow_imported_members .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBTrue\fP.UNINDENT .sp If this is \fBTrue\fP, viewcode extension will emit \fBviewcode\-follow\-imported\fP event to resolve the name of the module by other extensions. .sp Added in version 1.3. .sp Changed in version 1.8: Renamed from \fBviewcode_import\fP to \fBviewcode_follow_imported_members\fP\&. .UNINDENT .INDENT 0.0 .TP .B viewcode_enable_epub .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If this is \fBTrue\fP, viewcode extension is also enabled even if you use epub builders. This extension generates pages outside toctree, but this is not preferred as epub format. .sp Until 1.4.x, this extension is always enabled. If you want to generate epub as same as 1.4.x, you should set \fBTrue\fP, but epub format checker\(aqs score becomes worse. .sp Added in version 1.5. .sp \fBWarning:\fP .INDENT 7.0 .INDENT 3.5 Not all epub readers support pages generated by viewcode extension. These readers ignore links to pages are not under toctree. .sp Some reader\(aqs rendering result are corrupted and epubcheck \%<https://\:github\:.com/\:IDPF/\:epubcheck>\(aqs score becomes worse even if the reader supports. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B viewcode_line_numbers .INDENT 7.0 .TP .B Type \fBbool\fP.TP .B Default \fBFalse\fP.UNINDENT .sp If set to \fBTrue\fP, inline line numbers will be added to the highlighted code. .sp Added in version 7.2. .UNINDENT .INDENT 0.0 .TP .B viewcode\-find\-source(app, modname) Added in version 1.8. .sp Find the source code for a module. An event handler for this event should return a tuple of the source code itself and a dictionary of tags. The dictionary maps the name of a class, function, attribute, etc to a tuple of its type, the start line number, and the end line number. The type should be one of \(dqclass\(dq, \(dqdef\(dq, or \(dqother\(dq. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- The Sphinx application object. .IP \(bu 2 \fBmodname\fP \-\- The name of the module to find source code for. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B viewcode\-follow\-imported(app, modname, attribute) Added in version 1.8. .sp Find the name of the original module for an attribute. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- The Sphinx application object. .IP \(bu 2 \fBmodname\fP \-\- The name of the module that the attribute belongs to. .IP \(bu 2 \fBattribute\fP \-\- The name of the member to follow. .UNINDENT .UNINDENT .UNINDENT .SS Third\-party extensions .sp You can find several extensions contributed by users in the sphinx\-contrib \%<https://\:github\:.com/\:sphinx-contrib/> organization. If you wish to include your extension in this organization, simply follow the instructions provided in the github\-administration \%<https://\:github\:.com/\:sphinx-contrib/\:github-administration> project. This is optional and there are several extensions hosted elsewhere. The awesome\-sphinxdoc \%<https://\:github\:.com/\:yoloseem/\:awesome-sphinxdoc> and sphinx\-extensions \%<https://\:sphinx-extensions\:.readthedocs\:.io/\:en/\:latest/> projects are both curated lists of Sphinx packages, and many packages use the Framework :: Sphinx :: Extension \%<https://\:pypi\:.org/\:search/?\:c=Framework+%3A%3A+Sphinx+%3A%3A+Extension> and Framework :: Sphinx :: Theme \%<https://\:pypi\:.org/\:search/?\:c=Framework+%3A%3A+Sphinx+%3A%3A+Theme> trove classifiers for Sphinx extensions and themes, respectively. .SS Where to put your own extensions? .sp Extensions local to a project should be put within the project\(aqs directory structure. Set Python\(aqs module search path, \fBsys.path\fP, accordingly so that Sphinx can find them. For example, if your extension \fBfoo.py\fP lies in the \fBexts\fP subdirectory of the project root, put into \fBconf.py\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX import sys from pathlib import Path sys.path.append(str(Path(\(aqexts\(aq).resolve())) extensions = [\(aqfoo\(aq] .EE .UNINDENT .UNINDENT .sp You can also install extensions anywhere else on \fBsys.path\fP, e.g. in the \fBsite\-packages\fP directory. .SS HTML theming .sp Sphinx provides a number of builders for HTML and HTML\-based formats. .SS Builders .INDENT 0.0 .INDENT 3.5 .SS Todo .sp Populate when the \(aqbuilders\(aq document is split up. .UNINDENT .UNINDENT .SS Themes .sp Added in version 0.6. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 This section provides information about using pre\-existing HTML themes. If you wish to create your own theme, refer to HTML theme development \%<#\:extension-html-theme>\&. .UNINDENT .UNINDENT .sp Sphinx supports changing the appearance of its HTML output via \fIthemes\fP\&. A theme is a collection of HTML templates, stylesheet(s) and other static files. Additionally, it has a configuration file which specifies from which theme to inherit, which highlighting style to use, and what options exist for customizing the theme\(aqs look and feel. .sp Themes are meant to be project\-unaware, so they can be used for different projects without change. .SS Using a theme .sp Using a theme provided with Sphinx is easy. Since these do not need to be installed, you only need to set the \fBhtml_theme\fP \%<#\:confval-html_theme> config value. For example, to enable the \fBclassic\fP theme, add the following to \fBconf.py\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX html_theme = \(dqclassic\(dq .EE .UNINDENT .UNINDENT .sp You can also set theme\-specific options using the \fBhtml_theme_options\fP \%<#\:confval-html_theme_options> config value. These options are generally used to change the look and feel of the theme. For example, to place the sidebar on the right side and a black background for the relation bar (the bar with the navigation links at the page\(aqs top and bottom), add the following \fBconf.py\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX html_theme_options = { \(dqrightsidebar\(dq: \(dqtrue\(dq, \(dqrelbarbgcolor\(dq: \(dqblack\(dq } .EE .UNINDENT .UNINDENT .sp If the theme does not come with Sphinx, it can be in two static forms or as a Python package. For the static forms, either a directory (containing \fBtheme.toml\fP and other needed files), or a zip file with the same contents is supported. The directory or zipfile must be put where Sphinx can find it; for this there is the config value \fBhtml_theme_path\fP \%<#\:confval-html_theme_path>\&. This can be a list of directories, relative to the directory containing \fBconf.py\fP, that can contain theme directories or zip files. For example, if you have a theme in the file \fBblue.zip\fP, you can put it right in the directory containing \fBconf.py\fP and use this configuration: .INDENT 0.0 .INDENT 3.5 .sp .EX html_theme = \(dqblue\(dq html_theme_path = [\(dq.\(dq] .EE .UNINDENT .UNINDENT .sp The third form is a Python package. If a theme you want to use is distributed as a Python package, you can use it after installing .INDENT 0.0 .INDENT 3.5 .sp .EX # installing theme package $ pip install sphinxjp.themes.dotted .EE .UNINDENT .UNINDENT .sp Once installed, this can be used in the same manner as a directory or zipfile\-based theme: .INDENT 0.0 .INDENT 3.5 .sp .EX html_theme = \(dqdotted\(dq .EE .UNINDENT .UNINDENT .sp For more information on the design of themes, including information about writing your own themes, refer to HTML theme development \%<#\:extension-html-theme>\&. .SS Builtin themes .TS box center; l|l. T{ \fBTheme overview\fP T} T{ T} _ T{ [image: alabaster] [image] .sp \fIalabaster\fP T} T{ [image: classic] [image] .sp \fIclassic\fP T} _ T{ [image: sphinxdoc] [image] .sp \fIsphinxdoc\fP T} T{ [image: scrolls] [image] .sp \fIscrolls\fP T} _ T{ [image: agogo] [image] .sp \fIagogo\fP T} T{ [image: traditional] [image] .sp \fItraditional\fP T} _ T{ [image: nature] [image] .sp \fInature\fP T} T{ [image: haiku] [image] .sp \fIhaiku\fP T} _ T{ [image: pyramid] [image] .sp \fIpyramid\fP T} T{ [image: bizstyle] [image] .sp \fIbizstyle\fP T} .TE .sp Sphinx comes with a selection of themes to choose from. .sp Note that from these themes only the Alabaster and Scrolls themes are mobile\-optimated, the other themes resort to horizontal scrolling if the screen is too narrow. .sp These themes are: .INDENT 0.0 .TP \fBbasic\fP This is a basically unstyled layout used as the base for the other themes, and usable as the base for custom themes as well. The HTML contains all important elements like sidebar and relation bar. There are these options (which are inherited by the other themes): .INDENT 7.0 .IP \(bu 2 \fBnosidebar\fP (true or false): Don\(aqt include the sidebar. Defaults to \fBFalse\fP\&. .IP \(bu 2 \fBsidebarwidth\fP (int or str): Width of the sidebar in pixels. This can be an int, which is interpreted as pixels or a valid CSS dimension string such as \(aq70em\(aq or \(aq50%\(aq. Defaults to 230 pixels. .IP \(bu 2 \fBbody_min_width\fP (int or str): Minimal width of the document body. This can be an int, which is interpreted as pixels or a valid CSS dimension string such as \(aq70em\(aq or \(aq50%\(aq. Use 0 if you don\(aqt want a width limit. Defaults may depend on the theme (often 450px). .IP \(bu 2 \fBbody_max_width\fP (int or str): Maximal width of the document body. This can be an int, which is interpreted as pixels or a valid CSS dimension string such as \(aq70em\(aq or \(aq50%\(aq. Use \(aqnone\(aq if you don\(aqt want a width limit. Defaults may depend on the theme (often 800px). .IP \(bu 2 \fBnavigation_with_keys\fP (true or false): Allow navigating with the following keyboard shortcuts: .INDENT 2.0 .IP \(bu 2 \fBLeft\fP \fBarrow\fP: previous page .IP \(bu 2 \fBRight\fP \fBarrow\fP: next page .UNINDENT .sp Defaults to \fBFalse\fP\&. .IP \(bu 2 \fBenable_search_shortcuts\fP (true or false): Allow jumping to the search box with \fB/\fP and allow removal of search highlighting with \fBEsc\fP\&. .sp Defaults to \fBTrue\fP\&. .IP \(bu 2 \fBglobaltoc_collapse\fP (true or false): Only expand subsections of the current document in \fBglobaltoc.html\fP (see \fBhtml_sidebars\fP \%<#\:confval-html_sidebars>). Defaults to \fBTrue\fP\&. .sp Added in version 3.1. .IP \(bu 2 \fBglobaltoc_includehidden\fP (true or false): Show even those subsections in \fBglobaltoc.html\fP (see \fBhtml_sidebars\fP \%<#\:confval-html_sidebars>) which have been included with the \fB:hidden:\fP flag of the \fBtoctree\fP \%<#\:directive-toctree> directive. Defaults to \fBFalse\fP\&. .sp Added in version 3.1. .IP \(bu 2 \fBglobaltoc_maxdepth\fP (int): The maximum depth of the toctree in \fBglobaltoc.html\fP (see \fBhtml_sidebars\fP \%<#\:confval-html_sidebars>). Set it to \-1 to allow unlimited depth. Defaults to the max depth selected in the toctree directive. .sp Added in version 3.2. .UNINDENT .TP \fBalabaster\fP Alabaster theme \%<https://\:pypi\:.org/\:project/\:alabaster/> is a modified \(dqKr\(dq Sphinx theme from @kennethreitz (especially as used in his Requests project), which was itself originally based on @mitsuhiko\(aqs theme used for Flask & related projects. Refer to its installation page \%<https://\:alabaster\:.readthedocs\:.io/\:en/\:latest/\:installation\:.html> for information on how to configure \fBhtml_sidebars\fP \%<#\:confval-html_sidebars> for its use. .TP \fBclassic\fP This is the classic theme, which looks like the Python 2 documentation \%<https://\:docs\:.python\:.org/2/>\&. It can be customized via these options: .INDENT 7.0 .IP \(bu 2 \fBrightsidebar\fP (true or false): Put the sidebar on the right side. Defaults to \fBFalse\fP\&. .IP \(bu 2 \fBstickysidebar\fP (true or false): Make the sidebar \(dqfixed\(dq so that it doesn\(aqt scroll out of view for long body content. This may not work well with all browsers. Defaults to \fBFalse\fP\&. .IP \(bu 2 \fBcollapsiblesidebar\fP (true or false): Add an \fIexperimental\fP JavaScript snippet that makes the sidebar collapsible via a button on its side. Defaults to \fBFalse\fP\&. .IP \(bu 2 \fBexternalrefs\fP (true or false): Display external links differently from internal links. Defaults to \fBFalse\fP\&. .UNINDENT .sp There are also various color and font options that can change the color scheme without having to write a custom stylesheet: .INDENT 7.0 .IP \(bu 2 \fBfooterbgcolor\fP (CSS color): Background color for the footer line. .IP \(bu 2 \fBfootertextcolor\fP (CSS color): Text color for the footer line. .IP \(bu 2 \fBsidebarbgcolor\fP (CSS color): Background color for the sidebar. .IP \(bu 2 \fBsidebarbtncolor\fP (CSS color): Background color for the sidebar collapse button (used when \fIcollapsiblesidebar\fP is \fBTrue\fP). .IP \(bu 2 \fBsidebartextcolor\fP (CSS color): Text color for the sidebar. .IP \(bu 2 \fBsidebarlinkcolor\fP (CSS color): Link color for the sidebar. .IP \(bu 2 \fBrelbarbgcolor\fP (CSS color): Background color for the relation bar. .IP \(bu 2 \fBrelbartextcolor\fP (CSS color): Text color for the relation bar. .IP \(bu 2 \fBrelbarlinkcolor\fP (CSS color): Link color for the relation bar. .IP \(bu 2 \fBbgcolor\fP (CSS color): Body background color. .IP \(bu 2 \fBtextcolor\fP (CSS color): Body text color. .IP \(bu 2 \fBlinkcolor\fP (CSS color): Body link color. .IP \(bu 2 \fBvisitedlinkcolor\fP (CSS color): Body color for visited links. .IP \(bu 2 \fBheadbgcolor\fP (CSS color): Background color for headings. .IP \(bu 2 \fBheadtextcolor\fP (CSS color): Text color for headings. .IP \(bu 2 \fBheadlinkcolor\fP (CSS color): Link color for headings. .IP \(bu 2 \fBcodebgcolor\fP (CSS color): Background color for code blocks. .IP \(bu 2 \fBcodetextcolor\fP (CSS color): Default text color for code blocks, if not set differently by the highlighting style. .IP \(bu 2 \fBbodyfont\fP (CSS font\-family): Font for normal text. .IP \(bu 2 \fBheadfont\fP (CSS font\-family): Font for headings. .UNINDENT .TP \fBsphinxdoc\fP The theme originally used by this documentation. It features a sidebar on the right side. There are currently no options beyond \fInosidebar\fP and \fIsidebarwidth\fP\&. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The Sphinx documentation now uses an adjusted version of the sphinxdoc theme \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:tree/\:master/\:doc/\:_themes/\:sphinx13>\&. .UNINDENT .UNINDENT .TP \fBscrolls\fP A more lightweight theme, based on the Jinja documentation \%<https://\:jinja\:.palletsprojects\:.com/>\&. The following color options are available: .INDENT 7.0 .IP \(bu 2 \fBheaderbordercolor\fP .IP \(bu 2 \fBsubheadlinecolor\fP .IP \(bu 2 \fBlinkcolor\fP .IP \(bu 2 \fBvisitedlinkcolor\fP .IP \(bu 2 \fBadmonitioncolor\fP .UNINDENT .TP \fBagogo\fP A theme created by Andi Albrecht. The following options are supported: .INDENT 7.0 .IP \(bu 2 \fBbodyfont\fP (CSS font family): Font for normal text. .IP \(bu 2 \fBheaderfont\fP (CSS font family): Font for headings. .IP \(bu 2 \fBpagewidth\fP (CSS length): Width of the page content, default 70em. .IP \(bu 2 \fBdocumentwidth\fP (CSS length): Width of the document (without sidebar), default 50em. .IP \(bu 2 \fBsidebarwidth\fP (CSS length): Width of the sidebar, default 20em. .IP \(bu 2 \fBrightsidebar\fP (true or false): Put the sidebar on the right side. Defaults to \fBTrue\fP\&. .IP \(bu 2 \fBbgcolor\fP (CSS color): Background color. .IP \(bu 2 \fBheaderbg\fP (CSS value for \(dqbackground\(dq): background for the header area, default a grayish gradient. .IP \(bu 2 \fBfooterbg\fP (CSS value for \(dqbackground\(dq): background for the footer area, default a light gray gradient. .IP \(bu 2 \fBlinkcolor\fP (CSS color): Body link color. .IP \(bu 2 \fBheadercolor1\fP, \fBheadercolor2\fP (CSS color): colors for <h1> and <h2> headings. .IP \(bu 2 \fBheaderlinkcolor\fP (CSS color): Color for the backreference link in headings. .IP \(bu 2 \fBtextalign\fP (CSS \fItext\-align\fP value): Text alignment for the body, default is \fBjustify\fP\&. .UNINDENT .TP \fBnature\fP A greenish theme. There are currently no options beyond \fInosidebar\fP and \fIsidebarwidth\fP\&. .TP \fBpyramid\fP A theme from the Pyramid web framework project, designed by Blaise Laflamme. There are currently no options beyond \fInosidebar\fP and \fIsidebarwidth\fP\&. .TP \fBhaiku\fP A theme without sidebar inspired by the Haiku OS user guide \%<https://\:www\:.haiku-os\:.org/\:docs/\:userguide/\:en/\:contents\:.html>\&. The following options are supported: .INDENT 7.0 .IP \(bu 2 \fBfull_logo\fP (true or false, default \fBFalse\fP): If this is true, the header will only show the \fBhtml_logo\fP \%<#\:confval-html_logo>\&. Use this for large logos. If this is false, the logo (if present) will be shown floating right, and the documentation title will be put in the header. .IP \(bu 2 \fBtextcolor\fP, \fBheadingcolor\fP, \fBlinkcolor\fP, \fBvisitedlinkcolor\fP, \fBhoverlinkcolor\fP (CSS colors): Colors for various body elements. .UNINDENT .TP \fBtraditional\fP A theme resembling the old Python documentation. There are currently no options beyond \fInosidebar\fP and \fIsidebarwidth\fP\&. .TP \fBepub\fP A theme for the epub builder. This theme tries to save visual space which is a sparse resource on ebook readers. The following options are supported: .INDENT 7.0 .IP \(bu 2 \fBrelbar1\fP (true or false, default \fBTrue\fP): If this is true, the \fBrelbar1\fP block is inserted in the epub output, otherwise it is omitted. .IP \(bu 2 \fBfooter\fP (true or false, default \fBTrue\fP): If this is true, the \fBfooter\fP block is inserted in the epub output, otherwise it is omitted. .UNINDENT .TP \fBbizstyle\fP A simple bluish theme. The following options are supported beyond \fInosidebar\fP and \fIsidebarwidth\fP: .INDENT 7.0 .IP \(bu 2 \fBrightsidebar\fP (true or false): Put the sidebar on the right side. Defaults to \fBFalse\fP\&. .UNINDENT .UNINDENT .sp Added in version 1.3: \(aqalabaster\(aq, \(aqsphinx_rtd_theme\(aq and \(aqbizstyle\(aq theme. .sp Changed in version 1.3: The \(aqdefault\(aq theme has been renamed to \(aqclassic\(aq. \(aqdefault\(aq is still available, however it will emit a notice that it is an alias for the new \(aqalabaster\(aq theme. .SS Third Party Themes .sp There are many third\-party themes created for Sphinx. Some of these are for general use, while others are specific to an individual project. .sp sphinx\-themes.org \%<https://\:sphinx-themes\:.org/> is a gallery that showcases various themes for Sphinx, with demo documentation rendered under each theme. Themes can also be found on PyPI \%<https://\:pypi\:.org/\:search/?\:q=&\:o=&\:c=Framework+%3A%3A+Sphinx+%3A%3A+Theme> (using the classifier \fBFramework :: Sphinx :: Theme\fP), GitHub \%<https://\:github\:.com/\:search?\:utf8=%E2%9C%93&\:q=sphinx+theme> and GitLab \%<https://\:gitlab\:.com/\:explore?\:name=sphinx+theme>\&. .SS Internationalization .sp Added in version 1.1. .sp Complementary to translations provided for Sphinx\-generated messages such as navigation bars, Sphinx provides mechanisms facilitating the translation of \fIdocuments\fP\&. See the Options for internationalisation \%<#\:intl-options> for details on configuration. .INDENT 0.0 .INDENT 2.5 [image] Workflow visualization of translations in Sphinx. (The figure is created by plantuml \%<https://\:plantuml\:.com>\&.).UNINDENT .UNINDENT .INDENT 0.0 .IP \(bu 2 Sphinx internationalization details .IP \(bu 2 Translating with sphinx\-intl .INDENT 2.0 .IP \(bu 2 Quick guide .IP \(bu 2 Translating .IP \(bu 2 Update your po files by new pot files .UNINDENT .IP \(bu 2 Using Transifex service for team translation .IP \(bu 2 Using Weblate service for team translation .IP \(bu 2 Contributing to Sphinx reference translation .IP \(bu 2 Translation progress and statistics .UNINDENT .SS Sphinx internationalization details .sp \fBgettext\fP [1] is an established standard for internationalization and localization. It naively maps messages in a program to a translated string. Sphinx uses these facilities to translate whole documents. .sp Initially project maintainers have to collect all translatable strings (also referred to as \fImessages\fP) to make them known to translators. Sphinx extracts these through invocation of \fBsphinx\-build \-M gettext\fP\&. .sp Every single element in the doctree will end up in a single message which results in lists being equally split into different chunks while large paragraphs will remain as coarsely\-grained as they were in the original document. This grants seamless document updates while still providing a little bit of context for translators in free\-text passages. It is the maintainer\(aqs task to split up paragraphs which are too large as there is no sane automated way to do that. .sp After Sphinx successfully ran the \fBMessageCatalogBuilder\fP \%<#\:sphinx\:.builders\:.gettext\:.MessageCatalogBuilder> you will find a collection of \fB\&.pot\fP files in your output directory. These are \fBcatalog templates\fP and contain messages in your original language \fIonly\fP\&. .sp They can be delivered to translators which will transform them to \fB\&.po\fP files \-\-\- so called \fBmessage catalogs\fP \-\-\- containing a mapping from the original messages to foreign\-language strings. .sp \fIgettext\fP compiles them into a binary format known as \fBbinary catalogs\fP through \fBmsgfmt\fP for efficiency reasons. If you make these files discoverable with \fBlocale_dirs\fP \%<#\:confval-locale_dirs> for your \fBlanguage\fP \%<#\:confval-language>, Sphinx will pick them up automatically. .sp An example: you have a document \fBusage.rst\fP in your Sphinx project. The \fIgettext\fP builder will put its messages into \fBusage.pot\fP\&. Imagine you have Spanish translations [2] stored in \fBusage.po\fP \-\-\- for your builds to be translated you need to follow these instructions: .INDENT 0.0 .IP \(bu 2 Compile your message catalog to a locale directory, say \fBlocale\fP, so it ends up in \fB\&./locale/es/LC_MESSAGES/usage.mo\fP in your source directory (where \fBes\fP is the language code for Spanish.) .INDENT 2.0 .INDENT 3.5 .sp .EX msgfmt \(dqusage.po\(dq \-o \(dqlocale/es/LC_MESSAGES/usage.mo\(dq .EE .UNINDENT .UNINDENT .IP \(bu 2 Set \fBlocale_dirs\fP \%<#\:confval-locale_dirs> to \fB[\(dqlocale/\(dq]\fP\&. .IP \(bu 2 Set \fBlanguage\fP \%<#\:confval-language> to \fBes\fP (also possible via \fB\-D\fP \%<#\:cmdoption-sphinx-build-D>). .IP \(bu 2 Run your desired build. .UNINDENT .sp In order to protect against mistakes, a warning is emitted if cross\-references in the translated paragraph do not match those from the original. This can be turned off globally using the \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings> configuration variable. Alternatively, to turn it off for one message only, end the message with \fB#noqa\fP like this: .INDENT 0.0 .INDENT 3.5 .sp .EX Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse risus tortor, luctus id ultrices at. #noqa .EE .UNINDENT .UNINDENT .sp (Write \fB\e#noqa\fP in case you want to have \(dq#noqa\(dq literally in the text. This does not apply to code blocks, where \fB#noqa\fP is ignored because code blocks do not contain references anyway.) .sp Added in version 4.5: The \fB#noqa\fP mechanism. .SS Translating with sphinx\-intl .SS Quick guide .sp sphinx\-intl \%<https://\:pypi\:.org/\:project/\:sphinx-intl/> is a useful tool to work with Sphinx translation flow. This section describe an easy way to translate with \fIsphinx\-intl\fP\&. .INDENT 0.0 .IP 1. 3 Install sphinx\-intl \%<https://\:pypi\:.org/\:project/\:sphinx-intl/>\&. .INDENT 3.0 .INDENT 3.5 .sp .EX $ pip install sphinx\-intl .EE .UNINDENT .UNINDENT .IP 2. 3 Add configurations to \fBconf.py\fP\&. .INDENT 3.0 .INDENT 3.5 .sp .EX locale_dirs = [\(aqlocale/\(aq] # path is example but recommended. gettext_compact = False # optional. .EE .UNINDENT .UNINDENT .sp This case\-study assumes that BUILDDIR is set to \fB_build\fP, \fBlocale_dirs\fP \%<#\:confval-locale_dirs> is set to \fBlocale/\fP and \fBgettext_compact\fP \%<#\:confval-gettext_compact> is set to \fBFalse\fP (the Sphinx document is already configured as such). .IP 3. 3 Extract translatable messages into pot files. .INDENT 3.0 .INDENT 3.5 .sp .EX $ make gettext .EE .UNINDENT .UNINDENT .sp The generated pot files will be placed in the \fB_build/gettext\fP directory. If you want to customize the output beyond what can be done via the Options for internationalisation \%<#\:intl-options>, the \fBdefault pot file template\fP can be replaced by a custom \fBmessage.pot.jinja\fP file placed in any directory listed in \fBtemplates_path\fP \%<#\:confval-templates_path>\&. .IP 4. 3 Generate po files. .sp We\(aqll use the pot files generated in the above step. .INDENT 3.0 .INDENT 3.5 .sp .EX $ sphinx\-intl update \-p _build/gettext \-l de \-l ja .EE .UNINDENT .UNINDENT .sp Once completed, the generated po files will be placed in the below directories: .INDENT 3.0 .IP \(bu 2 \fB\&./locale/de/LC_MESSAGES/\fP .IP \(bu 2 \fB\&./locale/ja/LC_MESSAGES/\fP .UNINDENT .IP 5. 3 Translate po files. .sp As noted above, these are located in the \fB\&./locale/<lang>/LC_MESSAGES\fP directory. An example of one such file, from Sphinx, \fBbuilders.po\fP, is given below. .INDENT 3.0 .INDENT 3.5 .sp .EX # a5600c3d2e3d48fc8c261ea0284db79b #: ../../builders.rst:4 msgid \(dqAvailable builders\(dq msgstr \(dq<FILL HERE BY TARGET LANGUAGE>\(dq .EE .UNINDENT .UNINDENT .sp Another case, msgid is multi\-line text and contains reStructuredText syntax: .INDENT 3.0 .INDENT 3.5 .sp .EX # 302558364e1d41c69b3277277e34b184 #: ../../builders.rst:9 msgid \(dq\(dq \(dqThese are the built\-in Sphinx builders. More builders can be added by \(dq \(dq:ref:\(gaextensions <extensions>\(ga.\(dq msgstr \(dq\(dq \(dqFILL HERE BY TARGET LANGUAGE FILL HERE BY TARGET LANGUAGE FILL HERE \(dq \(dqBY TARGET LANGUAGE :ref:\(gaEXTENSIONS <extensions>\(ga FILL HERE.\(dq .EE .UNINDENT .UNINDENT .sp Please be careful not to break reStructuredText notation. Most po\-editors will help you with that. .IP 6. 3 Build translated document. .sp You need a \fBlanguage\fP \%<#\:confval-language> parameter in \fBconf.py\fP or you may also specify the parameter on the command line. .sp For BSD/GNU make, run: .INDENT 3.0 .INDENT 3.5 .sp .EX $ make \-e SPHINXOPTS=\(dq\-D language=\(aqde\(aq\(dq html .EE .UNINDENT .UNINDENT .sp For Windows \fBcmd.exe\fP, run: .INDENT 3.0 .INDENT 3.5 .sp .EX > set SPHINXOPTS=\-D language=de > .\emake.bat html .EE .UNINDENT .UNINDENT .sp For PowerShell, run: .INDENT 3.0 .INDENT 3.5 .sp .EX PS> Set\-Item env:SPHINXOPTS \(dq\-D language=de\(dq PS> .\emake.bat html .EE .UNINDENT .UNINDENT .UNINDENT .sp Congratulations! You got the translated documentation in the \fB_build/html\fP directory. .sp Added in version 1.3: \fBsphinx\-build\fP that is invoked by make command will build po files into mo files. .sp If you are using 1.2.x or earlier, please invoke \fBsphinx\-intl build\fP command before \fBmake\fP command. .SS Translating .SS Update your po files by new pot files .sp If a document is updated, it is necessary to generate updated pot files and to apply differences to translated po files. In order to apply the updates from a pot file to the po file, use the \fBsphinx\-intl update\fP command. .INDENT 0.0 .INDENT 3.5 .sp .EX $ sphinx\-intl update \-p _build/gettext .EE .UNINDENT .UNINDENT .SS Using Transifex service for team translation .sp Transifex \%<https://\:app\:.transifex\:.com/> is one of several services that allow collaborative translation via a web interface. It has a nifty Go\-based command line client that makes it easy to fetch and push translations. .INDENT 0.0 .IP 1. 3 Install the Transifex CLI tool \%<https://\:github\:.com/\:transifex/\:cli/>\&. .sp You need the \fBtx\fP command line tool for uploading resources (pot files). The official installation process place the \fBtx\fP binary file in the current directory along with a README and a LICENSE file, and adds the current directory to \fB$PATH\fP\&. .INDENT 3.0 .INDENT 3.5 .sp .EX $ curl \-o\- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash .EE .UNINDENT .UNINDENT .sp \fBSee also:\fP .INDENT 3.0 .INDENT 3.5 Transifex Client documentation \%<https://\:developers\:.transifex\:.com/\:docs/\:using-the-client> .UNINDENT .UNINDENT .IP 2. 3 Create your Transifex \%<https://\:app\:.transifex\:.com/> account and create a new project and an organization for your document. .sp Currently, Transifex does not allow for a translation project to have more than one version of the document, so you\(aqd better include a version number in your project name. .sp For example: .INDENT 3.0 .TP .B Organization ID \fBsphinx\-document\fP .TP .B Project ID \fBsphinx\-document\-test_1_0\fP .TP .B Project URL \fBhttps://www.transifex.com/projects/p/sphinx\-document\-test_1_0/\fP .UNINDENT .IP 3. 3 Create an API token to be used in the command\-line. .sp Go to your Transifex API token \%<https://\:app\:.transifex\:.com/\:user/\:settings/\:api/> page and generate a token. Copy the generated token now, as you will not be able to see it again later. .IP 4. 3 Set your Transifex API token in the user configuration file \fB$HOME/.transifexrc\fP\&. .INDENT 3.0 .INDENT 3.5 .sp .EX [https://app.transifex.com] rest_hostname = https://rest.api.transifex.com token = paste_your_api_token_here .EE .UNINDENT .UNINDENT .IP 5. 3 Alternatively, you can store your Transifex API token as the environment variable \fBTX_TOKEN\fP, which is recognized and used by \fBtx\fP\&. .INDENT 3.0 .INDENT 3.5 .sp .EX $ export TX_TOKEN=paste_your_api_token_here .EE .UNINDENT .UNINDENT .IP 6. 3 Create the project\(aqs config file for \fBtx\fP command. .sp This process will create \fB\&.tx/config\fP in the current directory. .INDENT 3.0 .INDENT 3.5 .sp .EX $ cd /your/document/root $ tx init Successful creation of \(aq.tx/config\(aq file .EE .UNINDENT .UNINDENT .IP 7. 3 Upload pot files to Transifex service. .sp Register pot files to \fB\&.tx/config\fP file using \fBsphinx\-intl update\-txconfig\-resources\fP, adjusting \fB\-\-pot\-dir\fP value to your project\(aqs pot files\(aq directory: .INDENT 3.0 .INDENT 3.5 .sp .EX $ cd /your/document/root $ sphinx\-intl update\-txconfig\-resources \-\-pot\-dir _build/locale \e \-\-transifex\-organization\-name=sphinx\-document \e \-\-transifex\-project\-name=sphinx\-document\-test_1_0 .EE .UNINDENT .UNINDENT .sp You can use the \fBSPHINXINTL_TRANSIFEX_ORGANIZATION_NAME\fP and \fBSPHINXINTL_TRANSIFEX_PROJECT_NAME\fP environment variables instead of the respective command line arguments. .sp \fBSee also:\fP .INDENT 3.0 .INDENT 3.5 sphinx\-intl update\-txconfig\-resources documentation \%<https://\:sphinx-intl\:.readthedocs\:.io/\:en/\:master/\:refs\:.html#\:sphinx-intl-update-txconfig-resources> .UNINDENT .UNINDENT .sp and upload pot files: .INDENT 3.0 .INDENT 3.5 .sp .EX $ tx push \-s # Getting info about resources sphinx\-document\-test_1_0.builders \- Getting info sphinx\-document\-test_1_0.builders \- Done # Pushing source files sphinx\-document\-test_1_0.builders \- Uploading file sphinx\-document\-test_1_0.builders \- Done .EE .UNINDENT .UNINDENT .IP 8. 3 Forward the translation on Transifex. .IP 9. 3 Pull translated po files and make translated HTML. .sp Get translated catalogs and build mo files. For example, to build mo files for German (de): .INDENT 3.0 .INDENT 3.5 .sp .EX $ cd /your/document/root $ tx pull \-l de # Getting info about resources sphinx\-document\-test_1_0.builders \- Getting info sphinx\-document\-test_1_0.builders \- Done # Pulling files sphinx\-document\-test_1_0.builders [de] \- Pulling file sphinx\-document\-test_1_0.builders [de] \- Creating download job sphinx\-document\-test_1_0.builders [de] \- Done .EE .UNINDENT .UNINDENT .sp Invoke \fBmake html\fP (for BSD/GNU make) passing the language code: .INDENT 3.0 .INDENT 3.5 .sp .EX $ make \-e SPHINXOPTS=\(dq\-D language=\(aqde\(aq\(dq html .EE .UNINDENT .UNINDENT .UNINDENT .sp That\(aqs all! .sp \fBTip:\fP .INDENT 0.0 .INDENT 3.5 Translating locally and on Transifex .sp If you want to push all language\(aqs po files, you can be done by using \fBtx push \-t\fP command. Watch out! This operation overwrites translations in Transifex. .sp In other words, if you have updated each in the service and local po files, it would take much time and effort to integrate them. .UNINDENT .UNINDENT .SS Using Weblate service for team translation .sp Read more in Weblate\(aqs documentation \%<https://\:docs\:.weblate\:.org/\:en/\:latest/\:devel/\:sphinx\:.html>\&. .SS Contributing to Sphinx reference translation .sp The recommended way for new contributors to translate Sphinx reference is to join the translation team on Transifex. .sp There is a Sphinx translation page \%<https://\:explore\:.transifex\:.com/\:sphinx-doc/\:sphinx-doc/> for Sphinx (master) documentation. .INDENT 0.0 .IP 1. 3 Login to Transifex \%<https://\:app\:.transifex\:.com/> service. .IP 2. 3 Go to the \(dqSphinx\(aqs documentation\(dq translation project \%<https://\:app\:.transifex\:.com/\:sphinx-doc/\:sphinx-doc/>\&. .IP 3. 3 Click \fBRequest language\fP and fill form. .IP 4. 3 Wait acceptance by Transifex sphinx translation maintainers. .IP 5. 3 (After acceptance) Translate on Transifex. .UNINDENT .sp Detail is here: \%<https://\:help\:.transifex\:.com/\:en/\:articles/\:6248698-getting-started-as-a-translator> .SS Translation progress and statistics .sp Added in version 7.1.0. .sp During the rendering process, Sphinx marks each translatable node with a \fBtranslated\fP attribute, indicating if a translation was found for the text in that node. .sp The \fBtranslation_progress_classes\fP \%<#\:confval-translation_progress_classes> configuration value can be used to add a class to each element, depending on the value of the \fBtranslated\fP attribute. .sp The \fB|translation progress|\fP substitution can be used to display the percentage of nodes that have been translated on a per\-document basis. .SH FOOTNOTES .IP [1] 5 See the GNU gettext utilities \%<https://\:www\:.gnu\:.org/\:software/\:gettext/\:manual/\:gettext\:.html#\:Introduction> for details on that software suite. .IP [2] 5 Because nobody expects the Spanish Inquisition! .SS Sphinx Web Support .sp Added in version 1.1. .sp Sphinx provides a Python API to easily integrate Sphinx documentation into your web application. To learn more read the Web Support Quick Start \%<#\:websupportquickstart>\&. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 \fBHistorical context\fP: Web Support originated from the Pocoo \%<https://\:www\:.pocoo\:.org> community, the original creators of Sphinx, Jinja, Flask, Pygments, and more. Web Support was part of a plan to create a forum application that tied together Jinja, Flask, Sphinx, etc. The core goal behind Web Support was to enable a user editing and suggestion layer on top of documentation. While the concept has merit, the feature has seen limited adoption and development over the years. As of 2025, there are few real\-world examples of its use. See sphinx\-websupport\-app \%<https://\:github\:.com/\:shimizukawa/\:sphinx-websupport-app> for one such example. .UNINDENT .UNINDENT .SS Web Support Quick Start .SS Building documentation data .sp To make use of the web support package in your application you\(aqll need to build the data it uses. This data includes pickle files representing documents, search indices, and node data that is used to track where comments and other things are in a document. To do this you will need to create an instance of the \fBWebSupport\fP \%<#\:sphinxcontrib\:.websupport\:.WebSupport> class and call its \fBbuild()\fP method: .INDENT 0.0 .INDENT 3.5 .sp .EX from sphinxcontrib.websupport import WebSupport support = WebSupport(srcdir=\(aq/path/to/rst/sources/\(aq, builddir=\(aq/path/to/build/outdir\(aq, search=\(aqxapian\(aq) support.build() .EE .UNINDENT .UNINDENT .sp This will read reStructuredText sources from \fBsrcdir\fP and place the necessary data in \fBbuilddir\fP\&. The \fBbuilddir\fP will contain two subdirectories: one named \(dqdata\(dq that contains all the data needed to display documents, search through documents, and add comments to documents. The other directory will be called \(dqstatic\(dq and contains static files that should be served from \(dq/static\(dq. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 If you wish to serve static files from a path other than \(dq/static\(dq, you can do so by providing the \fIstaticdir\fP keyword argument when creating the \fBWebSupport\fP \%<#\:sphinxcontrib\:.websupport\:.WebSupport> object. .UNINDENT .UNINDENT .SS Integrating Sphinx documents into your web\-app .sp Now that the data is built, it\(aqs time to do something useful with it. Start off by creating a \fBWebSupport\fP \%<#\:sphinxcontrib\:.websupport\:.WebSupport> object for your application: .INDENT 0.0 .INDENT 3.5 .sp .EX from sphinxcontrib.websupport import WebSupport support = WebSupport(datadir=\(aq/path/to/the/data\(aq, search=\(aqxapian\(aq) .EE .UNINDENT .UNINDENT .sp You\(aqll only need one of these for each set of documentation you will be working with. You can then call its \fBget_document()\fP method to access individual documents: .INDENT 0.0 .INDENT 3.5 .sp .EX contents = support.get_document(\(aqcontents\(aq) .EE .UNINDENT .UNINDENT .sp This will return a dictionary containing the following items: .INDENT 0.0 .IP \(bu 2 \fBbody\fP: The main body of the document as HTML .IP \(bu 2 \fBsidebar\fP: The sidebar of the document as HTML .IP \(bu 2 \fBrelbar\fP: A div containing links to related documents .IP \(bu 2 \fBtitle\fP: The title of the document .IP \(bu 2 \fBcss\fP: Links to CSS files used by Sphinx .IP \(bu 2 \fBscript\fP: JavaScript containing comment options .UNINDENT .sp This dict can then be used as context for templates. The goal is to be easy to integrate with your existing templating system. An example using Jinja2 \%<https://\:jinja\:.palletsprojects\:.com/> is: .INDENT 0.0 .INDENT 3.5 .sp .EX {%\- extends \(dqlayout.html\(dq %} {%\- block title %} {{ document.title }} {%\- endblock %} {% block css %} {{ super() }} {{ document.css|safe }} <link rel=\(dqstylesheet\(dq href=\(dq/static/websupport\-custom.css\(dq type=\(dqtext/css\(dq> {% endblock %} {%\- block script %} {{ super() }} {{ document.script|safe }} {%\- endblock %} {%\- block relbar %} {{ document.relbar|safe }} {%\- endblock %} {%\- block body %} {{ document.body|safe }} {%\- endblock %} {%\- block sidebar %} {{ document.sidebar|safe }} {%\- endblock %} .EE .UNINDENT .UNINDENT .SS Authentication .sp To use certain features such as voting, it must be possible to authenticate users. The details of the authentication are left to your application. Once a user has been authenticated you can pass the user\(aqs details to certain \fBWebSupport\fP \%<#\:sphinxcontrib\:.websupport\:.WebSupport> methods using the \fIusername\fP and \fImoderator\fP keyword arguments. The web support package will store the username with comments and votes. The only caveat is that if you allow users to change their username you must update the websupport package\(aqs data: .INDENT 0.0 .INDENT 3.5 .sp .EX support.update_username(old_username, new_username) .EE .UNINDENT .UNINDENT .sp \fIusername\fP should be a unique string which identifies a user, and \fImoderator\fP should be a boolean representing whether the user has moderation privileges. The default value for \fImoderator\fP is \fBFalse\fP\&. .sp An example Flask \%<https://\:flask\:.palletsprojects\:.com/> function that checks whether a user is logged in and then retrieves a document is: .INDENT 0.0 .INDENT 3.5 .sp .EX from sphinxcontrib.websupport.errors import * @app.route(\(aq/<path:docname>\(aq) def doc(docname): username = g.user.name if g.user else \(aq\(aq moderator = g.user.moderator if g.user else False try: document = support.get_document(docname, username, moderator) except DocumentNotFoundError: abort(404) return render_template(\(aqdoc.html\(aq, document=document) .EE .UNINDENT .UNINDENT .sp The first thing to notice is that the \fIdocname\fP is just the request path. This makes accessing the correct document easy from a single view. If the user is authenticated, then the username and moderation status are passed along with the docname to \fBget_document()\fP\&. The web support package will then add this data to the \fBCOMMENT_OPTIONS\fP that are used in the template. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 This only works if your documentation is served from your document root. If it is served from another directory, you will need to prefix the url route with that directory, and give the \fIdocroot\fP keyword argument when creating the web support object: .INDENT 0.0 .INDENT 3.5 .sp .EX support = WebSupport(..., docroot=\(aqdocs\(aq) @app.route(\(aq/docs/<path:docname>\(aq) .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS Performing searches .sp To use the search form built\-in to the Sphinx sidebar, create a function to handle requests to the URL \(aqsearch\(aq relative to the documentation root. The user\(aqs search query will be in the GET parameters, with the key \fBq\fP\&. Then use the \fBget_search_results()\fP method to retrieve search results. In Flask \%<https://\:flask\:.palletsprojects\:.com/> that would be like this: .INDENT 0.0 .INDENT 3.5 .sp .EX @app.route(\(aq/search\(aq) def search(): q = request.args.get(\(aqq\(aq) document = support.get_search_results(q) return render_template(\(aqdoc.html\(aq, document=document) .EE .UNINDENT .UNINDENT .sp Note that we used the same template to render our search results as we did to render our documents. That\(aqs because \fBget_search_results()\fP returns a context dict in the same format that \fBget_document()\fP does. .SS Comments & proposals .sp Now that this is done it\(aqs time to define the functions that handle the AJAX calls from the script. You will need three functions. The first function is used to add a new comment, and will call the web support method \fBadd_comment()\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX @app.route(\(aq/docs/add_comment\(aq, methods=[\(aqPOST\(aq]) def add_comment(): parent_id = request.form.get(\(aqparent\(aq, \(aq\(aq) node_id = request.form.get(\(aqnode\(aq, \(aq\(aq) text = request.form.get(\(aqtext\(aq, \(aq\(aq) proposal = request.form.get(\(aqproposal\(aq, \(aq\(aq) username = g.user.name if g.user is not None else \(aqAnonymous\(aq comment = support.add_comment(text, node_id=\(aqnode_id\(aq, parent_id=\(aqparent_id\(aq, username=username, proposal=proposal) return jsonify(comment=comment) .EE .UNINDENT .UNINDENT .sp You\(aqll notice that both a \fBparent_id\fP and \fBnode_id\fP are sent with the request. If the comment is being attached directly to a node, \fBparent_id\fP will be empty. If the comment is a child of another comment, then \fBnode_id\fP will be empty. Then next function handles the retrieval of comments for a specific node, and is aptly named \fBget_data()\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX @app.route(\(aq/docs/get_comments\(aq) def get_comments(): username = g.user.name if g.user else None moderator = g.user.moderator if g.user else False node_id = request.args.get(\(aqnode\(aq, \(aq\(aq) data = support.get_data(node_id, username, moderator) return jsonify(**data) .EE .UNINDENT .UNINDENT .sp The final function that is needed will call \fBprocess_vote()\fP, and will handle user votes on comments: .INDENT 0.0 .INDENT 3.5 .sp .EX @app.route(\(aq/docs/process_vote\(aq, methods=[\(aqPOST\(aq]) def process_vote(): if g.user is None: abort(401) comment_id = request.form.get(\(aqcomment_id\(aq) value = request.form.get(\(aqvalue\(aq) if value is None or comment_id is None: abort(400) support.process_vote(comment_id, g.user.id, value) return \(dqsuccess\(dq .EE .UNINDENT .UNINDENT .SS Comment moderation .sp By default, all comments added through \fBadd_comment()\fP are automatically displayed. If you wish to have some form of moderation, you can pass the \fBdisplayed\fP keyword argument: .INDENT 0.0 .INDENT 3.5 .sp .EX comment = support.add_comment(text, node_id=\(aqnode_id\(aq, parent_id=\(aqparent_id\(aq, username=username, proposal=proposal, displayed=False) .EE .UNINDENT .UNINDENT .sp You can then create a new view to handle the moderation of comments. It will be called when a moderator decides a comment should be accepted and displayed: .INDENT 0.0 .INDENT 3.5 .sp .EX @app.route(\(aq/docs/accept_comment\(aq, methods=[\(aqPOST\(aq]) def accept_comment(): moderator = g.user.moderator if g.user else False comment_id = request.form.get(\(aqid\(aq) support.accept_comment(comment_id, moderator=moderator) return \(aqOK\(aq .EE .UNINDENT .UNINDENT .sp Rejecting comments happens via comment deletion. .sp To perform a custom action (such as emailing a moderator) when a new comment is added but not displayed, you can pass callable to the \fBWebSupport\fP \%<#\:sphinxcontrib\:.websupport\:.WebSupport> class when instantiating your support object: .INDENT 0.0 .INDENT 3.5 .sp .EX def moderation_callback(comment): \(dq\(dq\(dqDo something...\(dq\(dq\(dq support = WebSupport(..., moderation_callback=moderation_callback) .EE .UNINDENT .UNINDENT .sp The moderation callback must take one argument, which will be the same comment dict that is returned by \fBWebSupport.add_comment()\fP\&. .SS The WebSupport class .INDENT 0.0 .TP .B class sphinxcontrib.websupport.WebSupport The main API class for the web support package. All interactions with the web support package should occur through this class. .sp The class takes the following keyword arguments: .INDENT 7.0 .TP .B srcdir The directory containing reStructuredText source files. .TP .B builddir The directory that build data and static files should be placed in. This should be used when creating a \fBWebSupport\fP object that will be used to build data. .TP .B datadir The directory that the web support data is in. This should be used when creating a \fBWebSupport\fP object that will be used to retrieve data. .TP .B search This may contain either a string (e.g. \(aqxapian\(aq) referencing a built\-in search adapter to use, or an instance of a subclass of \fBBaseSearch\fP \%<#\:sphinxcontrib\:.websupport\:.search\:.BaseSearch>\&. .TP .B storage This may contain either a string representing a database uri, or an instance of a subclass of \fBStorageBackend\fP \%<#\:sphinxcontrib\:.websupport\:.storage\:.StorageBackend>\&. If this is not provided, a new sqlite database will be created. .TP .B moderation_callback A callable to be called when a new comment is added that is not displayed. It must accept one argument: a dictionary representing the comment that was added. .TP .B staticdir If the static files should be created in a different location \fBand not in\fP \fB\(aq/static\(aq\fP, this should be a string with the name of that location (e.g. \fBbuilddir + \(aq/static_files\(aq\fP). .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 If you specify \fBstaticdir\fP, you will typically want to adjust \fBstaticroot\fP accordingly. .UNINDENT .UNINDENT .TP .B staticroot If the static files are not served from \fB\(aq/static\(aq\fP, this should be a string with the name of that location (e.g. \fB\(aq/static_files\(aq\fP). .TP .B docroot If the documentation is not served from the base path of a URL, this should be a string specifying that path (e.g. \fB\(aqdocs\(aq\fP). .UNINDENT .UNINDENT .sp Changed in version 1.6: WebSupport class is moved to sphinxcontrib.websupport from sphinx.websupport. Please add \fBsphinxcontrib\-websupport\fP package in your dependency and use moved class instead. .SS Methods .SS Search adapters .sp To create a custom search adapter you will need to subclass the \fBBaseSearch\fP class. Then create an instance of the new class and pass that as the \fIsearch\fP keyword argument when you create the \fBWebSupport\fP \%<#\:sphinxcontrib\:.websupport\:.WebSupport> object: .INDENT 0.0 .INDENT 3.5 .sp .EX support = WebSupport(srcdir=srcdir, builddir=builddir, search=MySearch()) .EE .UNINDENT .UNINDENT .sp For more information about creating a custom search adapter, please see the documentation of the \fBBaseSearch\fP class below. .INDENT 0.0 .TP .B class sphinxcontrib.websupport.search.BaseSearch Defines an interface for search adapters. .UNINDENT .sp Changed in version 1.6: BaseSearch class is moved to sphinxcontrib.websupport.search from sphinx.websupport.search. .SS Methods .sp The following methods are defined in the BaseSearch class. Some methods do not need to be overridden, but some (\fBadd_document()\fP and \fBhandle_query()\fP) must be overridden in your subclass. For a working example, look at the built\-in adapter for whoosh. .SS Storage backends .sp To create a custom storage backend you will need to subclass the \fBStorageBackend\fP class. Then create an instance of the new class and pass that as the \fIstorage\fP keyword argument when you create the \fBWebSupport\fP \%<#\:sphinxcontrib\:.websupport\:.WebSupport> object: .INDENT 0.0 .INDENT 3.5 .sp .EX support = WebSupport(srcdir=srcdir, builddir=builddir, storage=MyStorage()) .EE .UNINDENT .UNINDENT .sp For more information about creating a custom storage backend, please see the documentation of the \fBStorageBackend\fP class below. .INDENT 0.0 .TP .B class sphinxcontrib.websupport.storage.StorageBackend Defines an interface for storage backends. .UNINDENT .sp Changed in version 1.6: StorageBackend class is moved to sphinxcontrib.websupport.storage from sphinx.websupport.storage. .SS Methods .SS Extending Sphinx .sp This guide is aimed at giving a quick introduction for those wishing to develop their own extensions for Sphinx. Sphinx possesses significant extensibility capabilities including the ability to hook into almost every point of the build process. If you simply wish to use Sphinx with existing extensions, refer to Extensions \%<>\&. For a more detailed discussion of the extension interface see Sphinx API \%<>\&. .SS Tutorials .SS Extending syntax with roles and directives .SS Overview .sp The syntax of both reStructuredText and MyST can be extended by creating new \fBdirectives\fP \- for block\-level elements \- and \fBroles\fP \- for inline elements. .sp In this tutorial we shall extend Sphinx to add: .INDENT 0.0 .IP \(bu 2 A \fBhello\fP role, that will simply output the text \fBHello {text}!\fP\&. .IP \(bu 2 A \fBhello\fP directive, that will simply output the text \fBHello {text}!\fP, as a paragraph. .UNINDENT .sp For this extension, you will need some basic understanding of Python, and we shall also introduce aspects of the docutils \%<https://\:docutils\:.sourceforge\:.io/> API. .SS Setting up the project .sp You can either use an existing Sphinx project or create a new one using \fBsphinx\-quickstart\fP\&. .sp With this we will add the extension to the project, within the \fBsource\fP folder: .INDENT 0.0 .IP 1. 3 Create an \fB_ext\fP folder in \fBsource\fP .IP 2. 3 Create a new Python file in the \fB_ext\fP folder called \fBhelloworld.py\fP .UNINDENT .sp Here is an example of the folder structure you might obtain: .INDENT 0.0 .INDENT 3.5 .sp .EX └── source \ \ ├── _ext │ \ └── helloworld.py \ \ ├── conf.py \ \ ├── index.rst .EE .UNINDENT .UNINDENT .SS Writing the extension .sp Open \fBhelloworld.py\fP and paste the following code in it: .INDENT 0.0 .INDENT 3.5 .sp .EX from __future__ import annotations from docutils import nodes from sphinx.application import Sphinx from sphinx.util.docutils import SphinxDirective, SphinxRole from sphinx.util.typing import ExtensionMetadata class HelloRole(SphinxRole): \(dq\(dq\(dqA role to say hello!\(dq\(dq\(dq def run(self) \-> tuple[list[nodes.Node], list[nodes.system_message]]: node = nodes.inline(text=f\(aqHello {self.text}!\(aq) return [node], [] class HelloDirective(SphinxDirective): \(dq\(dq\(dqA directive to say hello!\(dq\(dq\(dq required_arguments = 1 def run(self) \-> list[nodes.Node]: paragraph_node = nodes.paragraph(text=f\(aqhello {self.arguments[0]}!\(aq) return [paragraph_node] def setup(app: Sphinx) \-> ExtensionMetadata: app.add_role(\(aqhello\(aq, HelloRole()) app.add_directive(\(aqhello\(aq, HelloDirective) return { \(aqversion\(aq: \(aq0.1\(aq, \(aqparallel_read_safe\(aq: True, \(aqparallel_write_safe\(aq: True, } .EE .UNINDENT .UNINDENT .sp Some essential things are happening in this example: .SS The role class .sp Our new role is declared in the \fBHelloRole\fP class. .INDENT 0.0 .INDENT 3.5 .sp .EX class HelloRole(SphinxRole): \(dq\(dq\(dqA role to say hello!\(dq\(dq\(dq def run(self) \-> tuple[list[nodes.Node], list[nodes.system_message]]: node = nodes.inline(text=f\(aqHello {self.text}!\(aq) return [node], [] .EE .UNINDENT .UNINDENT .sp This class extends the \fBSphinxRole\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxRole> class. The class contains a \fBrun\fP method, which is a requirement for every role. It contains the main logic of the role and it returns a tuple containing: .INDENT 0.0 .IP \(bu 2 a list of inline\-level docutils nodes to be processed by Sphinx. .IP \(bu 2 an (optional) list of system message nodes .UNINDENT .SS The directive class .sp Our new directive is declared in the \fBHelloDirective\fP class. .INDENT 0.0 .INDENT 3.5 .sp .EX class HelloDirective(SphinxDirective): \(dq\(dq\(dqA directive to say hello!\(dq\(dq\(dq required_arguments = 1 def run(self) \-> list[nodes.Node]: paragraph_node = nodes.paragraph(text=f\(aqhello {self.arguments[0]}!\(aq) return [paragraph_node] .EE .UNINDENT .UNINDENT .sp This class extends the \fBSphinxDirective\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxDirective> class. The class contains a \fBrun\fP method, which is a requirement for every directive. It contains the main logic of the directive and it returns a list of block\-level docutils nodes to be processed by Sphinx. It also contains a \fBrequired_arguments\fP attribute, which tells Sphinx how many arguments are required for the directive. .SS What are docutils nodes? .sp When Sphinx parses a document, it creates an \(dqAbstract Syntax Tree\(dq (AST) of nodes that represent the content of the document in a structured way, that is generally independent of any one input (rST, MyST, etc) or output (HTML, LaTeX, etc) format. It is a tree because each node can have children nodes, and so on: .INDENT 0.0 .INDENT 3.5 .sp .EX <document> <paragraph> <text> Hello world! .EE .UNINDENT .UNINDENT .sp The docutils \%<https://\:docutils\:.sourceforge\:.io/> package provides many built\-in nodes \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:doctree\:.html>, to represent different types of content such as text, paragraphs, references, tables, etc. .sp Each node type generally only accepts a specific set of direct child nodes, for example the \fBdocument\fP node should only contain \(dqblock\-level\(dq nodes, such as \fBparagraph\fP, \fBsection\fP, \fBtable\fP, etc, whilst the \fBparagraph\fP node should only contain \(dqinline\-level\(dq nodes, such as \fBtext\fP, \fBemphasis\fP, \fBstrong\fP, etc. .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 The docutils documentation on creating directives \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:howto/\:rst-directives\:.html>, and creating roles \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:howto/\:rst-roles\:.html>\&. .UNINDENT .UNINDENT .SS The \fBsetup\fP function .sp This function is a requirement. We use it to plug our new directive into Sphinx. .INDENT 0.0 .INDENT 3.5 .sp .EX def setup(app: Sphinx) \-> ExtensionMetadata: app.add_role(\(aqhello\(aq, HelloRole()) app.add_directive(\(aqhello\(aq, HelloDirective) return { \(aqversion\(aq: \(aq0.1\(aq, \(aqparallel_read_safe\(aq: True, \(aqparallel_write_safe\(aq: True, } .EE .UNINDENT .UNINDENT .sp The simplest thing you can do is to call the \fBSphinx.add_role()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_role> and \fBSphinx.add_directive()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_directive> methods, which is what we\(aqve done here. For this particular call, the first argument is the name of the role/directive itself as used in a reStructuredText file. In this case, we would use \fBhello\fP\&. For example: .INDENT 0.0 .INDENT 3.5 .sp .EX Some intro text here... \&.. hello:: world Some text with a :hello:\(gaworld\(ga role. .EE .UNINDENT .UNINDENT .sp We also return the extension metadata \%<#\:ext-metadata> that indicates the version of our extension, along with the fact that it is safe to use the extension for both parallel reading and writing. .SS Using the extension .sp The extension has to be declared in your \fBconf.py\fP file to make Sphinx aware of it. There are two steps necessary here: .INDENT 0.0 .IP 1. 3 Add the \fB_ext\fP directory to the Python path \%<https://\:docs\:.python\:.org/\:3/\:using/\:cmdline\:.html#\:envvar-PYTHONPATH> using \fBsys.path.append\fP\&. This should be placed at the top of the file. .IP 2. 3 Update or create the \fBextensions\fP \%<#\:confval-extensions> list and add the extension file name to the list .UNINDENT .sp For example: .INDENT 0.0 .INDENT 3.5 .sp .EX import sys from pathlib import Path sys.path.append(str(Path(\(aq_ext\(aq).resolve())) extensions = [\(aqhelloworld\(aq] .EE .UNINDENT .UNINDENT .sp \fBTip:\fP .INDENT 0.0 .INDENT 3.5 Because we haven\(aqt installed our extension as a Python package \%<https://\:packaging\:.python\:.org/>, we need to modify the Python path \%<https://\:docs\:.python\:.org/\:3/\:using/\:cmdline\:.html#\:envvar-PYTHONPATH> so Sphinx can find our extension. This is why we need the call to \fBsys.path.append\fP\&. .UNINDENT .UNINDENT .sp You can now use the extension in a file. For example: .INDENT 0.0 .INDENT 3.5 .sp .EX Some intro text here... \&.. hello:: world Some text with a :hello:\(gaworld\(ga role. .EE .UNINDENT .UNINDENT .sp The sample above would generate: .INDENT 0.0 .INDENT 3.5 .sp .EX Some intro text here... Hello world! Some text with a hello world! role. .EE .UNINDENT .UNINDENT .SS Further reading .sp This is the very basic principle of an extension that creates a new role and directive. .sp For a more advanced example, refer to Extending the build process \%<#\:tutorial-extend-build>\&. .sp If you wish to share your extension across multiple projects or with others, check out the Third\-party extensions \%<#\:third-party-extensions> section. .SS Extending the build process .sp The objective of this tutorial is to create a more comprehensive extension than that created in Extending syntax with roles and directives \%<#\:tutorial-extending-syntax>\&. Whereas that guide just covered writing a custom role \%<#\:term-role> and directive \%<#\:term-directive>, this guide covers a more complex extension to the Sphinx build process; adding multiple directives, along with custom nodes, additional config values and custom event handlers. .sp To this end, we will cover a \fBtodo\fP extension that adds capabilities to include todo entries in the documentation, and to collect these in a central place. This is similar to the \fBsphinx.ext.todo\fP \%<#\:module-sphinx\:.ext\:.todo> extension distributed with Sphinx. .SS Overview .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 To understand the design of this extension, refer to Important objects \%<#\:important-objects> and Build phases \%<#\:build-phases>\&. .UNINDENT .UNINDENT .sp We want the extension to add the following to Sphinx: .INDENT 0.0 .IP \(bu 2 A \fBtodo\fP directive, containing some content that is marked with \(dqTODO\(dq and only shown in the output if a new config value is set. Todo entries should not be in the output by default. .IP \(bu 2 A \fBtodolist\fP directive that creates a list of all todo entries throughout the documentation. .UNINDENT .sp For that, we will need to add the following elements to Sphinx: .INDENT 0.0 .IP \(bu 2 New directives, called \fBtodo\fP and \fBtodolist\fP\&. .IP \(bu 2 New document tree nodes to represent these directives, conventionally also called \fBtodo\fP and \fBtodolist\fP\&. We wouldn\(aqt need new nodes if the new directives only produced some content representable by existing nodes. .IP \(bu 2 A new config value \fBtodo_include_todos\fP (config value names should start with the extension name, in order to stay unique) that controls whether todo entries make it into the output. .IP \(bu 2 New event handlers: one for the \fBdoctree\-resolved\fP \%<#\:event-doctree-resolved> event, to replace the todo and todolist nodes, one for \fBenv\-merge\-info\fP \%<#\:event-env-merge-info> to merge intermediate results from parallel builds, and one for \fBenv\-purge\-doc\fP \%<#\:event-env-purge-doc> (the reason for that will be covered later). .UNINDENT .SS Prerequisites .sp As with Extending syntax with roles and directives \%<#\:tutorial-extending-syntax>, we will not be distributing this plugin via PyPI so once again we need a Sphinx project to call this from. You can use an existing project or create a new one using \fBsphinx\-quickstart\fP\&. .sp We assume you are using separate source (\fBsource\fP) and build (\fBbuild\fP) folders. Your extension file could be in any folder of your project. In our case, let\(aqs do the following: .INDENT 0.0 .IP 1. 3 Create an \fB_ext\fP folder in \fBsource\fP .IP 2. 3 Create a new Python file in the \fB_ext\fP folder called \fBtodo.py\fP .UNINDENT .sp Here is an example of the folder structure you might obtain: .INDENT 0.0 .INDENT 3.5 .sp .EX └── source \ \ ├── _ext │ \ └── todo.py \ \ ├── _static \ \ ├── conf.py \ \ ├── somefolder \ \ ├── index.rst \ \ ├── somefile.rst \ \ └── someotherfile.rst .EE .UNINDENT .UNINDENT .SS Writing the extension .sp Open \fBtodo.py\fP and paste the following code in it, all of which we will explain in detail shortly: .INDENT 0.0 .INDENT 3.5 .sp .EX from docutils import nodes from docutils.parsers.rst import Directive from sphinx.application import Sphinx from sphinx.locale import _ from sphinx.util.docutils import SphinxDirective from sphinx.util.typing import ExtensionMetadata class todo(nodes.Admonition, nodes.Element): pass class todolist(nodes.General, nodes.Element): pass def visit_todo_node(self, node): self.visit_admonition(node) def depart_todo_node(self, node): self.depart_admonition(node) class TodolistDirective(Directive): def run(self): return [todolist(\(aq\(aq)] class TodoDirective(SphinxDirective): # this enables content in the directive has_content = True def run(self): targetid = \(aqtodo\-%d\(aq % self.env.new_serialno(\(aqtodo\(aq) targetnode = nodes.target(\(aq\(aq, \(aq\(aq, ids=[targetid]) todo_node = todo(\(aq\en\(aq.join(self.content)) todo_node += nodes.title(_(\(aqTodo\(aq), _(\(aqTodo\(aq)) todo_node += self.parse_content_to_nodes() if not hasattr(self.env, \(aqtodo_all_todos\(aq): self.env.todo_all_todos = [] self.env.todo_all_todos.append({ \(aqdocname\(aq: self.env.current_document.docname, \(aqlineno\(aq: self.lineno, \(aqtodo\(aq: todo_node.deepcopy(), \(aqtarget\(aq: targetnode, }) return [targetnode, todo_node] def purge_todos(app, env, docname): if not hasattr(env, \(aqtodo_all_todos\(aq): return env.todo_all_todos = [ todo for todo in env.todo_all_todos if todo[\(aqdocname\(aq] != docname ] def merge_todos(app, env, docnames, other): if not hasattr(env, \(aqtodo_all_todos\(aq): env.todo_all_todos = [] if hasattr(other, \(aqtodo_all_todos\(aq): env.todo_all_todos.extend(other.todo_all_todos) def process_todo_nodes(app, doctree, fromdocname): if not app.config.todo_include_todos: for node in doctree.findall(todo): node.parent.remove(node) # Replace all todolist nodes with a list of the collected todos. # Augment each todo with a backlink to the original location. env = app.env if not hasattr(env, \(aqtodo_all_todos\(aq): env.todo_all_todos = [] for node in doctree.findall(todolist): if not app.config.todo_include_todos: node.replace_self([]) continue content = [] for todo_info in env.todo_all_todos: para = nodes.paragraph() filename = env.doc2path(todo_info[\(aqdocname\(aq], base=None) description = _( \(aq(The original entry is located in %s, line %d and can be found \(aq ) % (filename, todo_info[\(aqlineno\(aq]) para += nodes.Text(description) # Create a reference newnode = nodes.reference(\(aq\(aq, \(aq\(aq) innernode = nodes.emphasis(_(\(aqhere\(aq), _(\(aqhere\(aq)) newnode[\(aqrefdocname\(aq] = todo_info[\(aqdocname\(aq] newnode[\(aqrefuri\(aq] = app.builder.get_relative_uri( fromdocname, todo_info[\(aqdocname\(aq] ) newnode[\(aqrefuri\(aq] += \(aq#\(aq + todo_info[\(aqtarget\(aq][\(aqrefid\(aq] newnode.append(innernode) para += newnode para += nodes.Text(\(aq.)\(aq) # Insert into the todolist content.extend(( todo_info[\(aqtodo\(aq], para, )) node.replace_self(content) def setup(app: Sphinx) \-> ExtensionMetadata: app.add_config_value(\(aqtodo_include_todos\(aq, False, \(aqhtml\(aq) app.add_node(todolist) app.add_node( todo, html=(visit_todo_node, depart_todo_node), latex=(visit_todo_node, depart_todo_node), text=(visit_todo_node, depart_todo_node), ) app.add_directive(\(aqtodo\(aq, TodoDirective) app.add_directive(\(aqtodolist\(aq, TodolistDirective) app.connect(\(aqdoctree\-resolved\(aq, process_todo_nodes) app.connect(\(aqenv\-purge\-doc\(aq, purge_todos) app.connect(\(aqenv\-merge\-info\(aq, merge_todos) return { \(aqversion\(aq: \(aq0.1\(aq, \(aqenv_version\(aq: 1, \(aqparallel_read_safe\(aq: True, \(aqparallel_write_safe\(aq: True, } .EE .UNINDENT .UNINDENT .sp This is far more extensive extension than the one detailed in Extending syntax with roles and directives \%<#\:tutorial-extending-syntax>, however, we will will look at each piece step\-by\-step to explain what\(aqs happening. .sp The node classes .sp Let\(aqs start with the node classes: .INDENT 0.0 .INDENT 3.5 .sp .EX class todo(nodes.Admonition, nodes.Element): pass class todolist(nodes.General, nodes.Element): pass def visit_todo_node(self, node): self.visit_admonition(node) .EE .UNINDENT .UNINDENT .sp Node classes usually don\(aqt have to do anything except inherit from the standard docutils classes defined in \fBdocutils.nodes\fP\&. \fBtodo\fP inherits from \fBAdmonition\fP because it should be handled like a note or warning, \fBtodolist\fP is just a \(dqgeneral\(dq node. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Many extensions will not have to create their own node classes and work fine with the nodes already provided by docutils \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:doctree\:.html> and Sphinx \%<#\:nodes>\&. .UNINDENT .UNINDENT .sp \fBAttention:\fP .INDENT 0.0 .INDENT 3.5 It is important to know that while you can extend Sphinx without leaving your \fBconf.py\fP, if you declare an inherited node right there, you\(aqll hit an unobvious \fBPickleError\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:pickle\:.html#\:pickle\:.PickleError>\&. So if something goes wrong, please make sure that you put inherited nodes into a separate Python module. .sp For more details, see: .INDENT 0.0 .IP \(bu 2 \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:issues/\:6751> .IP \(bu 2 \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:issues/\:1493> .IP \(bu 2 \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:issues/\:1424> .UNINDENT .UNINDENT .UNINDENT .sp The directive classes .sp A directive class is a class deriving usually from \fBdocutils.parsers.rst.Directive\fP \%<#\:docutils\:.parsers\:.rst\:.Directive>\&. The directive interface is also covered in detail in the docutils documentation \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html>; the important thing is that the class should have attributes that configure the allowed markup, and a \fBrun\fP method that returns a list of nodes. .sp Looking first at the \fBTodolistDirective\fP directive: .INDENT 0.0 .INDENT 3.5 .sp .EX class TodolistDirective(Directive): def run(self): return [todolist(\(aq\(aq)] .EE .UNINDENT .UNINDENT .sp It\(aqs very simple, creating and returning an instance of our \fBtodolist\fP node class. The \fBTodolistDirective\fP directive itself has neither content nor arguments that need to be handled. That brings us to the \fBTodoDirective\fP directive: .INDENT 0.0 .INDENT 3.5 .sp .EX class TodoDirective(SphinxDirective): # this enables content in the directive has_content = True def run(self): targetid = \(aqtodo\-%d\(aq % self.env.new_serialno(\(aqtodo\(aq) targetnode = nodes.target(\(aq\(aq, \(aq\(aq, ids=[targetid]) todo_node = todo(\(aq\en\(aq.join(self.content)) todo_node += nodes.title(_(\(aqTodo\(aq), _(\(aqTodo\(aq)) todo_node += self.parse_content_to_nodes() if not hasattr(self.env, \(aqtodo_all_todos\(aq): self.env.todo_all_todos = [] self.env.todo_all_todos.append({ \(aqdocname\(aq: self.env.current_document.docname, \(aqlineno\(aq: self.lineno, \(aqtodo\(aq: todo_node.deepcopy(), \(aqtarget\(aq: targetnode, }) return [targetnode, todo_node] .EE .UNINDENT .UNINDENT .sp Several important things are covered here. First, as you can see, we\(aqre now subclassing the \fBSphinxDirective\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxDirective> helper class instead of the usual \fBDirective\fP \%<#\:docutils\:.parsers\:.rst\:.Directive> class. This gives us access to the build environment instance \%<#\:important-objects> using the \fBself.env\fP property. Without this, we\(aqd have to use the rather convoluted \fBself.state.document.settings.env\fP\&. Then, to act as a link target (from \fBTodolistDirective\fP), the \fBTodoDirective\fP directive needs to return a target node in addition to the \fBtodo\fP node. The target ID (in HTML, this will be the anchor name) is generated by using \fBenv.new_serialno\fP which returns a new unique integer on each call and therefore leads to unique target names. The target node is instantiated without any text (the first two arguments). .sp On creating admonition node, the content body of the directive are parsed using \fBself.parse_content_to_nodes()\fP\&. Following this, the \fBtodo\fP node is added to the environment. This is needed to be able to create a list of all todo entries throughout the documentation, in the place where the author puts a \fBtodolist\fP directive. For this case, the environment attribute \fBtodo_all_todos\fP is used (again, the name should be unique, so it is prefixed by the extension name). It does not exist when a new environment is created, so the directive must check and create it if necessary. Various information about the todo entry\(aqs location are stored along with a copy of the node. .sp In the last line, the nodes that should be put into the doctree are returned: the target node and the admonition node. .sp The node structure that the directive returns looks like this: .INDENT 0.0 .INDENT 3.5 .sp .EX +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | target node | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | todo node | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \e__+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | admonition title | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | paragraph | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | ... | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ .EE .UNINDENT .UNINDENT .sp The event handlers .sp Event handlers are one of Sphinx\(aqs most powerful features, providing a way to do hook into any part of the documentation process. There are many events provided by Sphinx itself, as detailed in the API guide \%<#\:events>, and we\(aqre going to use a subset of them here. .sp Let\(aqs look at the event handlers used in the above example. First, the one for the \fBenv\-purge\-doc\fP \%<#\:event-env-purge-doc> event: .INDENT 0.0 .INDENT 3.5 .sp .EX def purge_todos(app, env, docname): if not hasattr(env, \(aqtodo_all_todos\(aq): return env.todo_all_todos = [ todo for todo in env.todo_all_todos if todo[\(aqdocname\(aq] != docname ] .EE .UNINDENT .UNINDENT .sp Since we store information from source files in the environment, which is persistent, it may become out of date when the source file changes. Therefore, before each source file is read, the environment\(aqs records of it are cleared, and the \fBenv\-purge\-doc\fP \%<#\:event-env-purge-doc> event gives extensions a chance to do the same. Here we clear out all todos whose docname matches the given one from the \fBtodo_all_todos\fP list. If there are todos left in the document, they will be added again during parsing. .sp The next handler, for the \fBenv\-merge\-info\fP \%<#\:event-env-merge-info> event, is used during parallel builds. As during parallel builds all threads have their own \fBenv\fP, there\(aqs multiple \fBtodo_all_todos\fP lists that need to be merged: .INDENT 0.0 .INDENT 3.5 .sp .EX def merge_todos(app, env, docnames, other): if not hasattr(env, \(aqtodo_all_todos\(aq): env.todo_all_todos = [] if hasattr(other, \(aqtodo_all_todos\(aq): env.todo_all_todos.extend(other.todo_all_todos) .EE .UNINDENT .UNINDENT .sp The other handler belongs to the \fBdoctree\-resolved\fP \%<#\:event-doctree-resolved> event: .INDENT 0.0 .INDENT 3.5 .sp .EX def process_todo_nodes(app, doctree, fromdocname): if not app.config.todo_include_todos: for node in doctree.findall(todo): node.parent.remove(node) # Replace all todolist nodes with a list of the collected todos. # Augment each todo with a backlink to the original location. env = app.env if not hasattr(env, \(aqtodo_all_todos\(aq): env.todo_all_todos = [] for node in doctree.findall(todolist): if not app.config.todo_include_todos: node.replace_self([]) continue content = [] for todo_info in env.todo_all_todos: para = nodes.paragraph() filename = env.doc2path(todo_info[\(aqdocname\(aq], base=None) description = _( \(aq(The original entry is located in %s, line %d and can be found \(aq ) % (filename, todo_info[\(aqlineno\(aq]) para += nodes.Text(description) # Create a reference newnode = nodes.reference(\(aq\(aq, \(aq\(aq) innernode = nodes.emphasis(_(\(aqhere\(aq), _(\(aqhere\(aq)) newnode[\(aqrefdocname\(aq] = todo_info[\(aqdocname\(aq] newnode[\(aqrefuri\(aq] = app.builder.get_relative_uri( fromdocname, todo_info[\(aqdocname\(aq] ) newnode[\(aqrefuri\(aq] += \(aq#\(aq + todo_info[\(aqtarget\(aq][\(aqrefid\(aq] newnode.append(innernode) para += newnode para += nodes.Text(\(aq.)\(aq) # Insert into the todolist content.extend(( todo_info[\(aqtodo\(aq], para, )) node.replace_self(content) .EE .UNINDENT .UNINDENT .sp The \fBdoctree\-resolved\fP \%<#\:event-doctree-resolved> event is emitted for each document that is about to be written at the end of phase 3 (resolving) \%<#\:build-phases> and allows custom resolving to be done on that document. The handler we have written for this event is a bit more involved. If the \fBtodo_include_todos\fP config value (which we\(aqll describe shortly) is false, all \fBtodo\fP and \fBtodolist\fP nodes are removed from the documents. If not, \fBtodo\fP nodes just stay where and how they are. \fBtodolist\fP nodes are replaced by a list of todo entries, complete with backlinks to the location where they come from. The list items are composed of the nodes from the \fBtodo\fP entry and docutils nodes created on the fly: a paragraph for each entry, containing text that gives the location, and a link (reference node containing an italic node) with the backreference. The reference URI is built by \fBsphinx.builders.Builder.get_relative_uri()\fP \%<#\:sphinx\:.builders\:.Builder\:.get_relative_uri> which creates a suitable URI depending on the used builder, and appending the todo node\(aqs (the target\(aqs) ID as the anchor name. .sp The \fBsetup\fP function .sp As noted previously \%<#\:tutorial-extending-syntax>, the \fBsetup\fP function is a requirement and is used to plug directives into Sphinx. However, we also use it to hook up the other parts of our extension. Let\(aqs look at our \fBsetup\fP function: .INDENT 0.0 .INDENT 3.5 .sp .EX def setup(app: Sphinx) \-> ExtensionMetadata: app.add_config_value(\(aqtodo_include_todos\(aq, False, \(aqhtml\(aq) app.add_node(todolist) app.add_node( todo, html=(visit_todo_node, depart_todo_node), latex=(visit_todo_node, depart_todo_node), text=(visit_todo_node, depart_todo_node), ) app.add_directive(\(aqtodo\(aq, TodoDirective) app.add_directive(\(aqtodolist\(aq, TodolistDirective) app.connect(\(aqdoctree\-resolved\(aq, process_todo_nodes) app.connect(\(aqenv\-purge\-doc\(aq, purge_todos) app.connect(\(aqenv\-merge\-info\(aq, merge_todos) return { \(aqversion\(aq: \(aq0.1\(aq, \(aqenv_version\(aq: 1, \(aqparallel_read_safe\(aq: True, \(aqparallel_write_safe\(aq: True, } .EE .UNINDENT .UNINDENT .sp The calls in this function refer to the classes and functions we added earlier. What the individual calls do is the following: .INDENT 0.0 .IP \(bu 2 \fBadd_config_value()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_config_value> lets Sphinx know that it should recognize the new \fIconfig value\fP \fBtodo_include_todos\fP, whose default value is \fBFalse\fP (which also tells Sphinx that it is a boolean value). .sp If the third argument was \fB\(aqhtml\(aq\fP, HTML documents would be fully rebuilt if the config value changed its value. This is needed for config values that influence reading (build phase 1 (reading) \%<#\:build-phases>). .IP \(bu 2 \fBadd_node()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_node> adds a new \fInode class\fP to the build system. It also can specify visitor functions for each supported output format. These visitor functions are needed when the new nodes stay until phase 4 (writing) \%<#\:build-phases>\&. Since the \fBtodolist\fP node is always replaced in phase 3 (resolving) \%<#\:build-phases>, it doesn\(aqt need any. .IP \(bu 2 \fBadd_directive()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_directive> adds a new \fIdirective\fP, given by name and class. .IP \(bu 2 Finally, \fBconnect()\fP \%<#\:sphinx\:.application\:.Sphinx\:.connect> adds an \fIevent handler\fP to the event whose name is given by the first argument. The event handler function is called with several arguments which are documented with the event. .UNINDENT .sp With this, our extension is complete. .SS Using the extension .sp As before, we need to enable the extension by declaring it in our \fBconf.py\fP file. There are two steps necessary here: .INDENT 0.0 .IP 1. 3 Add the \fB_ext\fP directory to the Python path \%<https://\:docs\:.python\:.org/\:3/\:using/\:cmdline\:.html#\:envvar-PYTHONPATH> using \fBsys.path.append\fP\&. This should be placed at the top of the file. .IP 2. 3 Update or create the \fBextensions\fP \%<#\:confval-extensions> list and add the extension file name to the list .UNINDENT .sp In addition, we may wish to set the \fBtodo_include_todos\fP config value. As noted above, this defaults to \fBFalse\fP but we can set it explicitly. .sp For example: .INDENT 0.0 .INDENT 3.5 .sp .EX import sys from pathlib import Path sys.path.append(str(Path(\(aq_ext\(aq).resolve())) extensions = [\(aqtodo\(aq] todo_include_todos = False .EE .UNINDENT .UNINDENT .sp You can now use the extension throughout your project. For example: .sp index.rst .INDENT 0.0 .INDENT 3.5 .sp .EX Hello, world ============ \&.. toctree:: somefile.rst someotherfile.rst Hello world. Below is the list of TODOs. \&.. todolist:: .EE .UNINDENT .UNINDENT .sp somefile.rst .INDENT 0.0 .INDENT 3.5 .sp .EX foo === Some intro text here... \&.. todo:: Fix this .EE .UNINDENT .UNINDENT .sp someotherfile.rst .INDENT 0.0 .INDENT 3.5 .sp .EX bar === Some more text here... \&.. todo:: Fix that .EE .UNINDENT .UNINDENT .sp Because we have configured \fBtodo_include_todos\fP to \fBFalse\fP, we won\(aqt actually see anything rendered for the \fBtodo\fP and \fBtodolist\fP directives. However, if we toggle this to true, we will see the output described previously. .SS Further reading .sp For more information, refer to the docutils \%<https://\:docutils\:.sourceforge\:.io/\:docs/> documentation and Sphinx API \%<>\&. .sp If you wish to share your extension across multiple projects or with others, check out the Third\-party extensions \%<#\:third-party-extensions> section. .SS Adding a reference domain .sp The objective of this tutorial is to illustrate roles, directives and domains. Once complete, we will be able to use this extension to describe a recipe and reference that recipe from elsewhere in our documentation. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 This tutorial is based on a guide first published on opensource.com \%<https://\:opensource\:.com/\:article/\:18/\:11/\:building-custom-workflows-sphinx> and is provided here with the original author\(aqs permission. .UNINDENT .UNINDENT .SS Overview .sp We want the extension to add the following to Sphinx: .INDENT 0.0 .IP \(bu 2 A \fBrecipe\fP directive \%<#\:term-directive>, containing some content describing the recipe steps, along with a \fB:contains:\fP option highlighting the main ingredients of the recipe. .IP \(bu 2 A \fBref\fP role \%<#\:term-role>, which provides a cross\-reference to the recipe itself. .IP \(bu 2 A \fBrecipe\fP domain \%<#\:term-domain>, which allows us to tie together the above role and domain, along with things like indices. .UNINDENT .sp For that, we will need to add the following elements to Sphinx: .INDENT 0.0 .IP \(bu 2 A new directive called \fBrecipe\fP .IP \(bu 2 New indexes to allow us to reference ingredient and recipes .IP \(bu 2 A new domain called \fBrecipe\fP, which will contain the \fBrecipe\fP directive and \fBref\fP role .UNINDENT .SS Prerequisites .sp We need the same setup as in the previous extensions \%<#\:tutorial-extend-build>\&. This time, we will be putting out extension in a file called \fBrecipe.py\fP\&. .sp Here is an example of the folder structure you might obtain: .INDENT 0.0 .INDENT 3.5 .sp .EX └── source \ \ ├── _ext │ \ └── recipe.py \ \ ├── conf.py \ \ └── index.rst .EE .UNINDENT .UNINDENT .SS Writing the extension .sp Open \fBrecipe.py\fP and paste the following code in it, all of which we will explain in detail shortly: .INDENT 0.0 .INDENT 3.5 .sp .EX from collections import defaultdict from docutils.parsers.rst import directives from sphinx import addnodes from sphinx.application import Sphinx from sphinx.directives import ObjectDescription from sphinx.domains import Domain, Index from sphinx.roles import XRefRole from sphinx.util.nodes import make_refnode from sphinx.util.typing import ExtensionMetadata class RecipeDirective(ObjectDescription): \(dq\(dq\(dqA custom directive that describes a recipe.\(dq\(dq\(dq has_content = True required_arguments = 1 option_spec = { \(aqcontains\(aq: directives.unchanged_required, } def handle_signature(self, sig, signode): signode += addnodes.desc_name(text=sig) return sig def add_target_and_index(self, name_cls, sig, signode): signode[\(aqids\(aq].append(\(aqrecipe\(aq + \(aq\-\(aq + sig) if \(aqcontains\(aq in self.options: ingredients = [x.strip() for x in self.options.get(\(aqcontains\(aq).split(\(aq,\(aq)] recipes = self.env.get_domain(\(aqrecipe\(aq) recipes.add_recipe(sig, ingredients) class IngredientIndex(Index): \(dq\(dq\(dqA custom index that creates an ingredient matrix.\(dq\(dq\(dq name = \(aqingredient\(aq localname = \(aqIngredient Index\(aq shortname = \(aqIngredient\(aq def generate(self, docnames=None): content = defaultdict(list) recipes = { name: (dispname, typ, docname, anchor) for name, dispname, typ, docname, anchor, _ in self.domain.get_objects() } recipe_ingredients = self.domain.data[\(aqrecipe_ingredients\(aq] ingredient_recipes = defaultdict(list) # flip from recipe_ingredients to ingredient_recipes for recipe_name, ingredients in recipe_ingredients.items(): for ingredient in ingredients: ingredient_recipes[ingredient].append(recipe_name) # convert the mapping of ingredient to recipes to produce the expected # output, shown below, using the ingredient name as a key to group # # name, subtype, docname, anchor, extra, qualifier, description for ingredient, recipe_names in ingredient_recipes.items(): for recipe_name in recipe_names: dispname, typ, docname, anchor = recipes[recipe_name] content[ingredient].append(( dispname, 0, docname, anchor, docname, \(aq\(aq, typ, )) # convert the dict to the sorted list of tuples expected content = sorted(content.items()) return content, True class RecipeIndex(Index): \(dq\(dq\(dqA custom index that creates an recipe matrix.\(dq\(dq\(dq name = \(aqrecipe\(aq localname = \(aqRecipe Index\(aq shortname = \(aqRecipe\(aq def generate(self, docnames=None): content = defaultdict(list) # sort the list of recipes in alphabetical order recipes = self.domain.get_objects() recipes = sorted(recipes, key=lambda recipe: recipe[0]) # generate the expected output, shown below, from the above using the # first letter of the recipe as a key to group thing # # name, subtype, docname, anchor, extra, qualifier, description for _name, dispname, typ, docname, anchor, _priority in recipes: content[dispname[0].lower()].append(( dispname, 0, docname, anchor, docname, \(aq\(aq, typ, )) # convert the dict to the sorted list of tuples expected content = sorted(content.items()) return content, True class RecipeDomain(Domain): name = \(aqrecipe\(aq label = \(aqRecipe Sample\(aq roles = { \(aqref\(aq: XRefRole(), } directives = { \(aqrecipe\(aq: RecipeDirective, } indices = { RecipeIndex, IngredientIndex, } initial_data = { \(aqrecipes\(aq: [], # object list \(aqrecipe_ingredients\(aq: {}, # name \-> object } data_version = 0 def get_full_qualified_name(self, node): return f\(aqrecipe.{node.arguments[0]}\(aq def get_objects(self): yield from self.data[\(aqrecipes\(aq] def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): match = [ (docname, anchor) for name, sig, typ, docname, anchor, prio in self.get_objects() if sig == target ] if len(match) > 0: todocname = match[0][0] targ = match[0][1] return make_refnode(builder, fromdocname, todocname, targ, contnode, targ) else: print(\(aqAwww, found nothing\(aq) return None def add_recipe(self, signature, ingredients): \(dq\(dq\(dqAdd a new recipe to the domain.\(dq\(dq\(dq name = f\(aqrecipe.{signature}\(aq anchor = f\(aqrecipe\-{signature}\(aq self.data[\(aqrecipe_ingredients\(aq][name] = ingredients # name, dispname, type, docname, anchor, priority self.data[\(aqrecipes\(aq].append(( name, signature, \(aqRecipe\(aq, self.env.current_document.docname, anchor, 0, )) def setup(app: Sphinx) \-> ExtensionMetadata: app.add_domain(RecipeDomain) return { \(aqversion\(aq: \(aq0.1\(aq, \(aqparallel_read_safe\(aq: True, \(aqparallel_write_safe\(aq: True, } .EE .UNINDENT .UNINDENT .sp Let\(aqs look at each piece of this extension step\-by\-step to explain what\(aqs going on. .sp The directive class .sp The first thing to examine is the \fBRecipeDirective\fP directive: .INDENT 0.0 .INDENT 3.5 .sp .EX class RecipeDirective(ObjectDescription): \(dq\(dq\(dqA custom directive that describes a recipe.\(dq\(dq\(dq has_content = True required_arguments = 1 option_spec = { \(aqcontains\(aq: directives.unchanged_required, } def handle_signature(self, sig, signode): signode += addnodes.desc_name(text=sig) return sig def add_target_and_index(self, name_cls, sig, signode): signode[\(aqids\(aq].append(\(aqrecipe\(aq + \(aq\-\(aq + sig) if \(aqcontains\(aq in self.options: ingredients = [x.strip() for x in self.options.get(\(aqcontains\(aq).split(\(aq,\(aq)] recipes = self.env.get_domain(\(aqrecipe\(aq) recipes.add_recipe(sig, ingredients) .EE .UNINDENT .UNINDENT .sp Unlike Extending syntax with roles and directives \%<#\:tutorial-extending-syntax> and Extending the build process \%<#\:tutorial-extend-build>, this directive doesn\(aqt derive from \fBdocutils.parsers.rst.Directive\fP \%<#\:docutils\:.parsers\:.rst\:.Directive> and doesn\(aqt define a \fBrun\fP method. Instead, it derives from \fBsphinx.directives.ObjectDescription\fP \%<#\:sphinx\:.directives\:.ObjectDescription> and defines \fBhandle_signature\fP and \fBadd_target_and_index\fP methods. This is because \fBObjectDescription\fP is a special\-purpose directive that\(aqs intended for describing things like classes, functions, or, in our case, recipes. More specifically, \fBhandle_signature\fP implements parsing the signature of the directive and passes on the object\(aqs name and type to its superclass, while \fBadd_target_and_index\fP adds a target (to link to) and an entry to the index for this node. .sp We also see that this directive defines \fBhas_content\fP, \fBrequired_arguments\fP and \fBoption_spec\fP\&. Unlike the \fBTodoDirective\fP directive added in the previous tutorial \%<#\:tutorial-extend-build>, this directive takes a single argument, the recipe name, and an option, \fBcontains\fP, in addition to the nested reStructuredText in the body. .sp The index classes .INDENT 0.0 .INDENT 3.5 .SS Todo .sp Add brief overview of indices .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .EX class IngredientIndex(Index): \(dq\(dq\(dqA custom index that creates an ingredient matrix.\(dq\(dq\(dq name = \(aqingredient\(aq localname = \(aqIngredient Index\(aq shortname = \(aqIngredient\(aq def generate(self, docnames=None): content = defaultdict(list) recipes = { name: (dispname, typ, docname, anchor) for name, dispname, typ, docname, anchor, _ in self.domain.get_objects() } recipe_ingredients = self.domain.data[\(aqrecipe_ingredients\(aq] ingredient_recipes = defaultdict(list) # flip from recipe_ingredients to ingredient_recipes for recipe_name, ingredients in recipe_ingredients.items(): for ingredient in ingredients: ingredient_recipes[ingredient].append(recipe_name) # convert the mapping of ingredient to recipes to produce the expected # output, shown below, using the ingredient name as a key to group # # name, subtype, docname, anchor, extra, qualifier, description for ingredient, recipe_names in ingredient_recipes.items(): for recipe_name in recipe_names: dispname, typ, docname, anchor = recipes[recipe_name] content[ingredient].append(( dispname, 0, docname, anchor, docname, \(aq\(aq, typ, )) # convert the dict to the sorted list of tuples expected content = sorted(content.items()) return content, True .EE .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .EX class RecipeIndex(Index): \(dq\(dq\(dqA custom index that creates an recipe matrix.\(dq\(dq\(dq name = \(aqrecipe\(aq localname = \(aqRecipe Index\(aq shortname = \(aqRecipe\(aq def generate(self, docnames=None): content = defaultdict(list) # sort the list of recipes in alphabetical order recipes = self.domain.get_objects() recipes = sorted(recipes, key=lambda recipe: recipe[0]) # generate the expected output, shown below, from the above using the # first letter of the recipe as a key to group thing # # name, subtype, docname, anchor, extra, qualifier, description for _name, dispname, typ, docname, anchor, _priority in recipes: content[dispname[0].lower()].append(( dispname, 0, docname, anchor, docname, \(aq\(aq, typ, )) # convert the dict to the sorted list of tuples expected content = sorted(content.items()) return content, True .EE .UNINDENT .UNINDENT .sp Both \fBIngredientIndex\fP and \fBRecipeIndex\fP are derived from \fBIndex\fP \%<#\:sphinx\:.domains\:.Index>\&. They implement custom logic to generate a tuple of values that define the index. Note that \fBRecipeIndex\fP is a simple index that has only one entry. Extending it to cover more object types is not yet part of the code. .sp Both indices use the method \fBIndex.generate()\fP \%<#\:sphinx\:.domains\:.Index\:.generate> to do their work. This method combines the information from our domain, sorts it, and returns it in a list structure that will be accepted by Sphinx. This might look complicated but all it really is is a list of tuples like \fB(\(aqtomato\(aq, \(aqTomatoSoup\(aq, \(aqtest\(aq, \(aqrec\-TomatoSoup\(aq,...)\fP\&. Refer to the domain API guide \%<> for more information on this API. .sp These index pages can be referenced with the \fBref\fP \%<#\:role-ref> role by combining the domain name and the index \fBname\fP value. For example, \fBRecipeIndex\fP can be referenced with \fB:ref:\(garecipe\-recipe\(ga\fP and \fBIngredientIndex\fP can be referenced with \fB:ref:\(garecipe\-ingredient\(ga\fP\&. .sp The domain .sp A Sphinx domain is a specialized container that ties together roles, directives, and indices, among other things. Let\(aqs look at the domain we\(aqre creating here. .INDENT 0.0 .INDENT 3.5 .sp .EX class RecipeDomain(Domain): name = \(aqrecipe\(aq label = \(aqRecipe Sample\(aq roles = { \(aqref\(aq: XRefRole(), } directives = { \(aqrecipe\(aq: RecipeDirective, } indices = { RecipeIndex, IngredientIndex, } initial_data = { \(aqrecipes\(aq: [], # object list \(aqrecipe_ingredients\(aq: {}, # name \-> object } data_version = 0 def get_full_qualified_name(self, node): return f\(aqrecipe.{node.arguments[0]}\(aq def get_objects(self): yield from self.data[\(aqrecipes\(aq] def resolve_xref(self, env, fromdocname, builder, typ, target, node, contnode): match = [ (docname, anchor) for name, sig, typ, docname, anchor, prio in self.get_objects() if sig == target ] if len(match) > 0: todocname = match[0][0] targ = match[0][1] return make_refnode(builder, fromdocname, todocname, targ, contnode, targ) else: print(\(aqAwww, found nothing\(aq) return None def add_recipe(self, signature, ingredients): \(dq\(dq\(dqAdd a new recipe to the domain.\(dq\(dq\(dq name = f\(aqrecipe.{signature}\(aq anchor = f\(aqrecipe\-{signature}\(aq self.data[\(aqrecipe_ingredients\(aq][name] = ingredients # name, dispname, type, docname, anchor, priority self.data[\(aqrecipes\(aq].append(( name, signature, \(aqRecipe\(aq, self.env.current_document.docname, anchor, 0, )) .EE .UNINDENT .UNINDENT .sp There are some interesting things to note about this \fBrecipe\fP domain and domains in general. Firstly, we actually register our directives, roles and indices here, via the \fBdirectives\fP, \fBroles\fP and \fBindices\fP attributes, rather than via calls later on in \fBsetup\fP\&. We can also note that we aren\(aqt actually defining a custom role and are instead reusing the \fBsphinx.roles.XRefRole\fP role and defining the \fBsphinx.domains.Domain.resolve_xref\fP \%<#\:sphinx\:.domains\:.Domain\:.resolve_xref> method. This method takes two arguments, \fBtyp\fP and \fBtarget\fP, which refer to the cross\-reference type and its target name. We\(aqll use \fBtarget\fP to resolve our destination from our domain\(aqs \fBrecipes\fP because we currently have only one type of node. .sp Moving on, we can see that we\(aqve defined \fBinitial_data\fP\&. The values defined in \fBinitial_data\fP will be copied to \fBenv.domaindata[domain_name]\fP as the initial data of the domain, and domain instances can access it via \fBself.data\fP\&. We see that we have defined two items in \fBinitial_data\fP: \fBrecipes\fP and \fBrecipe_ingredients\fP\&. Each contains a list of all objects defined (i.e. all recipes) and a hash that maps a canonical ingredient name to the list of objects. The way we name objects is common across our extension and is defined in the \fBget_full_qualified_name\fP method. For each object created, the canonical name is \fBrecipe.<recipename>\fP, where \fB<recipename>\fP is the name the documentation writer gives the object (a recipe). This enables the extension to use different object types that share the same name. Having a canonical name and central place for our objects is a huge advantage. Both our indices and our cross\-referencing code use this feature. .sp The \fBsetup\fP function .sp As always \%<#\:tutorial-extend-build>, the \fBsetup\fP function is a requirement and is used to hook the various parts of our extension into Sphinx. Let\(aqs look at the \fBsetup\fP function for this extension. .INDENT 0.0 .INDENT 3.5 .sp .EX def setup(app: Sphinx) \-> ExtensionMetadata: app.add_domain(RecipeDomain) return { \(aqversion\(aq: \(aq0.1\(aq, \(aqparallel_read_safe\(aq: True, \(aqparallel_write_safe\(aq: True, } .EE .UNINDENT .UNINDENT .sp This looks a little different to what we\(aqre used to seeing. There are no calls to \fBadd_directive()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_directive> or even \fBadd_role()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_role>\&. Instead, we have a single call to \fBadd_domain()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_domain> followed by some initialization of the standard domain \%<>\&. This is because we had already registered our directives, roles and indexes as part of the directive itself. .SS Using the extension .sp You can now use the extension throughout your project. For example: .sp index.rst .INDENT 0.0 .INDENT 3.5 .sp .EX Joe\(aqs Recipes ============= Below are a collection of my favourite recipes. I highly recommend the :recipe:ref:\(gaTomatoSoup\(ga recipe in particular! \&.. toctree:: tomato\-soup .EE .UNINDENT .UNINDENT .sp tomato\-soup.rst .INDENT 0.0 .INDENT 3.5 .sp .EX The recipe contains \(gatomato\(ga and \(gacilantro\(ga. \&.. recipe:recipe:: TomatoSoup :contains: tomato, cilantro, salt, pepper This recipe is a tasty tomato soup, combine all ingredients and cook. .EE .UNINDENT .UNINDENT .sp The important things to note are the use of the \fB:recipe:ref:\fP role to cross\-reference the recipe actually defined elsewhere (using the \fB:recipe:recipe:\fP directive). .SS Further reading .sp For more information, refer to the docutils \%<https://\:docutils\:.sourceforge\:.io/\:docs/> documentation and Sphinx API \%<>\&. .sp If you wish to share your extension across multiple projects or with others, check out the Third\-party extensions \%<#\:third-party-extensions> section. .SS Developing autodoc extensions .sp The objective of this tutorial is to create an extension that adds support for new type for autodoc. This autodoc extension will format the \fBIntEnum\fP class from Python standard library. (module \fBenum\fP) .SS Overview .sp We want the extension that will create auto\-documentation for IntEnum. \fBIntEnum\fP is the integer enum class from standard library \fBenum\fP module. .sp Currently this class has no special auto documentation behavior. .sp We want to add following to autodoc: .INDENT 0.0 .IP \(bu 2 A new \fBautointenum\fP directive that will document the \fBIntEnum\fP class. .IP \(bu 2 The generated documentation will have all the enum possible values with names. .IP \(bu 2 The \fBautointenum\fP directive will have an option \fB:hex:\fP which will cause the integers be printed in hexadecimal form. .UNINDENT .SS Prerequisites .sp We need the same setup as in the previous extensions \%<#\:tutorial-extend-build>\&. This time, we will be putting out extension in a file called \fBautodoc_intenum.py\fP\&. The \fBmy_enums.py\fP will contain the sample enums we will document. .sp Here is an example of the folder structure you might obtain: .INDENT 0.0 .INDENT 3.5 .sp .EX └── source \ \ ├── _ext │ \ └── autodoc_intenum.py \ \ ├── conf.py \ \ ├── index.rst \ \ └── my_enums.py .EE .UNINDENT .UNINDENT .SS Writing the extension .sp Start with \fBsetup\fP function for the extension. .INDENT 0.0 .INDENT 3.5 .sp .EX def setup(app: Sphinx) \-> ExtensionMetadata: app.setup_extension(\(aqsphinx.ext.autodoc\(aq) # Require autodoc extension app.add_autodocumenter(IntEnumDocumenter) return { \(aqversion\(aq: \(aq1\(aq, \(aqparallel_read_safe\(aq: True, } .EE .UNINDENT .UNINDENT .sp The \fBsetup_extension()\fP \%<#\:sphinx\:.application\:.Sphinx\:.setup_extension> method will pull the autodoc extension because our new extension depends on autodoc. \fBadd_autodocumenter()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_autodocumenter> is the method that registers our new auto documenter class. .sp We want to import certain objects from the autodoc extension: .INDENT 0.0 .INDENT 3.5 .sp .EX from __future__ import annotations from enum import IntEnum from typing import TYPE_CHECKING from sphinx.ext.autodoc import ClassDocumenter, Documenter, bool_option .EE .UNINDENT .UNINDENT .sp There are several different documenter classes such as \fBMethodDocumenter\fP or \fBAttributeDocumenter\fP available in the autodoc extension but our new class is the subclass of \fBClassDocumenter\fP which a documenter class used by autodoc to document classes. .sp This is the definition of our new the auto\-documenter class: .INDENT 0.0 .INDENT 3.5 .sp .EX class IntEnumDocumenter(ClassDocumenter): objtype = \(aqintenum\(aq directivetype = ClassDocumenter.objtype priority = 10 + ClassDocumenter.priority option_spec = dict(ClassDocumenter.option_spec) option_spec[\(aqhex\(aq] = bool_option @classmethod def can_document_member( cls, member: Any, membername: str, isattr: bool, parent: Documenter ) \-> bool: try: return issubclass(member, IntEnum) except TypeError: return False def add_directive_header(self, sig: str) \-> None: super().add_directive_header(sig) self.add_line(\(aq :final:\(aq, self.get_sourcename()) def add_content( self, more_content: StringList | None, ) \-> None: super().add_content(more_content) source_name = self.get_sourcename() enum_object: IntEnum = self.object use_hex = self.options.hex self.add_line(\(aq\(aq, source_name) for the_member_name, enum_member in enum_object.__members__.items(): # type: ignore[attr\-defined] the_member_value = enum_member.value if use_hex: the_member_value = hex(the_member_value) self.add_line(f\(aq**{the_member_name}**: {the_member_value}\(aq, source_name) self.add_line(\(aq\(aq, source_name) .EE .UNINDENT .UNINDENT .sp Important attributes of the new class: .INDENT 0.0 .TP \fBobjtype\fP This attribute determines the \fBauto\fP directive name. In this case the auto directive will be \fBautointenum\fP\&. .TP \fBdirectivetype\fP This attribute sets the generated directive name. In this example the generated directive will be \fB\&.. :py:class::\fP\&. .TP \fBpriority\fP the larger the number the higher is the priority. We want our documenter be higher priority than the parent. .TP \fBoption_spec\fP option specifications. We copy the parent class options and add a new option \fIhex\fP\&. .UNINDENT .sp Overridden members: .INDENT 0.0 .TP \fBcan_document_member\fP This member is important to override. It should return \fITrue\fP when the passed object can be documented by this class. .TP \fBadd_directive_header\fP This method generates the directive header. We add \fB:final:\fP directive option. Remember to call \fBsuper\fP or no directive will be generated. .TP \fBadd_content\fP This method generates the body of the class documentation. After calling the super method we generate lines for enum description. .UNINDENT .SS Using the extension .sp You can now use the new autodoc directive to document any \fBIntEnum\fP\&. .sp For example, you have the following \fBIntEnum\fP: .sp my_enums.py .INDENT 0.0 .INDENT 3.5 .sp .EX class Colors(IntEnum): \(dq\(dq\(dqColors enumerator\(dq\(dq\(dq NONE = 0 RED = 1 GREEN = 2 BLUE = 3 .EE .UNINDENT .UNINDENT .sp This will be the documentation file with auto\-documentation directive: .sp index.rst .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. autointenum:: my_enums.Colors .EE .UNINDENT .UNINDENT .SS Further reading .sp If you wish to share your extension across multiple projects or with others, check out the Third\-party extensions \%<#\:third-party-extensions> section. .SS How\-tos .SS Depend on another extension .sp Sometimes your extension depends on the functionality of another Sphinx extension. Most Sphinx extensions are activated in a project\(aqs \fBconf.py\fP file, but this is not available to you as an extension developer. .sp To ensure that another extension is activated as a part of your own extension, use the \fBsphinx.application.Sphinx.setup_extension()\fP \%<#\:sphinx\:.application\:.Sphinx\:.setup_extension> method. This will activate another extension at run\-time, ensuring that you have access to its functionality. .sp For example, the following code activates the \fBsphinx.ext.autodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> extension: .INDENT 0.0 .INDENT 3.5 .sp .EX def setup(app): app.setup_extension(\(aqsphinx.ext.autodoc\(aq) .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Since your extension will depend on another, make sure to include it as a part of your extension\(aqs installation requirements. .UNINDENT .UNINDENT .SS Configuring builders .SS Discover builders by entry point .sp Added in version 1.6. .sp builder \%<#\:term-builder> extensions can be discovered by means of entry points \%<https://\:setuptools\:.pypa\:.io/\:en/\:latest/\:userguide/\:entry_point\:.html> so that they do not have to be listed in the \fBextensions\fP \%<#\:confval-extensions> configuration value. .sp Builder extensions should define an entry point in the \fB\(dqsphinx.builders\(dq\fP group. The name of the entry point needs to match your builder\(aqs \fBname\fP \%<#\:sphinx\:.builders\:.Builder\:.name> attribute, which is the name passed to the \fBsphinx\-build \-\-builder\fP \%<#\:cmdoption-sphinx-build-b> option. The entry point value should equal the dotted name of the extension module. Here is an example of how an entry point for \(aqmybuilder\(aq can be defined in the extension\(aqs \fBpyproject.toml\fP .INDENT 0.0 .INDENT 3.5 .sp .EX [project.entry\-points.\(dqsphinx.builders\(dq] mybuilder = \(dqmy.extension.module\(dq .EE .UNINDENT .UNINDENT .sp Note that it is still necessary to register the builder using \fBadd_builder()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_builder> in the extension\(aqs \fBsetup()\fP function. .SS HTML theme development .sp Added in version 0.6. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 This document provides information about creating your own theme. If you simply wish to use a pre\-existing HTML themes, refer to HTML theming \%<>\&. .UNINDENT .UNINDENT .sp Sphinx supports changing the appearance of its HTML output via \fIthemes\fP\&. A theme is a collection of HTML templates, stylesheet(s) and other static files. Additionally, it has a configuration file which specifies from which theme to inherit, which highlighting style to use, and what options exist for customizing the theme\(aqs look and feel. .sp Themes are meant to be project\-unaware, so they can be used for different projects without change. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 See Sphinx API \%<#\:dev-extensions> for more information that may be helpful in developing themes. .UNINDENT .UNINDENT .SS Creating themes .sp Themes take the form of either a directory or a zipfile (whose name is the theme name), containing the following: .INDENT 0.0 .IP \(bu 2 Either a \fBtheme.toml\fP file (preferred) or a \fBtheme.conf\fP file. .IP \(bu 2 HTML templates, if needed. .IP \(bu 2 A \fBstatic/\fP directory containing any static files that will be copied to the output static directory on build. These can be images, styles, script files. .UNINDENT .SS Theme configuration (\fBtheme.toml\fP) .sp The \fBtheme.toml\fP file is a TOML \%<https://\:toml\:.io/\:en/> document, containing two tables: \fB[theme]\fP and \fB[options]\fP\&. .sp The \fB[theme]\fP table defines the theme\(aqs settings: .INDENT 0.0 .IP \(bu 2 \fBinherit\fP (string): The name of the base theme from which to inherit settings, options, templates, and static files. All static files from theme \(aqancestors\(aq will be used. The theme will use all options defined in inherited themes. Finally, inherited themes will be used to locate missing templates (for example, if \fB\(dqbasic\(dq\fP is used as the base theme, most templates will already be defined). .sp If set to \fB\(dqnone\(dq\fP, the theme will not inherit from any other theme. Inheritance is recursive, forming a chain of inherited themes (e.g. \fBdefault\fP \-> \fBclassic\fP \-> \fBbasic\fP \-> \fBnone\fP). .IP \(bu 2 \fBstylesheets\fP (list of strings): A list of CSS filenames which will be included in generated HTML header. Setting the \fBhtml_style\fP \%<#\:confval-html_style> config value will override this setting. .sp Other mechanisms for including multiple stylesheets include \fB@import\fP in CSS or using a custom HTML template with appropriate \fB<link rel=\(dqstylesheet\(dq>\fP tags. .IP \(bu 2 \fBsidebars\fP (list of strings): A list of sidebar templates. This can be overridden by the user via the \fBhtml_sidebars\fP \%<#\:confval-html_sidebars> config value. .IP \(bu 2 \fBpygments_style\fP (table): A TOML table defining the names of Pygments styles to use for highlighting syntax. The table has two recognised keys: \fBdefault\fP and \fBdark\fP\&. The style defined in the \fBdark\fP key will be used when the CSS media query \fB(prefers\-color\-scheme: dark)\fP evaluates to true. .sp \fB[theme.pygments_style.default]\fP can be overridden by the user via the \fBpygments_style\fP \%<#\:confval-pygments_style> config value. .UNINDENT .sp The \fB[options]\fP table defines the options for the theme. It is structured such that each key\-value pair corresponds to a variable name and the corresponding default value. These options can be overridden by the user in \fBhtml_theme_options\fP \%<#\:confval-html_theme_options> and are accessible from all templates as \fBtheme_<name>\fP\&. .sp Added in version 7.3: \fBtheme.toml\fP support. .sp Exemplar \fBtheme.toml\fP file: .INDENT 0.0 .INDENT 3.5 .sp .EX [theme] inherit = \(dqbasic\(dq stylesheets = [ \(dqmain\-CSS\-stylesheet.css\(dq, ] sidebars = [ \(dqlocaltoc.html\(dq, \(dqrelations.html\(dq, \(dqsourcelink.html\(dq, \(dqsearchbox.html\(dq, ] # Style names from https://pygments.org/styles/ pygments_style = { default = \(dqstyle_name\(dq, dark = \(dqdark_style\(dq } [options] variable = \(dqdefault value\(dq .EE .UNINDENT .UNINDENT .SS Theme configuration (\fBtheme.conf\fP) .sp The \fBtheme.conf\fP file is in INI format [1] (readable by the standard Python \fBconfigparser\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:configparser\:.html#\:module-configparser> module) and has the following structure: .INDENT 0.0 .INDENT 3.5 .sp .EX [theme] inherit = base theme stylesheet = main CSS name pygments_style = stylename sidebars = localtoc.html, relations.html, sourcelink.html, searchbox.html [options] variable = default value .EE .UNINDENT .UNINDENT .INDENT 0.0 .IP \(bu 2 The \fBinherit\fP setting gives the name of a \(dqbase theme\(dq, or \fBnone\fP\&. The base theme will be used to locate missing templates (most themes will not have to supply most templates if they use \fBbasic\fP as the base theme), its options will be inherited, and all of its static files will be used as well. If you want to also inherit the stylesheet, include it via CSS\(aq \fB@import\fP in your own. .IP \(bu 2 The \fBstylesheet\fP setting gives a list of CSS filenames separated commas which will be referenced in the HTML header. You can also use CSS\(aq \fB@import\fP technique to include one from the other, or use a custom HTML template that adds \fB<link rel=\(dqstylesheet\(dq>\fP tags as necessary. Setting the \fBhtml_style\fP \%<#\:confval-html_style> config value will override this setting. .IP \(bu 2 The \fBpygments_style\fP setting gives the name of a Pygments style to use for highlighting. This can be overridden by the user in the \fBpygments_style\fP \%<#\:confval-pygments_style> config value. .IP \(bu 2 The \fBpygments_dark_style\fP setting gives the name of a Pygments style to use for highlighting when the CSS media query \fB(prefers\-color\-scheme: dark)\fP evaluates to true. It is injected into the page using \fBadd_css_file()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_css_file>\&. .IP \(bu 2 The \fBsidebars\fP setting gives the comma separated list of sidebar templates for constructing sidebars. This can be overridden by the user in the \fBhtml_sidebars\fP \%<#\:confval-html_sidebars> config value. .IP \(bu 2 The \fBoptions\fP section contains pairs of variable names and default values. These options can be overridden by the user in \fBhtml_theme_options\fP \%<#\:confval-html_theme_options> and are accessible from all templates as \fBtheme_<name>\fP\&. .UNINDENT .sp Added in version 1.7: sidebar settings .sp Changed in version 5.1: The stylesheet setting accepts multiple CSS filenames .SS Convert \fBtheme.conf\fP to \fBtheme.toml\fP .sp INI\-style theme configuration files (\fBtheme.conf\fP) can be converted to TOML via a helper programme distributed with Sphinx. This is intended for one\-time use, and may be removed without notice in a future version of Sphinx. .INDENT 0.0 .INDENT 3.5 .sp .EX $ python \-m sphinx.theming conf_to_toml [THEME DIRECTORY PATH] .EE .UNINDENT .UNINDENT .sp The required argument is a path to a directory containing a \fBtheme.conf\fP file. The programme will write a \fBtheme.toml\fP file in the same directory, and will not modify the original \fBtheme.conf\fP file. .sp Added in version 7.3. .SS Distribute your theme as a Python package .sp As a way to distribute your theme, you can use a Python package. This makes it easier for users to set up your theme. .sp To distribute your theme as a Python package, please define an entry point called \fBsphinx.html_themes\fP in your \fBpyproject.toml\fP file, and write a \fBsetup()\fP function to register your theme using the \fBadd_html_theme()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_html_theme> API: .INDENT 0.0 .INDENT 3.5 .sp .EX # pyproject.toml [project.entry\-points.\(dqsphinx.html_themes\(dq] name_of_theme = \(dqyour_theme_package\(dq .EE .UNINDENT .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .EX # your_theme_package.py from pathlib import Path def setup(app): app.add_html_theme(\(aqname_of_theme\(aq, Path(__file__).resolve().parent) .EE .UNINDENT .UNINDENT .sp If your theme package contains two or more themes, please call \fBadd_html_theme()\fP twice or more. .sp Added in version 1.2: \(aqsphinx_themes\(aq entry_points feature. .sp Deprecated since version 1.6: \fBsphinx_themes\fP entry_points has been deprecated. .sp Added in version 1.6: \fBsphinx.html_themes\fP entry_points feature. .SS Styling with CSS .sp The \fBstylesheets\fP setting can be used to add custom CSS files to a theme. .sp \fBCaution:\fP .INDENT 0.0 .INDENT 3.5 The structure of the HTML elements and their classes are currently not a well\-defined public API. Please infer them from inspecting the built HTML pages. While we cannot guarantee full stability, they tend to be fairly stable. .UNINDENT .UNINDENT .SS Styling search result entries by category .sp Added in version 8.0. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The CSS classes named below are generated by Sphinx\(aqs standalone search code. If you are using a third\-party search provider, such as ReadTheDocs \%<https://\:docs\:.readthedocs\:.io/>, to provide search results, then the theming options available may vary. .UNINDENT .UNINDENT .sp The search result items have classes indicating the context in which the search term was found. You can use the CSS selectors: .INDENT 0.0 .IP \(bu 2 \fBul.search li.kind\-index\fP: For results in an index, such as the glossary .IP \(bu 2 \fBul.search li.kind\-object\fP: For results in source code, like Python function definitions .IP \(bu 2 \fBul.search li.kind\-title\fP: For results found in section headings .IP \(bu 2 \fBul.search li.kind\-text\fP: For results found anywhere else in the documentation text .UNINDENT .sp As a base for inheritance by other themes, the \fBbasic\fP theme is intentionally minimal and does not define CSS rules using these. Derived themes are encouraged to use these selectors as they see fit. For example, the following stylesheet adds contextual icons to the search result list: .INDENT 0.0 .INDENT 3.5 .sp .EX ul.search { padding\-left: 30px; } ul.search li { padding: 5px 0 5px 10px; list\-style\-type: \(dq\e25A1\(dq; /* Unicode: White Square */ } ul.search li.kind\-index { list\-style\-type: \(dq\e1F4D1\(dq; /* Unicode: Bookmark Tabs */ } ul.search li.kind\-object { list\-style\-type: \(dq\e1F4E6\(dq; /* Unicode: Package */ } ul.search li.kind\-title { list\-style\-type: \(dq\e1F4C4\(dq; /* Unicode: Page Facing Up */ } ul.search li.kind\-text { list\-style\-type: \(dq\e1F4C4\(dq; /* Unicode: Page Facing Up */ } .EE .UNINDENT .UNINDENT .SS Templating .SS Templating .SS What Is Templating? .sp Templating is a method of generating HTML pages by combining static templates with variable data. The template files contain the static parts of the desired HTML output and include special syntax describing how variable content will be inserted. For example, this can be used to insert the current date in the footer of each page, or to surround the main content of the document with a scaffold of HTML for layout and formatting purposes. Doing so only requires an understanding of HTML and the templating syntax. Knowledge of Python can be helpful, but is not required. .sp Templating uses an inheritance mechanism which allows child templates files (e.g. in a theme) to override as much (or as little) of their \(aqparents\(aq as desired. Likewise, content authors can use their own local templates to override as much (or as little) of the theme templates as desired. .sp The result is that the Sphinx core, without needing to be changed, provides basic HTML generation, independent of the structure and appearance of the final output, while granting a great deal of flexibility to theme and content authors. .SS Sphinx Templating .sp Sphinx uses the Jinja \%<https://\:jinja\:.palletsprojects\:.com/> templating engine for its HTML templates. Jinja is a text\-based engine, inspired by Django templates, so anyone having used Django will already be familiar with it. It also has excellent documentation for those who need to make themselves familiar with it. .SS Do I need to use Sphinx\(aqs templates to produce HTML? .sp No. You have several other options: .INDENT 0.0 .IP \(bu 2 You can write a \fBTemplateBridge\fP \%<#\:sphinx\:.application\:.TemplateBridge> subclass that calls your template engine of choice, and set the \fBtemplate_bridge\fP \%<#\:confval-template_bridge> configuration value accordingly. .IP \(bu 2 You can write a custom builder \%<#\:writing-builders> that derives from \fBStandaloneHTMLBuilder\fP \%<#\:sphinx\:.builders\:.html\:.StandaloneHTMLBuilder> and calls your template engine of choice. .IP \(bu 2 You can use the \fBPickleHTMLBuilder\fP \%<#\:sphinxcontrib\:.serializinghtml\:.PickleHTMLBuilder> that produces pickle files with the page contents, and postprocess them using a custom tool, or use them in your Web application. .UNINDENT .SS Jinja/Sphinx Templating Primer .sp The default templating language in Sphinx is Jinja. It\(aqs Django/Smarty inspired and easy to understand. The most important concept in Jinja is \fItemplate inheritance\fP, which means that you can overwrite only specific blocks within a template, customizing it while also keeping the changes at a minimum. .sp To customize the output of your documentation you can override all the templates (both the layout templates and the child templates) by adding files with the same name as the original filename into the template directory of the structure the Sphinx quickstart generated for you. .sp Sphinx will look for templates in the folders of \fBtemplates_path\fP \%<#\:confval-templates_path> first, and if it can\(aqt find the template it\(aqs looking for there, it falls back to the selected theme\(aqs templates. .sp A template contains \fBvariables\fP, which are replaced with values when the template is evaluated, \fBtags\fP, which control the logic of the template and \fBblocks\fP which are used for template inheritance. .sp Sphinx\(aqs \fIbasic\fP theme provides base templates with a couple of blocks it will fill with data. These are located in the \fBthemes/basic\fP subdirectory of the Sphinx installation directory, and used by all builtin Sphinx themes. Templates with the same name in the \fBtemplates_path\fP \%<#\:confval-templates_path> override templates supplied by the selected theme. .sp For example, to add a new link to the template area containing related links all you have to do is to add a new template called \fBlayout.html\fP with the following contents: .INDENT 0.0 .INDENT 3.5 .sp .EX {% extends \(dq!layout.html\(dq %} {% block rootrellink %} <li><a href=\(dqhttps://project.invalid/\(dq>Project Homepage</a> »</li> {{ super() }} {% endblock %} .EE .UNINDENT .UNINDENT .sp By prefixing the name of the overridden template with an exclamation mark, Sphinx will load the layout template from the underlying HTML theme. .sp \fBImportant:\fP .INDENT 0.0 .INDENT 3.5 If you override a block, call \fB{{ super() }}\fP somewhere to render the block\(aqs original content in the extended template \-\- unless you don\(aqt want that content to show up. .UNINDENT .UNINDENT .SS Working with the builtin templates .sp The builtin \fBbasic\fP theme supplies the templates that all builtin Sphinx themes are based on. It has the following elements you can override or use: .SS Blocks .sp The following blocks exist in the \fBlayout.html\fP template: .INDENT 0.0 .TP .B \fBdoctype\fP The doctype of the output format. By default this is XHTML 1.0 Transitional as this is the closest to what Sphinx and Docutils generate and it\(aqs a good idea not to change it unless you want to switch to HTML 5 or a different but compatible XHTML doctype. .TP .B \fBlinktags\fP This block adds a couple of \fB<link>\fP tags to the head section of the template. .TP .B \fBextrahead\fP This block is empty by default and can be used to add extra contents into the \fB<head>\fP tag of the generated HTML file. This is the right place to add references to JavaScript or extra CSS files. .TP .B \fBrelbar1\fP, \fBrelbar2\fP This block contains the \fIrelation bar\fP, the list of related links (the parent documents on the left, and the links to index, modules etc. on the right). \fBrelbar1\fP appears before the document, \fBrelbar2\fP after the document. By default, both blocks are filled; to show the relbar only before the document, you would override \fBrelbar2\fP like this: .INDENT 7.0 .INDENT 3.5 .sp .EX {% block relbar2 %}{% endblock %} .EE .UNINDENT .UNINDENT .TP .B \fBrootrellink\fP, \fBrelbaritems\fP Inside the relbar there are three sections: The \fBrootrellink\fP, the links from the documentation and the custom \fBrelbaritems\fP\&. The \fBrootrellink\fP is a block that by default contains a list item pointing to the root document by default, the \fBrelbaritems\fP is an empty block. If you override them to add extra links into the bar make sure that they are list items and end with the \fBreldelim1\fP\&. .TP .B \fBdocument\fP The contents of the document itself. It contains the block \(dqbody\(dq where the individual content is put by subtemplates like \fBpage.html\fP\&. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 In order for the built\-in JavaScript search to show a page preview on the results page, the document or body content should be wrapped in an HTML element containing the \fBrole=\(dqmain\(dq\fP attribute. For example: .INDENT 0.0 .INDENT 3.5 .sp .EX <div role=\(dqmain\(dq> {% block document %}{% endblock %} </div> .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .TP .B \fBsidebar1\fP, \fBsidebar2\fP A possible location for a sidebar. \fBsidebar1\fP appears before the document and is empty by default, \fBsidebar2\fP after the document and contains the default sidebar. If you want to swap the sidebar location override this and call the \fBsidebar\fP helper: .INDENT 7.0 .INDENT 3.5 .sp .EX {% block sidebar1 %}{{ sidebar() }}{% endblock %} {% block sidebar2 %}{% endblock %} .EE .UNINDENT .UNINDENT .sp (The \fBsidebar2\fP location for the sidebar is needed by the \fBsphinxdoc.css\fP stylesheet, for example.) .TP .B \fBsidebarlogo\fP The logo location within the sidebar. Override this if you want to place some content at the top of the sidebar. .TP .B \fBfooter\fP The block for the footer div. If you want a custom footer or markup before or after it, override this one. .UNINDENT .sp The following four blocks are \fIonly\fP used for pages that do not have assigned a list of custom sidebars in the \fBhtml_sidebars\fP \%<#\:confval-html_sidebars> config value. Their use is deprecated in favor of separate sidebar templates, which can be included via \fBhtml_sidebars\fP \%<#\:confval-html_sidebars>\&. .INDENT 0.0 .TP .B \fBsidebartoc\fP The table of contents within the sidebar. .sp Deprecated since version 1.0. .TP .B \fBsidebarrel\fP The relation links (previous, next document) within the sidebar. .sp Deprecated since version 1.0. .TP .B \fBsidebarsourcelink\fP The \(dqShow source\(dq link within the sidebar (normally only shown if this is enabled by \fBhtml_show_sourcelink\fP \%<#\:confval-html_show_sourcelink>). .sp Deprecated since version 1.0. .TP .B \fBsidebarsearch\fP The search box within the sidebar. Override this if you want to place some content at the bottom of the sidebar. .sp Deprecated since version 1.0. .UNINDENT .SS Configuration Variables .sp Inside templates you can set a couple of variables used by the layout template using the \fB{% set %}\fP tag: .INDENT 0.0 .TP .B reldelim1 The delimiter for the items on the left side of the related bar. This defaults to \fB\(aq »\(aq\fP Each item in the related bar ends with the value of this variable. .UNINDENT .INDENT 0.0 .TP .B reldelim2 The delimiter for the items on the right side of the related bar. This defaults to \fB\(aq |\(aq\fP\&. Each item except of the last one in the related bar ends with the value of this variable. .UNINDENT .sp Overriding works like this: .INDENT 0.0 .INDENT 3.5 .sp .EX {% extends \(dq!layout.html\(dq %} {% set reldelim1 = \(aq >\(aq %} .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B script_files Add additional script files here, like this: .INDENT 7.0 .INDENT 3.5 .sp .EX {% set script_files = script_files + [\(dq_static/myscript.js\(dq] %} .EE .UNINDENT .UNINDENT .sp Deprecated since version 1.8.0: Please use \fB\&.Sphinx.add_js_file()\fP instead. .UNINDENT .SS Helper Functions .sp Sphinx provides various Jinja functions as helpers in the template. You can use them to generate links or output multiply used elements. .INDENT 0.0 .TP .B pathto(document) Return the path to a Sphinx document as a URL. Use this to refer to built documents. .UNINDENT .INDENT 0.0 .TP .B pathto(file, 1) Return the path to a \fIfile\fP which is a filename relative to the root of the generated output. Use this to refer to static files. .UNINDENT .INDENT 0.0 .TP .B hasdoc(document) Check if a document with the name \fIdocument\fP exists. .UNINDENT .INDENT 0.0 .TP .B sidebar() Return the rendered sidebar. .UNINDENT .INDENT 0.0 .TP .B relbar() Return the rendered relation bar. .UNINDENT .INDENT 0.0 .TP .B warning(message) Emit a warning message. .UNINDENT .SS Global Variables .sp These global variables are available in every template and are safe to use. There are more, but most of them are an implementation detail and might change in the future. .INDENT 0.0 .TP .B builder The name of the builder (e.g. \fBhtml\fP or \fBhtmlhelp\fP). .UNINDENT .INDENT 0.0 .TP .B copyright The value of \fBcopyright\fP \%<#\:confval-copyright>\&. .UNINDENT .INDENT 0.0 .TP .B docstitle The title of the documentation (the value of \fBhtml_title\fP \%<#\:confval-html_title>), except when the \(dqsingle\-file\(dq builder is used, when it is set to \fBNone\fP\&. .UNINDENT .INDENT 0.0 .TP .B embedded True if the built HTML is meant to be embedded in some viewing application that handles navigation, not the web browser, such as for HTML help or Qt help formats. In this case, the sidebar is not included. .UNINDENT .INDENT 0.0 .TP .B favicon_url The relative path to the HTML favicon image from the current document, or URL to the favicon, or \fB\(aq\(aq\fP\&. .sp Added in version 4.0. .UNINDENT .INDENT 0.0 .TP .B file_suffix The value of the builder\(aqs \fBout_suffix\fP \%<#\:sphinxcontrib\:.serializinghtml\:.SerializingHTMLBuilder\:.out_suffix> attribute, i.e. the file name extension that the output files will get. For a standard HTML builder, this is usually \fB\&.html\fP\&. .UNINDENT .INDENT 0.0 .TP .B has_source True if the reStructuredText document sources are copied (if \fBhtml_copy_source\fP \%<#\:confval-html_copy_source> is \fBTrue\fP). .UNINDENT .INDENT 0.0 .TP .B language The value of \fBlanguage\fP \%<#\:confval-language>\&. .UNINDENT .INDENT 0.0 .TP .B last_updated The build date. .UNINDENT .INDENT 0.0 .TP .B logo_url The relative path to the HTML logo image from the current document, or URL to the logo, or \fB\(aq\(aq\fP\&. .sp Added in version 4.0. .UNINDENT .INDENT 0.0 .TP .B master_doc .TP .B root_doc The value of \fBmaster_doc\fP \%<#\:confval-master_doc> or \fBroot_doc\fP \%<#\:confval-root_doc> (aliases), for usage with \fBpathto()\fP\&. .sp Added in version 4.0: The \fBroot_doc\fP template variable. .UNINDENT .INDENT 0.0 .TP .B pagename The \(dqpage name\(dq of the current file, i.e. either the document name if the file is generated from a reStructuredText source, or the equivalent hierarchical name relative to the output directory (\fB[directory/]filename_without_extension\fP). .UNINDENT .INDENT 0.0 .TP .B project The value of \fBproject\fP \%<#\:confval-project>\&. .UNINDENT .INDENT 0.0 .TP .B release The value of \fBrelease\fP \%<#\:confval-release>\&. .UNINDENT .INDENT 0.0 .TP .B rellinks A list of links to put at the left side of the relbar, next to \(dqnext\(dq and \(dqprev\(dq. This usually contains links to the general index and other indices, such as the Python module index. If you add something yourself, it must be a tuple \fB(pagename, link title, accesskey, link text)\fP\&. .UNINDENT .INDENT 0.0 .TP .B shorttitle The value of \fBhtml_short_title\fP \%<#\:confval-html_short_title>\&. .UNINDENT .INDENT 0.0 .TP .B show_source True if \fBhtml_show_sourcelink\fP \%<#\:confval-html_show_sourcelink> is \fBTrue\fP\&. .UNINDENT .INDENT 0.0 .TP .B sphinx_version The version of Sphinx used to build represented as a string for example \(dq3.5.1\(dq. .UNINDENT .INDENT 0.0 .TP .B sphinx_version_tuple The version of Sphinx used to build represented as a tuple of five elements. For Sphinx version 3.5.1 beta 3 this would be \fB(3, 5, 1, \(aqbeta\(aq, 3)\fP\&. The fourth element can be one of: \fBalpha\fP, \fBbeta\fP, \fBrc\fP, \fBfinal\fP\&. \fBfinal\fP always has 0 as the last element. .sp Added in version 4.2. .UNINDENT .INDENT 0.0 .TP .B docutils_version_info The version of Docutils used to build represented as a tuple of five elements. For Docutils version 0.16.1 beta 2 this would be \fB(0, 16, 1, \(aqbeta\(aq, 2)\fP\&. The fourth element can be one of: \fBalpha\fP, \fBbeta\fP, \fBcandidate\fP, \fBfinal\fP\&. \fBfinal\fP always has 0 as the last element. .sp Added in version 5.0.2. .UNINDENT .INDENT 0.0 .TP .B styles A list of the names of the main stylesheets as given by the theme or \fBhtml_style\fP \%<#\:confval-html_style>\&. .sp Added in version 5.1. .UNINDENT .INDENT 0.0 .TP .B title The title of the current document, as used in the \fB<title>\fP tag. .UNINDENT .INDENT 0.0 .TP .B use_opensearch The value of \fBhtml_use_opensearch\fP \%<#\:confval-html_use_opensearch>\&. .UNINDENT .INDENT 0.0 .TP .B version The value of \fBversion\fP \%<#\:confval-version>\&. .UNINDENT .sp In addition to these values, there are also all \fBtheme options\fP available (prefixed by \fBtheme_\fP), as well as the values given by the user in \fBhtml_context\fP \%<#\:confval-html_context>\&. .sp In documents that are created from source files (as opposed to automatically\-generated files like the module index, or documents that already are in HTML form), these variables are also available: .INDENT 0.0 .TP .B body A string containing the content of the page in HTML form as produced by the HTML builder, before the theme is applied. .UNINDENT .INDENT 0.0 .TP .B display_toc A boolean that is True if the toc contains more than one entry. .UNINDENT .INDENT 0.0 .TP .B meta Document metadata (a dictionary), see File\-wide metadata \%<#\:metadata>\&. .UNINDENT .INDENT 0.0 .TP .B metatags A string containing the page\(aqs HTML meta \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:meta> tags. .UNINDENT .INDENT 0.0 .TP .B next The next document for the navigation. This variable is either false or has two attributes \fBlink\fP and \fBtitle\fP\&. The title contains HTML markup. For example, to generate a link to the next page, you can use this snippet: .INDENT 7.0 .INDENT 3.5 .sp .EX {% if next %} <a href=\(dq{{ next.link|e }}\(dq>{{ next.title }}</a> {% endif %} .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B page_source_suffix The suffix of the file that was rendered. Since we support a list of \fBsource_suffix\fP \%<#\:confval-source_suffix>, this will allow you to properly link to the original source file. .UNINDENT .INDENT 0.0 .TP .B parents A list of parent documents for navigation, structured like the \fBnext\fP item. .UNINDENT .INDENT 0.0 .TP .B prev Like \fBnext\fP, but for the previous page. .UNINDENT .INDENT 0.0 .TP .B sourcename The name of the copied source file for the current document. This is only nonempty if the \fBhtml_copy_source\fP \%<#\:confval-html_copy_source> value is \fBTrue\fP\&. This has empty value on creating automatically\-generated files. .UNINDENT .INDENT 0.0 .TP .B toc The local table of contents for the current page, rendered as HTML bullet lists. .UNINDENT .INDENT 0.0 .TP .B toctree A callable yielding the global TOC tree containing the current page, rendered as HTML bullet lists. Optional keyword arguments: .INDENT 7.0 .TP .B \fBcollapse\fP If true, all TOC entries that are not ancestors of the current page are collapsed. \fBTrue\fP by default. .TP .B \fBmaxdepth\fP The maximum depth of the tree. Set it to \fB\-1\fP to allow unlimited depth. Defaults to the max depth selected in the toctree directive. .TP .B \fBtitles_only\fP If true, put only top\-level document titles in the tree. \fBFalse\fP by default. .TP .B \fBincludehidden\fP If true, the ToC tree will also contain hidden entries. \fBFalse\fP by default. .UNINDENT .UNINDENT .sp The guide to templating \%<> is helpful if you want to write your own templates. What is important to keep in mind is the order in which Sphinx searches for templates: .INDENT 0.0 .IP \(bu 2 First, in the user\(aqs \fBtemplates_path\fP directories. .IP \(bu 2 Then, in the selected theme. .IP \(bu 2 Then, in its base theme, its base\(aqs base theme, etc. .UNINDENT .sp When extending a template in the base theme with the same name, use the theme name as an explicit directory: \fB{% extends \(dqbasic/layout.html\(dq %}\fP\&. From a user \fBtemplates_path\fP template, you can still use the \(dqexclamation mark\(dq syntax as described in the templating document \%<#\:templating-primer>\&. .SS Static templates .sp Since theme options are meant for the user to configure a theme more easily, without having to write a custom stylesheet, it is necessary to be able to template static files as well as HTML files. Therefore, Sphinx supports so\-called \(dqstatic templates\(dq, like this: .sp If the name of a file in the \fBstatic/\fP directory of a theme (or in the user\(aqs static path) ends with \fB\&.jinja\fP or \fB_t\fP, it will be processed by the template engine. The suffix will be removed from the final file name. .sp For example, a theme with a \fBstatic/theme_styles.css.jinja\fP file could use templating to put options into the stylesheet. When a documentation project is built with that theme, the output directory will contain a \fB_static/theme_styles.css\fP file where all template tags have been processed. .sp Changed in version 7.4: .INDENT 0.0 .INDENT 3.5 The preferred suffix for static templates is now \fB\&.jinja\fP, in line with the Jinja project\(aqs recommended file extension \%<https://\:jinja\:.palletsprojects\:.com/\:en/\:latest/\:templates/#\:template-file-extension>\&. .sp The \fB_t\fP file suffix for static templates is now considered \(aqlegacy\(aq, and support may eventually be removed. .sp If a static template with either a \fB_t\fP suffix or a \fB\&.jinja\fP suffix is detected, it will be processed by the template engine, with the suffix removed from the final file name. .UNINDENT .UNINDENT .SS Use custom page metadata in HTML templates .sp Any key / value pairs in field lists \%<> that are placed \fIbefore\fP the page\(aqs title will be available to the Jinja template when building the page within the \fBmeta\fP \%<#\:meta> attribute. For example, if a page had the following text before its first title: .INDENT 0.0 .INDENT 3.5 .sp .EX :mykey: My value My first title \-\-\-\-\-\-\-\-\-\-\-\-\-\- .EE .UNINDENT .UNINDENT .sp Then it could be accessed within a Jinja template like so: .INDENT 0.0 .INDENT 3.5 .sp .EX {%\- if meta is mapping %} {{ meta.get(\(dqmykey\(dq) }} {%\- endif %} .EE .UNINDENT .UNINDENT .sp Note the check that \fBmeta\fP is a dictionary (\(dqmapping\(dq in Jinja terminology) to ensure that using it in this way is valid. .SS Defining custom template functions .sp Sometimes it is useful to define your own function in Python that you wish to then use in a template. For example, if you\(aqd like to insert a template value with logic that depends on the user\(aqs configuration in the project, or if you\(aqd like to include non\-trivial checks and provide friendly error messages for incorrect configuration in the template. .sp To define your own template function, you\(aqll need to define two functions inside your module: .INDENT 0.0 .IP \(bu 2 A \fBpage context event handler\fP (or \fBregistration\fP) function. This is connected to the \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> application via an event callback. .IP \(bu 2 A \fBtemplate function\fP that you will use in your Jinja template. .UNINDENT .sp First, define the registration function, which accepts the arguments for \fBhtml\-page\-context\fP \%<#\:event-html-page-context>\&. .sp Within the registration function, define the template function that you\(aqd like to use within Jinja. The template function should return a string or Python objects (lists, dictionaries) with strings inside that Jinja uses in the templating process .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The template function will have access to all of the variables that are passed to the registration function. .UNINDENT .UNINDENT .sp At the end of the registration function, add the template function to the Sphinx application\(aqs context with \fBcontext[\(aqtemplate_func\(aq] = template_func\fP\&. .sp Finally, in your extension\(aqs \fBsetup()\fP function, add your registration function as a callback for \fBhtml\-page\-context\fP \%<#\:event-html-page-context>\&. .INDENT 0.0 .INDENT 3.5 .sp .EX # The registration function def setup_my_func(app, pagename, templatename, context, doctree): # The template function def my_func(mystring): return \(dqYour string is %s\(dq % mystring # Add it to the page\(aqs context context[\(aqmy_func\(aq] = my_func # Your extension\(aqs setup function def setup(app): app.connect(\(dqhtml\-page\-context\(dq, setup_my_func) .EE .UNINDENT .UNINDENT .sp Now, you will have access to this function in jinja like so: .INDENT 0.0 .INDENT 3.5 .sp .EX <div> {{ my_func(\(dqsome string\(dq) }} </div> .EE .UNINDENT .UNINDENT .SS Add your own static files to the build assets .sp By default, Sphinx copies static files on the \fBstatic/\fP directory of the template directory. However, if your package needs to place static files outside of the \fBstatic/\fP directory for some reasons, you need to copy them to the \fB_static/\fP directory of HTML outputs manually at the build via an event hook. Here is an example of code to accomplish this: .INDENT 0.0 .INDENT 3.5 .sp .EX import shutil def copy_custom_files(app, exc): if app.builder.format == \(aqhtml\(aq and not exc: static_dir = app.outdir / \(aq_static\(aq shutil.copyfile(\(aqpath/to/myextension/_static/myjsfile.js\(aq, static_dir) def setup(app): app.connect(\(aqbuild\-finished\(aq, copy_custom_files) .EE .UNINDENT .UNINDENT .SS Inject JavaScript based on user configuration .sp If your extension makes use of JavaScript, it can be useful to allow users to control its behavior using their Sphinx configuration. However, this can be difficult to do if your JavaScript comes in the form of a static library (which will not be built with Jinja). .sp There are two ways to inject variables into the JavaScript space based on user configuration. .sp First, you may append \fB_t\fP to the end of any static files included with your extension. This will cause Sphinx to process these files with the templating engine, allowing you to embed variables and control behavior. .sp For example, the following JavaScript structure: .INDENT 0.0 .INDENT 3.5 .sp .EX mymodule/ ├── _static │\ \ └── myjsfile.js_t └── mymodule.py .EE .UNINDENT .UNINDENT .sp Will result in the following static file placed in your HTML\(aqs build output: .INDENT 0.0 .INDENT 3.5 .sp .EX _build/ └── html └── _static \ \ └── myjsfile.js .EE .UNINDENT .UNINDENT .sp See Static templates for more information. .sp Second, you may use the \fBSphinx.add_js_file()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_js_file> method without pointing it to a file. Normally, this method is used to insert a new JavaScript file into your site. However, if you do \fInot\fP pass a file path, but instead pass a string to the \(dqbody\(dq argument, then this text will be inserted as JavaScript into your site\(aqs head. This allows you to insert variables into your project\(aqs JavaScript from Python. .sp For example, the following code will read in a user\-configured value and then insert this value as a JavaScript variable, which your extension\(aqs JavaScript code may use: .INDENT 0.0 .INDENT 3.5 .sp .EX # This function reads in a variable and inserts it into JavaScript def add_js_variable(app): # This is a configuration that you\(aqve specified for users in \(gaconf.py\(ga js_variable = app.config[\(aqmy_javascript_variable\(aq] js_text = \(dqvar my_variable = \(aq%s\(aq;\(dq % js_variable app.add_js_file(None, body=js_text) # We connect this function to the step after the builder is initialized def setup(app): # Tell Sphinx about this configuration variable app.add_config_value(\(aqmy_javascript_variable\(aq, 0, \(aqhtml\(aq) # Run the function after the builder is initialized app.connect(\(aqbuilder\-inited\(aq, add_js_variable) .EE .UNINDENT .UNINDENT .sp As a result, in your theme you can use code that depends on the presence of this variable. Users can control the variable\(aqs value by defining it in their \fBconf.py\fP file. .IP [1] 5 It is not an executable Python file, as opposed to \fBconf.py\fP, because that would pose an unnecessary security risk if themes are shared. .SS Sphinx API .sp Since many projects will need special features in their documentation, Sphinx is designed to be extensible on several levels. .sp Here are a few things you can do in an extension: .INDENT 0.0 .IP \(bu 2 Add new builder \%<#\:term-builder>s to support new output formats or actions on the parsed documents. .IP \(bu 2 Register custom reStructuredText roles and directives, extending the markup using the Docutils markup API \%<>\&. .IP \(bu 2 Add custom code to so\-called \(dqhook points\(dq at strategic places throughout the build process, allowing you to register a hook and run specialized code. For example, see the Event callbacks API \%<#\:events>\&. .UNINDENT .sp An extension is simply a Python module with a \fBsetup()\fP function. A user activates the extension by placing the extension\(aqs module name (or a sub\-module) in their \fBextensions\fP \%<#\:confval-extensions> configuration value. .sp When \fBsphinx\-build\fP is executed, Sphinx will attempt to import each module that is listed, and execute \fByourmodule.setup(app)\fP\&. This function is used to prepare the extension (e.g., by executing Python code), linking resources that Sphinx uses in the build process (like CSS or HTML files), and notifying Sphinx of everything the extension offers (such as directive or role definitions). The \fBapp\fP argument is an instance of \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> and gives you control over most aspects of the Sphinx build. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The configuration file itself can be treated as an extension if it contains a \fBsetup()\fP function. All other extensions to load must be listed in the \fBextensions\fP \%<#\:confval-extensions> configuration value. .UNINDENT .UNINDENT .sp The rest of this page describes some high\-level aspects of developing extensions and various parts of Sphinx\(aqs behavior that you can control. For some examples of how extensions can be built and used to control different parts of Sphinx, see the Tutorials \%<#\:extension-tutorials-index>\&. .SS Important objects .sp There are several key objects whose API you will use while writing an extension. These are: .INDENT 0.0 .TP \fBApplication\fP The application object (usually called \fBapp\fP) is an instance of \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx>\&. It controls most high\-level functionality, such as loading config, initialising the environment, and the setup of extensions. .TP \fBEnvironment\fP The build environment object (usually called \fBenv\fP) is an instance of \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment>\&. It is responsible for parsing the source documents, stores all metadata about the document collection and is serialized to disk after each build. .sp Its API provides methods to do with access to metadata, resolving references, etc. It can also be used by extensions to cache information that should persist for incremental rebuilds. .sp If you have the application or builder object, the environment is available as \fBapp.env\fP or \fBbuilder.env\fP\&. In \fBSphinxDirective\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxDirective>, \fBSphinxRole\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxRole>, or \fBSphinxTransform\fP \%<#\:sphinx\:.transforms\:.SphinxTransform> subclasses, the environment is available as \fBself.env\fP\&. .TP \fBBuilder\fP The builder object (usually called \fBbuilder\fP) is an instance of a specific subclass of \fBBuilder\fP \%<#\:sphinx\:.builders\:.Builder>\&. Each builder class knows how to convert the parsed documents into an output format, or otherwise process them (e.g. check external links). .sp If you have the application object, the builder is available as \fBapp.builder\fP\&. .TP \fBConfig\fP The config object (usually called \fBconfig\fP) provides the values of configuration values set in \fBconf.py\fP as attributes. It is an instance of \fBConfig\fP \%<#\:sphinx\:.config\:.Config>\&. .sp The config is available as \fBenv.config\fP, \fBbuilder.config\fP, or \fBapp.config\fP\&. In \fBSphinxDirective\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxDirective>, \fBSphinxRole\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxRole>, or \fBSphinxTransform\fP \%<#\:sphinx\:.transforms\:.SphinxTransform> subclasses, the environment is available as \fBself.config\fP\&. .TP \fBEvents\fP The event manager object (usually called \fBevents\fP) manages and dispatches Sphinx\(aqs events system. It is an instance of \fBEventManager\fP \%<#\:sphinx\:.events\:.EventManager>\&. .sp The event manager is available as \fBenv.events\fP, \fBbuilder.events\fP, or \fBapp.events\fP\&. .UNINDENT .sp To see an example of use of these objects, refer to the tutorials \%<#\:extension-tutorials-index>\&. .SS Build phases .sp One thing that is vital in order to understand extension mechanisms is the way in which a Sphinx project is built: this works in several phases. .INDENT 0.0 .INDENT 2.5 [graph]Build phases.UNINDENT .UNINDENT .sp \fBPhase 0: Initialization\fP .sp In this phase, almost nothing of interest to us happens. The source directory is searched for source files, and extensions are initialized. Should a stored build environment exist, it is loaded, otherwise a new one is created. .sp \fBPhase 1: Reading\fP .sp In Phase 1, all source files (and on subsequent builds, those that are new or changed) are read and parsed. This is the phase where directives and roles are encountered by docutils, and the corresponding code is executed. The output of this phase is a \fIdoctree\fP for each source file; that is a tree of docutils nodes. For document elements that aren\(aqt fully known until all existing files are read, temporary nodes are created. .sp There are nodes provided by docutils, which are documented in the docutils documentation \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:doctree\:.html>\&. Additional nodes are provided by Sphinx and documented here \%<#\:nodes>\&. .sp During reading, the build environment is updated with all meta\- and cross reference data of the read documents, such as labels, the names of headings, described Python objects and index entries. This will later be used to replace the temporary nodes. .sp The parsed doctrees are stored on the disk, because it is not possible to hold all of them in memory. .sp \fBPhase 2: Consistency checks\fP .sp Some checking is done to ensure no surprises in the built documents. .sp \fBPhase 3: Resolving\fP .sp Now that the metadata and cross\-reference data of all existing documents is known, all temporary nodes are replaced by nodes that can be converted into output using components called transforms. For example, links are created for object references that exist, and simple literal nodes are created for those that don\(aqt. .sp \fBPhase 4: Writing\fP .sp This phase converts the resolved doctrees to the desired output format, such as HTML or LaTeX. This happens via a so\-called docutils writer that visits the individual nodes of each doctree and produces some output in the process. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Some builders deviate from this general build plan, for example, the builder that checks external links does not need anything more than the parsed doctrees and therefore does not have phases 2\-\-4. .UNINDENT .UNINDENT .sp To see an example of application, refer to Extending the build process \%<#\:tutorial-extend-build>\&. .SS Extension metadata .sp Added in version 1.3. .sp The \fBsetup()\fP function should return a dictionary. This is treated by Sphinx as metadata of the extension. Metadata keys currently recognized are: .INDENT 0.0 .TP .B \fB\(aqversion\(aq\fP A string that identifies the extension version. It is used for extension version requirement checking (see \fBneeds_extensions\fP \%<#\:confval-needs_extensions>) and informational purposes. If no version string is returned, \fB\(aqunknown version\(aq\fP is used by default. .TP .B \fB\(aqenv_version\(aq\fP A non\-zero positive integer integer that records the version of data stored in the environment by the extension. .sp \fBAttention:\fP .INDENT 7.0 .INDENT 3.5 If \fB\(aqenv_version\(aq\fP is not set, the extension \fBmust not\fP store any data or state directly on the environment object (\fBenv\fP). .UNINDENT .UNINDENT .sp This key must be defined if the extension uses the \fBenv\fP object to store data. The version number must be incremented whenever the type, structure, or meaning of the stored data change, to ensure Sphinx does not try and load invalid data from a cached environment. .sp Added in version 1.8. .TP .B \fB\(aqparallel_read_safe\(aq\fP A boolean that specifies if parallel reading of source files can be used when the extension is loaded. It defaults to \fBFalse\fP, meaning that you have to explicitly specify your extension to be safe for parallel reading after checking that it is. .sp \fBImportant:\fP .INDENT 7.0 .INDENT 3.5 When \fIparallel\-read\-safe\fP is \fBTrue\fP, the extension must satisfy the following conditions: .INDENT 0.0 .IP \(bu 2 The core logic of the extension is parallelly executable during the reading phase. .IP \(bu 2 It has event handlers for \fBenv\-merge\-info\fP \%<#\:event-env-merge-info> and \fBenv\-purge\-doc\fP \%<#\:event-env-purge-doc> events if it stores data to the build environment object (\fBenv\fP) during the reading phase. .UNINDENT .UNINDENT .UNINDENT .TP .B \fB\(aqparallel_write_safe\(aq\fP A boolean that specifies if parallel writing of output files can be used when the extension is loaded. Since extensions usually don\(aqt negatively influence the process, this defaults to \fBTrue\fP\&. .sp \fBImportant:\fP .INDENT 7.0 .INDENT 3.5 When \fIparallel\-write\-safe\fP is \fBTrue\fP, the extension must satisfy the following conditions: .INDENT 0.0 .IP \(bu 2 The core logic of the extension is parallelly executable during the writing phase. .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS APIs used for writing extensions .sp These sections provide a more complete description of the tools at your disposal when developing Sphinx extensions. Some are core to Sphinx (such as the Application API \%<>) while others trigger specific behavior (such as the i18n API \%<>) .SS Application API .sp Each Sphinx extension is a Python module with at least a \fBsetup()\fP function. This function is called at initialization time with one argument, the application object representing the Sphinx process. .INDENT 0.0 .TP .B class sphinx.application.Sphinx This application object has the public API described in the following. .UNINDENT .SS Extension setup .sp These methods are usually called in an extension\(aqs \fBsetup()\fP function. .sp Examples of using the Sphinx extension API can be seen in the \fBsphinx.ext\fP package. .INDENT 0.0 .TP .B Sphinx.setup_extension(extname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Import and setup a Sphinx extension module. .sp Load the extension given by the module \fIname\fP\&. Use this if your extension needs the features provided by another extension. No\-op if called twice. .UNINDENT .INDENT 0.0 .TP .B static Sphinx.require_sphinx(version: tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>, int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>] | str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Check the Sphinx version if requested. .sp Compare \fIversion\fP with the version of the running Sphinx, and abort the build when it is too old. .INDENT 7.0 .TP .B Parameters \fBversion\fP \-\- The required version in the form of \fBmajor.minor\fP or \fB(major, minor)\fP\&. .UNINDENT .sp Added in version 1.0. .sp Changed in version 7.1: Type of \fIversion\fP now allows \fB(major, minor)\fP form. .UNINDENT .INDENT 0.0 .TP .B Sphinx.connect(event: Literal[\(aqconfig\-inited\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, Config \%<#\:sphinx\:.config\:.Config>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqbuilder\-inited\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqenv\-get\-outdated\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], Sequence[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqenv\-before\-read\-docs\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqenv\-purge\-doc\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqsource\-read\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqinclude\-read\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, Path, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqdoctree\-read\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, nodes.document], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqenv\-merge\-info\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqenv\-updated\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqenv\-get\-updated\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>], Iterable[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqenv\-check\-consistency\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqwrite\-started\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, Builder \%<#\:sphinx\:.builders\:.Builder>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqdoctree\-resolved\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, nodes.document, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqmissing\-reference\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, addnodes.pending_xref \%<#\:sphinx\:.addnodes\:.pending_xref>, nodes.TextElement], nodes.reference | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqwarn\-missing\-reference\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, Domain \%<#\:sphinx\:.domains\:.Domain>, addnodes.pending_xref \%<#\:sphinx\:.addnodes\:.pending_xref>], bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqbuild\-finished\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, Exception \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:Exception> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqhtml\-collect\-pages\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>], Iterable[tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]]], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqhtml\-page\-context\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any], nodes.document], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqlinkcheck\-process\-uri\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqobject\-description\-transform\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, addnodes.desc_content \%<#\:sphinx\:.addnodes\:.desc_content>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqautodoc\-process\-docstring\(aq], callback: _AutodocProcessDocstringListener, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqautodoc\-before\-process\-signature\(aq], callback: _AutodocBeforeProcessSignatureListener, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqautodoc\-process\-signature\(aq], callback: _AutodocProcessSignatureListener, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqautodoc\-process\-bases\(aq], callback: _AutodocProcessBasesListener, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqautodoc\-skip\-member\(aq], callback: _AutodocSkipMemberListener, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqtodo\-defined\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, todo_node], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqviewcode\-find\-source\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[Literal[\(aqclass\(aq, \(aqdef\(aq, \(aqother\(aq], int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>, int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>]]]], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: Literal[\(aqviewcode\-follow\-imported\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B Sphinx.connect(event: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, callback: Callable[\&..., Any], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> Register \fIcallback\fP to be called when \fIevent\fP is emitted. .sp For details on available core events and the arguments of callback functions, please see Event callbacks API \%<#\:events>\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBevent\fP \-\- The name of target event .IP \(bu 2 \fBcallback\fP \-\- Callback function for the event .IP \(bu 2 \fBpriority\fP \-\- The priority of the callback. The callbacks will be invoked in order of \fIpriority\fP (ascending). .UNINDENT .TP .B Returns A listener ID. It can be used for \fBdisconnect()\fP\&. .UNINDENT .sp Changed in version 3.0: Support \fIpriority\fP .UNINDENT .INDENT 0.0 .TP .B Sphinx.disconnect(listener_id: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Unregister callback by \fIlistener_id\fP\&. .INDENT 7.0 .TP .B Parameters \fBlistener_id\fP \-\- A listener_id that \fBconnect()\fP returns .UNINDENT .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_builder(builder: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Builder \%<#\:sphinx\:.builders\:.Builder>], override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a new builder. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBbuilder\fP \-\- A builder class .IP \(bu 2 \fBoverride\fP \-\- If true, install the builder forcedly even if another builder is already installed as the same name .UNINDENT .UNINDENT .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_config_value(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, default: Any, rebuild: _ConfigRebuild, types: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type> | Collection[type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>] | ENUM \%<#\:sphinx\:.config\:.ENUM> = (), description: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a configuration value. .sp This is necessary for Sphinx to recognize new values and set default values accordingly. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP \-\- The name of the configuration value. It is recommended to be prefixed with the extension name (ex. \fBhtml_logo\fP, \fBepub_title\fP) .IP \(bu 2 \fBdefault\fP \-\- The default value of the configuration. .IP \(bu 2 \fBrebuild\fP \-\- .sp The condition of rebuild. It must be one of those values: .INDENT 2.0 .IP \(bu 2 \fB\(aqenv\(aq\fP if a change in the setting only takes effect when a document is parsed \-\- this means that the whole environment must be rebuilt. .IP \(bu 2 \fB\(aqhtml\(aq\fP if a change in the setting needs a full rebuild of HTML documents. .IP \(bu 2 \fB\(aq\(aq\fP if a change in the setting will not need any special rebuild. .UNINDENT .IP \(bu 2 \fBtypes\fP \-\- The type of configuration value. A list of types can be specified. For example, \fB[str]\fP is used to describe a configuration that takes string value. .IP \(bu 2 \fBdescription\fP \-\- A short description of the configuration value. .UNINDENT .UNINDENT .sp Changed in version 0.4: If the \fIdefault\fP value is a callable, it will be called with the config object as its argument in order to get the default value. This can be used to implement config values whose default depends on other values. .sp Changed in version 0.6: Changed \fIrebuild\fP from a simple boolean (equivalent to \fB\(aq\(aq\fP or \fB\(aqenv\(aq\fP) to a string. However, booleans are still accepted and converted internally. .sp Added in version 1.4: The \fItypes\fP parameter. .sp Added in version 7.4: The \fIdescription\fP parameter. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_event(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register an event called \fIname\fP\&. .sp This is needed to be able to emit it. .INDENT 7.0 .TP .B Parameters \fBname\fP \-\- The name of the event .UNINDENT .UNINDENT .INDENT 0.0 .TP .B Sphinx.set_translator(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, translator_class: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[nodes.NodeVisitor], override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register or override a Docutils translator class. .sp This is used to register a custom output translator or to replace a builtin translator. This allows extensions to use a custom translator and define custom nodes for the translator (see \fBadd_node()\fP). .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP \-\- The name of the builder for the translator .IP \(bu 2 \fBtranslator_class\fP \-\- A translator class .IP \(bu 2 \fBoverride\fP \-\- If true, install the translator forcedly even if another translator is already installed as the same name .UNINDENT .UNINDENT .sp Added in version 1.3. .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_node(node: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Element], override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False, **kwargs: _NodeHandlerPair) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a Docutils node class. .sp This is necessary for Docutils internals. It may also be used in the future to validate nodes in the parsed documents. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBnode\fP \-\- A node class .IP \(bu 2 \fBkwargs\fP \-\- Visitor functions for each builder (see below) .IP \(bu 2 \fBoverride\fP \-\- If true, install the node forcedly even if another node is already installed as the same name .UNINDENT .UNINDENT .sp Node visitor functions for the Sphinx HTML, LaTeX, text and manpage writers can be given as keyword arguments: the keyword should be one or more of \fB\(aqhtml\(aq\fP, \fB\(aqlatex\(aq\fP, \fB\(aqtext\(aq\fP, \fB\(aqman\(aq\fP, \fB\(aqtexinfo\(aq\fP or any other supported translators, the value a 2\-tuple of \fB(visit, depart)\fP methods. \fBdepart\fP can be \fBNone\fP if the \fBvisit\fP function raises \fBdocutils.nodes.SkipNode\fP\&. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX class math(docutils.nodes.Element): ... def visit_math_html(self, node): self.body.append(self.starttag(node, \(aqmath\(aq)) def depart_math_html(self, node): self.body.append(\(aq</math>\(aq) app.add_node(math, html=(visit_math_html, depart_math_html)) .EE .UNINDENT .UNINDENT .sp Obviously, translators for which you don\(aqt specify visitor methods will choke on the node when encountered in a document to translate. .sp Changed in version 0.5: Added the support for keyword arguments giving visit functions. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_enumerable_node(node: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Element], figtype: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, title_getter: TitleGetter | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False, **kwargs: tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[_NodeHandler, _NodeHandler]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a Docutils node class as a numfig target. .sp Sphinx numbers the node automatically. And then the users can refer it using \fBnumref\fP \%<#\:role-numref>\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBnode\fP \-\- A node class .IP \(bu 2 \fBfigtype\fP \-\- The type of enumerable nodes. Each figtype has individual numbering sequences. As system figtypes, \fBfigure\fP, \fBtable\fP and \fBcode\-block\fP are defined. It is possible to add custom nodes to these default figtypes. It is also possible to define new custom figtype if a new figtype is given. .IP \(bu 2 \fBtitle_getter\fP \-\- A getter function to obtain the title of node. It takes an instance of the enumerable node, and it must return its title as string. The title is used to the default title of references for \fBref\fP \%<#\:role-ref>\&. By default, Sphinx searches \fBdocutils.nodes.caption\fP or \fBdocutils.nodes.title\fP from the node as a title. .IP \(bu 2 \fBkwargs\fP \-\- Visitor functions for each builder (same as \fBadd_node()\fP) .IP \(bu 2 \fBoverride\fP \-\- If true, install the node forcedly even if another node is already installed as the same name .UNINDENT .UNINDENT .sp Added in version 1.4. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_directive(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, cls: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Directive \%<#\:docutils\:.parsers\:.rst\:.Directive>], override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a Docutils directive. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP \-\- The name of the directive .IP \(bu 2 \fBcls\fP \-\- A directive class .IP \(bu 2 \fBoverride\fP \-\- If false, do not install it if another directive is already installed as the same name If true, unconditionally install the directive. .UNINDENT .UNINDENT .sp For example, a custom directive named \fBmy\-directive\fP would be added like this: .INDENT 7.0 .INDENT 3.5 .sp .EX from docutils.parsers.rst import Directive, directives class MyDirective(Directive): has_content = True required_arguments = 1 optional_arguments = 0 final_argument_whitespace = True option_spec = { \(aqclass\(aq: directives.class_option, \(aqname\(aq: directives.unchanged, } def run(self): pass def setup(app): app.add_directive(\(aqmy\-directive\(aq, MyDirective) .EE .UNINDENT .UNINDENT .sp For more details, see the Docutils docs \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:howto/\:rst-directives\:.html> . .sp Changed in version 0.6: Docutils 0.5\-style directive classes are now supported. .sp Changed in version 1.8: Docutils 0.4\-style (function based) directives support is deprecated. .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_role(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, role: Any, override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a Docutils role. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP \-\- The name of role .IP \(bu 2 \fBrole\fP \-\- A role function .IP \(bu 2 \fBoverride\fP \-\- If false, do not install it if another role is already installed as the same name If true, unconditionally install the role. .UNINDENT .UNINDENT .sp For more details about role functions, see the Docutils docs \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:howto/\:rst-roles\:.html> . .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_generic_role(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, nodeclass: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Node], override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a generic Docutils role. .sp Register a Docutils role that does nothing but wrap its contents in the node given by \fInodeclass\fP\&. .INDENT 7.0 .TP .B Parameters \fBoverride\fP \-\- If false, do not install it if another role is already installed as the same name If true, unconditionally install the role. .UNINDENT .sp Added in version 0.6. .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_domain(domain: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Domain \%<#\:sphinx\:.domains\:.Domain>], override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a domain. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP \-\- A domain class .IP \(bu 2 \fBoverride\fP \-\- If false, do not install it if another domain is already installed as the same name If true, unconditionally install the domain. .UNINDENT .UNINDENT .sp Added in version 1.0. .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_directive_to_domain(domain: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, cls: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Directive \%<#\:docutils\:.parsers\:.rst\:.Directive>], override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a Docutils directive in a domain. .sp Like \fBadd_directive()\fP, but the directive is added to the domain named \fIdomain\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP \-\- The name of target domain .IP \(bu 2 \fBname\fP \-\- A name of directive .IP \(bu 2 \fBcls\fP \-\- A directive class .IP \(bu 2 \fBoverride\fP \-\- If false, do not install it if another directive is already installed as the same name If true, unconditionally install the directive. .UNINDENT .UNINDENT .sp Added in version 1.0. .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_role_to_domain(domain: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, role: RoleFunction | XRefRole, override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a Docutils role in a domain. .sp Like \fBadd_role()\fP, but the role is added to the domain named \fIdomain\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP \-\- The name of the target domain .IP \(bu 2 \fBname\fP \-\- The name of the role .IP \(bu 2 \fBrole\fP \-\- The role function .IP \(bu 2 \fBoverride\fP \-\- If false, do not install it if another role is already installed as the same name If true, unconditionally install the role. .UNINDENT .UNINDENT .sp Added in version 1.0. .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_index_to_domain(domain: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, index: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Index \%<#\:sphinx\:.domains\:.Index>], _override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a custom index for a domain. .sp Add a custom \fIindex\fP class to the domain named \fIdomain\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdomain\fP \-\- The name of the target domain .IP \(bu 2 \fBindex\fP \-\- The index class .IP \(bu 2 \fBoverride\fP \-\- If false, do not install it if another index is already installed as the same name If true, unconditionally install the index. .UNINDENT .UNINDENT .sp Added in version 1.0. .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_object_type(directivename: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, rolename: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, indextemplate: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, parse_node: Callable[[BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, addnodes.desc_signature \%<#\:sphinx\:.addnodes\:.desc_signature>], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, ref_nodeclass: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[nodes.TextElement] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, objname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, doc_field_types: Sequence[Field] = (), override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a new object type. .sp This method is a very convenient way to add a new object \%<#\:term-object> type that can be cross\-referenced. It will do this: .INDENT 7.0 .IP \(bu 2 Create a new directive (called \fIdirectivename\fP) for documenting an object. It will automatically add index entries if \fIindextemplate\fP is nonempty; if given, it must contain exactly one instance of \fB%s\fP\&. See the example below for how the template will be interpreted. .IP \(bu 2 Create a new role (called \fIrolename\fP) to cross\-reference to these object descriptions. .IP \(bu 2 If you provide \fIparse_node\fP, it must be a function that takes a string and a docutils node, and it must populate the node with children parsed from the string. It must then return the name of the item to be used in cross\-referencing and index entries. See the \fBconf.py\fP file in the source for this documentation for an example. .IP \(bu 2 The \fIobjname\fP (if not given, will default to \fIdirectivename\fP) names the type of object. It is used when listing objects, e.g. in search results. .UNINDENT .sp For example, if you have this call in a custom Sphinx extension: .INDENT 7.0 .INDENT 3.5 .sp .EX app.add_object_type(\(aqdirective\(aq, \(aqdir\(aq, \(aqpair: %s; directive\(aq) .EE .UNINDENT .UNINDENT .sp you can use this markup in your documents: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. rst:directive:: function Document a function. <...> See also the :rst:dir:\(gafunction\(ga directive. .EE .UNINDENT .UNINDENT .sp For the directive, an index entry will be generated as if you had prepended .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. index:: pair: function; directive .EE .UNINDENT .UNINDENT .sp The reference node will be of class \fBliteral\fP (so it will be rendered in a proportional font, as appropriate for code) unless you give the \fIref_nodeclass\fP argument, which must be a docutils node class. Most useful are \fBdocutils.nodes.emphasis\fP or \fBdocutils.nodes.strong\fP \-\- you can also use \fBdocutils.nodes.generated\fP if you want no further text decoration. If the text should be treated as literal (e.g. no smart quote replacement), but not have typewriter styling, use \fBsphinx.addnodes.literal_emphasis\fP or \fBsphinx.addnodes.literal_strong\fP\&. .sp For the role content, you have the same syntactical possibilities as for standard Sphinx roles (see Syntax \%<#\:xref-syntax>). .sp If \fIoverride\fP is True, the given object_type is forcedly installed even if an object_type having the same name is already installed. .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_crossref_type(directivename: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, rolename: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, indextemplate: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, ref_nodeclass: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[nodes.TextElement] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, objname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a new crossref object type. .sp This method is very similar to \fBadd_object_type()\fP except that the directive it generates must be empty, and will produce no output. .sp That means that you can add semantic targets to your sources, and refer to them using custom roles instead of generic ones (like \fBref\fP \%<#\:role-ref>). Example call: .INDENT 7.0 .INDENT 3.5 .sp .EX app.add_crossref_type( \(aqtopic\(aq, \(aqtopic\(aq, \(aqsingle: %s\(aq, docutils.nodes.emphasis ) .EE .UNINDENT .UNINDENT .sp Example usage: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. topic:: application API The application API \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- Some random text here. See also :topic:\(gathis section <application API>\(ga. .EE .UNINDENT .UNINDENT .sp (Of course, the element following the \fBtopic\fP directive needn\(aqt be a section.) .INDENT 7.0 .TP .B Parameters \fBoverride\fP \-\- If false, do not install it if another cross\-reference type is already installed as the same name If true, unconditionally install the cross\-reference type. .UNINDENT .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_transform(transform: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Transform]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a Docutils transform to be applied after parsing. .sp Add the standard docutils \fBTransform\fP subclass \fItransform\fP to the list of transforms that are applied after Sphinx parses a reST document. .INDENT 7.0 .TP .B Parameters \fBtransform\fP \-\- A transform class .UNINDENT .SS priority range categories for Sphinx transforms .TS box center; l|l. T{ Priority T} T{ Main purpose in Sphinx T} _ T{ 0\-99 T} T{ Fix invalid nodes by docutils. Translate a doctree. T} _ T{ 100\-299 T} T{ Preparation T} _ T{ 300\-399 T} T{ early T} _ T{ 400\-699 T} T{ main T} _ T{ 700\-799 T} T{ Post processing. Deadline to modify text and referencing. T} _ T{ 800\-899 T} T{ Collect referencing and referenced nodes. Domain processing. T} _ T{ 900\-999 T} T{ Finalize and clean up. T} .TE .sp refs: Transform Priority Range Categories \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:transforms\:.html#\:transform-priority-range-categories> .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_post_transform(transform: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Transform]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a Docutils transform to be applied before writing. .sp Add the standard docutils \fBTransform\fP subclass \fItransform\fP to the list of transforms that are applied before Sphinx writes a document. .INDENT 7.0 .TP .B Parameters \fBtransform\fP \-\- A transform class .UNINDENT .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_js_file(filename: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500, loading_method: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, **kwargs: Any) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a JavaScript file to include in the HTML output. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfilename\fP \-\- The name of a JavaScript file that the default HTML template will include. It must be relative to the HTML static path, or a full URI with scheme, or \fBNone\fP . The \fBNone\fP value is used to create an inline \fB<script>\fP tag. See the description of \fIkwargs\fP below. .IP \(bu 2 \fBpriority\fP \-\- Files are included in ascending order of priority. If multiple JavaScript files have the same priority, those files will be included in order of registration. See list of \(dqpriority range for JavaScript files\(dq below. .IP \(bu 2 \fBloading_method\fP \-\- The loading method for the JavaScript file. Either \fB\(aqasync\(aq\fP or \fB\(aqdefer\(aq\fP are allowed. .IP \(bu 2 \fBkwargs\fP \-\- Extra keyword arguments are included as attributes of the \fB<script>\fP tag. If the special keyword argument \fBbody\fP is given, its value will be added as the content of the \fB<script>\fP tag. .UNINDENT .UNINDENT .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX app.add_js_file(\(aqexample.js\(aq) # => <script src=\(dq_static/example.js\(dq></script> app.add_js_file(\(aqexample.js\(aq, loading_method=\(aqasync\(aq) # => <script src=\(dq_static/example.js\(dq async=\(dqasync\(dq></script> app.add_js_file(None, body=\(dqvar myVariable = \(aqfoo\(aq;\(dq) # => <script>var myVariable = \(aqfoo\(aq;</script> .EE .UNINDENT .UNINDENT .SS priority range for JavaScript files .TS box center; l|l. T{ Priority T} T{ Main purpose in Sphinx T} _ T{ 200 T} T{ default priority for built\-in JavaScript files T} _ T{ 500 T} T{ default priority for extensions T} _ T{ 800 T} T{ default priority for \fBhtml_js_files\fP \%<#\:confval-html_js_files> T} .TE .sp A JavaScript file can be added to the specific HTML page when an extension calls this method on \fBhtml\-page\-context\fP \%<#\:event-html-page-context> event. .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBadd_static_dir()\fP for copying static files to the output directory .UNINDENT .UNINDENT .sp Added in version 0.5. .sp Changed in version 1.8: Renamed from \fBapp.add_javascript()\fP\&. And it allows keyword arguments as attributes of script tag. .sp Changed in version 3.5: Take priority argument. Allow to add a JavaScript file to the specific page. .sp Changed in version 4.4: Take loading_method argument. Allow to change the loading method of the JavaScript file. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_css_file(filename: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 500, **kwargs: Any) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a stylesheet to include in the HTML output. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBfilename\fP \-\- The name of a CSS file that the default HTML template will include. It must be relative to the HTML static path, or a full URI with scheme. .IP \(bu 2 \fBpriority\fP \-\- Files are included in ascending order of priority. If multiple CSS files have the same priority, those files will be included in order of registration. See list of \(dqpriority range for CSS files\(dq below. .IP \(bu 2 \fBkwargs\fP \-\- Extra keyword arguments are included as attributes of the \fB<link>\fP tag. .UNINDENT .UNINDENT .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX app.add_css_file(\(aqcustom.css\(aq) # => <link rel=\(dqstylesheet\(dq href=\(dq_static/custom.css\(dq type=\(dqtext/css\(dq /> app.add_css_file(\(aqprint.css\(aq, media=\(aqprint\(aq) # => <link rel=\(dqstylesheet\(dq href=\(dq_static/print.css\(dq # type=\(dqtext/css\(dq media=\(dqprint\(dq /> app.add_css_file(\(aqfancy.css\(aq, rel=\(aqalternate stylesheet\(aq, title=\(aqfancy\(aq) # => <link rel=\(dqalternate stylesheet\(dq href=\(dq_static/fancy.css\(dq # type=\(dqtext/css\(dq title=\(dqfancy\(dq /> .EE .UNINDENT .UNINDENT .SS priority range for CSS files .TS box center; l|l. T{ Priority T} T{ Main purpose in Sphinx T} _ T{ 200 T} T{ default priority for built\-in CSS files T} _ T{ 500 T} T{ default priority for extensions T} _ T{ 800 T} T{ default priority for \fBhtml_css_files\fP \%<#\:confval-html_css_files> T} .TE .sp A CSS file can be added to the specific HTML page when an extension calls this method on \fBhtml\-page\-context\fP \%<#\:event-html-page-context> event. .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBadd_static_dir()\fP for copying static files to the output directory .UNINDENT .UNINDENT .sp Added in version 1.0. .sp Changed in version 1.6: Optional \fBalternate\fP and/or \fBtitle\fP attributes can be supplied with the arguments \fIalternate\fP (a Boolean) and \fItitle\fP (a string). The default is no title and \fIalternate\fP = \fBFalse\fP\&. For more information, refer to the documentation \%<https://\:mdn\:.io/\:Web/\:CSS/\:Alternative_style_sheets>\&. .sp Changed in version 1.8: Renamed from \fBapp.add_stylesheet()\fP\&. And it allows keyword arguments as attributes of link tag. .sp Changed in version 3.5: Take priority argument. Allow to add a CSS file to the specific page. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_static_dir(path: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | os.PathLike \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.PathLike>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a static directory to include in HTML output. .sp The given directory\(aqs contents will be copied to the \fB_static\fP directory during an HTML build. Files from extension static directories are copied after theme static files and before any directories from the user\-configured \fBhtml_static_path\fP setting. .sp Sphinx has built\-in support for \fBstatic/\fP directories in themes; theme developers should only use this method to register further directories to be copied. .INDENT 7.0 .TP .B Parameters \fBpath\fP \-\- The path to a directory containing static files. This is typically relative to the extension\(aqs package directory. .UNINDENT .sp Example: .INDENT 7.0 .INDENT 3.5 .sp .EX from pathlib import Path def setup(app): # All files in this directory are copied to _static/, # preserving the subdirectory structure app.add_static_dir(Path(__file__).parent / \(aqstatic\(aq) # Add JavaScript and CSS files to HTML pages, # the paths are relative to _static/ app.add_js_file(\(aqjs/my_extension.js\(aq) app.add_css_file(\(aqcss/my_extension.css\(aq) .EE .UNINDENT .UNINDENT .sp Added in version 9.1. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_latex_package(packagename: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, options: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, after_hyperref: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a package to include in the LaTeX source code. .sp Add \fIpackagename\fP to the list of packages that LaTeX source code will include. If you provide \fIoptions\fP, it will be taken to the \fIusepackage\fP declaration. If you set \fIafter_hyperref\fP truthy, the package will be loaded after \fBhyperref\fP package. .INDENT 7.0 .INDENT 3.5 .sp .EX app.add_latex_package(\(aqmypackage\(aq) # => \eusepackage{mypackage} app.add_latex_package(\(aqmypackage\(aq, \(aqfoo,bar\(aq) # => \eusepackage[foo,bar]{mypackage} .EE .UNINDENT .UNINDENT .sp Added in version 1.3. .sp Added in version 3.1: \fIafter_hyperref\fP option. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_lexer(alias: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, lexer: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Lexer]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a new lexer for source code. .sp Use \fIlexer\fP to highlight code blocks with the given language \fIalias\fP\&. .sp Added in version 0.6. .sp Changed in version 2.1: Take a lexer class as an argument. .sp Changed in version 4.0: Removed support for lexer instances as an argument. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_autodocumenter(cls: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Documenter], override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a new documenter class for the autodoc extension. .sp Add \fIcls\fP as a new documenter class for the \fBsphinx.ext.autodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> extension. It must be a subclass of \fBsphinx.ext.autodoc.Documenter\fP\&. This allows auto\-documenting new types of objects. See the source of the autodoc module for examples on how to subclass \fBDocumenter\fP\&. .sp If \fIoverride\fP is True, the given \fIcls\fP is forcedly installed even if a documenter having the same name is already installed. .sp See Developing autodoc extensions \%<#\:autodoc-ext-tutorial>\&. .sp Added in version 0.6. .sp Changed in version 2.2: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_autodoc_attrgetter(typ: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>, getter: Callable[[Any, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any], Any]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a new \fBgetattr\fP\-like function for the autodoc extension. .sp Add \fIgetter\fP, which must be a function with an interface compatible to the \fBgetattr()\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:getattr> builtin, as the autodoc attribute getter for objects that are instances of \fItyp\fP\&. All cases where autodoc needs to get an attribute of a type are then handled by this function instead of \fBgetattr()\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:getattr>\&. .sp Added in version 0.6. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_search_language(cls: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[SearchLanguage]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a new language for the HTML search index. .sp Add \fIcls\fP, which must be a subclass of \fBsphinx.search.SearchLanguage\fP, as a support language for building the HTML full\-text search index. The class must have a \fIlang\fP attribute that indicates the language it should be used for. See \fBhtml_search_language\fP \%<#\:confval-html_search_language>\&. .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_source_suffix(suffix: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, filetype: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a suffix of source files. .sp Same as \fBsource_suffix\fP \%<#\:confval-source_suffix>\&. The users can override this using the config setting. .INDENT 7.0 .TP .B Parameters \fBoverride\fP \-\- If false, do not install it the same suffix is already installed. If true, unconditionally install the suffix. .UNINDENT .sp Added in version 1.8. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_source_parser(parser: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Parser \%<#\:sphinx\:.parsers\:.Parser>], override: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a parser class. .INDENT 7.0 .TP .B Parameters \fBoverride\fP \-\- If false, do not install it if another parser is already installed for the same suffix. If true, unconditionally install the parser. .UNINDENT .sp Added in version 1.4. .sp Changed in version 1.8: \fIsuffix\fP argument is deprecated. It only accepts \fIparser\fP argument. Use \fBadd_source_suffix()\fP API to register suffix instead. .sp Changed in version 1.8: Add \fIoverride\fP keyword. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_env_collector(collector: type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[EnvironmentCollector \%<#\:sphinx\:.environment\:.collectors\:.EnvironmentCollector>]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register an environment collector class. .sp Refer to Environment Collector API \%<#\:collector-api>\&. .sp Added in version 1.6. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_html_theme(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, theme_path: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | os.PathLike \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.PathLike>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a HTML Theme. .sp The \fIname\fP is a name of theme, and \fItheme_path\fP is a full path to the theme (refs: Distribute your theme as a Python package \%<#\:distribute-your-theme>). .sp Added in version 1.6. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_html_math_renderer(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, inline_renderers: _MathsInlineRenderers | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, block_renderers: _MathsBlockRenderers | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a math renderer for HTML. .sp The \fIname\fP is a name of math renderer. Both \fIinline_renderers\fP and \fIblock_renderers\fP are used as visitor functions for the HTML writer: the former for inline math node (\fBnodes.math\fP), the latter for block math node (\fBnodes.math_block\fP). Regarding visitor functions, see \fBadd_node()\fP for details. .sp Added in version 1.8. .UNINDENT .INDENT 0.0 .TP .B Sphinx.add_message_catalog(catalog: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, locale_dir: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | os.PathLike \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.PathLike>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a message catalog. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBcatalog\fP \-\- The name of the catalog .IP \(bu 2 \fBlocale_dir\fP \-\- The base path of the message catalog .UNINDENT .UNINDENT .sp For more details, see \fBsphinx.locale.get_translation()\fP \%<#\:sphinx\:.locale\:.get_translation>\&. .sp Added in version 1.8. .UNINDENT .INDENT 0.0 .TP .B Sphinx.is_parallel_allowed(typ: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) -> bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> Check whether parallel processing is allowed or not. .INDENT 7.0 .TP .B Parameters \fBtyp\fP \-\- A type of processing; \fB\(aqread\(aq\fP or \fB\(aqwrite\(aq\fP\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B Sphinx.set_html_assets_policy(policy: Literal[\(aqalways\(aq, \(aqper_page\(aq]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Set the policy to include assets in HTML pages. .INDENT 7.0 .IP \(bu 2 always: include the assets in all the pages .IP \(bu 2 per_page: include the assets only in pages where they are used .UNINDENT .UNINDENT .INDENT 0.0 .TP .B exception sphinx.application.ExtensionError All these methods raise this exception if something went wrong with the extension API. .UNINDENT .SS Emitting events .sp \fBAttention:\fP .INDENT 0.0 .INDENT 3.5 Extension developers should prefer using the event manager (\fBevents\fP) object directly, via \fBEventManager.emit()\fP \%<#\:sphinx\:.events\:.EventManager\:.emit> and \fBEventManager.emit_firstresult()\fP \%<#\:sphinx\:.events\:.EventManager\:.emit_firstresult>, which have identical behaviour to the methods below. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.application.Sphinx .INDENT 7.0 .TP .B emit(event: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, *args: Any, allowed_exceptions: tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Exception \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:Exception>], \&...] = ()) -> list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[Any] Emit \fIevent\fP and pass \fIarguments\fP to the callback functions. .sp Return the return values of all callbacks as a list. Do not emit core Sphinx events in extensions! .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBevent\fP \-\- The name of event that will be emitted .IP \(bu 2 \fBargs\fP \-\- The arguments for the event .IP \(bu 2 \fBallowed_exceptions\fP \-\- The list of exceptions that are allowed in the callbacks .UNINDENT .UNINDENT .sp Changed in version 3.1: Added \fIallowed_exceptions\fP to specify path\-through exceptions .UNINDENT .INDENT 7.0 .TP .B emit_firstresult(event: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, *args: Any, allowed_exceptions: tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Exception \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:Exception>], \&...] = ()) -> Any Emit \fIevent\fP and pass \fIarguments\fP to the callback functions. .sp Return the result of the first callback that doesn\(aqt return \fBNone\fP\&. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBevent\fP \-\- The name of event that will be emitted .IP \(bu 2 \fBargs\fP \-\- The arguments for the event .IP \(bu 2 \fBallowed_exceptions\fP \-\- The list of exceptions that are allowed in the callbacks .UNINDENT .UNINDENT .sp Added in version 0.5. .sp Changed in version 3.1: Added \fIallowed_exceptions\fP to specify path\-through exceptions .UNINDENT .UNINDENT .SS Sphinx runtime information .sp The application object also provides runtime information as attributes. .INDENT 0.0 .TP .B Sphinx.project Target project. See \fBProject\fP \%<#\:sphinx\:.project\:.Project>\&. .UNINDENT .INDENT 0.0 .TP .B Sphinx.srcdir Source directory. .UNINDENT .INDENT 0.0 .TP .B Sphinx.confdir Directory containing \fBconf.py\fP\&. .UNINDENT .INDENT 0.0 .TP .B Sphinx.doctreedir Directory for storing pickled doctrees. .UNINDENT .INDENT 0.0 .TP .B Sphinx.outdir Directory for storing built document. .UNINDENT .INDENT 0.0 .TP .B Sphinx.fresh_env_used True/False as to whether a new environment was created for this build, or None if the environment has not been initialised yet. .UNINDENT .SS Sphinx core events .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Moved to Event callbacks API \%<#\:events>\&. .UNINDENT .UNINDENT .SS Checking the Sphinx version .sp Use this to adapt your extension to API changes in Sphinx. .INDENT 0.0 .TP .B sphinx.version_info: Final = (9, 1, 0, \(aqfinal\(aq, 0) Version info for better programmatic use. .sp A tuple of five elements; for Sphinx version 1.2.1 beta 3 this would be \fB(1, 2, 1, \(aqbeta\(aq, 3)\fP\&. The fourth element can be one of: \fBalpha\fP, \fBbeta\fP, \fBrc\fP, \fBfinal\fP\&. \fBfinal\fP always has 0 as the last element. .sp Added in version 1.2: Before version 1.2, check the string \fBsphinx.__version__\fP\&. .UNINDENT .SS The Config object .INDENT 0.0 .TP .B class sphinx.config.Config(config: dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any \%<https://\:docs\:.python\:.org/\:3/\:library/\:typing\:.html#\:typing\:.Any>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, overrides: dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any \%<https://\:docs\:.python\:.org/\:3/\:library/\:typing\:.html#\:typing\:.Any>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None) Configuration file abstraction. .sp The Config object makes the values of all config options available as attributes. .sp It is exposed via the \fBSphinx\fP\fB\&.config\fP and \fBsphinx.environment.BuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment>\fB\&.config\fP attributes. For example, to get the value of \fBlanguage\fP \%<#\:confval-language>, use either \fBapp.config.language\fP or \fBenv.config.language\fP\&. .UNINDENT .SS The template bridge .INDENT 0.0 .TP .B class sphinx.application.TemplateBridge This class defines the interface for a \(dqtemplate bridge\(dq, that is, a class that renders templates given a template name and a context. .INDENT 7.0 .TP .B init(builder: Builder \%<#\:sphinx\:.builders\:.Builder>, theme: Theme | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, dirs: list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Called by the builder to initialize the template system. .sp \fIbuilder\fP is the builder object; you\(aqll probably want to look at the value of \fBbuilder.config.templates_path\fP\&. .sp \fItheme\fP is a \fBsphinx.theming.Theme\fP object or None; in the latter case, \fIdirs\fP can be list of fixed directories to look for templates. .UNINDENT .INDENT 7.0 .TP .B newest_template_mtime() -> float \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:float> Called by the builder to determine if output files are outdated because of template changes. Return the mtime of the newest template file that was changed. The default implementation returns \fB0\fP\&. .UNINDENT .INDENT 7.0 .TP .B render(template: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, context: dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Called by the builder to render a template given as a filename with a specified context (a Python dictionary). .UNINDENT .INDENT 7.0 .TP .B render_string(template: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, context: dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any]) -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Called by the builder to render a template given as a string with a specified context (a Python dictionary). .UNINDENT .UNINDENT .SS Exceptions .INDENT 0.0 .TP .B exception sphinx.errors.SphinxError Base class for Sphinx errors. .sp This is the base class for \(dqnice\(dq exceptions. When such an exception is raised, Sphinx will abort the build and present the exception category and message to the user. .sp Extensions are encouraged to derive from this exception for their custom errors. .sp Exceptions \fInot\fP derived from \fBSphinxError\fP are treated as unexpected and shown to the user with a part of the traceback (and the full traceback saved in a temporary file). .INDENT 7.0 .TP .B category Description of the exception \(dqcategory\(dq, used in converting the exception to a string (\(dqcategory: message\(dq). Should be set accordingly in subclasses. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B exception sphinx.errors.ConfigError Configuration error. .UNINDENT .INDENT 0.0 .TP .B exception sphinx.errors.ExtensionError(message: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, orig_exc: Exception \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:Exception> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, modname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None) Extension error. .UNINDENT .INDENT 0.0 .TP .B exception sphinx.errors.ThemeError Theme error. .UNINDENT .INDENT 0.0 .TP .B exception sphinx.errors.VersionRequirementError Incompatible Sphinx version error. .UNINDENT .SS Event callbacks API .sp Connecting callback functions to events is a simple way to extend Sphinx, by hooking into the build process at various points. .sp Use \fBSphinx.connect()\fP \%<#\:sphinx\:.application\:.Sphinx\:.connect> in an extension\(aqs \fBsetup\fP function, or a \fBsetup\fP function in your project\(aqs \fBconf.py\fP, to connect functions to the events: .INDENT 0.0 .INDENT 3.5 .sp .EX def source_read_handler(app, docname, source): print(\(aqdo something here...\(aq) def setup(app): app.connect(\(aqsource\-read\(aq, source_read_handler) .EE .UNINDENT .UNINDENT .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 Extensions can add their own events by using \fBSphinx.add_event()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_event>, and calling them them with \fBEventManager.emit()\fP \%<#\:sphinx\:.events\:.EventManager\:.emit> or \fBEventManager.emit_firstresult()\fP \%<#\:sphinx\:.events\:.EventManager\:.emit_firstresult>\&. .UNINDENT .UNINDENT .SS Core events overview .sp Below is an overview of the core event that happens during a build. .INDENT 0.0 .INDENT 3.5 .sp .EX 1. event.config\-inited(app,config) 2. event.builder\-inited(app) 3. event.env\-get\-outdated(app, env, added, changed, removed) 4. event.env\-before\-read\-docs(app, env, docnames) for docname in docnames: 5. event.env\-purge\-doc(app, env, docname) if doc changed and not removed: 6. source\-read(app, docname, source) 7. run source parsers: text \-> docutils.document \- parsers can be added with the app.add_source_parser() API \- event.include\-read(app, relative_path, parent_docname, content) is called for each include directive 8. apply transforms based on priority: docutils.document \-> docutils.document \- event.doctree\-read(app, doctree) is called in the middle of transforms, transforms come before/after this event depending on their priority. 9. event.env\-merge\-info(app, env, docnames, other) \- if running in parallel mode, this event will be emitted for each process 10. event.env\-updated(app, env) 11. event.env\-get\-updated(app, env) if environment is written to disk: 12. event.env\-check\-consistency(app, env) 13. event.write\-started(app, builder) \- This is called after \(ga\(gaapp.parallel_ok\(ga\(ga has been set, which must not be altered by any event handler. # The updated\-docs list can be builder dependent, but generally includes all new/changed documents, # plus any output from \(gaenv\-get\-updated\(ga, and then all \(dqparent\(dq documents in the ToC tree # For builders that output a single page, they are first joined into a single doctree before post\-transforms # or the doctree\-resolved event is emitted for docname in updated\-docs: 14. apply post\-transforms (by priority): docutils.document \-> docutils.document 15. event.doctree\-resolved(app, doctree, docname) \- In the event that any reference nodes fail to resolve, the following may emit: \- event.missing\-reference(app, env, node, contnode) \- event.warn\-missing\-reference(app, domain, node) 16. Generate output files 17. event.build\-finished(app, exception) .EE .UNINDENT .UNINDENT .sp Here is also a flow diagram of the events, within the context of the Sphinx build process: .INDENT 0.0 .INDENT 2.5 [graph]Sphinx core events flow.UNINDENT .UNINDENT .SS Core event details .sp Here is a more detailed list of these events. .INDENT 0.0 .TP .B config\-inited(app, config) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBconfig\fP \-\- \fBConfig\fP \%<#\:sphinx\:.config\:.Config> .UNINDENT .UNINDENT .sp Emitted when the config object has been initialized. .sp Added in version 1.8. .UNINDENT .INDENT 0.0 .TP .B builder\-inited(app) .INDENT 7.0 .TP .B Parameters \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .UNINDENT .sp Emitted when the builder object has been created (available as \fBapp.builder\fP). .UNINDENT .INDENT 0.0 .TP .B env\-get\-outdated(app, env, added, changed, removed) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBenv\fP \-\- \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> .IP \(bu 2 \fBadded\fP \-\- \fBSet[str]\fP .IP \(bu 2 \fBchanged\fP \-\- \fBSet[str]\fP .IP \(bu 2 \fBremoved\fP \-\- \fBSet[str]\fP .UNINDENT .TP .B Returns \fBSequence[str]\fP of additional docnames to re\-read .UNINDENT .sp Emitted when the environment determines which source files have changed and should be re\-read. \fIadded\fP, \fIchanged\fP and \fIremoved\fP are sets of docnames that the environment has determined. You can return a list of docnames to re\-read in addition to these. .sp Added in version 1.1. .UNINDENT .INDENT 0.0 .TP .B env\-purge\-doc(app, env, docname) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBenv\fP \-\- \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> .IP \(bu 2 \fBdocname\fP \-\- \fBstr\fP .UNINDENT .UNINDENT .sp Emitted when all traces of a source file should be cleaned from the environment, that is, if the source file is removed or before it is freshly read. This is for extensions that keep their own caches in attributes of the environment. .sp For example, there is a cache of all modules on the environment. When a source file has been changed, the cache\(aqs entries for the file are cleared, since the module declarations could have been removed from the file. .sp Added in version 0.5. .UNINDENT .INDENT 0.0 .TP .B env\-before\-read\-docs(app, env, docnames) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBenv\fP \-\- \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> .IP \(bu 2 \fBdocnames\fP \-\- \fBlist[str]\fP .UNINDENT .UNINDENT .sp Emitted after the environment has determined the list of all added and changed files and just before it reads them. It allows extension authors to reorder the list of docnames (\fIinplace\fP) before processing, or add more docnames that Sphinx did not consider changed (but never add any docnames that are not in \fBfound_docs\fP \%<#\:sphinx\:.environment\:.BuildEnvironment\:.found_docs>). .sp You can also remove document names; do this with caution since it will make Sphinx treat changed files as unchanged. .sp Added in version 1.3. .UNINDENT .INDENT 0.0 .TP .B source\-read(app, docname, content) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBdocname\fP \-\- \fBstr\fP .IP \(bu 2 \fBcontent\fP \-\- \fBlist[str]\fP with a single element, representing the content of the source file. .UNINDENT .UNINDENT .sp Emitted when a source file has been read. .sp You can process the \fBcontent\fP and replace this item to implement source\-level transformations. .sp For example, if you want to use \fB$\fP signs to delimit inline math, like in LaTeX, you can use a regular expression to replace \fB$...$\fP by \fB:math:\(ga...\(ga\fP\&. .sp Added in version 0.5. .UNINDENT .INDENT 0.0 .TP .B include\-read(app, relative_path, parent_docname, content) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBrelative_path\fP \-\- \fBPath\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:pathlib\:.html#\:pathlib\:.Path> representing the included file relative to the source directory \%<#\:term-source-directory>\&. .IP \(bu 2 \fBparent_docname\fP \-\- \fBstr\fP of the document name that contains the include \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:include> directive. .IP \(bu 2 \fBcontent\fP \-\- \fBlist[str]\fP with a single element, representing the content of the included file. .UNINDENT .UNINDENT .sp Emitted when a file has been read with the include \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:include> directive. .sp You can process the \fBcontent\fP and replace this item to transform the included content, as with the \fBsource\-read\fP event. .sp Added in version 7.2.5. .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 The include \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:include> directive and the \fBsource\-read\fP event. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B object\-description\-transform(app, domain, objtype, contentnode) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBdomain\fP \-\- \fBstr\fP .IP \(bu 2 \fBobjtype\fP \-\- \fBstr\fP .IP \(bu 2 \fBcontentnode\fP \-\- \fBdesc_content\fP \%<#\:sphinx\:.addnodes\:.desc_content> .UNINDENT .UNINDENT .sp Emitted when an object description directive has run. The \fIdomain\fP and \fIobjtype\fP arguments are strings indicating object description of the object. And \fIcontentnode\fP is a content for the object. It can be modified in\-place. .sp Added in version 2.4. .UNINDENT .INDENT 0.0 .TP .B doctree\-read(app, doctree) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBdoctree\fP \-\- \fBdocutils.nodes.document\fP .UNINDENT .UNINDENT .sp Emitted when a doctree has been parsed and read by the environment, and is about to be pickled. The \fBdoctree\fP can be modified in\-place. .UNINDENT .INDENT 0.0 .TP .B missing\-reference(app, env, node, contnode) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBenv\fP \-\- \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> .IP \(bu 2 \fBnode\fP \-\- The \fBpending_xref\fP \%<#\:sphinx\:.addnodes\:.pending_xref> node to be resolved. Its \fBreftype\fP, \fBreftarget\fP, \fBmodname\fP and \fBclassname\fP attributes determine the type and target of the reference. .IP \(bu 2 \fBcontnode\fP \-\- The node that carries the text and formatting inside the future reference and should be a child of the returned reference node. .UNINDENT .TP .B Returns A new node to be inserted in the document tree in place of the node, or \fBNone\fP to let other handlers try. .UNINDENT .sp Emitted when a cross\-reference to an object cannot be resolved. If the event handler can resolve the reference, it should return a new docutils node to be inserted in the document tree in place of the node \fInode\fP\&. Usually this node is a \fBreference\fP node containing \fIcontnode\fP as a child. If the handler can not resolve the cross\-reference, it can either return \fBNone\fP to let other handlers try, or raise \fBNoUri\fP to prevent other handlers in trying and suppress a warning about this cross\-reference being unresolved. .sp Added in version 0.5. .UNINDENT .INDENT 0.0 .TP .B warn\-missing\-reference(app, domain, node) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBdomain\fP \-\- The \fBDomain\fP \%<#\:sphinx\:.domains\:.Domain> of the missing reference. .IP \(bu 2 \fBnode\fP \-\- The \fBpending_xref\fP \%<#\:sphinx\:.addnodes\:.pending_xref> node that could not be resolved. .UNINDENT .TP .B Returns \fBTrue\fP if a warning was emitted, else \fBNone\fP .UNINDENT .sp Emitted when a cross\-reference to an object cannot be resolved even after \fBmissing\-reference\fP\&. If the event handler can emit warnings for the missing reference, it should return \fBTrue\fP\&. The configuration variables \fBnitpick_ignore\fP \%<#\:confval-nitpick_ignore> and \fBnitpick_ignore_regex\fP \%<#\:confval-nitpick_ignore_regex> prevent the event from being emitted for the corresponding nodes. .sp Added in version 3.4. .UNINDENT .INDENT 0.0 .TP .B doctree\-resolved(app, doctree, docname) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBdoctree\fP \-\- \fBdocutils.nodes.document\fP .IP \(bu 2 \fBdocname\fP \-\- \fBstr\fP .UNINDENT .UNINDENT .sp Emitted when a doctree has been \(dqresolved\(dq by the environment, that is, all references have been resolved and TOCs have been inserted. The \fIdoctree\fP can be modified in place. .sp Here is the place to replace custom nodes that don\(aqt have visitor methods in the writers, so that they don\(aqt cause errors when the writers encounter them. .UNINDENT .INDENT 0.0 .TP .B env\-merge\-info(app, env, docnames, other) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBenv\fP \-\- \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> .IP \(bu 2 \fBdocnames\fP \-\- \fBlist[str]\fP .IP \(bu 2 \fBother\fP \-\- \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> .UNINDENT .UNINDENT .sp This event is only emitted when parallel reading of documents is enabled. It is emitted once for every subprocess that has read some documents. .sp You must handle this event in an extension that stores data in the environment in a custom location. Otherwise the environment in the main process will not be aware of the information stored in the subprocess. .sp \fIother\fP is the environment object from the subprocess, \fIenv\fP is the environment from the main process. \fIdocnames\fP is a set of document names that have been read in the subprocess. .sp Added in version 1.3. .UNINDENT .INDENT 0.0 .TP .B env\-updated(app, env) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBenv\fP \-\- \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> .UNINDENT .TP .B Returns iterable of \fBstr\fP .UNINDENT .sp Emitted after reading all documents, when the environment and all doctrees are now up\-to\-date. .sp You can return an iterable of docnames from the handler. These documents will then be considered updated, and will be (re\-)written during the writing phase. .sp Added in version 0.5. .sp Changed in version 1.3: The handlers\(aq return value is now used. .UNINDENT .INDENT 0.0 .TP .B env\-get\-updated(app, env) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBenv\fP \-\- \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> .UNINDENT .TP .B Returns iterable of \fBstr\fP .UNINDENT .sp Emitted when the environment determines which source files have changed and should be re\-read. You can return an iterable of docnames to re\-read. .UNINDENT .INDENT 0.0 .TP .B env\-check\-consistency(app, env) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBenv\fP \-\- \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> .UNINDENT .UNINDENT .sp Emitted when Consistency checks phase. You can check consistency of metadata for whole of documents. .sp Added in version 1.6. .UNINDENT .INDENT 0.0 .TP .B write\-started(app, builder) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBbuilder\fP \-\- \fBBuilder\fP \%<#\:sphinx\:.builders\:.Builder> .UNINDENT .UNINDENT .sp Emitted before the builder starts to resolve and write documents. .sp Added in version 7.4. .UNINDENT .INDENT 0.0 .TP .B build\-finished(app, exception) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBexception\fP \-\- \fBException\fP or \fBNone\fP .UNINDENT .UNINDENT .sp Emitted when a build has finished, before Sphinx exits, usually used for cleanup. This event is emitted even when the build process raised an exception, given as the \fIexception\fP argument. The exception is reraised in the application after the event handlers have run. If the build process raised no exception, \fIexception\fP will be \fBNone\fP\&. This allows to customize cleanup actions depending on the exception status. .sp Added in version 0.5. .UNINDENT .SS Builder specific events .sp These events are emitted by specific builders. .INDENT 0.0 .TP .B html\-collect\-pages(app) .INDENT 7.0 .TP .B Parameters \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .TP .B Returns iterable of \fB(pagename, context, templatename)\fP where \fIpagename\fP and \fItemplatename\fP are strings and \fIcontext\fP is a \fBdict[str, Any]\fP\&. .UNINDENT .sp Emitted when the HTML builder is starting to write non\-document pages. .sp You can add pages to write by returning an iterable from this event. .sp Added in version 1.0. .UNINDENT .INDENT 0.0 .TP .B html\-page\-context(app, pagename, templatename, context, doctree) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBpagename\fP \-\- \fBstr\fP .IP \(bu 2 \fBtemplatename\fP \-\- \fBstr\fP .IP \(bu 2 \fBcontext\fP \-\- \fBdict[str, Any]\fP .IP \(bu 2 \fBdoctree\fP \-\- \fBdocutils.nodes.document\fP or \fBNone\fP .UNINDENT .TP .B Returns \fBstr\fP or \fBNone\fP .UNINDENT .sp Emitted when the HTML builder has created a context dictionary to render a template with \-\- this can be used to add custom elements to the context. .sp The \fIpagename\fP argument is the canonical name of the page being rendered, that is, without \fB\&.html\fP suffix and using slashes as path separators. The \fItemplatename\fP is the name of the template to render, this will be \fB\(aqpage.html\(aq\fP for all pages from reStructuredText documents. .sp The \fIcontext\fP argument is a dictionary of values that are given to the template engine to render the page and can be modified to include custom values. .sp The \fIdoctree\fP argument will be a doctree when the page is created from a reStructuredText documents; it will be \fBNone\fP when the page is created from an HTML template alone. .sp You can return a string from the handler, it will then replace \fB\(aqpage.html\(aq\fP as the HTML template for this page. .sp \fBTip:\fP .INDENT 7.0 .INDENT 3.5 You can install JS/CSS files for the specific page via \fBSphinx.add_js_file()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_js_file> and \fBSphinx.add_css_file()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_css_file> (since v3.5.0). .UNINDENT .UNINDENT .sp Added in version 0.4. .sp Changed in version 1.3: The return value can now specify a template name. .UNINDENT .INDENT 0.0 .TP .B linkcheck\-process\-uri(app, uri) .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBapp\fP \-\- \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> .IP \(bu 2 \fBuri\fP \-\- \fBstr\fP of the collected URI .UNINDENT .TP .B Returns \fBstr\fP or \fBNone\fP .UNINDENT .sp Emitted when the linkcheck builder collects hyperlinks from document. .sp The event handlers can modify the URI by returning a string. .sp Added in version 4.1. .UNINDENT .SS Project API .INDENT 0.0 .TP .B class sphinx.project.Project(srcdir: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | os.PathLike \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.PathLike>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], source_suffix: Iterable[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]) A project is the source code set of the Sphinx document(s). .INDENT 7.0 .TP .B discover(exclude_paths: Iterable[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] = (), include_paths: Iterable[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] = (\(aq**\(aq,)) -> set \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:set>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] Find all document files in the source directory and put them in \fBdocnames\fP\&. .UNINDENT .INDENT 7.0 .TP .B doc2path(docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, absolute: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool>) -> _StrPath Return the filename for the document name. .sp If \fIabsolute\fP is True, return as an absolute path. Else, return as a relative path to the source directory. .UNINDENT .INDENT 7.0 .TP .B path2doc(filename: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | PathLike \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.PathLike>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]) -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Return the docname for the filename if the file is a document. .sp \fIfilename\fP should be absolute or relative to the source directory. .UNINDENT .INDENT 7.0 .TP .B restore(other: Project \%<#\:sphinx\:.project\:.Project>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Take over a result of last build. .UNINDENT .INDENT 7.0 .TP .B docnames: set \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:set>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] The name of documents belonging to this project. .UNINDENT .INDENT 7.0 .TP .B source_suffix source_suffix. Same as \fBsource_suffix\fP \%<#\:confval-source_suffix>\&. .UNINDENT .INDENT 7.0 .TP .B srcdir Source directory. .UNINDENT .UNINDENT .SS Build environment API .INDENT 0.0 .TP .B class sphinx.environment.BuildEnvironment \fBAttributes\fP .INDENT 7.0 .TP .B app Reference to the \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> (application) object. .UNINDENT .INDENT 7.0 .TP .B config Reference to the \fBConfig\fP \%<#\:sphinx\:.config\:.Config> object. .UNINDENT .INDENT 7.0 .TP .B project Target project. See \fBProject\fP \%<#\:sphinx\:.project\:.Project>\&. .UNINDENT .INDENT 7.0 .TP .B srcdir Source directory. .UNINDENT .INDENT 7.0 .TP .B doctreedir Directory for storing pickled doctrees. .UNINDENT .INDENT 7.0 .TP .B events An \fBEventManager\fP \%<#\:sphinx\:.events\:.EventManager> object. .UNINDENT .INDENT 7.0 .TP .B found_docs A set of all existing docnames. .UNINDENT .INDENT 7.0 .TP .B metadata Dictionary mapping docnames to \(dqmetadata\(dq (see File\-wide metadata \%<#\:metadata>). .UNINDENT .INDENT 7.0 .TP .B titles Dictionary mapping docnames to the docutils node for their main title. .UNINDENT .INDENT 7.0 .TP .B docname Returns the docname of the document currently being parsed. .UNINDENT .INDENT 7.0 .TP .B parser Returns the parser being used for to parse the current document. .UNINDENT .sp \fBPer\-document attributes\fP .INDENT 7.0 .TP .B current_document Temporary data storage while reading a document. .sp Extensions may use the mapping interface provided by \fBenv.current_document\fP to store data relating to the current document, but should use a unique prefix to avoid name clashes. .sp \fBImportant:\fP .INDENT 7.0 .INDENT 3.5 Only the following attributes constitute the public API. The type itself and any methods or other attributes remain private, experimental, and will be changed or removed without notice. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B current_document.docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> The document name (\(aqdocname\(aq) for the current document. .UNINDENT .INDENT 7.0 .TP .B current_document.default_role: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> The default role for the current document. Set by the default\-role \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:default-role> directive. .UNINDENT .INDENT 7.0 .TP .B current_document.default_domain: Domain \%<#\:sphinx\:.domains\:.Domain> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> The default domain for the current document. Set by the \fBdefault\-domain\fP \%<#\:directive-default-domain> directive. .UNINDENT .INDENT 7.0 .TP .B current_document.highlight_language: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> The default language for syntax highlighting. Set by the \fBhighlight\fP \%<#\:directive-highlight> directive to override the \fBhighlight_language\fP \%<#\:confval-highlight_language> config value. .UNINDENT .INDENT 7.0 .TP .B current_document._parser: Parser \%<#\:sphinx\:.parsers\:.Parser> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> \fIThis attribute is experimental and may be changed without notice.\fP .sp The parser being used to parse the current document. .UNINDENT .UNINDENT .sp \fBUtility methods\fP .INDENT 7.0 .TP .B doc2path(docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, base: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = True) -> _StrPath Return the filename for the document name. .sp If \fIbase\fP is True, return absolute path under self.srcdir. If \fIbase\fP is False, return relative path to self.srcdir. .UNINDENT .INDENT 7.0 .TP .B relfn2path(filename: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | Path \%<https://\:docs\:.python\:.org/\:3/\:library/\:pathlib\:.html#\:pathlib\:.Path>, docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None) -> tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] Return paths to a file referenced from a document, relative to documentation root and absolute. .sp In the input \(dqfilename\(dq, absolute filenames are taken as relative to the source dir, while relative filenames are relative to the dir of the containing document. .UNINDENT .INDENT 7.0 .TP .B note_dependency(filename: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | PathLike \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.PathLike>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], *, docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Add \fIfilename\fP as a dependency of the current document. .sp This means that the document will be rebuilt if this file changes. .sp \fIfilename\fP should be absolute or relative to the source directory. .UNINDENT .INDENT 7.0 .TP .B new_serialno(category: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> Return a serial number, e.g. for index entry targets. .sp The number is guaranteed to be unique in the current document. .UNINDENT .INDENT 7.0 .TP .B note_reread() -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Add the current document to the list of documents that will automatically be re\-read at the next build. .UNINDENT .UNINDENT .SS Builder API .INDENT 0.0 .TP .B class sphinx.builders.Builder This is the base class for all builders. .sp It follows this basic workflow: .INDENT 7.0 .INDENT 2.5 [graph]Call graph for the standard Sphinx build workflow.UNINDENT .UNINDENT .sp Overridable Attributes .sp These class attributes should be set on builder sub\-classes: .INDENT 7.0 .TP .B name: ClassVar[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] = \(aq\(aq The builder\(aqs name. This is the value used to select builders on the command line. .UNINDENT .INDENT 7.0 .TP .B format: ClassVar[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] = \(aq\(aq The builder\(aqs output format, or \(aq\(aq if no document output is produced. This is commonly the file extension, e.g. \(dqhtml\(dq, though any string value is accepted. The builder\(aqs format string can be used by various components such as \fBSphinxPostTransform\fP \%<#\:sphinx\:.transforms\:.post_transforms\:.SphinxPostTransform> or extensions to determine their compatibility with the builder. .UNINDENT .INDENT 7.0 .TP .B epilog: ClassVar[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] = \(aq\(aq The message emitted upon successful build completion. This can be a printf\-style template string with the following keys: \fBoutdir\fP, \fBproject\fP .UNINDENT .INDENT 7.0 .TP .B allow_parallel: ClassVar[bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool>] = False Whether it is safe to make parallel \fBwrite_doc()\fP calls. .UNINDENT .INDENT 7.0 .TP .B supported_image_types: ClassVar[list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]] = [] The list of MIME types of image formats supported by the builder. Image files are searched in the order in which they appear here. .UNINDENT .INDENT 7.0 .TP .B supported_remote_images: ClassVar[bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool>] = False The builder can produce output documents that may fetch external images when opened. .UNINDENT .INDENT 7.0 .TP .B supported_data_uri_images: ClassVar[bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool>] = False The file format produced by the builder allows images to be embedded using data\-URIs. .UNINDENT .INDENT 7.0 .TP .B default_translator_class: ClassVar[type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[nodes.NodeVisitor]] default translator class for the builder. This can be overridden by \fBset_translator()\fP \%<#\:sphinx\:.application\:.Sphinx\:.set_translator>\&. .UNINDENT .sp Core Methods .sp These methods define the core build workflow and must not be overridden: .INDENT 7.0 .TP .B final build_all() -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Build all source files. .UNINDENT .INDENT 7.0 .TP .B final build_specific(filenames: Sequence[Path]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Only rebuild as much as needed for changes in the \fIfilenames\fP\&. .UNINDENT .INDENT 7.0 .TP .B final build_update() -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Only rebuild what was changed or added since last build. .UNINDENT .INDENT 7.0 .TP .B final build(docnames: Iterable[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>, summary: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, method: Literal[\(aqall\(aq, \(aqspecific\(aq, \(aqupdate\(aq] = \(aqupdate\(aq) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Main build method, usually called by a specific \fBbuild_*\fP method. .sp First updates the environment, and then calls \fBwrite()\fP\&. .UNINDENT .INDENT 7.0 .TP .B final read() -> list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] (Re\-)read all files new or changed since last update. .sp Store all environment docnames in the canonical format (ie using SEP as a separator in place of os.path.sep). .UNINDENT .INDENT 7.0 .TP .B final read_doc(docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, *, _cache: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = True) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Parse a file and add/update inventory entries for the doctree. .UNINDENT .INDENT 7.0 .TP .B final write_doctree(docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, doctree: document, *, _cache: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = True) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Write the doctree to a file, to be used as a cache by re\-builds. .UNINDENT .INDENT 7.0 .TP .B final write(build_docnames: Iterable[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>, updated_docnames: Iterable[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], method: Literal[\(aqall\(aq, \(aqspecific\(aq, \(aqupdate\(aq] = \(aqupdate\(aq) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Write builder specific output files. .UNINDENT .sp Abstract Methods .sp These must be implemented in builder sub\-classes: .INDENT 7.0 .TP .B get_outdated_docs() -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | Iterable[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] Return an iterable of output files that are outdated, or a string describing what an update build will build. .sp If the builder does not output individual files corresponding to source files, return a string here. If it does, return an iterable of those files that need to be written. .UNINDENT .INDENT 7.0 .TP .B write_doc(docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, doctree: document) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Write the output file for the document .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBdocname\fP \-\- the docname \%<#\:term-document-name>\&. .IP \(bu 2 \fBdoctree\fP \-\- defines the content to be written. .UNINDENT .UNINDENT .sp The output filename must be determined within this method, typically by calling \fBget_target_uri()\fP or \fBget_relative_uri()\fP\&. .UNINDENT .INDENT 7.0 .TP .B get_target_uri(docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, typ: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None) -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Return the target URI for a document name. .sp \fItyp\fP can be used to qualify the link characteristic for individual builders. .UNINDENT .sp Overridable Methods .sp These methods can be overridden in builder sub\-classes: .INDENT 7.0 .TP .B init() -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Load necessary templates and perform initialization. The default implementation does nothing. .UNINDENT .INDENT 7.0 .TP .B write_documents(docnames: Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Write all documents in \fIdocnames\fP\&. .sp This method can be overridden if a builder does not create output files for each document. .UNINDENT .INDENT 7.0 .TP .B prepare_writing(docnames: Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> A place where you can add logic before \fBwrite_doc()\fP is run .UNINDENT .INDENT 7.0 .TP .B copy_assets() -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Where assets (images, static files, etc) are copied before writing .UNINDENT .INDENT 7.0 .TP .B get_relative_uri(from_: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, to: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, typ: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None) -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Return a relative URI between two source filenames. .INDENT 7.0 .TP .B Raises \fBNoUri\fP if there\(aqs no way to return a sensible URI. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B finish() -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Finish the building process. .sp The default implementation does nothing. .UNINDENT .sp Attributes .sp Attributes that are callable from the builder instance: .INDENT 7.0 .TP .B events An \fBEventManager\fP \%<#\:sphinx\:.events\:.EventManager> object. .UNINDENT .sp Overridable Attributes (extensions) .sp Builder sub\-classes can set these attributes to support built\-in extensions: .INDENT 7.0 .TP .B supported_linkcode: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> By default, the \fBlinkcode\fP \%<#\:module-sphinx\:.ext\:.linkcode> extension will only inject references for an \fBhtml\fP builder. The \fBsupported_linkcode\fP class attribute can be defined in a non\-HTML builder to support managing references generated by linkcode. The expected value for this attribute is an expression which is compatible with \fBonly\fP \%<#\:directive-only>\&. .sp For example, if a builder was named \fBcustom\-builder\fP, the following can be used: .INDENT 7.0 .INDENT 3.5 .sp .EX class CustomBuilder(Builder): supported_linkcode = \(aqcustom\-builder\(aq ... .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS Event Manager API .INDENT 0.0 .TP .B class sphinx.events.EventManager(app: Sphinx \%<#\:sphinx\:.application\:.Sphinx>) Event manager for Sphinx. .INDENT 7.0 .TP .B add(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Register a custom Sphinx event called \fIname\fP\&. .sp This is needed to be able to emit the event. .INDENT 7.0 .TP .B Parameters \fBname\fP \-\- The name of the event. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B connect(name: Literal[\(aqconfig\-inited\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, Config \%<#\:sphinx\:.config\:.Config>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqbuilder\-inited\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqenv\-get\-outdated\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], Sequence[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqenv\-before\-read\-docs\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqenv\-purge\-doc\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqsource\-read\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqinclude\-read\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, Path, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqdoctree\-read\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, nodes.document], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqenv\-merge\-info\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqenv\-updated\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqenv\-get\-updated\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>], Iterable[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqenv\-check\-consistency\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqwrite\-started\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, Builder \%<#\:sphinx\:.builders\:.Builder>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqdoctree\-resolved\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, nodes.document, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqmissing\-reference\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, addnodes.pending_xref \%<#\:sphinx\:.addnodes\:.pending_xref>, nodes.TextElement], nodes.reference | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqwarn\-missing\-reference\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, Domain \%<#\:sphinx\:.domains\:.Domain>, addnodes.pending_xref \%<#\:sphinx\:.addnodes\:.pending_xref>], bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqbuild\-finished\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, Exception \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:Exception> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqhtml\-collect\-pages\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>], Iterable[tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]]], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqhtml\-page\-context\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any], nodes.document], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqlinkcheck\-process\-uri\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqobject\-description\-transform\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, addnodes.desc_content \%<#\:sphinx\:.addnodes\:.desc_content>], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqautodoc\-process\-docstring\(aq], callback: _AutodocProcessDocstringListener, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqautodoc\-before\-process\-signature\(aq], callback: _AutodocBeforeProcessSignatureListener, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqautodoc\-process\-signature\(aq], callback: _AutodocProcessSignatureListener, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqautodoc\-process\-bases\(aq], callback: _AutodocProcessBasesListener, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqautodoc\-skip\-member\(aq], callback: _AutodocSkipMemberListener, priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqtodo\-defined\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, todo_node], None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqviewcode\-find\-source\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[Literal[\(aqclass\(aq, \(aqdef\(aq, \(aqother\(aq], int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>, int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>]]]], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: Literal[\(aqviewcode\-follow\-imported\(aq], callback: Callable[[Sphinx \%<#\:sphinx\:.application\:.Sphinx>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> .TP .B connect(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, callback: Callable[\&..., Any], priority: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> Connect a handler to specific event. .sp Register \fIcallback\fP to be called when the \fIname\fP event is emitted. .sp See event callbacks \%<#\:events> for details on available core events and the arguments of their corresponding callback functions. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP \-\- The name of the target event. .IP \(bu 2 \fBcallback\fP \-\- Callback function for the event. .IP \(bu 2 \fBpriority\fP \-\- The priority of the callback. The callbacks will be invoked in ascending order of \fIpriority\fP\&. .UNINDENT .TP .B Returns A listener ID, for use with the \fBdisconnect()\fP method. .UNINDENT .sp Changed in version 3.0: Support \fIpriority\fP .UNINDENT .INDENT 7.0 .TP .B disconnect(listener_id: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Disconnect the handler given by \fIlistener_id\fP\&. .INDENT 7.0 .TP .B Parameters \fBlistener_id\fP \-\- A listener_id previously returned by \fBconnect()\fP\&. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B emit(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, *args: Any, allowed_exceptions: tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Exception \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:Exception>], \&...] = ()) -> list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[Any] Emit a Sphinx event. .sp This emits the \fIname\fP event and passes \fIargs\fP to the handler functions. Return the return values of all handlers as a list. Do not emit core Sphinx events in extensions! .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP \-\- The name of the event that will be emitted. .IP \(bu 2 \fBargs\fP \-\- The arguments for the event, to be passed to the handler functions. .IP \(bu 2 \fBallowed_exceptions\fP \-\- The list of exceptions that are allowed in the handlers. .UNINDENT .UNINDENT .sp Changed in version 3.1: Added \fIallowed_exceptions\fP to specify path\-through exceptions .UNINDENT .INDENT 7.0 .TP .B emit_firstresult(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, *args: Any, allowed_exceptions: tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Exception \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:Exception>], \&...] = ()) -> Any Emit a Sphinx event and return the first result. .sp This emits the \fIname\fP event and passes \fIargs\fP to the handler functions. The first non\-None result is returned. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBname\fP \-\- The name of the event that will be emitted. .IP \(bu 2 \fBargs\fP \-\- The arguments for the event, to be passed to the handler functions. .IP \(bu 2 \fBallowed_exceptions\fP \-\- The list of exceptions that are allowed in the handlers. .UNINDENT .UNINDENT .sp Added in version 0.5. .sp Changed in version 3.1: Added \fIallowed_exceptions\fP to specify path\-through exceptions .UNINDENT .UNINDENT .SS Environment Collector API .INDENT 0.0 .TP .B class sphinx.environment.collectors.EnvironmentCollector An EnvironmentCollector is a specific data collector from each document. .sp It gathers data and stores \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> as a database. Examples of specific data would be images, download files, section titles, metadatas, index entries and toctrees, etc. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 This class essentially wraps a sub\-set of Sphinx event callbacks \%<#\:events>\&. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B clear_doc(app: Sphinx \%<#\:sphinx\:.application\:.Sphinx>, env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Remove specified data of a document. .sp This method is called on the removal of the document. .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBenv\-purge\-doc\fP \%<#\:event-env-purge-doc> .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_outdated_docs(app: Sphinx \%<#\:sphinx\:.application\:.Sphinx>, env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, added: set \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:set>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], changed: set \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:set>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], removed: set \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:set>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]) -> list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] Return a list of docnames to re\-read. .sp This method is called before reading the documents. .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBenv\-get\-outdated\fP \%<#\:event-env-get-outdated> .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_updated_docs(app: Sphinx \%<#\:sphinx\:.application\:.Sphinx>, env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>) -> list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] Return a list of docnames to re\-read. .sp This method is called after reading the whole of documents. .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBenv\-get\-updated\fP \%<#\:event-env-get-updated> .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B merge_other(app: Sphinx \%<#\:sphinx\:.application\:.Sphinx>, env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, docnames: Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], other: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Merge in specified data regarding docnames from a different \fIBuildEnvironment\fP object which coming from a subprocess in parallel builds. .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBenv\-merge\-info\fP \%<#\:event-env-merge-info> .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B process_doc(app: Sphinx \%<#\:sphinx\:.application\:.Sphinx>, doctree: nodes.document) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Process a document and gather specific data from it. .sp This method is called after the document is read. .sp \fBSee also:\fP .INDENT 7.0 .INDENT 3.5 \fBdoctree\-read\fP \%<#\:event-doctree-read> .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS Docutils markup API .sp This section describes the API for adding reStructuredText markup elements (roles and directives). .SS Roles .sp Roles follow the interface described below. They have to be registered by an extension using \fBSphinx.add_role()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_role> or \fBSphinx.add_role_to_domain()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_role_to_domain>\&. .INDENT 0.0 .INDENT 3.5 .sp .EX def role_function( role_name: str, raw_source: str, text: str, lineno: int, inliner: Inliner, options: dict = {}, content: list = [], ) \-> tuple[list[Node], list[system_message]]: elements = [] messages = [] return elements, messages .EE .UNINDENT .UNINDENT .sp The \fIoptions\fP and \fIcontent\fP parameters are only used for custom roles created via the role \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:role> directive. The return value is a tuple of two lists, the first containing the text nodes and elements from the role, and the second containing any system messages generated. For more information, see the custom role overview \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:howto/\:rst-roles\:.html> from Docutils. .SS Creating custom roles .sp Sphinx provides two base classes for creating custom roles, \fBSphinxRole\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxRole> and \fBReferenceRole\fP \%<#\:sphinx\:.util\:.docutils\:.ReferenceRole>\&. .sp These provide a class\-based interface for creating roles, where the main logic must be implemented in your \fBrun()\fP method. The classes provide a number of useful methods and attributes, such as \fBself.text\fP, \fBself.config\fP, and \fBself.env\fP\&. The \fBReferenceRole\fP class implements Sphinx\(aqs \fBtitle <target>\fP logic, exposing \fBself.target\fP and \fBself.title\fP attributes. This is useful for creating cross\-reference roles. .SS Directives .sp Directives are handled by classes derived from \fBdocutils.parsers.rst.Directive\fP\&. They have to be registered by an extension using \fBSphinx.add_directive()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_directive> or \fBSphinx.add_directive_to_domain()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_directive_to_domain>\&. .INDENT 0.0 .TP .B class docutils.parsers.rst.Directive The markup syntax of the new directive is determined by the follow five class attributes: .INDENT 7.0 .TP .B required_arguments = 0 Number of required directive arguments. .UNINDENT .INDENT 7.0 .TP .B optional_arguments = 0 Number of optional arguments after the required arguments. .UNINDENT .INDENT 7.0 .TP .B final_argument_whitespace = False May the final argument contain whitespace? .UNINDENT .INDENT 7.0 .TP .B option_spec = None Mapping of option names to validator functions. .sp Option validator functions take a single parameter, the option argument (or \fBNone\fP if not given), and should validate it or convert it to the proper form. They raise \fBValueError\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:ValueError> or \fBTypeError\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:TypeError> to indicate failure. .sp There are several predefined and possibly useful validators in the \fBdocutils.parsers.rst.directives\fP module. .UNINDENT .INDENT 7.0 .TP .B has_content = False May the directive have content? .UNINDENT .sp New directives must implement the \fBrun()\fP method: .INDENT 7.0 .TP .B run() This method must process the directive arguments, options and content, and return a list of Docutils/Sphinx nodes that will be inserted into the document tree at the point where the directive was encountered. .UNINDENT .sp Instance attributes that are always set on the directive are: .INDENT 7.0 .TP .B name The directive name (useful when registering the same directive class under multiple names). .UNINDENT .INDENT 7.0 .TP .B arguments The arguments given to the directive, as a list. .UNINDENT .INDENT 7.0 .TP .B options The options given to the directive, as a dictionary mapping option names to validated/converted values. .UNINDENT .INDENT 7.0 .TP .B content The directive content, if given, as a \fBViewList\fP\&. .UNINDENT .INDENT 7.0 .TP .B lineno The absolute line number on which the directive appeared. This is not always a useful value; use \fBsrcline\fP instead. .UNINDENT .INDENT 7.0 .TP .B content_offset Internal offset of the directive content. Used when calling \fBnested_parse\fP (see below). .UNINDENT .INDENT 7.0 .TP .B block_text The string containing the entire directive. .UNINDENT .INDENT 7.0 .TP .B state .TP .B state_machine The state and state machine which controls the parsing. Used for \fBnested_parse\fP\&. .UNINDENT .UNINDENT .sp \fBSee also:\fP .INDENT 0.0 .INDENT 3.5 Creating directives \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:howto/\:rst-directives\:.html> HOWTO of the Docutils documentation .UNINDENT .UNINDENT .SS Parsing directive content as reStructuredText .sp Many directives will contain more markup that must be parsed. To do this, use one of the following APIs from the \fBrun()\fP method: .INDENT 0.0 .IP \(bu 2 \fBSphinxDirective.parse_content_to_nodes()\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxDirective\:.parse_content_to_nodes> .IP \(bu 2 \fBSphinxDirective.parse_text_to_nodes()\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxDirective\:.parse_text_to_nodes> .UNINDENT .sp The first method parses all the directive\(aqs content as markup, whilst the second only parses the given \fItext\fP string. Both methods return the parsed Docutils nodes in a list. .sp The methods are used as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX def run(self) \-> list[Node]: # either parsed = self.parse_content_to_nodes() # or parsed = self.parse_text_to_nodes(\(aqspam spam spam\(aq) return parsed .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The above utility methods were added in Sphinx 7.4. Prior to Sphinx 7.4, the following methods should be used to parse content: .INDENT 0.0 .IP \(bu 2 \fBself.state.nested_parse\fP .IP \(bu 2 \fBsphinx.util.nodes.nested_parse_with_titles()\fP \-\- this allows titles in the parsed content. .UNINDENT .INDENT 0.0 .INDENT 3.5 .sp .EX def run(self) \-> list[Node]: container = docutils.nodes.Element() # either nested_parse_with_titles(self.state, self.result, container, self.content_offset) # or self.state.nested_parse(self.result, self.content_offset, container) parsed = container.children return parsed .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To parse inline markup, use \fBparse_inline()\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxDirective\:.parse_inline>\&. This must only be used for text which is a single line or paragraph, and does not contain any structural elements (headings, transitions, directives, etc). .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 \fBsphinx.util.docutils.switch_source_input()\fP allows changing the source (input) file during parsing content in a directive. It is useful to parse mixed content, such as in \fBsphinx.ext.autodoc\fP, where it is used to parse docstrings. .INDENT 0.0 .INDENT 3.5 .sp .EX from sphinx.util.docutils import switch_source_input from sphinx.util.parsing import nested_parse_to_nodes # Switch source_input between parsing content. # Inside this context, all parsing errors and warnings are reported as # happened in new source_input (in this case, \(ga\(gaself.result\(ga\(ga). with switch_source_input(self.state, self.result): parsed = nested_parse_to_nodes(self.state, self.result) .EE .UNINDENT .UNINDENT .sp Deprecated since version 1.7: Until Sphinx 1.6, \fBsphinx.ext.autodoc.AutodocReporter\fP was used for this purpose. It is replaced by \fBswitch_source_input()\fP\&. .UNINDENT .UNINDENT .SS ViewLists and StringLists .sp Docutils represents document source lines in a \fBStringList\fP class, which inherits from \fBViewList\fP, both in the \fBdocutils.statemachine\fP module. This is a list with extended functionality, including that slicing creates views of the original list and that the list contains information about source line numbers. .sp The \fBDirective.content\fP attribute is a \fBStringList\fP\&. If you generate content to be parsed as reStructuredText, you have to create a \fBStringList\fP for the Docutils APIs. The utility functions provided by Sphinx handle this automatically. Important for content generation are the following points: .INDENT 0.0 .IP \(bu 2 The \fBViewList\fP constructor takes a list of strings (lines) and a source (document) name. .IP \(bu 2 The \fBViewList.append()\fP method takes a line and a source name as well. .UNINDENT .SS Domain API .INDENT 0.0 .TP .B class sphinx.domains.Domain(env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>) A Domain is meant to be a group of \(dqobject\(dq description directives for objects of a similar nature, and corresponding roles to create references to them. Examples would be Python modules, classes, functions etc., elements of a templating language, Sphinx roles and directives, etc. .sp Each domain has a separate storage for information about existing objects and how to reference them in \fIself.data\fP, which must be a dictionary. It also must implement several functions that expose the object information in a uniform way to parts of Sphinx that allow the user to reference or search for objects in a domain\-agnostic way. .sp About \fIself.data\fP: since all object and cross\-referencing information is stored on a BuildEnvironment instance, the \fIdomain.data\fP object is also stored in the \fIenv.domaindata\fP dict under the key \fIdomain.name\fP\&. Before the build process starts, every active domain is instantiated and given the environment object; the \fIdomaindata\fP dict must then either be nonexistent or a dictionary whose \(aqversion\(aq key is equal to the domain class\(aq \fBdata_version\fP attribute. Otherwise, \fIOSError\fP is raised and the pickled environment is discarded. .INDENT 7.0 .TP .B add_object_type(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, objtype: ObjType \%<#\:sphinx\:.domains\:.ObjType>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Add an object type. .UNINDENT .INDENT 7.0 .TP .B check_consistency() -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Do consistency checks (\fBexperimental\fP). .UNINDENT .INDENT 7.0 .TP .B clear_doc(docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Remove traces of a document in the domain\-specific inventories. .UNINDENT .INDENT 7.0 .TP .B directive(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) -> type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Directive \%<#\:docutils\:.parsers\:.rst\:.Directive>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Return a directive adapter class that always gives the registered directive its full name (\(aqdomain:name\(aq) as \fBself.name\fP\&. .UNINDENT .INDENT 7.0 .TP .B get_enumerable_node_type(node: Node) -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Get type of enumerable nodes (experimental). .UNINDENT .INDENT 7.0 .TP .B get_full_qualified_name(node: Element) -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Return full qualified name for given node. .UNINDENT .INDENT 7.0 .TP .B get_objects() -> Iterable[tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>]] Return an iterable of \(dqobject descriptions\(dq. .sp Object descriptions are tuples with six items: .INDENT 7.0 .TP .B \fBname\fP Fully qualified name. .TP .B \fBdispname\fP Name to display when searching/linking. .TP .B \fBtype\fP Object type, a key in \fBself.object_types\fP\&. .TP .B \fBdocname\fP The document where it is to be found. .TP .B \fBanchor\fP The anchor name for the object. .TP .B \fBpriority\fP How \(dqimportant\(dq the object is (determines placement in search results). One of: .INDENT 7.0 .TP .B \fB1\fP Default priority (placed before full\-text matches). .TP .B \fB0\fP Object is important (placed before default\-priority objects). .TP .B \fB2\fP Object is unimportant (placed after full\-text matches). .TP .B \fB\-1\fP Object should not show up in search at all. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_type_name(type: ObjType \%<#\:sphinx\:.domains\:.ObjType>, primary: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Return full name for given ObjType. .UNINDENT .INDENT 7.0 .TP .B merge_domaindata(docnames: Set[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], otherdata: dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any]) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Merge in data regarding \fIdocnames\fP from a different domaindata inventory (coming from a subprocess in parallel builds). .UNINDENT .INDENT 7.0 .TP .B process_doc(env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, document: nodes.document) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Process a document after it is read by the environment. .UNINDENT .INDENT 7.0 .TP .B process_field_xref(pnode: pending_xref \%<#\:sphinx\:.addnodes\:.pending_xref>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Process a pending xref created in a doc field. For example, attach information about the current scope. .UNINDENT .INDENT 7.0 .TP .B resolve_any_xref(env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, fromdocname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, builder: Builder \%<#\:sphinx\:.builders\:.Builder>, target: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, node: pending_xref \%<#\:sphinx\:.addnodes\:.pending_xref>, contnode: Element) -> list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, nodes.reference]] Resolve the pending_xref \fInode\fP with the given \fItarget\fP\&. .sp The reference comes from an \(dqany\(dq or similar role, which means that we don\(aqt know the type. Otherwise, the arguments are the same as for \fBresolve_xref()\fP\&. .sp The method must return a list (potentially empty) of tuples \fB(\(aqdomain:role\(aq, newnode)\fP, where \fB\(aqdomain:role\(aq\fP is the name of a role that could have created the same reference, e.g. \fB\(aqpy:func\(aq\fP\&. \fBnewnode\fP is what \fBresolve_xref()\fP would return. .sp Added in version 1.3. .UNINDENT .INDENT 7.0 .TP .B resolve_xref(env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>, fromdocname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, builder: Builder \%<#\:sphinx\:.builders\:.Builder>, typ: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, target: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, node: pending_xref \%<#\:sphinx\:.addnodes\:.pending_xref>, contnode: Element) -> nodes.reference | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Resolve the pending_xref \fInode\fP with the given \fItyp\fP and \fItarget\fP\&. .sp This method should return a new node, to replace the xref node, containing the \fIcontnode\fP which is the markup content of the cross\-reference. .sp If no resolution can be found, None can be returned; the xref node will then given to the \fBmissing\-reference\fP \%<#\:event-missing-reference> event, and if that yields no resolution, replaced by \fIcontnode\fP\&. .sp The method can also raise \fBsphinx.environment.NoUri\fP to suppress the \fBmissing\-reference\fP \%<#\:event-missing-reference> event being emitted. .UNINDENT .INDENT 7.0 .TP .B role(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) -> RoleFunction | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Return a role adapter function that always gives the registered role its full name (\(aqdomain:name\(aq) as the first argument. .UNINDENT .INDENT 7.0 .TP .B setup() -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Set up domain object. .UNINDENT .INDENT 7.0 .TP .B dangling_warnings: ClassVar[dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]] = {} role name \-> a warning message if reference is missing .UNINDENT .INDENT 7.0 .TP .B data: dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any] data value .UNINDENT .INDENT 7.0 .TP .B data_version: ClassVar[int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>] = 0 data version, bump this when the format of \fIself.data\fP changes .UNINDENT .INDENT 7.0 .TP .B directives: ClassVar[dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Directive \%<#\:docutils\:.parsers\:.rst\:.Directive>]]] = {} directive name \-> directive class .UNINDENT .INDENT 7.0 .TP .B enumerable_nodes: ClassVar[dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Node], tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, TitleGetter | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>]]] = {} node_class \-> (enum_node_type, title_getter) .UNINDENT .INDENT 7.0 .TP .B indices: ClassVar[list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[Index \%<#\:sphinx\:.domains\:.Index>]]] = [] a list of Index subclasses .UNINDENT .INDENT 7.0 .TP .B initial_data: ClassVar[dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any]] = {} data value for a fresh environment .UNINDENT .INDENT 7.0 .TP .B label: ClassVar[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] = \(aq\(aq domain label: longer, more descriptive (used in messages) .UNINDENT .INDENT 7.0 .TP .B name: ClassVar[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] = \(aq\(aq domain name: should be short, but unique .UNINDENT .INDENT 7.0 .TP .B object_types: ClassVar[dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, ObjType \%<#\:sphinx\:.domains\:.ObjType>]] = {} type (usually directive) name \-> ObjType instance .UNINDENT .INDENT 7.0 .TP .B roles: ClassVar[dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, RoleFunction | XRefRole]] = {} role name \-> role callable .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.domains.ObjType(lname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, /, *roles: Any, **attrs: Any) An ObjType is the description for a type of object that a domain can document. In the object_types attribute of Domain subclasses, object type names are mapped to instances of this class. .sp Constructor arguments: .INDENT 7.0 .IP \(bu 2 \fIlname\fP: localized name of the type (do not include domain name) .IP \(bu 2 \fIroles\fP: all the roles that can refer to an object of this type .IP \(bu 2 \fIattrs\fP: object attributes \-\- currently only \(dqsearchprio\(dq is known, which defines the object\(aqs priority in the full\-text search index, see \fBDomain.get_objects()\fP\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.domains.Index(domain: Domain \%<#\:sphinx\:.domains\:.Domain>) An Index is the description for a domain\-specific index. To add an index to a domain, subclass Index, overriding the three name attributes: .INDENT 7.0 .IP \(bu 2 \fIname\fP is an identifier used for generating file names. It is also used for a hyperlink target for the index. Therefore, users can refer the index page using \fBref\fP role and a string which is combined domain name and \fBname\fP attribute (ex. \fB:ref:\(gapy\-modindex\(ga\fP). .IP \(bu 2 \fIlocalname\fP is the section title for the index. .IP \(bu 2 \fIshortname\fP is a short name for the index, for use in the relation bar in HTML output. Can be empty to disable entries in the relation bar. .UNINDENT .sp and providing a \fBgenerate()\fP method. Then, add the index class to your domain\(aqs \fIindices\fP list. Extensions can add indices to existing domains using \fBadd_index_to_domain()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_index_to_domain>\&. .sp Changed in version 3.0: Index pages can be referred by domain name and index name via \fBref\fP \%<#\:role-ref> role. .INDENT 7.0 .TP .B abstractmethod generate(docnames: Iterable[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None) -> tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[IndexEntry \%<#\:sphinx\:.domains\:.IndexEntry>]]], bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool>] Get entries for the index. .sp If \fBdocnames\fP is given, restrict to entries referring to these docnames. .sp The return value is a tuple of \fB(content, collapse)\fP: .INDENT 7.0 .TP .B \fBcollapse\fP A boolean that determines if sub\-entries should start collapsed (for output formats that support collapsing sub\-entries). .TP .B \fBcontent\fP: A sequence of \fB(letter, entries)\fP tuples, where \fBletter\fP is the \(dqheading\(dq for the given \fBentries\fP, usually the starting letter, and \fBentries\fP is a sequence of single entries. Each entry is an \fBIndexEntry\fP\&. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.domains.IndexEntry(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, subtype: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int>, docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, anchor: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, extra: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, qualifier: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, descr: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) An index entry. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The \fIqualifier\fP and \fIdescription\fP are not rendered for some output formats, such as LaTeX. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> The name of the index entry to be displayed. .UNINDENT .INDENT 7.0 .TP .B subtype: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> The sub\-entry related type. One of: .INDENT 7.0 .TP .B \fB0\fP A normal entry. .TP .B \fB1\fP An entry with sub\-entries. .TP .B \fB2\fP A sub\-entry. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B docname: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> \fIdocname\fP where the entry is located. .UNINDENT .INDENT 7.0 .TP .B anchor: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Anchor for the entry within \fIdocname\fP .UNINDENT .INDENT 7.0 .TP .B extra: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Extra info for the entry. .UNINDENT .INDENT 7.0 .TP .B qualifier: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Qualifier for the description. .UNINDENT .INDENT 7.0 .TP .B descr: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Description for the entry. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.directives.ObjectDescription(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine) Directive to describe a class, function or similar object. .sp Not used directly, but subclassed (in domain\-specific directives) to add custom behaviour. .INDENT 7.0 .TP .B _object_hierarchy_parts(sig_node: desc_signature \%<#\:sphinx\:.addnodes\:.desc_signature>) -> tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, \&...] Returns a tuple of strings, one entry for each part of the object\(aqs hierarchy (e.g. \fB(\(aqmodule\(aq, \(aqsubmodule\(aq, \(aqClass\(aq, \(aqmethod\(aq)\fP). The returned tuple is used to properly nest children within parents in the table of contents, and can also be used within the \fB_toc_entry_name()\fP method. .sp This method must not be used outwith table of contents generation. .UNINDENT .INDENT 7.0 .TP .B _toc_entry_name(sig_node: desc_signature \%<#\:sphinx\:.addnodes\:.desc_signature>) -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Returns the text of the table of contents entry for the object. .sp This function is called once, in \fBrun()\fP, to set the name for the table of contents entry (a special attribute \fB_toc_name\fP is set on the object node, later used in \fBenvironment.collectors.toctree.TocTreeCollector.process_doc().build_toc()\fP when the table of contents entries are collected). .sp To support table of contents entries for their objects, domains must override this method, also respecting the configuration setting \fBtoc_object_entries_show_parents\fP\&. Domains must also override \fB_object_hierarchy_parts()\fP, with one (string) entry for each part of the object\(aqs hierarchy. The result of this method is set on the signature node, and can be accessed as \fBsig_node[\(aq_toc_parts\(aq]\fP for use within this method. The resulting tuple is also used to properly nest children within parents in the table of contents. .sp An example implementations of this method is within the python domain (\fBPyObject._toc_entry_name()\fP). The python domain sets the \fB_toc_parts\fP attribute within the \fBhandle_signature()\fP method. .UNINDENT .INDENT 7.0 .TP .B add_target_and_index(name: ObjDescT, sig: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, signode: desc_signature \%<#\:sphinx\:.addnodes\:.desc_signature>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Add cross\-reference IDs and entries to self.indexnode, if applicable. .sp \fIname\fP is whatever \fBhandle_signature()\fP returned. .UNINDENT .INDENT 7.0 .TP .B after_content() -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Called after parsing content. .sp Used to reset information about the current directive context on the build environment. .UNINDENT .INDENT 7.0 .TP .B before_content() -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Called before parsing content. .sp Used to set information about the current directive context on the build environment. .UNINDENT .INDENT 7.0 .TP .B get_signatures() -> list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] Retrieve the signatures to document from the directive arguments. .sp By default, signatures are given as arguments, one per line. .UNINDENT .INDENT 7.0 .TP .B handle_signature(sig: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, signode: desc_signature \%<#\:sphinx\:.addnodes\:.desc_signature>) -> ObjDescT Parse the signature \fIsig\fP\&. .sp The individual nodes are then appended to \fIsignode\fP\&. If ValueError is raised, parsing is aborted and the whole \fIsig\fP is put into a single desc_name node. .sp The return value should be a value that identifies the object. It is passed to \fBadd_target_and_index()\fP unchanged, and otherwise only used to skip duplicates. .UNINDENT .INDENT 7.0 .TP .B run() -> list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[Node] Main directive entry function, called by docutils upon encountering the directive. .sp This directive is meant to be quite easily subclassable, so it delegates to several additional methods. What it does: .INDENT 7.0 .IP \(bu 2 find out if called as a domain\-specific directive, set self.domain .IP \(bu 2 create a \fIdesc\fP node to fit all description inside .IP \(bu 2 parse standard options, currently \fIno\-index\fP .IP \(bu 2 create an index node if needed as self.indexnode .IP \(bu 2 parse all given signatures (as returned by self.get_signatures()) using self.handle_signature(), which should either return a name or raise ValueError .IP \(bu 2 add index entries using self.add_target_and_index() .IP \(bu 2 parse the content and handle doc fields in it .UNINDENT .UNINDENT .INDENT 7.0 .TP .B transform_content(content_node: desc_content \%<#\:sphinx\:.addnodes\:.desc_content>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Can be used to manipulate the content. .sp Called after creating the content through nested parsing, but before the \fBobject\-description\-transform\fP event is emitted, and before the info\-fields are transformed. .UNINDENT .INDENT 7.0 .TP .B final_argument_whitespace = True May the final argument contain whitespace? .UNINDENT .INDENT 7.0 .TP .B has_content = True May the directive have content? .UNINDENT .INDENT 7.0 .TP .B option_spec: ClassVar[OptionSpec] = {\(aqno\-contents\-entry\(aq: <function flag>, \(aqno\-index\(aq: <function flag>, \(aqno\-index\-entry\(aq: <function flag>, \(aqno\-typesetting\(aq: <function flag>, \(aqnocontentsentry\(aq: <function flag>, \(aqnoindex\(aq: <function flag>, \(aqnoindexentry\(aq: <function flag>} Mapping of option names to validator functions. .UNINDENT .INDENT 7.0 .TP .B optional_arguments = 0 Number of optional arguments after the required arguments. .UNINDENT .INDENT 7.0 .TP .B required_arguments = 1 Number of required directive arguments. .UNINDENT .UNINDENT .SS Python Domain .INDENT 0.0 .TP .B class sphinx.domains.python.PythonDomain(env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment>) Python language domain. .INDENT 7.0 .TP .B objects .UNINDENT .INDENT 7.0 .TP .B modules .UNINDENT .INDENT 7.0 .TP .B note_object(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, objtype: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, node_id: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, aliased: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False, location: Any = None) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Note a python object for cross reference. .sp Added in version 2.1. .UNINDENT .INDENT 7.0 .TP .B note_module(name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, node_id: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, synopsis: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, platform: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, deprecated: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Note a python module for cross reference. .sp Added in version 2.1. .UNINDENT .UNINDENT .SS Parser API .sp The docutils documentation describes \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:dev/\:hacking\:.html#\:parsing-the-document> parsers as follows: .INDENT 0.0 .INDENT 3.5 The Parser analyzes the input document and creates a node tree representation. .UNINDENT .UNINDENT .sp In Sphinx, the parser modules works as same as docutils. The parsers are registered to Sphinx by extensions using Application APIs; \fBSphinx.add_source_suffix()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_source_suffix> and \fBSphinx.add_source_parser()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_source_parser>\&. .sp The \fIsource suffix\fP is a mapping from file suffix to file type. For example, \fB\&.rst\fP file is mapped to \fB\(aqrestructuredtext\(aq\fP type. Sphinx uses the file type to looking for parsers from registered list. On searching, Sphinx refers to the \fBParser.supported\fP attribute and picks up a parser which contains the file type in the attribute. .sp The users can override the source suffix mappings using \fBsource_suffix\fP \%<#\:confval-source_suffix> like following: .INDENT 0.0 .INDENT 3.5 .sp .EX # a mapping from file suffix to file types source_suffix = { \(aq.rst\(aq: \(aqrestructuredtext\(aq, \(aq.md\(aq: \(aqmarkdown\(aq, } .EE .UNINDENT .UNINDENT .sp You should indicate file types your parser supports. This will allow users to configure their settings appropriately. .INDENT 0.0 .TP .B class sphinx.parsers.Parser A base class for source parsers. .sp Additional parsers should inherit from this class instead of \fBdocutils.parsers.Parser\fP\&. This class provides access to core Sphinx objects; \fIconfig\fP and \fIenv\fP\&. .INDENT 7.0 .TP .B set_application(app: Sphinx \%<#\:sphinx\:.application\:.Sphinx>) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> set_application will be called from Sphinx to set app and other instance variables .INDENT 7.0 .TP .B Parameters \fBapp\fP (\fIsphinx.application.Sphinx\fP \%<#\:sphinx\:.application\:.Sphinx>) \-\- Sphinx application object .UNINDENT .UNINDENT .INDENT 7.0 .TP .B property config: Config \%<#\:sphinx\:.config\:.Config> The config object. .UNINDENT .INDENT 7.0 .TP .B property env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment> The environment object. .UNINDENT .UNINDENT .SS Doctree node classes added by Sphinx .SS Nodes for domain\-specific object descriptions .SS Top\-level nodes .sp These nodes form the top\-most levels of object descriptions. .INDENT 0.0 .TP .B class sphinx.addnodes.desc(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for a list of object signatures and a common description of them. .sp Contains one or more \fBdesc_signature\fP nodes and then a single \fBdesc_content\fP node. .sp This node always has two classes: .INDENT 7.0 .IP \(bu 2 The name of the domain it belongs to, e.g., \fBpy\fP or \fBcpp\fP\&. .IP \(bu 2 The name of the object type in the domain, e.g., \fBfunction\fP\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_signature(*args: Any, **kwargs: Any) Node for a single object signature. .sp As default the signature is a single\-line signature. Set \fBis_multiline = True\fP to describe a multi\-line signature. In that case all child nodes must be \fBdesc_signature_line\fP nodes. .sp This node always has the classes \fBsig\fP, \fBsig\-object\fP, and the domain it belongs to. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_signature_line(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for a line in a multi\-line object signature. .sp It should only be used as a child of a \fBdesc_signature\fP with \fBis_multiline\fP set to \fBTrue\fP\&. Set \fBadd_permalink = True\fP for the line that should get the permalink. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_content(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for object description content. .sp Must be the last child node in a \fBdesc\fP node. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_inline(domain: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, *args: Any, **kwargs: Any) Node for a signature fragment in inline text. .sp This is for example used for roles like \fBcpp:expr\fP \%<#\:role-cpp-expr>\&. .sp This node always has the classes \fBsig\fP, \fBsig\-inline\fP, and the name of the domain it belongs to. .UNINDENT .SS Nodes for high\-level structure in signatures .sp These nodes occur in in non\-multiline \fBdesc_signature\fP nodes and in \fBdesc_signature_line\fP nodes. .INDENT 0.0 .TP .B class sphinx.addnodes.desc_name(*args: Any, **kwargs: Any) Node for the main object name. .sp For example, in the declaration of a Python class \fBMyModule.MyClass\fP, the main name is \fBMyClass\fP\&. .sp This node always has the class \fBsig\-name\fP\&. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_addname(*args: Any, **kwargs: Any) Node for additional name parts for an object. .sp For example, in the declaration of a Python class \fBMyModule.MyClass\fP, the additional name part is \fBMyModule.\fP\&. .sp This node always has the class \fBsig\-prename\fP\&. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_type(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for return types or object type names. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_returns(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for a \(dqreturns\(dq annotation (a la \-> in Python). .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_parameterlist(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for a general parameter list. .sp As default the parameter list is written in line with the rest of the signature. Set \fBmulti_line_parameter_list = True\fP to describe a multi\-line parameter list. In that case each parameter will then be written on its own, indented line. A trailing comma will be added on the last line if \fBmulti_line_trailing_comma\fP is True. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_parameter(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for a single parameter. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_optional(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for marking optional parts of the parameter list. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_annotation(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for signature annotations (not Python 3\-style annotations). .UNINDENT .SS Nodes for signature text elements .sp These nodes inherit \fBdesc_sig_element\fP and are generally translated to \fBdocutils.nodes.inline\fP by \fBSigElementFallbackTransform\fP\&. .sp Extensions may create additional \fBdesc_sig_*\fP\-like nodes but in order for \fBSigElementFallbackTransform\fP to translate them to inline nodes automatically, they must be added to \fBSIG_ELEMENTS\fP via the class keyword argument \fB_sig_element=True\fP of \fBdesc_sig_element\fP, e.g.: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .EX class desc_custom_sig_node(desc_sig_element, _sig_element=True): ... .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp For backwards compatibility, it is still possible to add the nodes directly using \fBSIG_ELEMENTS.add(desc_custom_sig_node)\fP\&. .INDENT 0.0 .TP .B sphinx.addnodes.SIG_ELEMENTS: set \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:set>[type \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:type>[desc_sig_element \%<#\:sphinx\:.addnodes\:.desc_sig_element>]] A set of classes inheriting \fBdesc_sig_element\fP\&. Each node class is expected to be handled by the builder\(aqs translator class if the latter does not inherit from SphinxTranslator. .sp This set can be extended manually by third\-party extensions or by subclassing \fBdesc_sig_element\fP and using the class keyword argument \fI_sig_element=True\fP\&. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_sig_element(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children: Element, **attributes: Any) Common parent class of nodes for inline text of a signature. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_sig_space(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq \(aq, *children: Element, **attributes: Any) Node for a space in a signature. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_sig_name(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children: Element, **attributes: Any) Node for an identifier in a signature. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_sig_operator(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children: Element, **attributes: Any) Node for an operator in a signature. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_sig_punctuation(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children: Element, **attributes: Any) Node for punctuation in a signature. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_sig_keyword(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children: Element, **attributes: Any) Node for a general keyword in a signature. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_sig_keyword_type(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children: Element, **attributes: Any) Node for a keyword which is a built\-in type in a signature. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_sig_literal_number(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children: Element, **attributes: Any) Node for a numeric literal in a signature. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_sig_literal_string(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children: Element, **attributes: Any) Node for a string literal in a signature. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.desc_sig_literal_char(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children: Element, **attributes: Any) Node for a character literal in a signature. .UNINDENT .SS New admonition\-like constructs .INDENT 0.0 .TP .B class sphinx.addnodes.versionmodified(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for version change entries. .sp Currently used for \(dqversion\-added\(dq, \(dqversion\-changed\(dq, \(dqversion\-deprecated\(dq and \(dqversion\-removed\(dq directives, along with their aliases. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.seealso(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Custom \(dqsee also\(dq admonition. .UNINDENT .SS Other paragraph\-level nodes .INDENT 0.0 .TP .B class sphinx.addnodes.compact_paragraph(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for a compact paragraph (which never makes a <p> node). .UNINDENT .SS New inline nodes .INDENT 0.0 .TP .B class sphinx.addnodes.index(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for index entries. .sp This node is created by the \fBindex\fP directive and has one attribute, \fBentries\fP\&. Its value is a list of 5\-tuples of \fB(entrytype, entryname, target, ignored, key)\fP\&. .sp \fIentrytype\fP is one of \(dqsingle\(dq, \(dqpair\(dq, \(dqdouble\(dq, \(dqtriple\(dq. .sp \fIkey\fP is categorization characters (usually a single character) for general index page. For the details of this, please see also: \fBglossary\fP \%<#\:directive-glossary> and \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:pull/\:2320>\&. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.pending_xref(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for cross\-references that cannot be resolved without complete information about all documents. .sp These nodes are resolved before writing output, in BuildEnvironment.resolve_references. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.pending_xref_condition(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node representing a potential way to create a cross\-reference and the condition in which this way should be used. .sp This node is only allowed to be placed under a \fBpending_xref\fP node. A \fBpending_xref\fP node must contain either no \fBpending_xref_condition\fP nodes or it must only contains \fBpending_xref_condition\fP nodes. .sp The cross\-reference resolver will replace a \fBpending_xref\fP which contains \fBpending_xref_condition\fP nodes by the content of exactly one of those \fBpending_xref_condition\fP nodes\(aq content. It uses the \fBcondition\fP attribute to decide which \fBpending_xref_condition\fP node\(aqs content to use. For example, let us consider how the cross\-reference resolver acts on: .INDENT 7.0 .INDENT 3.5 .sp .EX <pending_xref refdomain=\(dqpy\(dq reftarget=\(dqio.StringIO ...> <pending_xref_condition condition=\(dqresolved\(dq> <literal> StringIO <pending_xref_condition condition=\(dq*\(dq> <literal> io.StringIO .EE .UNINDENT .UNINDENT .sp If the cross\-reference resolver successfully resolves the cross\-reference, then it rewrites the \fBpending_xref\fP as: .INDENT 7.0 .INDENT 3.5 .sp .EX <reference> <literal> StringIO .EE .UNINDENT .UNINDENT .sp Otherwise, if the cross\-reference resolution failed, it rewrites the \fBpending_xref\fP as: .INDENT 7.0 .INDENT 3.5 .sp .EX <reference> <literal> io.StringIO .EE .UNINDENT .UNINDENT .sp The \fBpending_xref_condition\fP node should have \fBcondition\fP attribute. Domains can be store their individual conditions into the attribute to filter contents on resolving phase. As a reserved condition name, \fBcondition=\(dq*\(dq\fP is used for the fallback of resolution failure. Additionally, as a recommended condition name, \fBcondition=\(dqresolved\(dq\fP represents a resolution success in the intersphinx module. .sp Added in version 4.0. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.literal_emphasis(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node that behaves like \fIemphasis\fP, but further text processors are not applied (e.g. smartypants for HTML output). .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.download_reference(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for download references, similar to pending_xref. .UNINDENT .SS Special nodes .INDENT 0.0 .TP .B class sphinx.addnodes.only(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for \(dqonly\(dq directives (conditional inclusion based on tags). .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.highlightlang(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Inserted to set the highlight language and line number options for subsequent code blocks. .UNINDENT .sp You should not need to generate the nodes below in extensions. .INDENT 0.0 .TP .B class sphinx.addnodes.glossary(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node to insert a glossary. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.toctree(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for inserting a \(dqTOC tree\(dq. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.start_of_file(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node to mark start of a new file, used in the LaTeX builder only. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.productionlist(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for grammar production lists. .sp Contains \fBproduction\fP nodes. .UNINDENT .INDENT 0.0 .TP .B class sphinx.addnodes.production(rawsource: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, *children, **attributes: Any) Node for a single grammar production rule. .UNINDENT .SS Logging API .INDENT 0.0 .TP .B sphinx.util.logging.getLogger(name) Get logger wrapped by \fBsphinx.util.logging.SphinxLoggerAdapter\fP\&. .sp Sphinx logger always uses \fBsphinx.*\fP namespace to be independent from settings of root logger. It ensures logging is consistent even if a third\-party extension or imported application resets logger settings. .sp Example usage: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> from sphinx.util import logging >>> logger = logging.getLogger(__name__) >>> logger.info(\(aqHello, this is an extension!\(aq) Hello, this is an extension! .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.util.logging.SphinxLoggerAdapter(logging.LoggerAdapter) LoggerAdapter allowing \fBtype\fP and \fBsubtype\fP keywords. .INDENT 7.0 .TP .B error(msg, *args, **kwargs) .UNINDENT .INDENT 7.0 .TP .B critical(msg, *args, **kwargs) .UNINDENT .INDENT 7.0 .TP .B warning(msg, *args, **kwargs) Logs a message on this logger with the specified level. Basically, the arguments are as with python\(aqs logging module. .sp In addition, Sphinx logger supports following keyword arguments: .INDENT 7.0 .TP \fBtype\fP, \fB*subtype*\fP Categories of warning logs. It is used to suppress warnings by \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings> setting. .TP \fBlocation\fP Where the warning happened. It is used to include the path and line number in each log. It allows docname, tuple of docname and line number and nodes: .INDENT 7.0 .INDENT 3.5 .sp .EX logger = sphinx.util.logging.getLogger(__name__) logger.warning(\(aqWarning happened!\(aq, location=\(aqindex\(aq) logger.warning(\(aqWarning happened!\(aq, location=(\(aqchapter1/index\(aq, 10)) logger.warning(\(aqWarning happened!\(aq, location=some_node) .EE .UNINDENT .UNINDENT .TP \fBcolor\fP The color of logs. By default, error level logs are colored as \fB\(dqdarkred\(dq\fP, critical level ones is not colored, and warning level ones are colored as \fB\(dqred\(dq\fP\&. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B log(level, msg, *args, **kwargs) .UNINDENT .INDENT 7.0 .TP .B info(msg, *args, **kwargs) .UNINDENT .INDENT 7.0 .TP .B verbose(msg, *args, **kwargs) .UNINDENT .INDENT 7.0 .TP .B debug(msg, *args, **kwargs) Logs a message to this logger with the specified level. Basically, the arguments are as with python\(aqs logging module. .sp In addition, Sphinx logger supports following keyword arguments: .INDENT 7.0 .TP \fBnonl\fP If true, the logger does not fold lines at the end of the log message. The default is \fBFalse\fP\&. .TP \fBlocation\fP Where the message emitted. For more detail, see \fBSphinxLoggerAdapter.warning()\fP\&. .TP \fBcolor\fP The color of logs. By default, info and verbose level logs are not colored, and debug level ones are colored as \fB\(dqdarkgray\(dq\fP\&. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B sphinx.util.logging.pending_logging() Context manager to postpone logging all logs temporarily. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> with pending_logging(): >>> logger.warning(\(aqWarning message!\(aq) # not flushed yet >>> some_long_process() >>> Warning message! # the warning is flushed here .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B sphinx.util.logging.pending_warnings() Context manager to postpone logging warnings temporarily. .sp Similar to \fBpending_logging()\fP\&. .UNINDENT .INDENT 0.0 .TP .B sphinx.util.logging.prefixed_warnings() Context manager to prepend prefix to all warning log records temporarily. .sp For example: .INDENT 7.0 .INDENT 3.5 .sp .EX >>> with prefixed_warnings(\(dqprefix:\(dq): >>> logger.warning(\(aqWarning message!\(aq) # => prefix: Warning message! .EE .UNINDENT .UNINDENT .sp Added in version 2.0. .UNINDENT .SS i18n API .INDENT 0.0 .TP .B sphinx.locale.init(locale_dirs: Iterable[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | os.PathLike \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.PathLike>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>], language: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>, catalog: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aqsphinx\(aq, namespace: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aqgeneral\(aq) -> tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[NullTranslations, bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool>] Look for message catalogs in \fIlocale_dirs\fP and \fIensure\fP that there is at least a NullTranslations catalog set in \fItranslators\fP\&. If called multiple times or if several \fB\&.mo\fP files are found, their contents are merged together (thus making \fBinit\fP reentrant). .UNINDENT .INDENT 0.0 .TP .B sphinx.locale.init_console(locale_dir: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | os.PathLike \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.PathLike>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None, catalog: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aqsphinx\(aq) -> tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[NullTranslations, bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool>] Initialize locale for console. .sp Added in version 1.8. .UNINDENT .INDENT 0.0 .TP .B sphinx.locale.get_translation(catalog: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, namespace: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aqgeneral\(aq) -> Callable[[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] Get a translation function based on the \fIcatalog\fP and \fInamespace\fP\&. .sp The extension can use this API to translate the messages on the extension: .INDENT 7.0 .INDENT 3.5 .sp .EX from pathlib import Path from sphinx.locale import get_translation MESSAGE_CATALOG_NAME = \(aqmyextension\(aq # name of *.pot, *.po and *.mo files _ = get_translation(MESSAGE_CATALOG_NAME) text = _(\(aqHello Sphinx!\(aq) def setup(app): package_dir = Path(__file__).resolve().parent locale_dir = package_dir / \(aqlocales\(aq app.add_message_catalog(MESSAGE_CATALOG_NAME, locale_dir) .EE .UNINDENT .UNINDENT .sp With this code, sphinx searches a message catalog from \fB${package_dir}/locales/${language}/LC_MESSAGES/myextension.mo\fP\&. The \fBlanguage\fP \%<#\:confval-language> is used for the searching. .sp Added in version 1.8. .UNINDENT .INDENT 0.0 .TP .B sphinx.locale._(message: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Translation function for messages on documentation (menu, labels, themes and so on). This function follows \fBlanguage\fP \%<#\:confval-language> setting. .UNINDENT .INDENT 0.0 .TP .B sphinx.locale.__(message: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>) -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Translation function for console messages This function follows locale setting (\fILC_ALL\fP, \fILC_MESSAGES\fP and so on). .UNINDENT .SS Extension internationalization (\fBi18n\fP) and localization (\fBl10n\fP) using i18n API .sp Added in version 1.8. .sp An extension may naturally come with message translations. This is briefly summarized in \fBsphinx.locale.get_translation()\fP help. .sp In practice, you have to: .INDENT 0.0 .IP 1. 3 Choose a name for your message catalog, which must be unique. Usually the name of your extension is used for the name of message catalog. .IP 2. 3 Mark in your extension sources all messages as translatable, via \fBsphinx.locale.get_translation()\fP function, usually renamed \fB_()\fP, e.g.: .sp src/__init__.py .INDENT 3.0 .INDENT 3.5 .sp .EX from sphinx.locale import get_translation MESSAGE_CATALOG_NAME = \(aqmyextension\(aq _ = get_translation(MESSAGE_CATALOG_NAME) translated_text = _(\(aqHello Sphinx!\(aq) .EE .UNINDENT .UNINDENT .IP 3. 3 Set up your extension to be aware of its dedicated translations: .sp src/__init__.py .INDENT 3.0 .INDENT 3.5 .sp .EX def setup(app): package_dir = Path(__file__).resolve().parent locale_dir = package_dir / \(aqlocales\(aq app.add_message_catalog(MESSAGE_CATALOG_NAME, locale_dir) .EE .UNINDENT .UNINDENT .IP 4. 3 Generate message catalog template \fB*.pot\fP file, usually in \fBlocale/\fP source directory, for example via Babel \%<https://\:babel\:.pocoo\:.org/>: .INDENT 3.0 .INDENT 3.5 .sp .EX $ pybabel extract \-\-output=src/locale/myextension.pot src/ .EE .UNINDENT .UNINDENT .IP 5. 3 Create message catalogs (\fB*.po\fP) for each language which your extension will provide localization, for example via Babel \%<https://\:babel\:.pocoo\:.org/>: .INDENT 3.0 .INDENT 3.5 .sp .EX $ pybabel init \-\-input\-file=src/locale/myextension.pot \-\-domain=myextension \-\-output\-dir=src/locale \-\-locale=fr_FR .EE .UNINDENT .UNINDENT .IP 6. 3 Translate message catalogs for each language manually .IP 7. 3 Compile message catalogs into \fB*.mo\fP files, for example via Babel \%<https://\:babel\:.pocoo\:.org/>: .INDENT 3.0 .INDENT 3.5 .sp .EX $ pybabel compile \-\-directory=src/locale \-\-domain=myextension .EE .UNINDENT .UNINDENT .IP 8. 3 Ensure that message catalog files are distributed when your package will be installed, by adding equivalent line in your extension \fBMANIFEST.in\fP: .sp MANIFEST.in .INDENT 3.0 .INDENT 3.5 .sp .EX recursive\-include src *.pot *.po *.mo .EE .UNINDENT .UNINDENT .UNINDENT .sp When the messages on your extension has been changed, you need to also update message catalog template and message catalogs, for example via Babel \%<https://\:babel\:.pocoo\:.org/>: .INDENT 0.0 .INDENT 3.5 .sp .EX $ pybabel extract \-\-output=src/locale/myextension.pot src/ $ pybabel update \-\-input\-file=src/locale/myextension.pot \-\-domain=myextension \-\-output\-dir=src/locale .EE .UNINDENT .UNINDENT .SS Utilities .sp Sphinx provides utility classes and functions to develop extensions. .SS Base classes for components .sp These base classes are useful to allow your extensions to obtain Sphinx components (e.g. \fBConfig\fP \%<#\:sphinx\:.config\:.Config>, \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> and so on) easily. .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 The subclasses of them might not work with bare docutils because they are strongly coupled with Sphinx. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.transforms.SphinxTransform(document, startnode=None) A base class of Transforms. .sp Compared with \fBdocutils.transforms.Transform\fP, this class improves accessibility to Sphinx APIs. .INDENT 7.0 .TP .B property app: Sphinx \%<#\:sphinx\:.application\:.Sphinx> Reference to the \fBSphinx\fP \%<#\:sphinx\:.application\:.Sphinx> object. .UNINDENT .INDENT 7.0 .TP .B property config: Config \%<#\:sphinx\:.config\:.Config> Reference to the \fBConfig\fP \%<#\:sphinx\:.config\:.Config> object. .UNINDENT .INDENT 7.0 .TP .B property env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment> Reference to the \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> object. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.transforms.post_transforms.SphinxPostTransform(document, startnode=None) A base class of post\-transforms. .sp Post transforms are invoked to modify the document to restructure it for outputting. They resolve references, convert images, do special transformation for each output formats and so on. This class helps to implement these post transforms. .INDENT 7.0 .TP .B apply(**kwargs: Any) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Override to apply the transform to the document tree. .UNINDENT .INDENT 7.0 .TP .B is_supported() -> bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> Check this transform working for current builder. .UNINDENT .INDENT 7.0 .TP .B run(**kwargs: Any) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Main method of post transforms. .sp Subclasses should override this method instead of \fBapply()\fP\&. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.util.docutils.SphinxDirective(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine) A base class for Sphinx directives. .sp This class provides helper methods for Sphinx directives. .sp Added in version 1.8. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The subclasses of this class might not work with docutils. This class is strongly coupled with Sphinx. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_location() -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Get current location info for logging. .sp Added in version 4.2. .UNINDENT .INDENT 7.0 .TP .B get_source_info() -> tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>, int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None>] Get source and line number. .sp Added in version 3.0. .UNINDENT .INDENT 7.0 .TP .B parse_content_to_nodes(allow_section_headings: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[Node] Parse the directive\(aqs content into nodes. .INDENT 7.0 .TP .B Parameters \fBallow_section_headings\fP \-\- Are titles (sections) allowed in the directive\(aqs content? Note that this option bypasses Docutils\(aq usual checks on doctree structure, and misuse of this option can lead to an incoherent doctree. In Docutils, section nodes should only be children of \fBStructural\fP nodes, which includes \fBdocument\fP, \fBsection\fP, and \fBsidebar\fP nodes. .UNINDENT .sp Added in version 7.4. .UNINDENT .INDENT 7.0 .TP .B parse_inline(text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, *, lineno: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = \-1) -> tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[Node], list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[system_message]] Parse \fItext\fP as inline elements. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtext\fP \-\- The text to parse, which should be a single line or paragraph. This cannot contain any structural elements (headings, transitions, directives, etc). .IP \(bu 2 \fBlineno\fP \-\- The line number where the interpreted text begins. .UNINDENT .TP .B Returns A list of nodes (text and inline elements) and a list of system_messages. .UNINDENT .sp Added in version 7.4. .UNINDENT .INDENT 7.0 .TP .B parse_text_to_nodes(text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq\(aq, /, *, offset: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = \-1, allow_section_headings: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[Node] Parse \fItext\fP into nodes. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBtext\fP \-\- Text, in string form. \fBStringList\fP is also accepted. .IP \(bu 2 \fBallow_section_headings\fP \-\- Are titles (sections) allowed in \fItext\fP? Note that this option bypasses Docutils\(aq usual checks on doctree structure, and misuse of this option can lead to an incoherent doctree. In Docutils, section nodes should only be children of \fBStructural\fP nodes, which includes \fBdocument\fP, \fBsection\fP, and \fBsidebar\fP nodes. .IP \(bu 2 \fBoffset\fP \-\- The offset of the content. .UNINDENT .UNINDENT .sp Added in version 7.4. .UNINDENT .INDENT 7.0 .TP .B set_source_info(node: Node) -> None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> Set source and line number to the node. .sp Added in version 2.1. .UNINDENT .INDENT 7.0 .TP .B property config: Config \%<#\:sphinx\:.config\:.Config> Reference to the \fBConfig\fP \%<#\:sphinx\:.config\:.Config> object. .sp Added in version 1.8. .UNINDENT .INDENT 7.0 .TP .B property env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment> Reference to the \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> object. .sp Added in version 1.8. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.util.docutils.SphinxRole A base class for Sphinx roles. .sp This class provides helper methods for Sphinx roles. .sp Added in version 2.0. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The subclasses of this class might not work with docutils. This class is strongly coupled with Sphinx. .UNINDENT .UNINDENT .INDENT 7.0 .TP .B get_location() -> str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> Get current location info for logging. .sp Added in version 4.2. .UNINDENT .INDENT 7.0 .TP .B property config: Config \%<#\:sphinx\:.config\:.Config> Reference to the \fBConfig\fP \%<#\:sphinx\:.config\:.Config> object. .sp Added in version 2.0. .UNINDENT .INDENT 7.0 .TP .B content: Sequence[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>] A list of strings, the directive content for customisation (from the \(dqrole\(dq directive). .UNINDENT .INDENT 7.0 .TP .B property env: BuildEnvironment \%<#\:sphinx\:.environment\:.BuildEnvironment> Reference to the \fBBuildEnvironment\fP \%<#\:sphinx\:.environment\:.BuildEnvironment> object. .sp Added in version 2.0. .UNINDENT .INDENT 7.0 .TP .B inliner: Inliner The \fBdocutils.parsers.rst.states.Inliner\fP object. .UNINDENT .INDENT 7.0 .TP .B lineno: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> The line number where the interpreted text begins. .UNINDENT .INDENT 7.0 .TP .B name: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> The role name actually used in the document. .UNINDENT .INDENT 7.0 .TP .B options: dict \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:dict>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, Any] A dictionary of directive options for customisation (from the \(dqrole\(dq directive). .UNINDENT .INDENT 7.0 .TP .B rawtext: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> A string containing the entire interpreted text input. .UNINDENT .INDENT 7.0 .TP .B text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> The interpreted text content. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.util.docutils.ReferenceRole A base class for reference roles. .sp The reference roles can accept \fBlink title <target>\fP style as a text for the role. The parsed result; link title and target will be stored to \fBself.title\fP and \fBself.target\fP\&. .sp Added in version 2.0. .INDENT 7.0 .TP .B disabled: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> A boolean indicates the reference is disabled. .UNINDENT .INDENT 7.0 .TP .B has_explicit_title: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> A boolean indicates the role has explicit title or not. .UNINDENT .INDENT 7.0 .TP .B target: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> The link target for the interpreted text. .UNINDENT .INDENT 7.0 .TP .B title: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> The link title for the interpreted text. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B class sphinx.transforms.post_transforms.images.ImageConverter(document, startnode=None) A base class for image converters. .sp An image converter is kind of Docutils transform module. It is used to convert image files which are not supported by a builder to the appropriate format for that builder. .sp For example, \fBLaTeX builder\fP \%<#\:sphinx\:.builders\:.latex\:.LaTeXBuilder> supports PDF, PNG and JPEG as image formats. However it does not support SVG images. For such case, using image converters allows to embed these unsupported images into the document. One of the image converters; sphinx.ext.imgconverter \%<#\:sphinx-ext-imgconverter> can convert a SVG image to PNG format using Imagemagick internally. .sp There are three steps to make your custom image converter: .INDENT 7.0 .IP 1. 3 Make a subclass of \fBImageConverter\fP class .IP 2. 3 Override \fBconversion_rules\fP, \fBis_available()\fP and \fBconvert()\fP .IP 3. 3 Register your image converter to Sphinx using \fBSphinx.add_post_transform()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_post_transform> .UNINDENT .INDENT 7.0 .TP .B convert(_from: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | PathLike \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.PathLike>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>], _to: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | PathLike \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.PathLike>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]) -> bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> Convert an image file to the expected format. .sp \fI_from\fP is a path of the source image file, and \fI_to\fP is a path of the destination file. .UNINDENT .INDENT 7.0 .TP .B is_available() -> bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> Return the image converter is available or not. .UNINDENT .INDENT 7.0 .TP .B available: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> | None \%<https://\:docs\:.python\:.org/\:3/\:library/\:constants\:.html#\:None> = None The converter is available or not. Will be filled at the first call of the build. The result is shared in the same process. .INDENT 7.0 .INDENT 3.5 .SS Todo .sp This should be refactored not to store the state without class variable. .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B conversion_rules: list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[tuple \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:tuple>[str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>, str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str>]] = [] A conversion rules the image converter supports. It is represented as a list of pair of source image format (mimetype) and destination one: .INDENT 7.0 .INDENT 3.5 .sp .EX conversion_rules = [ (\(aqimage/svg+xml\(aq, \(aqimage/png\(aq), (\(aqimage/gif\(aq, \(aqimage/png\(aq), (\(aqapplication/pdf\(aq, \(aqimage/png\(aq), ] .EE .UNINDENT .UNINDENT .UNINDENT .INDENT 7.0 .TP .B default_priority = 200 Numerical priority of this transform, 0 through 999 (override). .UNINDENT .UNINDENT .SS Utility functions .INDENT 0.0 .TP .B sphinx.util.parsing.nested_parse_to_nodes(state: RSTState, text: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> | StringList, *, source: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> = \(aq<generated text>\(aq, offset: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> = 0, allow_section_headings: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = True, keep_title_context: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> = False) -> list \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:list>[Node] Parse \fItext\fP into nodes. .INDENT 7.0 .TP .B Parameters .INDENT 7.0 .IP \(bu 2 \fBstate\fP \-\- The state machine state. Must be a subclass of \fBRSTState\fP\&. .IP \(bu 2 \fBtext\fP \-\- Text, in string form. \fBStringList\fP is also accepted. .IP \(bu 2 \fBsource\fP \-\- The text\(aqs source, used when creating a new \fBStringList\fP\&. .IP \(bu 2 \fBoffset\fP \-\- The offset of the content. .IP \(bu 2 \fBallow_section_headings\fP \-\- Are titles (sections) allowed in \fItext\fP? Note that this option bypasses Docutils\(aq usual checks on doctree structure, and misuse of this option can lead to an incoherent doctree. In Docutils, section nodes should only be children of \fBdocument\fP or \fBsection\fP nodes. .IP \(bu 2 \fBkeep_title_context\fP \-\- .sp If this is False (the default), then \fIcontent\fP is parsed as if it were an independent document, meaning that title decorations (e.g. underlines) do not need to match the surrounding document. This is useful when the parsed content comes from a completely different context, such as docstrings. If this is True, then title underlines must match those in the surrounding document, otherwise the behaviour is undefined. .sp Warning: Up to Docutils 0.21, sections with a decoration style matching a level that is higher than the current section level are silently discarded! Since Docutils 0.22.1, an error is reported. .UNINDENT .UNINDENT .sp Added in version 7.4. .UNINDENT .SS Utility types .INDENT 0.0 .TP .B class sphinx.util.typing.ExtensionMetadata The metadata returned by an extension\(aqs \fBsetup()\fP function. .sp See Extension metadata \%<#\:ext-metadata>\&. .INDENT 7.0 .TP .B env_version: int \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:int> An integer that identifies the version of env data added by the extension. .UNINDENT .INDENT 7.0 .TP .B parallel_read_safe: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> Indicate whether parallel reading of source files is supported by the extension. .UNINDENT .INDENT 7.0 .TP .B parallel_write_safe: bool \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:bool> Indicate whether parallel writing of output files is supported by the extension (default: \fBTrue\fP). .UNINDENT .INDENT 7.0 .TP .B version: str \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> The extension version (default: \fB\(aqunknown version\(aq\fP). .UNINDENT .UNINDENT .SS Testing API .sp Added in version 1.6. .sp Utility functions and pytest fixtures for testing are provided in \fBsphinx.testing\fP\&. If you are a developer of Sphinx extensions, you can write unit tests with pytest \%<https://\:docs\:.pytest\:.org/\:en/\:latest/>\&. .SS \fBpytest\fP configuration .sp To use pytest fixtures that are provided by \fBsphinx.testing\fP, add the \fB\(aqsphinx.testing.fixtures\(aq\fP plugin to your test modules or \fBconftest.py\fP files as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX pytest_plugins = (\(aqsphinx.testing.fixtures\(aq,) .EE .UNINDENT .UNINDENT .SS Usage .sp If you want to know more detailed usage, please refer to \fBtests/conftest.py\fP and other \fBtest_*.py\fP files under the \fBtests/\fP directory. .SS Deprecated APIs .sp On developing Sphinx, we are always careful to the compatibility of our APIs. But, sometimes, the change of interface are needed for some reasons. In such cases, we\(aqve marked them as deprecated. And they are kept during the two major versions (for more details, please see Deprecation policy \%<#\:deprecation-policy>). .sp The following is a list of deprecated interfaces. .SS deprecated APIs .TS box center; l|l|l|l. T{ Target T} T{ Deprecated T} T{ Removed T} T{ Alternatives T} _ T{ \fBsphinx.io\fP (entire module) T} T{ 9.0 T} T{ 11.0 T} T{ \fBdocutils.io\fP or standard Python I/O T} _ T{ \fBsphinx.builders.Builder.app\fP T} T{ 9.0 T} T{ 11.0 T} T{ N/A T} _ T{ \fBsphinx.environment.BuildEnvironment.app\fP T} T{ 9.0 T} T{ 11.0 T} T{ N/A T} _ T{ \fBsphinx.transforms.Transform.app\fP T} T{ 9.0 T} T{ 11.0 T} T{ N/A T} _ T{ \fBsphinx.transforms.post_transforms.SphinxPostTransform.app\fP T} T{ 9.0 T} T{ 11.0 T} T{ N/A T} _ T{ \fBsphinx.events.EventManager.app\fP T} T{ 9.0 T} T{ 11.0 T} T{ N/A T} _ T{ \fBsphinx.builders.singlehtml.SingleFileHTMLBuilder.fix_refuris\fP T} T{ 8.2 T} T{ 10.0 T} T{ N/A T} _ T{ \fBsphinx.util.FilenameUniqDict\fP T} T{ 8.1 T} T{ 10.0 T} T{ N/A T} _ T{ \fBsphinx.util.DownloadFiles\fP T} T{ 8.1 T} T{ 10.0 T} T{ N/A T} _ T{ \fBsphinx.ext.intersphinx.normalize_intersphinx_mapping\fP T} T{ 8.0 T} T{ 10.0 T} T{ \fBsphinx.ext.intersphinx.validate_intersphinx_mapping\fP T} _ T{ \fBsphinx.testing.util.strip_escseq\fP T} T{ 7.3 T} T{ 9.0 T} T{ \fBsphinx.util.console.strip_colors\fP T} _ T{ Old\-style Makefiles in \fBsphinx\-quickstart\fP and the \fB\-M\fP, \fB\-m\fP, \fB\-\-no\-use\-make\-mode\fP, and \fB\-\-use\-make\-mode\fP options T} T{ 7.3 T} T{ 9.0 T} T{ Vendoring the old style Makefile templates \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:blob/\:v7\:.0\:.0/\:sphinx/\:templates/\:quickstart/\:Makefile_t> T} _ T{ \fBsphinx.ext.autodoc.preserve_defaults.get_function_def()\fP T} T{ 7.2 T} T{ 9.0 T} T{ N/A (replacement is private) T} _ T{ \fBsphinx.builders.html.StandaloneHTMLBuilder.css_files\fP T} T{ 7.2 T} T{ 9.0 T} T{ N/A T} _ T{ \fBsphinx.builders.html.StandaloneHTMLBuilder.script_files\fP T} T{ 7.2 T} T{ 9.0 T} T{ N/A T} _ T{ \fBsphinx.builders.html.Stylesheet\fP T} T{ 7.2 T} T{ 9.0 T} T{ \fBsphinx.application.Sphinx.add_css_file()\fP T} _ T{ \fBsphinx.builders.html.JavaScript\fP T} T{ 7.2 T} T{ 9.0 T} T{ \fBsphinx.application.Sphinx.add_js_file()\fP T} _ T{ \fBsphinx.util.split_into\fP T} T{ 7.2 T} T{ 9.0 T} T{ N/A T} _ T{ \fBsphinx.util.split_index_msg\fP T} T{ 7.2 T} T{ 9.0 T} T{ \fBsphinx.util.index_entries.split_index_msg\fP T} _ T{ \fBsphinx.testing.path\fP T} T{ 7.2 T} T{ 9.0 T} T{ \fBos.path\fP or \fBpathlib\fP T} _ T{ \fBsphinx.util.md5\fP T} T{ 7.2 T} T{ 9.0 T} T{ \fBhashlib.md5\fP T} _ T{ \fBsphinx.util.sha1\fP T} T{ 7.2 T} T{ 9.0 T} T{ \fBhashlib.sha1\fP T} _ T{ \fBsphinx.util.osutil.cd\fP T} T{ 6.2 T} T{ 8.0 T} T{ \fBcontextlib.chdir\fP T} _ T{ \fBsphinx.util.save_traceback\fP T} T{ 6.1 T} T{ 8.0 T} T{ \fBsphinx.util.exceptions.save_traceback\fP T} _ T{ \fBsphinx.util.format_exception_cut_frames\fP T} T{ 6.1 T} T{ 8.0 T} T{ \fBsphinx.util.exceptions.format_exception_cut_frames\fP T} _ T{ \fBsphinx.util.epoch_to_rfc1123\fP T} T{ 6.1 T} T{ 8.0 T} T{ \fBsphinx.util.http_date.epoch_to_rfc1123\fP T} _ T{ \fBsphinx.util.rfc1123_to_epoch\fP T} T{ 6.1 T} T{ 8.0 T} T{ \fBsphinx.util.http_date.rfc1123_to_epoch\fP T} _ T{ \fBsphinx.util.status_iterator\fP T} T{ 6.1 T} T{ 8.0 T} T{ \fBsphinx.util.display.status_iterator\fP T} _ T{ \fBsphinx.util.display_chunk\fP T} T{ 6.1 T} T{ 8.0 T} T{ \fBsphinx.util.display.display_chunk\fP T} _ T{ \fBsphinx.util.SkipProgressMessage\fP T} T{ 6.1 T} T{ 8.0 T} T{ \fBsphinx.util.display.SkipProgressMessage\fP T} _ T{ \fBsphinx.util.progress_message\fP T} T{ 6.1 T} T{ 8.0 T} T{ \fBsphinx.util.display.progress_message\fP T} _ T{ \fBsphinx.util.typing.stringify\fP T} T{ 6.1 T} T{ 8.0 T} T{ \fBsphinx.util.typing.stringify_annotation\fP T} _ T{ HTML 4 support T} T{ 5.2 T} T{ 7.0 T} T{ N/A T} _ T{ \fBsphinx.util.path_stabilize\fP T} T{ 5.1 T} T{ 7.0 T} T{ \fBsphinx.util.osutil.path_stabilize\fP T} _ T{ \fBsphinx.util.get_matching_files\fP T} T{ 5.1 T} T{ 7.0 T} T{ \fBsphinx.util.matching.get_matching_files\fP T} _ T{ \fBsphinx.ext.napoleon.iterators\fP T} T{ 5.1 T} T{ 7.0 T} T{ \fBpockets.iterators\fP T} _ T{ \fBsphinx.util.stemmer\fP T} T{ 5.1 T} T{ 7.0 T} T{ \fBsnowballstemmer\fP T} _ T{ \fBsphinx.util.jsdump\fP T} T{ 5.0 T} T{ 7.0 T} T{ The standard library \fBjson\fP module. T} _ T{ The Setuptools integration (\fBsetup.py build_sphinx\fP) T} T{ 5.0 T} T{ 7.0 T} T{ N/A T} _ T{ The \fBlocale\fP argument of \fBsphinx.util.i18n:babel_format_date()\fP T} T{ 5.0 T} T{ 7.0 T} T{ N/A T} _ T{ The \fBlanguage\fP argument of \fBsphinx.util.i18n:format_date()\fP T} T{ 5.0 T} T{ 7.0 T} T{ N/A T} _ T{ \fBsphinx.builders.html.html5_ready\fP T} T{ 5.0 T} T{ 7.0 T} T{ N/A T} _ T{ \fBsphinx.io.read_doc()\fP T} T{ 5.0 T} T{ 7.0 T} T{ \fBsphinx.builders.Builder.read_doc()\fP T} _ T{ \fBsphinx.util.docutils.__version_info__\fP T} T{ 5.0 T} T{ 7.0 T} T{ \fBdocutils.__version_info__\fP T} _ T{ \fBsphinx.util.docutils.is_html5_writer_available()\fP T} T{ 5.0 T} T{ 7.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXWriter.docclasses\fP T} T{ 5.0 T} T{ 7.0 T} T{ N/A T} _ T{ \fBsphinx.ext.napoleon.docstring.GoogleDocstring._qualify_name()\fP T} T{ 4.5 T} T{ 6.0 T} T{ N/A T} _ T{ \fBsphinx.ext.autodoc.AttributeDocumenter._datadescriptor\fP T} T{ 4.3 T} T{ 6.0 T} T{ N/A T} _ T{ \fBsphinx.writers.html.HTMLTranslator._fieldlist_row_index\fP T} T{ 4.3 T} T{ 6.0 T} T{ \fBsphinx.writers.html.HTMLTranslator._fieldlist_row_indices\fP T} _ T{ \fBsphinx.writers.html.HTMLTranslator._table_row_index\fP T} T{ 4.3 T} T{ 6.0 T} T{ \fBsphinx.writers.html.HTMLTranslator._table_row_indices\fP T} _ T{ \fBsphinx.writers.html5.HTML5Translator._fieldlist_row_index\fP T} T{ 4.3 T} T{ 6.0 T} T{ \fBsphinx.writers.html5.HTML5Translator._fieldlist_row_indices\fP T} _ T{ \fBsphinx.writers.html5.HTML5Translator._table_row_index\fP T} T{ 4.3 T} T{ 6.0 T} T{ \fBsphinx.writers.html5.HTML5Translator._table_row_indices\fP T} _ T{ The optional argument \fBapp\fP for \fBsphinx.environment.BuildEnvironment\fP T} T{ 4.1 T} T{ 6.0 T} T{ The required argument T} _ T{ \fBsphinx.application.Sphinx.html_theme\fP T} T{ 4.1 T} T{ 6.0 T} T{ \fBsphinx.registry.SphinxComponentRegistry.html_themes\fP T} _ T{ \fBsphinx.ext.autosummary._app\fP T} T{ 4.1 T} T{ 6.0 T} T{ N/A T} _ T{ \fBsphinx.util.docstrings.extract_metadata()\fP T} T{ 4.1 T} T{ 6.0 T} T{ \fBsphinx.util.docstrings.separate_metadata()\fP T} _ T{ \fBfavicon\fP variable in HTML templates T} T{ 4.0 T} T{ 6.0 T} T{ \fBfavicon_url\fP T} _ T{ \fBlogo\fP variable in HTML templates T} T{ 4.0 T} T{ 6.0 T} T{ \fBlogo_url\fP T} _ T{ \fBsphinx.directives.patches.ListTable\fP T} T{ 4.0 T} T{ 6.0 T} T{ \fBdocutils.parsers.rst.directives.tables.ListSVTable\fP T} _ T{ \fBsphinx.directives.patches.RSTTable\fP T} T{ 4.0 T} T{ 6.0 T} T{ \fBdocutils.parsers.rst.directives.tables.RSTTable\fP T} _ T{ \fBsphinx.ext.autodoc.directive.DocumenterBridge.filename_set\fP T} T{ 4.0 T} T{ 6.0 T} T{ \fBsphinx.ext.autodoc.directive.DocumenterBridge.record_dependencies\fP T} _ T{ \fBsphinx.ext.autodoc.directive.DocumenterBridge.warn()\fP T} T{ 4.0 T} T{ 6.0 T} T{ Logging API \%<#\:logging-api> T} _ T{ \fBsphinx.registry.SphinxComponentRegistry.get_source_input()\fP T} T{ 4.0 T} T{ 6.0 T} T{ N/A T} _ T{ \fBsphinx.registry.SphinxComponentRegistry.source_inputs\fP T} T{ 4.0 T} T{ 6.0 T} T{ N/A T} _ T{ \fBsphinx.transforms.FigureAligner\fP T} T{ 4.0 T} T{ 6.0 T} T{ N/A T} _ T{ \fBsphinx.util.pycompat.convert_with_2to3()\fP T} T{ 4.0 T} T{ 6.0 T} T{ N/A T} _ T{ \fBsphinx.util.pycompat.execfile_()\fP T} T{ 4.0 T} T{ 6.0 T} T{ N/A T} _ T{ \fBsphinx.util.smartypants\fP T} T{ 4.0 T} T{ 6.0 T} T{ \fBdocutils.utils.smartquotes\fP T} _ T{ \fBsphinx.util.typing.DirectiveOption\fP T} T{ 4.0 T} T{ 6.0 T} T{ N/A T} _ T{ pending_xref node for viewcode extension T} T{ 3.5 T} T{ 5.0 T} T{ \fBsphinx.ext.viewcode.viewcode_anchor\fP T} _ T{ \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.anchors_ignore\fP T} T{ 3.5 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.auth\fP T} T{ 3.5 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.broken\fP T} T{ 3.5 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.good\fP T} T{ 3.5 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.redirected\fP T} T{ 3.5 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.rqueue\fP T} T{ 3.5 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.to_ignore\fP T} T{ 3.5 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.workers\fP T} T{ 3.5 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.wqueue\fP T} T{ 3.5 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.builders.linkcheck.node_line_or_0()\fP T} T{ 3.5 T} T{ 5.0 T} T{ \fBsphinx.util.nodes.get_node_line()\fP T} _ T{ \fBsphinx.ext.autodoc.AttributeDocumenter.isinstanceattribute()\fP T} T{ 3.5 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.ext.autodoc.importer.get_module_members()\fP T} T{ 3.5 T} T{ 5.0 T} T{ \fBsphinx.ext.autodoc.ModuleDocumenter.get_module_members()\fP T} _ T{ \fBsphinx.ext.autosummary.generate._simple_info()\fP T} T{ 3.5 T} T{ 5.0 T} T{ Logging API \%<#\:logging-api> T} _ T{ \fBsphinx.ext.autosummary.generate._simple_warn()\fP T} T{ 3.5 T} T{ 5.0 T} T{ Logging API \%<#\:logging-api> T} _ T{ \fBsphinx.writers.html.HTMLTranslator.permalink_text\fP T} T{ 3.5 T} T{ 5.0 T} T{ \fBhtml_permalinks_icon\fP \%<#\:confval-html_permalinks_icon> T} _ T{ \fBsphinx.writers.html5.HTML5Translator.permalink_text\fP T} T{ 3.5 T} T{ 5.0 T} T{ \fBhtml_permalinks_icon\fP \%<#\:confval-html_permalinks_icon> T} _ T{ The \fBfollow_wrapped\fP argument of \fBsphinx.util.inspect.signature()\fP T} T{ 3.4 T} T{ 5.0 T} T{ N/A T} _ T{ The \fBno_docstring\fP argument of \fBsphinx.ext.autodoc.Documenter.add_content()\fP T} T{ 3.4 T} T{ 5.0 T} T{ \fBsphinx.ext.autodoc.Documenter.get_doc()\fP T} _ T{ \fBsphinx.ext.autodoc.Documenter.get_object_members()\fP T} T{ 3.4 T} T{ 6.0 T} T{ \fBsphinx.ext.autodoc.ClassDocumenter.get_object_members()\fP T} _ T{ \fBsphinx.ext.autodoc.DataDeclarationDocumenter\fP T} T{ 3.4 T} T{ 5.0 T} T{ \fBsphinx.ext.autodoc.DataDocumenter\fP T} _ T{ \fBsphinx.ext.autodoc.GenericAliasDocumenter\fP T} T{ 3.4 T} T{ 5.0 T} T{ \fBsphinx.ext.autodoc.DataDocumenter\fP T} _ T{ \fBsphinx.ext.autodoc.InstanceAttributeDocumenter\fP T} T{ 3.4 T} T{ 5.0 T} T{ \fBsphinx.ext.autodoc.AttributeDocumenter\fP T} _ T{ \fBsphinx.ext.autodoc.SlotsAttributeDocumenter\fP T} T{ 3.4 T} T{ 5.0 T} T{ \fBsphinx.ext.autodoc.AttributeDocumenter\fP T} _ T{ \fBsphinx.ext.autodoc.TypeVarDocumenter\fP T} T{ 3.4 T} T{ 5.0 T} T{ \fBsphinx.ext.autodoc.DataDocumenter\fP T} _ T{ \fBsphinx.ext.autodoc.directive.DocumenterBridge.reporter\fP T} T{ 3.5 T} T{ 5.0 T} T{ \fBsphinx.util.logging\fP T} _ T{ \fBsphinx.ext.autodoc.importer._getannotations()\fP T} T{ 3.4 T} T{ 4.0 T} T{ \fBsphinx.util.inspect.getannotations()\fP T} _ T{ \fBsphinx.ext.autodoc.importer._getmro()\fP T} T{ 3.4 T} T{ 4.0 T} T{ \fBsphinx.util.inspect.getmro()\fP T} _ T{ \fBsphinx.pycode.ModuleAnalyzer.parse()\fP T} T{ 3.4 T} T{ 5.0 T} T{ \fBsphinx.pycode.ModuleAnalyzer.analyze()\fP T} _ T{ \fBsphinx.util.osutil.movefile()\fP T} T{ 3.4 T} T{ 5.0 T} T{ \fBos.replace()\fP T} _ T{ \fBsphinx.util.requests.is_ssl_error()\fP T} T{ 3.4 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.builders.latex.LaTeXBuilder.usepackages\fP T} T{ 3.3 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.builders.latex.LaTeXBuilder.usepackages_afger_hyperref\fP T} T{ 3.3 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.ext.autodoc.SingledispatchFunctionDocumenter\fP T} T{ 3.3 T} T{ 5.0 T} T{ \fBsphinx.ext.autodoc.FunctionDocumenter\fP T} _ T{ \fBsphinx.ext.autodoc.SingledispatchMethodDocumenter\fP T} T{ 3.3 T} T{ 5.0 T} T{ \fBsphinx.ext.autodoc.MethodDocumenter\fP T} _ T{ \fBsphinx.ext.autodoc.members_set_option()\fP T} T{ 3.2 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.ext.autodoc.merge_special_members_option()\fP T} T{ 3.2 T} T{ 5.0 T} T{ \fBsphinx.ext.autodoc.merge_members_option()\fP T} _ T{ \fBsphinx.writers.texinfo.TexinfoWriter.desc\fP T} T{ 3.2 T} T{ 5.0 T} T{ \fBsphinx.writers.texinfo.TexinfoWriter.descs\fP T} _ T{ The first argument for \fBsphinx.ext.autosummary.generate.AutosummaryRenderer\fP has been changed to Sphinx object T} T{ 3.1 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.ext.autosummary.generate.AutosummaryRenderer\fP takes an object type as an argument T} T{ 3.1 T} T{ 5.0 T} T{ N/A T} _ T{ The \fBignore\fP argument of \fBsphinx.ext.autodoc.Documenter.get_doc()\fP T} T{ 3.1 T} T{ 5.0 T} T{ N/A T} _ T{ The \fBtemplate_dir\fP argument of \fBsphinx.ext.autosummary.generate.AutosummaryRenderer\fP T} T{ 3.1 T} T{ 5.0 T} T{ N/A T} _ T{ The \fBmodule\fP argument of \fBsphinx.ext.autosummary.generate.find_autosummary_in_docstring()\fP T} T{ 3.0 T} T{ 5.0 T} T{ N/A T} _ T{ The \fBbuilder\fP argument of \fBsphinx.ext.autosummary.generate.generate_autosummary_docs()\fP T} T{ 3.1 T} T{ 5.0 T} T{ N/A T} _ T{ The \fBtemplate_dir\fP argument of \fBsphinx.ext.autosummary.generate.generate_autosummary_docs()\fP T} T{ 3.1 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.ext.autosummary.generate.AutosummaryRenderer.exists()\fP T} T{ 3.1 T} T{ 5.0 T} T{ N/A T} _ T{ The \fBignore\fP argument of \fBsphinx.util.docstring.prepare_docstring()\fP T} T{ 3.1 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.util.rpartition()\fP T} T{ 3.1 T} T{ 5.0 T} T{ \fBstr.rpartition()\fP T} _ T{ \fBdesc_signature[\(aqfirst\(aq]\fP T} T{ T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.directives.DescDirective\fP T} T{ 3.0 T} T{ 5.0 T} T{ \fBsphinx.directives.ObjectDescription\fP T} _ T{ \fBsphinx.domains.std.StandardDomain.add_object()\fP T} T{ 3.0 T} T{ 5.0 T} T{ \fBsphinx.domains.std.StandardDomain.note_object()\fP T} _ T{ \fBsphinx.domains.python.PyDecoratorMixin\fP T} T{ 3.0 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.ext.autodoc.get_documenters()\fP T} T{ 3.0 T} T{ 5.0 T} T{ \fBsphinx.registry.documenters\fP T} _ T{ \fBsphinx.ext.autosummary.process_autosummary_toc()\fP T} T{ 3.0 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.parsers.Parser.app\fP T} T{ 3.0 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.testing.path.Path.text()\fP T} T{ 3.0 T} T{ 5.0 T} T{ \fBsphinx.testing.path.Path.read_text()\fP T} _ T{ \fBsphinx.testing.path.Path.bytes()\fP T} T{ 3.0 T} T{ 5.0 T} T{ \fBsphinx.testing.path.Path.read_bytes()\fP T} _ T{ \fBsphinx.util.inspect.getargspec()\fP T} T{ 3.0 T} T{ 5.0 T} T{ \fBinspect.getargspec()\fP T} _ T{ \fBsphinx.writers.latex.LaTeXWriter.format_docclass()\fP T} T{ 3.0 T} T{ 5.0 T} T{ LaTeX Themes T} _ T{ \fBdecode\fP argument of \fBsphinx.pycode.ModuleAnalyzer()\fP T} T{ 2.4 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.directives.other.Index\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.domains.index.IndexDirective\fP T} _ T{ \fBsphinx.environment.temp_data[\(aqgloss_entries\(aq]\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBdocuments.nameids\fP T} _ T{ \fBsphinx.environment.BuildEnvironment.indexentries\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.domains.index.IndexDomain\fP T} _ T{ \fBsphinx.environment.collectors.indexentries.IndexEntriesCollector\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.domains.index.IndexDomain\fP T} _ T{ \fBsphinx.io.FiletypeNotFoundError\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.errors.FiletypeNotFoundError\fP T} _ T{ \fBsphinx.ext.apidoc.INITPY\fP T} T{ 2.4 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.ext.apidoc.shall_skip()\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.ext.apidoc.is_skipped_package\fP T} _ T{ \fBsphinx.io.get_filetype()\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.util.get_filetype()\fP T} _ T{ \fBsphinx.pycode.ModuleAnalyzer.encoding\fP T} T{ 2.4 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.roles.Index\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.domains.index.IndexRole\fP T} _ T{ \fBsphinx.util.detect_encoding()\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBtokenize.detect_encoding()\fP T} _ T{ \fBsphinx.util.get_module_source()\fP T} T{ 2.4 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.util.inspect.Signature\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.util.inspect.signature\fP and \fBsphinx.util.inspect.stringify_signature()\fP T} _ T{ \fBsphinx.util.inspect.safe_getmembers()\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBinspect.getmembers()\fP T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.settings.author\fP T} T{ 2.4 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.settings.contentsname\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBdocument[\(aqcontentsname\(aq]\fP T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.settings.docclass\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBdocument[\(aqdocclass\(aq]\fP T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.settings.docname\fP T} T{ 2.4 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.settings.title\fP T} T{ 2.4 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.ADDITIONAL_SETTINGS\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.builders.latex.constants.ADDITIONAL_SETTINGS\fP T} _ T{ \fBsphinx.writers.latex.DEFAULT_SETTINGS\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.builders.latex.constants.DEFAULT_SETTINGS\fP T} _ T{ \fBsphinx.writers.latex.LUALATEX_DEFAULT_FONTPKG\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.builders.latex.constants.LUALATEX_DEFAULT_FONTPKG\fP T} _ T{ \fBsphinx.writers.latex.PDFLATEX_DEFAULT_FONTPKG\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.builders.latex.constants.PDFLATEX_DEFAULT_FONTPKG\fP T} _ T{ \fBsphinx.writers.latex.XELATEX_DEFAULT_FONTPKG\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.builders.latex.constants.XELATEX_DEFAULT_FONTPKG\fP T} _ T{ \fBsphinx.writers.latex.XELATEX_GREEK_DEFAULT_FONTPKG\fP T} T{ 2.4 T} T{ 4.0 T} T{ \fBsphinx.builders.latex.constants.XELATEX_GREEK_DEFAULT_FONTPKG\fP T} _ T{ \fBsphinx.builders.gettext.POHEADER\fP T} T{ 2.3 T} T{ 4.0 T} T{ \fBsphinx/templates/gettext/message.pot_t\fP (template file) T} _ T{ \fBsphinx.io.SphinxStandaloneReader.app\fP T} T{ 2.3 T} T{ 4.0 T} T{ \fBsphinx.io.SphinxStandaloneReader.setup()\fP T} _ T{ \fBsphinx.io.SphinxStandaloneReader.env\fP T} T{ 2.3 T} T{ 4.0 T} T{ \fBsphinx.io.SphinxStandaloneReader.setup()\fP T} _ T{ \fBsphinx.util.texescape.tex_escape_map\fP T} T{ 2.3 T} T{ 4.0 T} T{ \fBsphinx.util.texescape.escape()\fP T} _ T{ \fBsphinx.util.texescape.tex_hl_escape_map_new\fP T} T{ 2.3 T} T{ 4.0 T} T{ \fBsphinx.util.texescape.hlescape()\fP T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.no_contractions\fP T} T{ 2.3 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.domains.math.MathDomain.add_equation()\fP T} T{ 2.2 T} T{ 4.0 T} T{ \fBsphinx.domains.math.MathDomain.note_equation()\fP T} _ T{ \fBsphinx.domains.math.MathDomain.get_next_equation_number()\fP T} T{ 2.2 T} T{ 4.0 T} T{ \fBsphinx.domains.math.MathDomain.note_equation()\fP T} _ T{ The \fBinfo\fP and \fBwarn\fP arguments of \fBsphinx.ext.autosummary.generate.generate_autosummary_docs()\fP T} T{ 2.2 T} T{ 4.0 T} T{ \fBlogging.info()\fP and \fBlogging.warning()\fP T} _ T{ \fBsphinx.ext.autosummary.generate._simple_info()\fP T} T{ 2.2 T} T{ 4.0 T} T{ \fBlogging.info()\fP T} _ T{ \fBsphinx.ext.autosummary.generate._simple_warn()\fP T} T{ 2.2 T} T{ 4.0 T} T{ \fBlogging.warning()\fP T} _ T{ \fBsphinx.ext.todo.merge_info()\fP T} T{ 2.2 T} T{ 4.0 T} T{ \fBsphinx.ext.todo.TodoDomain\fP T} _ T{ \fBsphinx.ext.todo.process_todo_nodes()\fP T} T{ 2.2 T} T{ 4.0 T} T{ \fBsphinx.ext.todo.TodoDomain\fP T} _ T{ \fBsphinx.ext.todo.process_todos()\fP T} T{ 2.2 T} T{ 4.0 T} T{ \fBsphinx.ext.todo.TodoDomain\fP T} _ T{ \fBsphinx.ext.todo.purge_todos()\fP T} T{ 2.2 T} T{ 4.0 T} T{ \fBsphinx.ext.todo.TodoDomain\fP T} _ T{ \fBsphinx.builders.latex.LaTeXBuilder.apply_transforms()\fP T} T{ 2.1 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.builders._epub_base.EpubBuilder.esc()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBhtml.escape()\fP T} _ T{ \fBsphinx.directives.Acks\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.other.Acks\fP T} _ T{ \fBsphinx.directives.Author\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.other.Author\fP T} _ T{ \fBsphinx.directives.Centered\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.other.Centered\fP T} _ T{ \fBsphinx.directives.Class\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.other.Class\fP T} _ T{ \fBsphinx.directives.CodeBlock\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.code.CodeBlock\fP T} _ T{ \fBsphinx.directives.Figure\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.patches.Figure\fP T} _ T{ \fBsphinx.directives.HList\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.other.HList\fP T} _ T{ \fBsphinx.directives.Highlight\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.code.Highlight\fP T} _ T{ \fBsphinx.directives.Include\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.other.Include\fP T} _ T{ \fBsphinx.directives.Index\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.other.Index\fP T} _ T{ \fBsphinx.directives.LiteralInclude\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.code.LiteralInclude\fP T} _ T{ \fBsphinx.directives.Meta\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.patches.Meta\fP T} _ T{ \fBsphinx.directives.Only\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.other.Only\fP T} _ T{ \fBsphinx.directives.SeeAlso\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.other.SeeAlso\fP T} _ T{ \fBsphinx.directives.TabularColumns\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.other.TabularColumns\fP T} _ T{ \fBsphinx.directives.TocTree\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.other.TocTree\fP T} _ T{ \fBsphinx.directives.VersionChange\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.domains.changeset.VersionChange\fP T} _ T{ \fBsphinx.domains.python.PyClassmember\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.domains.python.PyAttribute\fP, \fBsphinx.domains.python.PyMethod\fP, \fBsphinx.domains.python.PyClassMethod\fP, \fBsphinx.domains.python.PyObject\fP and \fBsphinx.domains.python.PyStaticMethod\fP T} _ T{ \fBsphinx.domains.python.PyModulelevel\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.domains.python.PyFunction\fP, \fBsphinx.domains.python.PyObject\fP and \fBsphinx.domains.python.PyVariable\fP T} _ T{ \fBsphinx.domains.std.StandardDomain._resolve_citation_xref()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.domains.citation.CitationDomain.resolve_xref()\fP T} _ T{ \fBsphinx.domains.std.StandardDomain.note_citations()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.domains.citation.CitationDomain.note_citation()\fP T} _ T{ \fBsphinx.domains.std.StandardDomain.note_citation_refs()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.domains.citation.CitationDomain.note_citation_reference()\fP T} _ T{ \fBsphinx.domains.std.StandardDomain.note_labels()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.domains.std.StandardDomain.process_doc()\fP T} _ T{ \fBsphinx.domains.js.JSObject.display_prefix\fP T} T{ T} T{ 4.3 T} T{ \fBsphinx.domains.js.JSObject.get_display_prefix()\fP T} _ T{ \fBsphinx.environment.NoUri\fP T} T{ 2.1 T} T{ 3.0 T} T{ \fBsphinx.errors.NoUri\fP T} _ T{ \fBsphinx.ext.apidoc.format_directive()\fP T} T{ 2.1 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.ext.apidoc.format_heading()\fP T} T{ 2.1 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.ext.apidoc.makename()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.ext.apidoc.module_join()\fP T} _ T{ \fBsphinx.ext.autodoc.importer.MockFinder\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.ext.autodoc.mock.MockFinder\fP T} _ T{ \fBsphinx.ext.autodoc.importer.MockLoader\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.ext.autodoc.mock.MockLoader\fP T} _ T{ \fBsphinx.ext.autodoc.importer.mock()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.ext.autodoc.mock.mock()\fP T} _ T{ \fBsphinx.ext.autosummary.autolink_role()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.ext.autosummary.AutoLink\fP T} _ T{ \fBsphinx.ext.imgmath.DOC_BODY\fP T} T{ 2.1 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.ext.imgmath.DOC_BODY_PREVIEW\fP T} T{ 2.1 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.ext.imgmath.DOC_HEAD\fP T} T{ 2.1 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.transforms.CitationReferences\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.domains.citation.CitationReferenceTransform\fP T} _ T{ \fBsphinx.transforms.SmartQuotesSkipper\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.domains.citation.CitationDefinitionTransform\fP T} _ T{ \fBsphinx.util.docfields.DocFieldTransformer.preprocess_fieldtypes()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.directives.ObjectDescription.get_field_type_map()\fP T} _ T{ \fBsphinx.util.node.find_source_node()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.util.node.get_node_source()\fP T} _ T{ \fBsphinx.util.i18n.find_catalog()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.util.i18n.docname_to_domain()\fP T} _ T{ \fBsphinx.util.i18n.find_catalog_files()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.util.i18n.CatalogRepository\fP T} _ T{ \fBsphinx.util.i18n.find_catalog_source_files()\fP T} T{ 2.1 T} T{ 4.0 T} T{ \fBsphinx.util.i18n.CatalogRepository\fP T} _ T{ \fBencoding\fP argument of \fBautodoc.Documenter.get_doc()\fP, \fBautodoc.DocstringSignatureMixin.get_doc()\fP, \fBautodoc.DocstringSignatureMixin._find_signature()\fP, and \fBautodoc.ClassDocumenter.get_doc()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ arguments of \fBEpubBuilder.build_mimetype()\fP, \fBEpubBuilder.build_container()\fP, \fBEpubBuilder.build_content()\fP, \fBEpubBuilder.build_toc()\fP and \fBEpubBuilder.build_epub()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ arguments of \fBEpub3Builder.build_navigation_doc()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBnodetype\fP argument of \fBsphinx.search.WordCollector.is_meta_keywords()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsuffix\fP argument of \fBBuildEnvironment.doc2path()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ string style \fBbase\fP argument of \fBBuildEnvironment.doc2path()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBos.path.join()\fP T} _ T{ \fBsphinx.addnodes.abbreviation\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBdocutils.nodes.abbreviation\fP T} _ T{ \fBsphinx.builders.applehelp\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinxcontrib.applehelp\fP T} _ T{ \fBsphinx.builders.devhelp\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinxcontrib.devhelp\fP T} _ T{ \fBsphinx.builders.epub3.Epub3Builder.validate_config_value()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.builders.epub3.validate_config_values()\fP T} _ T{ \fBsphinx.builders.html.JSONHTMLBuilder\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.builders.serializinghtml.JSONHTMLBuilder\fP T} _ T{ \fBsphinx.builders.html.PickleHTMLBuilder\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.builders.serializinghtml.PickleHTMLBuilder\fP T} _ T{ \fBsphinx.builders.html.SerializingHTMLBuilder\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.builders.serializinghtml.SerializingHTMLBuilder\fP T} _ T{ \fBsphinx.builders.html.SingleFileHTMLBuilder\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.builders.singlehtml.SingleFileHTMLBuilder\fP T} _ T{ \fBsphinx.builders.html.WebHTMLBuilder\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.builders.serializinghtml.PickleHTMLBuilder\fP T} _ T{ \fBsphinx.builders.htmlhelp\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinxcontrib.htmlhelp\fP T} _ T{ \fBsphinx.builders.htmlhelp.HTMLHelpBuilder.open_file()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBopen()\fP T} _ T{ \fBsphinx.builders.qthelp\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinxcontrib.qthelp\fP T} _ T{ \fBsphinx.cmd.quickstart.term_decode()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.cmd.quickstart.TERM_ENCODING\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsys.stdin.encoding\fP T} _ T{ \fBsphinx.config.check_unicode()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.config.string_classes\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fB[str]\fP T} _ T{ \fBsphinx.domains.cpp.DefinitionError.description\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBstr(exc)\fP T} _ T{ \fBsphinx.domains.cpp.NoOldIdError.description\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBstr(exc)\fP T} _ T{ \fBsphinx.domains.cpp.UnsupportedMultiCharacterCharLiteral.decoded\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBstr(exc)\fP T} _ T{ \fBsphinx.ext.autosummary.Autosummary.warn()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.ext.autosummary.Autosummary.genopt\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.ext.autosummary.Autosummary.warnings\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.ext.autosummary.Autosummary.result\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.ext.doctest.doctest_encode()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.ext.jsmath\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinxcontrib.jsmath\fP T} _ T{ \fBsphinx.roles.abbr_role()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.roles.Abbreviation\fP T} _ T{ \fBsphinx.roles.emph_literal_role()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.roles.EmphasizedLiteral\fP T} _ T{ \fBsphinx.roles.menusel_role()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.roles.GUILabel\fP or \fBsphinx.roles.MenuSelection\fP T} _ T{ \fBsphinx.roles.index_role()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.roles.Index\fP T} _ T{ \fBsphinx.roles.indexmarkup_role()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.roles.PEP\fP or \fBsphinx.roles.RFC\fP T} _ T{ \fBsphinx.testing.util.remove_unicode_literal()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.util.attrdict\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.util.force_decode()\fP T} T{ 2.0 T} T{ 5.0 T} T{ N/A T} _ T{ \fBsphinx.util.get_matching_docs()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.util.get_matching_files()\fP T} _ T{ \fBsphinx.util.inspect.Parameter\fP T} T{ 2.0 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.util.jsonimpl\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinxcontrib.serializinghtml.jsonimpl\fP T} _ T{ \fBsphinx.util.osutil.EEXIST\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBerrno.EEXIST\fP or \fBFileExistsError\fP T} _ T{ \fBsphinx.util.osutil.EINVAL\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBerrno.EINVAL\fP T} _ T{ \fBsphinx.util.osutil.ENOENT\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBerrno.ENOENT\fP or \fBFileNotFoundError\fP T} _ T{ \fBsphinx.util.osutil.EPIPE\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBerrno.ENOENT\fP or \fBBrokenPipeError\fP T} _ T{ \fBsphinx.util.osutil.walk()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBos.walk()\fP T} _ T{ \fBsphinx.util.pycompat.NoneType\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.util.typing.NoneType\fP T} _ T{ \fBsphinx.util.pycompat.TextIOWrapper\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBio.TextIOWrapper\fP T} _ T{ \fBsphinx.util.pycompat.UnicodeMixin\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.util.pycompat.htmlescape()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBhtml.escape()\fP T} _ T{ \fBsphinx.util.pycompat.indent()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBtextwrap.indent()\fP T} _ T{ \fBsphinx.util.pycompat.sys_encoding\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsys.getdefaultencoding()\fP T} _ T{ \fBsphinx.util.pycompat.terminal_safe()\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.util.console.terminal_safe()\fP T} _ T{ \fBsphinx.util.pycompat.u\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.util.PeekableIterator\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ Omitting the \fBfilename\fP argument in an overriddent \fBIndexBuilder.feed()\fP method. T} T{ 2.0 T} T{ 4.0 T} T{ \fBIndexBuilder.feed(docname, filename, title, doctree)\fP T} _ T{ \fBsphinx.writers.latex.ExtBabel\fP T} T{ 2.0 T} T{ 4.0 T} T{ \fBsphinx.builders.latex.util.ExtBabel\fP T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.babel_defmacro()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.application.Sphinx._setting_up_extension\fP T} T{ 2.0 T} T{ 3.0 T} T{ N/A T} _ T{ The \fBimporter\fP argument of \fBsphinx.ext.autodoc.importer._MockModule\fP T} T{ 2.0 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.ext.autodoc.importer._MockImporter\fP T} T{ 2.0 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.io.SphinxBaseFileInput\fP T} T{ 2.0 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.io.SphinxFileInput.supported\fP T} T{ 2.0 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.io.SphinxRSTFileInput\fP T} T{ 2.0 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.registry.SphinxComponentRegistry.add_source_input()\fP T} T{ 2.0 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator._make_visit_admonition()\fP T} T{ 2.0 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.collect_footnotes()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBsphinx.writers.texinfo.TexinfoTranslator._make_visit_admonition()\fP T} T{ 2.0 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.text.TextTranslator._make_depart_admonition()\fP T} T{ 2.0 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.generate_numfig_format()\fP T} T{ 2.0 T} T{ 4.0 T} T{ N/A T} _ T{ \fBhighlightlang\fP T} T{ 1.8 T} T{ 4.0 T} T{ \fBhighlight\fP \%<#\:directive-highlight> T} _ T{ \fBadd_stylesheet()\fP T} T{ 1.8 T} T{ 6.0 T} T{ \fBadd_css_file()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_css_file> T} _ T{ \fBadd_javascript()\fP T} T{ 1.8 T} T{ 4.0 T} T{ \fBadd_js_file()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_js_file> T} _ T{ \fBautodoc_default_flags\fP T} T{ 1.8 T} T{ 4.0 T} T{ \fBautodoc_default_options\fP \%<#\:confval-autodoc_default_options> T} _ T{ \fBcontent\fP arguments of \fBsphinx.util.image.guess_mimetype()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBgettext_compact\fP arguments of \fBsphinx.util.i18n.find_catalog_source_files()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.io.SphinxI18nReader.set_lineno_for_reporter()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.io.SphinxI18nReader.line\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.directives.other.VersionChange\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.domains.changeset.VersionChange\fP T} _ T{ \fBsphinx.highlighting.PygmentsBridge.unhighlight()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBtrim_doctest_flags\fP arguments of \fBsphinx.highlighting.PygmentsBridge\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.ext.mathbase\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.ext.mathbase.MathDomain\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.domains.math.MathDomain\fP T} _ T{ \fBsphinx.ext.mathbase.MathDirective\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.directives.patches.MathDirective\fP T} _ T{ \fBsphinx.ext.mathbase.math_role()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBdocutils.parsers.rst.roles.math_role()\fP T} _ T{ \fBsphinx.ext.mathbase.setup_math()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBadd_html_math_renderer()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_html_math_renderer> T} _ T{ \fBsphinx.ext.mathbase.is_in_section_title()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.ext.mathbase.get_node_equation_number()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.util.math.get_node_equation_number()\fP T} _ T{ \fBsphinx.ext.mathbase.wrap_displaymath()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.util.math.wrap_displaymath()\fP T} _ T{ \fBsphinx.ext.mathbase.math\fP (node) T} T{ 1.8 T} T{ 3.0 T} T{ \fBdocutils.nodes.math\fP T} _ T{ \fBsphinx.ext.mathbase.displaymath\fP (node) T} T{ 1.8 T} T{ 3.0 T} T{ \fBdocutils.nodes.math_block\fP T} _ T{ \fBsphinx.ext.mathbase.eqref\fP (node) T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.builders.latex.nodes.math_reference\fP T} _ T{ \fBviewcode_import\fP (config value) T} T{ 1.8 T} T{ 3.0 T} T{ \fBviewcode_follow_imported_members\fP \%<#\:confval-viewcode_follow_imported_members> T} _ T{ \fBsphinx.writers.latex.Table.caption_footnotetexts\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.Table.header_footnotetexts\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.footnotestack\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.in_container_literal_block\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.next_section_ids\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.next_hyperlink_ids\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.restrict_footnote()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.unrestrict_footnote()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.push_hyperlink_ids()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.pop_hyperlink_ids()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.bibitems\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.hlsettingstack\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.ExtBabel.get_shorthandoff()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.html.HTMLTranslator.highlightlang()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.html.HTMLTranslator.highlightlang_base()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.html.HTMLTranslator.highlightlangopts()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.html.HTMLTranslator.highlightlinenothreshold()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.html5.HTMLTranslator.highlightlang()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.html5.HTMLTranslator.highlightlang_base()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.html5.HTMLTranslator.highlightlangopts()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.html5.HTMLTranslator.highlightlinenothreshold()\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBsphinx.writers.latex.LaTeXTranslator.check_latex_elements()\fP T} T{ 1.8 T} T{ 3.0 T} T{ Nothing T} _ T{ \fBsphinx.application.CONFIG_FILENAME\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.config.CONFIG_FILENAME\fP T} _ T{ \fBConfig.check_unicode()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.config.check_unicode()\fP T} _ T{ \fBConfig.check_types()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.config.check_confval_types()\fP T} _ T{ \fBdirname\fP, \fBfilename\fP and \fBtags\fP arguments of \fBConfig.__init__()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBConfig.read()\fP T} _ T{ The value of \fBhtml_search_options\fP \%<#\:confval-html_search_options> T} T{ 1.8 T} T{ 3.0 T} T{ see \fBhtml_search_options\fP \%<#\:confval-html_search_options> T} _ T{ \fBsphinx.versioning.prepare()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.versioning.UIDTransform\fP T} _ T{ \fBSphinx.override_domain()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBadd_domain()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_domain> T} _ T{ \fBSphinx.import_object()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.util.import_object()\fP T} _ T{ \fBsuffix\fP argument of \fBadd_source_parser()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_source_parser> T} T{ 1.8 T} T{ 3.0 T} T{ \fBadd_source_suffix()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_source_suffix> T} _ T{ \fBBuildEnvironment.load()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBpickle.load()\fP T} _ T{ \fBBuildEnvironment.loads()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBpickle.loads()\fP T} _ T{ \fBBuildEnvironment.frompickle()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBpickle.load()\fP T} _ T{ \fBBuildEnvironment.dump()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBpickle.dump()\fP T} _ T{ \fBBuildEnvironment.dumps()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBpickle.dumps()\fP T} _ T{ \fBBuildEnvironment.topickle()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBpickle.dump()\fP T} _ T{ \fBBuildEnvironment._nitpick_ignore\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBnitpick_ignore\fP \%<#\:confval-nitpick_ignore> T} _ T{ \fBBuildEnvironment.versionchanges\fP T} T{ 1.8 T} T{ 3.0 T} T{ N/A T} _ T{ \fBBuildEnvironment.update()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBBuilder.read()\fP T} _ T{ \fBBuildEnvironment.read_doc()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBBuilder.read_doc()\fP T} _ T{ \fBBuildEnvironment._read_serial()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBBuilder.read()\fP T} _ T{ \fBBuildEnvironment._read_parallel()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBBuilder.read()\fP T} _ T{ \fBBuildEnvironment.write_doctree()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBBuilder.write_doctree()\fP T} _ T{ \fBBuildEnvironment.note_versionchange()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBChangesDomain.note_changeset()\fP T} _ T{ \fBwarn()\fP (template helper function) T} T{ 1.8 T} T{ 3.0 T} T{ \fBwarning()\fP T} _ T{ \fBsource_parsers\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBadd_source_parser()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_source_parser> T} _ T{ \fBsphinx.util.docutils.directive_helper()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBDirective\fP class of docutils T} _ T{ \fBsphinx.cmdline\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.cmd.build\fP T} _ T{ \fBsphinx.make_mode\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.cmd.make_mode\fP T} _ T{ \fBsphinx.locale.l_()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.locale._()\fP \%<#\:sphinx\:.locale._> T} _ T{ \fBsphinx.locale.lazy_gettext()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.locale._()\fP \%<#\:sphinx\:.locale._> T} _ T{ \fBsphinx.locale.mygettext()\fP T} T{ 1.8 T} T{ 3.0 T} T{ \fBsphinx.locale._()\fP \%<#\:sphinx\:.locale._> T} _ T{ \fBsphinx.util.copy_static_entry()\fP T} T{ 1.5 T} T{ 3.0 T} T{ \fBsphinx.util.fileutil.copy_asset()\fP T} _ T{ \fBsphinx.build_main()\fP T} T{ 1.7 T} T{ 2.0 T} T{ \fBsphinx.cmd.build.build_main()\fP T} _ T{ \fBsphinx.ext.intersphinx.debug()\fP T} T{ 1.7 T} T{ 2.0 T} T{ \fBsphinx.ext.intersphinx.inspect_main()\fP T} _ T{ \fBsphinx.ext.autodoc.format_annotation()\fP T} T{ 1.7 T} T{ 2.0 T} T{ \fBsphinx.util.inspect.Signature\fP T} _ T{ \fBsphinx.ext.autodoc.formatargspec()\fP T} T{ 1.7 T} T{ 2.0 T} T{ \fBsphinx.util.inspect.Signature\fP T} _ T{ \fBsphinx.ext.autodoc.AutodocReporter\fP T} T{ 1.7 T} T{ 2.0 T} T{ \fBsphinx.util.docutils.switch_source_input()\fP T} _ T{ \fBsphinx.ext.autodoc.add_documenter()\fP T} T{ 1.7 T} T{ 2.0 T} T{ \fBadd_autodocumenter()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_autodocumenter> T} _ T{ \fBsphinx.ext.autodoc.AutoDirective._register\fP T} T{ 1.7 T} T{ 2.0 T} T{ \fBadd_autodocumenter()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_autodocumenter> T} _ T{ \fBAutoDirective._special_attrgetters\fP T} T{ 1.7 T} T{ 2.0 T} T{ \fBadd_autodoc_attrgetter()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_autodoc_attrgetter> T} _ T{ \fBSphinx.warn()\fP, \fBSphinx.info()\fP T} T{ 1.6 T} T{ 2.0 T} T{ Logging API \%<#\:logging-api> T} _ T{ \fBBuildEnvironment.set_warnfunc()\fP T} T{ 1.6 T} T{ 2.0 T} T{ Logging API \%<#\:logging-api> T} _ T{ \fBBuildEnvironment.note_toctree()\fP T} T{ 1.6 T} T{ 2.0 T} T{ \fBToctree.note()\fP (in \fBsphinx.environment.adapters.toctree\fP) T} _ T{ \fBBuildEnvironment.get_toc_for()\fP T} T{ 1.6 T} T{ 2.0 T} T{ \fBToctree.get_toc_for()\fP (in \fBsphinx.environment.adapters.toctree\fP) T} _ T{ \fBBuildEnvironment.get_toctree_for()\fP T} T{ 1.6 T} T{ 2.0 T} T{ \fBToctree.get_toctree_for()\fP (in \fBsphinx.environment.adapters.toctree\fP) T} _ T{ \fBBuildEnvironment.create_index()\fP T} T{ 1.6 T} T{ 2.0 T} T{ \fBIndexEntries.create_index()\fP (in \fBsphinx.environment.adapters.indexentries\fP) T} _ T{ \fBsphinx.websupport\fP T} T{ 1.6 T} T{ 2.0 T} T{ sphinxcontrib\-websupport \%<https://\:pypi\:.org/\:project/\:sphinxcontrib-websupport/> T} _ T{ \fBStandaloneHTMLBuilder.css_files\fP T} T{ 1.6 T} T{ 2.0 T} T{ \fBadd_stylesheet()\fP T} _ T{ \fBdocument.settings.gettext_compact\fP T} T{ 1.8 T} T{ 1.8 T} T{ \fBgettext_compact\fP \%<#\:confval-gettext_compact> T} _ T{ \fBSphinx.status_iterator()\fP T} T{ 1.6 T} T{ 1.7 T} T{ \fBsphinx.util.status_iterator()\fP T} _ T{ \fBSphinx.old_status_iterator()\fP T} T{ 1.6 T} T{ 1.7 T} T{ \fBsphinx.util.old_status_iterator()\fP T} _ T{ \fBSphinx._directive_helper()\fP T} T{ 1.6 T} T{ 1.7 T} T{ \fBsphinx.util.docutils.directive_helper()\fP T} _ T{ \fBsphinx.util.compat.Directive\fP T} T{ 1.6 T} T{ 1.7 T} T{ \fBdocutils.parsers.rst.Directive\fP T} _ T{ \fBsphinx.util.compat.docutils_version\fP T} T{ 1.6 T} T{ 1.7 T} T{ \fBsphinx.util.docutils.__version_info__\fP T} .TE .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 On deprecating on public APIs (internal functions and classes), we also follow the policy as much as possible. .UNINDENT .UNINDENT .SS LaTeX customization .sp Unlike the HTML builders \%<#\:html-themes>, the \fBlatex\fP builder does not benefit from prepared themes. The Options for LaTeX output \%<#\:latex-options>, and particularly the latex_elements variable, provides much of the interface for customization. For example: .INDENT 0.0 .INDENT 3.5 .sp .EX # inside conf.py latex_engine = \(aqxelatex\(aq latex_elements = { \(aqpassoptionstopackages\(aq: r\(aq\(aq\(aq \ePassOptionsToPackage{svgnames}{xcolor} \(aq\(aq\(aq, \(aqfontpkg\(aq: r\(aq\(aq\(aq \esetmainfont{DejaVu Serif} \esetsansfont{DejaVu Sans} \esetmonofont{DejaVu Sans Mono} \(aq\(aq\(aq, \(aqpreamble\(aq: r\(aq\(aq\(aq \eusepackage[titles]{tocloft} \ecftsetpnumwidth {1.25cm}\ecftsetrmarg{1.5cm} \esetlength{\ecftchapnumwidth}{0.75cm} \esetlength{\ecftsecindent}{\ecftchapnumwidth} \esetlength{\ecftsecnumwidth}{1.25cm} \(aq\(aq\(aq, \(aqsphinxsetup\(aq: \(aqTitleColor=DarkGoldenrod\(aq, \(aqfncychap\(aq: r\(aq\eusepackage[Bjornstrup]{fncychap}\(aq, \(aqprintindex\(aq: r\(aq\efootnotesize\eraggedright\eprintindex\(aq, } latex_show_urls = \(aqfootnote\(aq .EE .UNINDENT .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Keep in mind that backslashes must be doubled in Python string literals to avoid interpretation as escape sequences. Alternatively, you may use raw strings as is done above. .UNINDENT .UNINDENT .SS The \fBlatex_elements\fP configuration setting .sp A dictionary that contains LaTeX snippets overriding those Sphinx usually puts into the generated \fB\&.tex\fP files. Its \fB\(aqsphinxsetup\(aq\fP key is described separately\&. It allows also local configurations inserted in generated files, via raw \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:raw> directives. For example, in the PDF documentation this chapter is styled especially, as will be described later. .sp Keys that you may want to override include: .INDENT 0.0 .TP .B \fB\(aqpapersize\(aq\fP Paper size option of the document class (\fB\(aqa4paper\(aq\fP or \fB\(aqletterpaper\(aq\fP) .sp Default: \fB\(aqletterpaper\(aq\fP .TP .B \fB\(aqpointsize\(aq\fP Point size option of the document class (\fB\(aq10pt\(aq\fP, \fB\(aq11pt\(aq\fP or \fB\(aq12pt\(aq\fP) .sp Default: \fB\(aq10pt\(aq\fP .TP .B \fB\(aqpxunit\(aq\fP The value of the \fBpx\fP when used in image attributes \fBwidth\fP and \fBheight\fP\&. The default value is \fB\(aq0.75bp\(aq\fP which achieves \fB96px=1in\fP (in TeX \fB1in = 72bp = 72.27pt\fP\&.) To obtain for example \fB100px=1in\fP use \fB\(aq0.01in\(aq\fP or \fB\(aq0.7227pt\(aq\fP (the latter leads to TeX computing a more precise value, due to the smaller unit used in the specification); for \fB72px=1in\fP, simply use \fB\(aq1bp\(aq\fP; for \fB90px=1in\fP, use \fB\(aq0.8bp\(aq\fP or \fB\(aq0.803pt\(aq\fP\&. .sp Default: \fB\(aq0.75bp\(aq\fP .sp Added in version 1.5. .TP .B \fB\(aqpassoptionstopackages\(aq\fP A string which will be positioned early in the preamble, designed to contain \fB\ePassOptionsToPackage{options}{foo}\fP commands. .sp \fBHint:\fP .INDENT 7.0 .INDENT 3.5 It may be also used for loading LaTeX packages very early in the preamble. For example package \fBfancybox\fP is incompatible with being loaded via the \fB\(aqpreamble\(aq\fP key, it must be loaded earlier. .UNINDENT .UNINDENT .sp Default: \fB\(aq\(aq\fP .sp Added in version 1.4. .TP .B \fB\(aqbabel\(aq\fP \(dqbabel\(dq package inclusion, default \fBr\(aq\eusepackage{babel}\(aq\fP (the suitable document language string is passed as class option, and \fBenglish\fP is used if no language.) For Japanese documents, the default is the empty string. .sp With XeLaTeX and LuaLaTeX, Sphinx configures the LaTeX document to use polyglossia \%<https://\:ctan\:.org/\:pkg/\:polyglossia>, but one should be aware that current babel \%<https://\:ctan\:.org/\:pkg/\:babel> has improved its support for Unicode engines in recent years and for some languages it may make sense to prefer \fBbabel\fP over \fBpolyglossia\fP\&. .sp \fBHint:\fP .INDENT 7.0 .INDENT 3.5 After modifying a core LaTeX key like this one, clean up the LaTeX build repertory before next PDF build, else left\-over auxiliary files are likely to break the build. .UNINDENT .UNINDENT .sp Default: \fBr\(aq\eusepackage{babel}\(aq\fP (for Japanese documents) .sp Changed in version 1.5: For \fBlatex_engine\fP \%<#\:confval-latex_engine> set to \fB\(aqxelatex\(aq\fP, the default is \fB\(aq\e\eusepackage{polyglossia}\en\e\esetmainlanguage{<language>}\(aq\fP\&. .sp Changed in version 1.6: \fB\(aqlualatex\(aq\fP uses same default setting as \fB\(aqxelatex\(aq\fP .sp Changed in version 1.7.6: For French with \fB\(aqxelatex\(aq\fP (not \fB\(aqlualatex\(aq\fP) the default is to use \fBbabel\fP, not \fBpolyglossia\fP\&. .sp Changed in version 7.4.0: For French with \fB\(aqlualatex\(aq\fP the default is to use \fBbabel\fP\&. .UNINDENT .INDENT 0.0 .TP .B \fB\(aqfontpkg\(aq\fP Font package inclusion. The default with \fB\(aqpdflatex\(aq\fP is: .INDENT 7.0 .INDENT 3.5 .sp .EX r\(dq\(dq\(dq\eusepackage{tgtermes} \eusepackage{tgheros} \erenewcommand\ettdefault{txtt} \(dq\(dq\(dq .EE .UNINDENT .UNINDENT .sp For \fB\(aqxelatex\(aq\fP and \fB\(aqlualatex\(aq\fP on the other hand the \fB\esetmainfont\fP, \fB\esetsansfont\fP and \fB\esetmonofont\fP commands of LaTeX package \fBfontspec\fP (included via \(aqfontenc\(aq) are used to set up the OpenType fonts GNU FreeSerif, FreeSans, and FreeMono (scaled with ratio \fB0.9\fP) as document fonts. .sp Changed in version 1.2: Defaults to \fB\(aq\(aq\fP when the \fBlanguage\fP \%<#\:confval-language> uses the Cyrillic script. .sp Changed in version 2.0: Incorporates some font substitution commands to help support occasional Greek or Cyrillic in a document using \fB\(aqpdflatex\(aq\fP engine. At 4.0.0 these commands were moved to the \fB\(aqfontsubstitution\(aq\fP key. .sp Changed in version 4.0.0: The default font setting was changed. As shown above it still uses Times and Helvetica clones for serif and sans serif, but via better, more complete TeX fonts and associated LaTeX packages. The monospace font has been changed to better match the Times clone. .sp Changed in version 8.1.0: The monospace font FreeMono used with Unicode engines is loaded at scale \fB0.9\fP\&. This replaces the former mechanism via \(aqfvset\(aq which configured code\-blocks to use \fB\esmall\fP\&. Inline literals now fit better in their surrounding text, and it is easier to set up custom fonts, as \(aqfvset\(aq does not intervene anymore by default. .TP .B \fB\(aqfncychap\(aq\fP Inclusion of the \(dqfncychap\(dq package (which makes fancy chapter titles), default \fBr\(aq\eusepackage[Bjarne]{fncychap}\(aq\fP for English documentation (this option is slightly customized by Sphinx), \fBr\(aq\eusepackage[Sonny]{fncychap}\(aq\fP for internationalized docs (because the \(dqBjarne\(dq style uses numbers spelled out in English). Other \(dqfncychap\(dq styles you can try are \(dqLenny\(dq, \(dqGlenn\(dq, \(dqConny\(dq, \(dqRejne\(dq and \(dqBjornstrup\(dq. You can also set this to \fB\(aq\(aq\fP to disable fncychap. .sp Default: \fBr\(aq\eusepackage[Bjarne]{fncychap}\(aq\fP for English documents, \fBr\(aq\eusepackage[Sonny]{fncychap}\(aq\fP for internationalized documents, and \fB\(aq\(aq\fP for Japanese documents. .UNINDENT .INDENT 0.0 .TP .B \fB\(aqpreamble\(aq\fP Additional preamble content. One may move all needed macros into some file \fBmystyle.tex.txt\fP of the project source repertory, and get LaTeX to import it at run time: .INDENT 7.0 .INDENT 3.5 .sp .EX \(aqpreamble\(aq: r\(aq\einput{mystyle.tex.txt}\(aq, # or, if the \eProvidesPackage LaTeX macro is used in a file mystyle.sty \(aqpreamble\(aq: r\(aq\eusepackage{mystyle}\(aq, .EE .UNINDENT .UNINDENT .sp It is then needed to set appropriately \fBlatex_additional_files\fP \%<#\:confval-latex_additional_files>, for example: .INDENT 7.0 .INDENT 3.5 .sp .EX latex_additional_files = [\(dqmystyle.sty\(dq] .EE .UNINDENT .UNINDENT .sp Do not use \fB\&.tex\fP as suffix, else the file is submitted itself to the PDF build process, use \fB\&.tex.txt\fP or \fB\&.sty\fP as in the examples above. .sp Default: \fB\(aq\(aq\fP .TP .B \fB\(aqfigure_align\(aq\fP Latex figure float alignment. Whenever an image doesn\(aqt fit into the current page, it will be \(aqfloated\(aq into the next page but may be preceded by any other text. If you don\(aqt like this behavior, use \(aqH\(aq which will disable floating and position figures strictly in the order they appear in the source. .sp Default: \fB\(aqhtbp\(aq\fP (here, top, bottom, page) .sp Added in version 1.3. .TP .B \fB\(aqatendofbody\(aq\fP Additional document content (right before the indices). .sp Default: \fB\(aq\(aq\fP .sp Added in version 1.5. .TP .B \fB\(aqextrapackages\(aq\fP Additional LaTeX packages. For example: .INDENT 7.0 .INDENT 3.5 .sp .EX latex_elements = { \(aqextrapackages\(aq: r\(aq\eusepackage{isodate}\(aq } .EE .UNINDENT .UNINDENT .sp The specified LaTeX packages will be loaded before hyperref package and packages loaded from Sphinx extensions. .sp \fBHint:\fP .INDENT 7.0 .INDENT 3.5 If you\(aqd like to load additional LaTeX packages after hyperref, use \fB\(aqpreamble\(aq\fP key instead. .UNINDENT .UNINDENT .sp Default: \fB\(aq\(aq\fP .sp Added in version 2.3. .TP .B \fB\(aqfooter\(aq\fP Additional footer content (before the indices). .sp Default: \fB\(aq\(aq\fP .sp Deprecated since version 1.5: Use \fB\(aqatendofbody\(aq\fP key instead. .UNINDENT .sp Keys that don\(aqt need to be overridden unless in special cases are: .INDENT 0.0 .TP .B \fB\(aqextraclassoptions\(aq\fP The default is the empty string. Example: \fB\(aqextraclassoptions\(aq: \(aqopenany\(aq\fP will allow chapters (for documents of the \fB\(aqmanual\(aq\fP type) to start on any page. .sp Default: \fB\(aq\(aq\fP .sp Added in version 1.2. .sp Changed in version 1.6: Added this documentation. .TP .B \fB\(aqmaxlistdepth\(aq\fP LaTeX allows by default at most 6 levels for nesting list and quote\-like environments, with at most 4 enumerated lists, and 4 bullet lists. Setting this key for example to \fB\(aq10\(aq\fP (as a string) will allow up to 10 nested levels (of all sorts). Leaving it to the empty string means to obey the LaTeX default. .sp \fBWarning:\fP .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 Using this key may prove incompatible with some LaTeX packages or special document classes which do their own list customization. .IP \(bu 2 The key setting is silently \fIignored\fP if \fB\eusepackage{enumitem}\fP is executed inside the document preamble. Use then rather the dedicated commands of this LaTeX package. .UNINDENT .UNINDENT .UNINDENT .sp Default: \fB6\fP .sp Added in version 1.5. .TP .B \fB\(aqinputenc\(aq\fP \(dqinputenc\(dq package inclusion. .sp Default: \fBr\(aq\eusepackage[utf8]{inputenc}\(aq\fP when using pdflatex, else \fB\(aq\(aq\fP\&. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 If using \fButf8x\fP in place of \fButf8\fP it is mandatory to extend the LaTeX preamble with suitable \fB\ePreloadUnicodePage{<number>}\fP commands, as per the \fButf8x\fP documentation (\fBtexdoc ucs\fP on a TeXLive based TeX installation). Else, unexpected and possibly hard\-to\-spot problems (i.e. not causing a build crash) may arise in the PDF, in particular regarding hyperlinks. .sp Even if these precautions are taken, PDF build via \fBpdflatex\fP engine may crash due to upstream LaTeX not being fully compatible with \fButf8x\fP\&. For example, in certain circumstances related to code\-blocks, or attempting to include images whose filenames contain Unicode characters. Indeed, starting in 2015, upstream LaTeX with \fBpdflatex\fP engine has somewhat enhanced native support for Unicode and is becoming more and more incompatible with \fButf8x\fP\&. In particular, since the October 2019 LaTeX release, filenames can use Unicode characters, and even spaces. At Sphinx level this means e.g. that the image \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:image> and figure \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:figure> directives are now compatible with such filenames for PDF via LaTeX output. But this is broken if \fButf8x\fP is in use. .UNINDENT .UNINDENT .sp Changed in version 1.4.3: Previously \fBr\(aq\eusepackage[utf8]{inputenc}\(aq\fP was used for all compilers. .TP .B \fB\(aqcmappkg\(aq\fP \(dqcmap\(dq package inclusion. .sp Default: \fBr\(aq\eusepackage{cmap}\(aq\fP .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B \fB\(aqfontenc\(aq\fP Its default, for \fB\(aqpdflatex\(aq\fP as \fBlatex_engine\fP \%<#\:confval-latex_engine>, is \fBr\(aq\eusepackage[T1]{fontenc}\(aq\fP\&. Replace it (if using \fB\(aqpdflatex\(aq\fP) with: .INDENT 7.0 .IP \(bu 2 \fBr\(aq\eusepackage[X2,T1]{fontenc}\(aq\fP if you need occasional Cyrillic letters (физика частиц), .IP \(bu 2 \fBr\(aq\eusepackage[LGR,T1]{fontenc}\(aq\fP if you need occasional Greek letters (Σωματιδιακή φυσική), .IP \(bu 2 \fBr\(aq\eusepackage[LGR,X2,T1]{fontenc}\(aq\fP if you need both. .UNINDENT .sp The TeX installation may need some extra packages. For example, on Ubuntu xenial: .INDENT 7.0 .IP \(bu 2 \fBtexlive\-lang\-greek\fP and \fBcm\-super\fP are needed for Greek (\fBLGR\fP), .IP \(bu 2 \fBtexlive\-lang\-cyrillic\fP and \fBcm\-super\fP are needed for Cyrillic (\fBX2\fP). .UNINDENT .sp With \fB\(aqxelatex\(aq\fP and \fB\(aqlualatex\(aq\fP, support for Greek and Cyrillic is out\-of\-the\-box: this \(aqfontenc\(aq key defaults to including the LaTeX package \fBfontspec\fP (with some extras described below) and selects the GNU FreeSerif font as body font. See \(aqfontpkg\(aq\&. .sp Changed in version 1.5: Defaults to \fBr\(aq\eusepackage{fontspec}\(aq\fP if \fBlatex_engine\fP \%<#\:confval-latex_engine> is set to \fB\(aqxelatex\(aq\fP\&. .sp Changed in version 1.6: Defaults to \fBr\(aq\eusepackage{fontspec}\(aq\fP if \fBlatex_engine\fP \%<#\:confval-latex_engine> is set to \fB\(aqlualatex\(aq\fP\&. .sp Changed in version 2.0: \fB\(aqlualatex\(aq\fP executes additionally \fB\edefaultfontfeatures[\ermfamily,\esffamily]{}\fP to disable TeX ligatures for \fB<<\fP and \fB>>\fP\&. .sp Changed in version 2.0: Extra LaTeX configuration is automatically executed if \fBLGR\fP, \fBT2A\fP, or \fBX2\fP are detected in this key, in order to support occasional Greek or Cyrillic with \fB\(aqpdflatex\(aq\fP\&. .sp Changed in version 2.2.1: Documents having Greek as main language default to \fB\(aqxelatex\(aq\fP and should not set the \(aqfontenc\(aq key, which will load \fBfontspec\fP\&. .sp Changed in version 2.3.0: \fB\(aqxelatex\(aq\fP executes \fB\edefaultfontfeatures[\ermfamily,\esffamily]{}\fP in order to avoid contractions of \fB\-\-\fP into en\-dash and also transforms of straight quotes into curly quotes (which otherwise would happen even with \fBsmartquotes\fP \%<#\:confval-smartquotes> set to \fBFalse\fP). .TP .B \fB\(aqfontsubstitution\(aq\fP Ignored if \fB\(aqfontenc\(aq\fP was not configured to use \fBLGR\fP or \fBX2\fP (or \fBT2A\fP). In case \(aqfontpkg\(aq key is configured for usage with some TeX fonts known to be available in the \fBLGR\fP or \fBX2\fP encodings, set this one to be the empty string. Else leave to its default. .sp Ignored with \fBlatex_engine\fP \%<#\:confval-latex_engine> other than \fB\(aqpdflatex\(aq\fP\&. .sp Added in version 4.0.0. .TP .B \fB\(aqtextgreek\(aq\fP For the support of occasional Greek letters. .sp It is ignored with \fB\(aqplatex\(aq\fP, \fB\(aqxelatex\(aq\fP or \fB\(aqlualatex\(aq\fP as \fBlatex_engine\fP \%<#\:confval-latex_engine> and defaults to either the empty string or to \fBr\(aq\eusepackage{textalpha}\(aq\fP for \fB\(aqpdflatex\(aq\fP depending on whether the \fB\(aqfontenc\(aq\fP key was used with \fBLGR\fP or not. Only expert LaTeX users may want to customize this key. .sp It can also be used as \fBr\(aq\eusepackage{textalpha,alphabeta}\(aq\fP to let \fB\(aqpdflatex\(aq\fP support Greek Unicode input in \fBmath\fP \%<#\:directive-math> context. For example \fB:math:\(gaα\(ga\fP (U+03B1) will render as \ealpha\&. .sp Default: \fBr\(aq\eusepackage{textalpha}\(aq\fP or \fB\(aq\(aq\fP if \fBfontenc\fP does not include the \fBLGR\fP option. .sp Added in version 2.0. .TP .B \fB\(aqgeometry\(aq\fP \(dqgeometry\(dq package inclusion, defaults to \fBr\(aq\eusepackage{geometry}\(aq\fP or \fBr\(aq\eusepackage[dvipdfm]{geometry}\(aq\fP for Japanese documents. The Sphinx LaTeX style file executes additionally: .INDENT 7.0 .INDENT 3.5 .sp .EX \ePassOptionsToPackage{hmargin=1in,vmargin=1in,marginpar=0.5in}{geometry} .EE .UNINDENT .UNINDENT .sp which can be customized via corresponding \(aqsphinxsetup\(aq options\&. .sp Added in version 1.5. .sp Changed in version 1.5.2: \fBdvipdfm\fP option if \fBlatex_engine\fP \%<#\:confval-latex_engine> is \fB\(aqplatex\(aq\fP\&. .sp Added in version 1.5.3: The \(aqsphinxsetup\(aq keys for the margins\&. .sp Changed in version 1.5.3: The location in the LaTeX file has been moved to after \fB\eusepackage{sphinx}\fP and \fB\esphinxsetup{..}\fP, hence also after insertion of \(aqfontpkg\(aq key. This is in order to handle the paper layout options in a special way for Japanese documents: the text width will be set to an integer multiple of the \fIzenkaku\fP width, and the text height to an integer multiple of the baseline. See the hmargin documentation for more. .TP .B \fB\(aqhyperref\(aq\fP \(dqhyperref\(dq package inclusion; also loads package \(dqhypcap\(dq and issues \fB\eurlstyle{same}\fP\&. This is done after \fBsphinx.sty\fP file is loaded and before executing the contents of \fB\(aqpreamble\(aq\fP key. .sp \fBAttention:\fP .INDENT 7.0 .INDENT 3.5 Loading of packages \(dqhyperref\(dq and \(dqhypcap\(dq is mandatory. .UNINDENT .UNINDENT .sp Added in version 1.5: Previously this was done from inside \fBsphinx.sty\fP\&. .TP .B \fB\(aqmaketitle\(aq\fP \(dqmaketitle\(dq call. Override if you want to generate a differently styled title page. .sp \fBHint:\fP .INDENT 7.0 .INDENT 3.5 If the key value is set to \fBr\(aq\enewcommand\esphinxbackoftitlepage{<Extra material>}\esphinxmaketitle\(aq\fP, then \fB<Extra material>\fP will be typeset on back of title page (\fB\(aqmanual\(aq\fP docclass only). .UNINDENT .UNINDENT .sp Default: \fBr\(aq\esphinxmaketitle\(aq\fP .sp Changed in version 1.8.3: Original \fB\emaketitle\fP from document class is not overwritten, hence is reusable as part of some custom setting for this key. .sp Added in version 1.8.3: \fB\esphinxbackoftitlepage\fP optional macro. It can also be defined inside \fB\(aqpreamble\(aq\fP key rather than this one. .TP .B \fB\(aqreleasename\(aq\fP Value that prefixes \fB\(aqrelease\(aq\fP element on title page. As for \fItitle\fP and \fIauthor\fP used in the tuples of \fBlatex_documents\fP \%<#\:confval-latex_documents>, it is inserted as LaTeX markup. .sp Default: \fB\(aqRelease\(aq\fP .TP .B \fB\(aqtableofcontents\(aq\fP \(dqtableofcontents\(dq call. The default of \fBr\(aq\esphinxtableofcontents\(aq\fP is a wrapper of unmodified \fB\etableofcontents\fP, which may itself be customized by user loaded packages. Override if you want to generate a different table of contents or put content between the title page and the TOC. .sp Default: \fBr\(aq\esphinxtableofcontents\(aq\fP .sp Changed in version 1.5: Previously the meaning of \fB\etableofcontents\fP itself was modified by Sphinx. This created an incompatibility with dedicated packages modifying it also such as \(dqtocloft\(dq or \(dqetoc\(dq. .TP .B \fB\(aqtransition\(aq\fP Commands used to display transitions. Override if you want to display transitions differently. .sp Default: \fB\(aq\en\en\e\ebigskip\e\ehrule\e\ebigskip\en\en\(aq\fP .sp Added in version 1.2. .sp Changed in version 1.6: Remove unneeded \fB{}\fP formerly located after \fB\ehrule\fP\&. .TP .B \fB\(aqmakeindex\(aq\fP \(dqmakeindex\(dq call, the last thing before \fB\ebegin{document}\fP\&. With \fBr\(aq\eusepackage[columns=1]{idxlayout}\emakeindex\(aq\fP the index will use only one column. You may have to install \fBidxlayout\fP LaTeX package. .sp Default: \fBr\(aq\emakeindex\(aq\fP .TP .B \fB\(aqprintindex\(aq\fP \(dqprintindex\(dq call, the last thing in the file. Override if you want to generate the index differently, append some content after the index, or change the font. As LaTeX uses two\-column mode for the index it is often advisable to set this key to \fBr\(aq\efootnotesize\eraggedright\eprintindex\(aq\fP\&. Or, to obtain a one\-column index, use \fBr\(aq\edef\etwocolumn[#1]{#1}\eprintindex\(aq\fP (this trick may fail if using a custom document class; then try the \fBidxlayout\fP approach described in the documentation of the \fB\(aqmakeindex\(aq\fP key). .sp Default: \fBr\(aq\eprintindex\(aq\fP .UNINDENT .INDENT 0.0 .TP .B \fB\(aqfvset\(aq\fP Customization of \fBfancyvrb\fP LaTeX package. .sp The default value is \fBr\(aq\efvset{fontsize=auto}\(aq\fP which means that the font size will adjust correctly if a code\-block ends up in a footnote. You may need to modify this when using a custom monospace font, for example set it to \fBr\(aq\efvset{fontsize=\esmall}\(aq\fP if it is Courier\-like (for Unicode engines, it is recommended to use rather the \fBScale\fP interface of \fB\esetmonofont\fP LaTeX command from \fBfontspec\fP). .sp Default: \fBr\(aq\efvset{fontsize=auto}\(aq\fP .sp Added in version 1.8. .sp Changed in version 2.0: For \fB\(aqxelatex\(aq\fP and \fB\(aqlualatex\(aq\fP defaults to \fBr\(aq\efvset{fontsize=\esmall}\(aq\fP as this is adapted to the relative widths of the FreeFont family. .sp Changed in version 4.0.0: Changed default for \fB\(aqpdflatex\(aq\fP\&. Previously it was using \fBr\(aq\efvset{fontsize=\esmall}\(aq\fP\&. .sp Changed in version 4.1.0: Changed default for Chinese documents to \fBr\(aq\efvset{fontsize=\esmall,formatcom=\exeCJKVerbAddon}\(aq\fP .sp Changed in version 8.1.0: Changed default for \fB\(aqxelatex\(aq\fP and \fB\(aqlualatex\(aq\fP to be also \fBr\(aq\efvset{fontsize=auto}\(aq\fP\&. The rescaling for default monospace font FreeMono is now set via the LaTeX package \fBfontspec\fP interface rather. See \(aqfontpkg\(aq\&. .UNINDENT .sp Keys that are set by other options and therefore should not be overridden are: .sp \fB\(aqdocclass\(aq\fP \fB\(aqclassoptions\(aq\fP \fB\(aqtitle\(aq\fP \fB\(aqrelease\(aq\fP \fB\(aqauthor\(aq\fP .SS The \fBsphinxsetup\fP configuration setting .sp Added in version 1.5. .sp The \fB\(aqsphinxsetup\(aq\fP key of latex_elements provides a LaTeX\-type customization interface: .INDENT 0.0 .INDENT 3.5 .sp .EX latex_elements = { \(aqsphinxsetup\(aq: \(aqkey1=value1, key2=value2, ...\(aq, } .EE .UNINDENT .UNINDENT .sp LaTeX syntax for boolean keys requires \fIlowercase\fP \fBtrue\fP or \fBfalse\fP e.g \fB\(aqsphinxsetup\(aq: \(dqverbatimwrapslines=false\(dq\fP\&. If setting a boolean key to \fBtrue\fP, \fB=true\fP is optional. Spaces around the commas and equal signs are ignored, spaces inside LaTeX macros may be significant. Do not use ticks/quotes to enclose string or numerical values. .sp The \fB\(aqsphinxsetup\(aq\fP defaults to empty. If non\-empty, it will be passed as argument to the \fB\esphinxsetup\fP macro inside the document preamble, like this: .INDENT 0.0 .INDENT 3.5 .sp .EX \eusepackage{sphinx} \esphinxsetup{key1=value1, key2=value2,...} .EE .UNINDENT .UNINDENT .sp It is possible to insert uses of the \fB\esphinxsetup\fP LaTeX macro directly into the body of the document, via the \fBraw\fP directive: .INDENT 0.0 .INDENT 3.5 .sp .EX \&.. raw:: latex \ebegingroup \esphinxsetup{% TitleColor=DarkGoldenrod, ... more comma separated key=value using LaTeX syntax ... } All elements here will be under the influence of the raw \(ga\(ga\esphinxsetup\(ga\(ga settings. \&.. raw:: latex \eendgroup From here on, the raw \(ga\(ga\esphinxsetup\(ga\(ga has no effect anymore. .EE .UNINDENT .UNINDENT .sp This is the technique which has been used to style especially the present part of the documentation for the PDF output. The actually used options will be found at top of \fBdoc/latex.rst\fP at the development repository \%<https://\:github\:.com/\:sphinx-doc/\:sphinx>\&. .sp The color used in the above example is available from having passed the \fBsvgnames\fP option to the \(dqxcolor\(dq package: .INDENT 0.0 .INDENT 3.5 .sp .EX latex_elements = { \(aqpassoptionstopackages\(aq: r\(aq\ePassOptionsToPackage{svgnames}{xcolor}\(aq, } .EE .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fBbookmarksdepth\fP Controls the depth of the collapsible bookmarks panel in the PDF. May be either a number (e.g. \fB3\fP) or a LaTeX sectioning name (e.g. \fBsubsubsection\fP, i.e. without backslash). For details, refer to the \fBhyperref\fP LaTeX docs. .sp Default: \fB5\fP .sp Added in version 4.0.0. .UNINDENT .INDENT 0.0 .TP .B \fBhmargin, vmargin\fP The dimensions of the horizontal (resp. vertical) margins, passed as \fBhmargin\fP (resp. \fBvmargin\fP) option to the \fBgeometry\fP package. Example: .INDENT 7.0 .INDENT 3.5 .sp .EX \(aqsphinxsetup\(aq: \(aqhmargin={2in,1.5in}, vmargin={1.5in,2in}, marginpar=1in\(aq, .EE .UNINDENT .UNINDENT .sp Japanese documents currently accept only the one\-dimension format for these parameters. The \fBgeometry\fP package is then passed suitable options to get the text width set to an exact multiple of the \fIzenkaku\fP width, and the text height set to an integer multiple of the baselineskip, with the closest fit for the margins. .sp Default: \fB1in\fP (equivalent to \fB{1in,1in}\fP) .sp \fBHint:\fP .INDENT 7.0 .INDENT 3.5 For Japanese \fB\(aqmanual\(aq\fP docclass with pointsize \fB11pt\fP or \fB12pt\fP, use the \fBnomag\fP extra document class option (cf. \fB\(aqextraclassoptions\(aq\fP key of \fBlatex_elements\fP \%<#\:confval-latex_elements>) or so\-called TeX \(dqtrue\(dq units: .INDENT 0.0 .INDENT 3.5 .sp .EX \(aqsphinxsetup\(aq: \(aqhmargin=1.5truein, vmargin=1.5truein, marginpar=5zw\(aq, .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp Added in version 1.5.3. .TP .B \fBmarginpar\fP The \fB\emarginparwidth\fP LaTeX dimension. For Japanese documents, the value is modified to be the closest integer multiple of the \fIzenkaku\fP width. .sp Default: \fB0.5in\fP .sp Added in version 1.5.3. .TP .B \fBmathnumsep\fP This defaults to the string (without quotes!) as set by \fBmath_numsep\fP \%<#\:confval-math_numsep> (which itself defaults to \fB\(aq.\(aq\fP). Use it if a different setting is needed for LaTeX output. .sp Added in version 8.1.0. .TP .B \fBliteralblockcappos\fP Decides the caption position: either \fBb\fP (\(dqbottom\(dq) or \fBt\fP (\(dqtop\(dq). .sp Default: \fBt\fP .sp Added in version 1.7. .TP .B \fBverbatimwithframe\fP Boolean to specify if \fBcode\-block\fP \%<#\:directive-code-block>s and literal includes are framed. Setting it to \fBfalse\fP does not deactivate use of package \(dqframed\(dq, because it is still in use for the optional background color. .sp Default: \fBtrue\fP\&. .TP .B \fBverbatimwrapslines\fP Boolean to specify if long lines in \fBcode\-block\fP \%<#\:directive-code-block>\(aqs contents are wrapped. .sp If \fBtrue\fP, line breaks may happen at spaces (the last space before the line break will be rendered using a special symbol), and at ASCII punctuation characters (i.e. not at letters or digits). Whenever a long string has no break points, it is moved to next line. If its length is longer than the line width it will overflow. .sp Default: \fBtrue\fP .UNINDENT .INDENT 0.0 .TP .B \fBverbatimforcewraps\fP Boolean to specify if long lines in \fBcode\-block\fP \%<#\:directive-code-block>\(aqs contents should be forcefully wrapped to never overflow due to long strings. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 It is assumed that the Pygments \%<https://\:pygments\:.org/> LaTeXFormatter has not been used with its \fBtexcomments\fP or similar options which allow additional (arbitrary) LaTeX mark\-up. .sp Also, in case of \fBlatex_engine\fP \%<#\:confval-latex_engine> set to \fB\(aqpdflatex\(aq\fP, only the default LaTeX handling of Unicode code points, i.e. \fButf8\fP not \fButf8x\fP is allowed. .UNINDENT .UNINDENT .sp Default: \fBfalse\fP .sp Added in version 3.5.0. .TP .B \fBverbatimmaxoverfull\fP A number. If an unbreakable long string has length larger than the total linewidth plus this number of characters, and if \fBverbatimforcewraps\fP mode is on, the input line will be reset using the forceful algorithm which applies breakpoints at each character. .sp Default: \fB3\fP .sp Added in version 3.5.0. .TP .B \fBverbatimmaxunderfull\fP A number. If \fBverbatimforcewraps\fP mode applies, and if after applying the line wrapping at spaces and punctuation, the first part of the split line is lacking at least that number of characters to fill the available width, then the input line will be reset using the forceful algorithm. .sp As the default is set to a high value, the forceful algorithm is triggered only in overfull case, i.e. in presence of a string longer than full linewidth. Set this to \fB0\fP to force all input lines to be hard wrapped at the current available linewidth: .INDENT 7.0 .INDENT 3.5 .sp .EX latex_elements = { \(aqsphinxsetup\(aq: \(dqverbatimforcewraps, verbatimmaxunderfull=0\(dq, } .EE .UNINDENT .UNINDENT .sp This can be done locally for a given code\-block via the use of raw latex directives to insert suitable \fB\esphinxsetup\fP (before and after) into the latex file. .sp Default: \fB100\fP .sp Added in version 3.5.0. .TP .B \fBverbatimhintsturnover\fP Boolean to specify if code\-blocks display \(dqcontinued on next page\(dq and \(dqcontinued from previous page\(dq hints in case of page breaks. .sp Default: \fBtrue\fP .sp Added in version 1.6.3. .sp Changed in version 1.7: the default changed from \fBfalse\fP to \fBtrue\fP\&. .TP .B \fBverbatimcontinuedalign\fP, \fBverbatimcontinuesalign\fP Horizontal position relative to the framed contents: either \fBl\fP (left aligned), \fBr\fP (right aligned) or \fBc\fP (centered). .sp Default: \fBr\fP .sp Added in version 1.7. .TP .B \fBparsedliteralwraps\fP Boolean to specify if long lines in parsed\-literal \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:parsed-literal>\(aqs contents should wrap. .sp Default: \fBtrue\fP .sp Added in version 1.5.2: set this option value to \fBfalse\fP to recover former behavior. .TP .B \fBinlineliteralwraps\fP Boolean to specify if line breaks are allowed inside inline literals: but extra potential break\-points (additionally to those allowed by LaTeX at spaces or for hyphenation) are currently inserted only after the characters \fB\&. , ; ? ! /\fP and \fB\e\fP\&. Due to TeX internals, white space in the line will be stretched (or shrunk) in order to accommodate the linebreak. .sp Default: \fBtrue\fP .sp Added in version 1.5: set this option value to \fBfalse\fP to recover former behavior. .sp Changed in version 2.3.0: added potential breakpoint at \fB\e\fP characters. .TP .B \fBverbatimvisiblespace\fP When a long code line is split, the last space character from the source code line right before the linebreak location is typeset using this. .sp Default: \fB\etextcolor{red}{\etextvisiblespace}\fP .TP .B \fBverbatimcontinued\fP A LaTeX macro inserted at start of continuation code lines. Its (complicated...) default typesets a small red hook pointing to the right: .INDENT 7.0 .INDENT 3.5 .sp .EX \emakebox[2\efontcharwd\efont\(ga\ex][r]{\etextcolor{red}{\etiny$\ehookrightarrow$}} .EE .UNINDENT .UNINDENT .sp Changed in version 1.5: The breaking of long code lines was added at 1.4.2. The default definition of the continuation symbol was changed at 1.5 to accommodate various font sizes (e.g. code\-blocks can be in footnotes). .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 Values for color keys must either: .INDENT 0.0 .IP \(bu 2 obey the syntax of the \fB\edefinecolor\fP LaTeX command, e.g. something such as \fBVerbatimColor={rgb}{0.2,0.3,0.5}\fP or \fB{RGB}{37,23,255}\fP or \fB{gray}{0.75}\fP or \fB{HTML}{808080}\fP or \&... .IP \(bu 2 or obey the syntax of the \fB\ecolorlet\fP command from package \fBxcolor\fP e.g. \fBVerbatimColor=red!10\fP or \fBred!50!green\fP or \fB\-red!75\fP or \fBMyPreviouslyDefinedColor\fP or... Refer to xcolor \%<https://\:ctan\:.org/\:pkg/\:xcolor> documentation for this syntax. .UNINDENT .sp Changed in version 5.3.0: Formerly only the \fB\edefinecolor\fP syntax was accepted. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fBTitleColor\fP The color for titles (as configured via use of package \(dqtitlesec\(dq.) .sp Default: \fB{rgb}{0.126,0.263,0.361}\fP .TP .B \fBInnerLinkColor\fP A color passed to \fBhyperref\fP as value of \fBlinkcolor\fP and \fBcitecolor\fP\&. .sp Default: \fB{rgb}{0.208,0.374,0.486}\fP\&. .TP .B \fBOuterLinkColor\fP A color passed to \fBhyperref\fP as value of \fBfilecolor\fP, \fBmenucolor\fP, and \fBurlcolor\fP\&. .sp Default: \fB{rgb}{0.216,0.439,0.388}\fP .TP .B \fBVerbatimColor\fP The background color for \fBcode\-block\fP \%<#\:directive-code-block>s. .sp Default: \fB{RGB}{242,242,242}\fP (same as \fB{gray}{0.95}\fP). .sp Changed in version 6.0.0: Formerly, it was \fB{rgb}{1,1,1}\fP (white). .TP .B \fBVerbatimBorderColor\fP The frame color. .sp Default: \fB{RGB}{32,32,32}\fP .sp Changed in version 6.0.0: Formerly it was \fB{rgb}{0,0,0}\fP (black). .TP .B \fBVerbatimHighlightColor\fP The color for highlighted lines. .sp Default: \fB{rgb}{0.878,1,1}\fP .sp Added in version 1.6.6. .UNINDENT .INDENT 0.0 .TP .B \fBTableRowColorHeader\fP Sets the background color for (all) the header rows of tables. .sp It will have an effect only if either the \fBlatex_table_style\fP \%<#\:confval-latex_table_style> contains \fB\(aqcolorrows\(aq\fP or if the table is assigned the \fBcolorrows\fP class. It is ignored for tables with \fBnocolorrows\fP class. .sp As for the other \fB\(aqsphinxsetup\(aq\fP keys, it can also be set or modified from a \fB\esphinxsetup{...}\fP LaTeX command inserted via the raw \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:raw> directive, or also from a LaTeX environment associated to a container class and using such \fB\esphinxsetup{...}\fP\&. .sp Default: \fB{gray}{0.86}\fP .sp There is also \fBTableMergeColorHeader\fP\&. If used, sets a specific color for merged single\-row cells in the header. .sp Added in version 5.3.0. .TP .B \fBTableRowColorOdd\fP Sets the background color for odd rows in tables (the row count starts at \fB1\fP at the first non\-header row). Has an effect only if the \fBlatex_table_style\fP \%<#\:confval-latex_table_style> contains \fB\(aqcolorrows\(aq\fP or for specific tables assigned the \fBcolorrows\fP class. .sp Default: \fB{gray}{0.92}\fP .sp There is also \fBTableMergeColorOdd\fP\&. .sp Added in version 5.3.0. .TP .B \fBTableRowColorEven\fP Sets the background color for even rows in tables. .sp Default \fB{gray}{0.98}\fP .sp There is also \fBTableMergeColorEven\fP\&. .sp Added in version 5.3.0. .TP .B \fBverbatimsep\fP The separation between code lines and the frame. .sp See Additional CSS\-like \(aqsphinxsetup\(aq keys for its alias \fBpre_padding\fP and additional keys. .sp Default: \fB\efboxsep\fP .TP .B \fBverbatimborder\fP The width of the frame around \fBcode\-block\fP \%<#\:directive-code-block>s. See also Additional CSS\-like \(aqsphinxsetup\(aq keys for \fBpre_border\-width\fP\&. .sp Default: \fB\efboxrule\fP .UNINDENT .sp \fBImportant:\fP .INDENT 0.0 .INDENT 3.5 Since 8.1.0 it is possible to style separately the topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> directives, and their defaults differ. See Additional CSS\-like \(aqsphinxsetup\(aq keys\&. The next three keys are kept as legacy interface not distinguishing between the three directives. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fBshadowsep\fP This legacy option sets the padding (same in all directions) simultaneously for the topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> directives. .TP .B \fBshadowsize\fP This legacy option sets the shadow width simultaneously for the topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> directives. .TP .B \fBshadowrule\fP This legacy option sets the border\-width (same on all sides) simultaneously for the topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> directives. .UNINDENT .sp \fBImportant:\fP .INDENT 0.0 .INDENT 3.5 At 7.4.0 all admonitions (not only danger\-type) use the possibilities which were added at 5.1.0 and 6.2.0. All defaults have changed. .UNINDENT .UNINDENT .sp \fBiconpackage\fP .INDENT 0.0 .INDENT 3.5 The name of the LaTeX package used for rendering icons in the admonition titles. Its default is set dynamically to either \fBfontawesome7\fP, \fBfontawesome6\fP, \fBfontawesome5\fP, \fBfontawesome\fP, or \fBnone\fP, in decreasing order of priority and depending on whether packages with those names exist in the used LaTeX installation. The LaTeX code for each admonition icon will use \fB\efaIcon\fP command if with \fBfontawesome{5,6,7}\fP and \fB\efaicon\fP if with \fBfontawesome\fP\&. If no \(dqFont Awesome\(dq related package is found (or if the option is set forcefully to \fBnone\fP) the icons are silently dropped. User can set this option to some specific package and must configure then the \fBdiv.note_title\-icon\fP and similar keys to use then that LaTeX package interface (see the Additional CSS\-like \(aqsphinxsetup\(aq keys section about this). .sp Added in version 7.4.0. .UNINDENT .UNINDENT .INDENT 0.0 .TP .B \fBnoteBorderColor\fP, \fBhintBorderColor\fP, \fBimportantBorderColor\fP, \fBtipBorderColor\fP The color for the admonition border. .sp Default: \fB{RGB}{134,152,155}\fP\&. .sp Changed in version 7.4.0. .TP .B \fBnoteBgColor\fP, \fBhintBgColor\fP, \fBimportantBgColor\fP, \fBtipBgColor\fP The color for the admonition background. .sp Default: \fB{RGB}{247,247,247}\fP\&. .sp Added in version 6.2.0. .sp Changed in version 7.4.0. .TP .B \fBnoteTextColor\fP, \fBhintTextColor\fP, \fBimportantTextColor\fP, \fBtipTextColor\fP The color for the admonition contents. .sp Default: unset (contents text uses ambient text color, a priori black) .sp Added in version 6.2.0: To be considered experimental until 7.0.0. These options have aliases \fBdiv.note_TeXcolor\fP (etc) described in Additional CSS\-like \(aqsphinxsetup\(aq keys\&. Using the latter will let Sphinx switch to a more complex LaTeX code, which supports the customizability described in Additional CSS\-like \(aqsphinxsetup\(aq keys\&. .TP .B \fBnoteTeXextras\fP, \fBhintTeXextras\fP, \fBimportantTeXextras\fP, \fBtipTeXextras\fP Some extra LaTeX code (such as \fB\ebfseries\fP or \fB\efootnotesize\fP) to be executed at start of the contents. .sp Default: empty .sp Added in version 6.2.0: To be considered experimental until 7.0.0. These options have aliases \fBdiv.note_TeXextras\fP (etc) described in Additional CSS\-like \(aqsphinxsetup\(aq keys\&. .TP .B \fBnoteborder\fP, \fBhintborder\fP, \fBimportantborder\fP, \fBtipborder\fP The width of the border. See Additional CSS\-like \(aqsphinxsetup\(aq keys for keys allowing to configure separately each border width. .sp Default: \fB0.5pt\fP .UNINDENT .INDENT 0.0 .TP .B \fBwarningBorderColor\fP, \fBcautionBorderColor\fP, \fBattentionBorderColor\fP, \fBdangerBorderColor\fP, \fBerrorBorderColor\fP The color for the admonition border. .sp Default: \fB{RGB}{148,0,0}\fP except for \fBerror\fP which uses \fBred\fP\&. .sp Changed in version 7.4.0. .UNINDENT .INDENT 0.0 .TP .B \fBwarningBgColor\fP, \fBcautionBgColor\fP, \fBattentionBgColor\fP, \fBdangerBgColor\fP, \fBerrorBgColor\fP The background color for the admonition background. .sp Default: \fB{RGB}{247,247,247}\fP\&. .sp Changed in version 7.4.0. .TP .B \fBwarningborder\fP, \fBcautionborder\fP, \fBattentionborder\fP, \fBdangerborder\fP, \fBerrorborder\fP The width of the admonition frame. See Additional CSS\-like \(aqsphinxsetup\(aq keys for keys allowing to configure separately each border width. .sp Default: \fB1pt\fP except for \fBerror\fP which uses \fB1.25pt\fP\&. .sp Changed in version 7.4.0. .TP .B \fBAtStartFootnote\fP LaTeX macros inserted at the start of the footnote text at bottom of page, after the footnote number. .sp Default: \fB\embox{ }\fP .TP .B \fBBeforeFootnote\fP LaTeX macros inserted before the footnote mark. The default removes possible space before it (else, TeX could insert a line break there). .sp Default: \fB\eleavevmode\eunskip\fP .sp Added in version 1.5. .TP .B \fBHeaderFamily\fP default \fB\esffamily\ebfseries\fP\&. Sets the font used by headings. .UNINDENT .SS Additional CSS\-like \fB\(aqsphinxsetup\(aq\fP keys .sp Added in version 5.1.0: For \fBcode\-block\fP \%<#\:directive-code-block>, topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic> and contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents> directive, and strong\-type admonitions (warning \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:warning>, error \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:error>, ...). .sp Added in version 6.2.0: Also the note \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:note>, hint \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:hint>, important \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:important> and tip \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:tip> admonitions can be styled this way. Using for them \fIany\fP of the listed options will trigger usage of a more complex LaTeX code than the one used per default (\fBsphinxheavybox\fP vs \fBsphinxlightbox\fP). Setting the new \fBnoteBgColor\fP (or \fBhintBgColor\fP, ...) also triggers usage of \fBsphinxheavybox\fP for note \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:note> (or hint \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:hint>, ...). .sp Added in version 7.4.0: For \fIall\fP admonition types, the default configuration does set a background color (hence the richer \fBsphinxheavybox\fP is always used). .sp \fBImportant:\fP .INDENT 0.0 .INDENT 3.5 Further, all admonition titles are by default styled using a colored row and an icon, which are modeled on the current rendering of Sphinx own docs at \%<https://\:www\:.sphinx-doc\:.org>\&. CSS\-named alike keys are added to set the foreground and background colors for the title as well as the LaTeX code for the icon. .UNINDENT .UNINDENT .sp Added in version 7.4.0: Customizability of the \fBseealso\fP \%<#\:directive-seealso> and \fBtodo\fP \%<#\:directive-todo> directives. .sp Added in version 8.1.0: Separate customizability and new defaults for the topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> directives. .sp Perhaps in future these 5.1.0 (and 6.2.0) novel settings will be optionally imported from some genuine CSS external file, but currently they have to be used via the \fB\(aqsphinxsetup\(aq\fP interface (or the \fB\esphinxsetup\fP LaTeX command inserted via the raw \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:raw> directive) and the CSS syntax is only imitated. .sp \fBImportant:\fP .INDENT 0.0 .INDENT 3.5 Low\-level LaTeX errors causing a build failure can happen if the input syntax is not respected. .INDENT 0.0 .IP \(bu 2 In particular colors must be input as for the other color related options previously described, i.e. either in the \fB\edefinecolor\fP syntax or via the \fB\ecolorlet\fP syntax: .INDENT 2.0 .INDENT 3.5 .sp .EX \&...<other options> div.warning_border\-TeXcolor={rgb}{1,0,0},% \edefinecolor syntax div.error_background\-TeXcolor=red!10,% \ecolorlet syntax \&...<other options> .EE .UNINDENT .UNINDENT .IP \(bu 2 A colon in place of the equal sign will break LaTeX. .IP \(bu 2 \fB\&...border\-width\fP or \fB\&...padding\fP expect a \fIsingle\fP dimension: they can not be used so far with space separated dimensions. .IP \(bu 2 \fB\&...top\-right\-radius\fP et al. values may be either a single or \fItwo\fP space separated dimensions. .IP \(bu 2 Dimension specifications must use TeX units such as \fBpt\fP or \fBcm\fP or \fBin\fP\&. The \fBpx\fP unit is recognized by \fBpdflatex\fP and \fBlualatex\fP but not by \fBxelatex\fP or \fBplatex\fP\&. .IP \(bu 2 It is allowed for such specifications to be so\-called \(dqdimensional expressions\(dq, e.g. \fB\efboxsep+2pt\fP or \fB0.5\ebaselineskip\fP are valid inputs. The expressions will be evaluated only at the typesetting time. Be careful though if using as in these examples TeX control sequences to double the backslash or to employ a raw Python string for the value of the \(aqsphinxsetup\(aq key. .IP \(bu 2 As a rule, avoid inserting unneeded spaces in the key values: especially for the radii an input such \fB2 pt 3pt\fP will break LaTeX. Beware also that \fB\efboxsep \efboxsep\fP will not be seen as space separated in LaTeX. You must use something such as \fB{\efboxsep} \efboxsep\fP\&. Or use directly \fB3pt 3pt\fP which is a priori equivalent and simpler. .UNINDENT .UNINDENT .UNINDENT .sp The options are all named in a similar pattern which depends on a \fBprefix\fP, which is then followed by an underscore, then the property name. .TS box center; l|l|l. T{ Directive T} T{ Option prefix T} T{ LaTeX environment T} _ T{ \fBcode\-block\fP \%<#\:directive-code-block> T} T{ \fBpre\fP T} T{ \fBsphinxVerbatim\fP T} _ T{ \fBliteralinclude\fP \%<#\:directive-literalinclude> T} T{ \fBpre\fP T} T{ \fBsphinxVerbatim\fP T} _ T{ topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic> T} T{ \fBdiv.topic\fP T} T{ \fBsphinxtopic\fP T} _ T{ contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents> T} T{ \fBdiv.contents\fP T} T{ \fBsphinxcontents\fP T} _ T{ sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> T} T{ \fBdiv.sidebar\fP T} T{ \fBsphinxsidebar\fP T} _ T{ note \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:note> T} T{ \fBdiv.note\fP T} T{ \fBsphinxnote\fP T} _ T{ warning \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:warning> T} T{ \fBdiv.warning\fP T} T{ \fBsphinxwarning\fP T} _ T{ further admonition types \fB<type>\fP T} T{ \fBdiv.<type>\fP T} T{ \fBsphinx<type>\fP T} _ T{ \fBseealso\fP \%<#\:directive-seealso> T} T{ \fBdiv.seealso\fP T} T{ \fBsphinxseealso\fP T} _ T{ \fBtodo\fP \%<#\:directive-todo> T} T{ \fBdiv.todo\fP T} T{ \fBsphinxtodo\fP T} .TE .sp Here are now these options as well as their common defaults. Replace below \fB<prefix>\fP by the actual prefix as explained above. Don\(aqt forget the underscore separating the prefix from the property names. .INDENT 0.0 .IP \(bu 2 .nf \fB<prefix>_border\-top\-width\fP, \fB<prefix>_border\-right\-width\fP, \fB<prefix>_border\-bottom\-width\fP, \fB<prefix>_border\-left\-width\fP, \fB<prefix>_border\-width\fP\&. The latter can (currently) be only a \fIsingle\fP dimension which then sets all four others. .fi .sp .sp The default is that all those dimensions are equal. They are set to: .INDENT 2.0 .IP \(bu 2 \fB0.4pt\fP for \fBcode\-block\fP \%<#\:directive-code-block>, .IP \(bu 2 \fB0.5pt\fP for topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic> and contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents> directive, .IP \(bu 2 \fB1pt\fP for sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> directive, .IP \(bu 2 \fB0.5pt\fP for note \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:note> and other \(dqlight\(dq admonitions, .IP \(bu 2 \fB0.5pt\fP for \fBseealso\fP \%<#\:directive-seealso> and \fBtodo\fP \%<#\:directive-todo> directives, .IP \(bu 2 \fB1pt\fP for warning \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:warning> and other \(dqstrong\(dq admonitions except error \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:error> which uses \fB1.25pt\fP\&. .UNINDENT .sp Changed in version 7.4.0: Changed defaults for topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic> and error \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:error>\&. .sp Changed in version 8.1.0: Distinct from topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic> defaults for sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar>\&. .IP \(bu 2 \fB<prefix>_box\-decoration\-break\fP can be set to either \fBclone\fP or \fBslice\fP and configures the behavior at page breaks. It defaults to \fBslice\fP for \fBcode\-block\fP \%<#\:directive-code-block> (i.e. for \fB<prefix>=pre\fP) since 6.0.0. For other directives the default is \fBclone\fP\&. .IP \(bu 2 .nf \fB<prefix>_padding\-top\fP, \fB<prefix>_padding\-right\fP, \fB<prefix>_padding\-bottom\fP, \fB<prefix>_padding\-left\fP, \fB<prefix>_padding\fP\&. The latter can (currently) be only a \fIsingle\fP dimension which then sets all four others. .fi .sp .sp The defaults: .INDENT 2.0 .IP \(bu 2 all four \fB3pt\fP for \fBcode\-block\fP \%<#\:directive-code-block>, .IP \(bu 2 \fB6pt\fP, \fB7pt\fP, \fB6pt\fP, \fB7pt\fP for topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, .IP \(bu 2 \fB10pt\fP, \fB7pt\fP, \fB12pt\fP, \fB7pt\fP for contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, .IP \(bu 2 \fB6pt\fP, \fB5.5pt\fP, \fB6pt\fP, \fB5.5pt\fP for sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar>, .IP \(bu 2 \fB6pt\fP, \fB7pt\fP, \fB6pt\fP, \fB7pt\fP for all \(dqlight\(dq admonitions as well as the \fBseealso\fP \%<#\:directive-seealso> and \fBtodo\fP \%<#\:directive-todo> directives. .IP \(bu 2 \fB6pt\fP, \fB6.5pt\fP, \fB6pt\fP, \fB6.5pt\fP for the strong admonition types except error \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:error> which uses horizontal padding of \fB6.25pt\fP\&. .UNINDENT .sp Changed in version 7.4.0: All defaults were changed, except for \fBcode\-block\fP \%<#\:directive-code-block>\&. Admonitions are set\-up so that left (or right) padding plus left (or right) border\-width add up always to \fB7.5pt\fP, so contents align well vertically across admonition types on same page in PDF. This is only a property of defaults, not a constraint on possible user choices. .sp Changed in version 8.1.0: Separate defaults for topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar>\&. .IP \(bu 2 .nf \fB<prefix>_border\-top\-left\-radius\fP, \fB<prefix>_border\-top\-right\-radius\fP, \fB<prefix>_border\-bottom\-right\-radius\fP, \fB<prefix>_border\-bottom\-left\-radius\fP, \fB<prefix>_border\-radius\fP\&. This last key sets the first four to its assigned value. Each key value can be either a single, or \fItwo\fP, dimensions which are then space separated. .fi .sp .sp The defaults: .INDENT 2.0 .IP \(bu 2 \fB3pt\fP for \fBcode\-block\fP \%<#\:directive-code-block> (since 6.0.0) and all corners, .IP \(bu 2 \fB8pt\fP for all corners of topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, .IP \(bu 2 \fB12pt\fP for the bottom right corner of contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, others use \fB0pt\fP, .IP \(bu 2 \fB12pt\fP for the top\-left and bottom\-right corners for sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar>, \fB0pt\fP for top\-right and bottom\-left. .IP \(bu 2 all radii set to \fB5pt\fP for note \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:note>, hint \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:hint> and tip \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:tip>, .IP \(bu 2 \fB0pt\fP, i.e. straight corners for all other directives. .UNINDENT .sp Changed in version 7.4.0: topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic> and note \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:note>\-like admonitions acquire (at least one) rounded corners. .sp Changed in version 8.1.0: Separate defaults for topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar>\&. .sp See a remark above about traps with spaces in LaTeX. .IP \(bu 2 \fB<prefix>_box\-shadow\fP is special in so far as it may be: .INDENT 2.0 .IP \(bu 2 the \fBnone\fP keyword, .IP \(bu 2 or a single dimension (giving both x\-offset and y\-offset), .IP \(bu 2 or two dimensions (separated by a space), .IP \(bu 2 or two dimensions followed by the keyword \fBinset\fP\&. .UNINDENT .sp The x\-offset and y\-offset may be negative. A negative x\-offset means that the shadow is on the left. The shadow extends into the page margin, whether the offset is positive or negative. .sp The default is \fBnone\fP \fIexcept\fP for the contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents> directive which uses \fB4pt 4pt\fP\&. .sp Changed in version 8.1.0: No shadow per default for topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic> and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar>\&. .IP \(bu 2 .nf \fB<prefix>_border\-TeXcolor\fP, \fB<prefix>_background\-TeXcolor\fP, \fB<prefix>_box\-shadow\-TeXcolor\fP, \fB<prefix>_TeXcolor\fP\&. These are colors. .fi .sp .sp Since 6.0.0 the border and background colors of \fBcode\-block\fP \%<#\:directive-code-block>, default respectively to \fB{RGB}{32,32,32}\fP (i.e. \fB{HTML}{202020}\fP), and \fB{RGB}{242,242,242}\fP (i.e. \fB{gray}{0.95}\fP or \fB{HTML}{F2F2F2}\fP). .sp At 7.4.0 other directives acquire non\-black/white default border and background colors. Here they are using \fBxcolor\fP hexadecimal notation (which requires always 6 hexadecimal digits): .INDENT 2.0 .IP \(bu 2 \fB{HTML}{F7F7F7}\fP serves as background color to all. .IP \(bu 2 \fB{HTML}{86989B}\fP is border color of light admonitions (inclusive of \fBseealso\fP \%<#\:directive-seealso> and \fBtodo\fP \%<#\:directive-todo>) as well as of topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents> and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> directives. .IP \(bu 2 \fB{HTML}{940000}\fP is border color of warning \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:warning>\-type admonitions, except error \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:error> which uses \fB{HTML}{B40000}\fP\&. .UNINDENT .sp The only directives displaying a shadow per default are contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents> and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar>\&. The shadow\-color for the former is \fB{HTML}{6C6C6C}\fP and for the latter \fB{HTML}{9EACAF}\fP\&. .sp The \fB<prefix>_TeXcolor\fP stands for the CSS property \(dqcolor\(dq, i.e. it influences the text color of the contents. As for the three other options, the naming \fBTeXcolor\fP is to stress that the input syntax is the TeX one for colors not an HTML/CSS one. If package \fBxcolor\fP is available in the LaTeX installation, one can use directly named colors as key values. Consider passing options such as \fBdvipsnames\fP, \fBsvgnames\fP or \fBx11names\fP to \fBxcolor\fP via \fB\(aqpassoptionstopackages\(aq\fP key of \fBlatex_elements\fP \%<#\:confval-latex_elements>\&. .sp If \fB<prefix>_TeXcolor\fP is set, a \fB\ecolor\fP command is inserted at start of the directive contents; for admonitions, this happens after the heading which reproduces the admonition type. .IP \(bu 2 \fB<prefix>_TeXextras\fP: if set, its value must be some LaTeX command or commands, for example \fB\eitshape\fP\&. These commands will be inserted at the start of the contents; for admonitions, this happens after the heading which reproduces the admonition type. .UNINDENT .sp The next keys, for admonitions, topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar>, were all three added at 7.4.0 (and 8.1.0 for the latter three). .INDENT 0.0 .IP \(bu 2 \fBdiv.<type>_title\-background\-TeXcolor\fP: the background color for the title. .sp \fBImportant:\fP .INDENT 2.0 .INDENT 3.5 The colored title\-row is produced as a result of the Sphinx default definitions for the various \fB\esphinxstyle<type>title\fP commands, which employ the \fB\esphinxdotitlerow\fP LaTeX command. See Macros\&. .UNINDENT .UNINDENT .IP \(bu 2 \fBdiv.<type>_title\-foreground\-TeXcolor\fP: the color to be used for the icon (it applies only to the icon, not to the title of the admonition). .IP \(bu 2 \fBdiv.<type>_title\-icon\fP: the LaTeX code responsible for producing the icon for the given \fB<admonition type>\fP\&. For example the default for note \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:note> is \fBdiv.note_title\-icon=\efaIcon{info\-circle}\fP with \fBfontawesome5\fP, but \fBdiv.note_title\-icon=\efaIcon{circle\-info}\fP with \fBfontawesome6\fP and \fBfontawesome7\fP\&. If you want to modify the icons used by Sphinx, employ in these keys the \fB\efaIcon\fP LaTeX command if one of \fBfontawesome5\fP, \fB6\fP or \fB7\fP is on your LaTeX installation. If your system only provides the \fBfontawesome\fP package use its command \fB\efaicon\fP (not \fB\efaIcon\fP) in order to modify the choice of icons. The \fBiconpackage\fP key of \fB\(aqsphinxsetup\(aq\fP can be used to force usage of one among \fBfontawesome{,5,6,7}\fP or be the name of some other icon\-providing package. In that latter case you must configure the \fBdiv.<type>_title\-icon\fP keys to use the LaTeX commands appropriate to that custom icon package. .UNINDENT .sp \fBNote:\fP .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 All directives support \fBbox\-decoration\-break\fP to be set to \fBslice\fP\&. .sp Changed in version 6.2.0: Formerly, only \fBcode\-block\fP \%<#\:directive-code-block> did. The default remains \fBclone\fP for all other directives, but this will probably change at 7.0.0. .IP \(bu 2 The corners of rounded boxes may be elliptical. .sp Changed in version 6.2.0: Formerly, only circular rounded corners were supported and a rounded corner forced the whole frame to use the same constant width from \fB<prefix>_border\-width\fP\&. .IP \(bu 2 Inset shadows are incompatible with rounded corners. In case both are specified the inset shadow will simply be ignored. .sp Changed in version 6.2.0: Formerly it was to the contrary the rounded corners which were ignored in case an inset shadow was specified. .IP \(bu 2 \fB<prefix>_TeXcolor\fP and \fB<prefix>_TeXextras\fP are new with 6.2.0. .sp Usefulness is doubtful in the case of \fBcode\-block\fP \%<#\:directive-code-block>: .INDENT 2.0 .IP \(bu 2 \fBpre_TeXcolor\fP will influence only the few non\-Pygments highlighted tokens; it does color the line numbers, but if one wants to color \fIonly\fP them one has to go through the \fBfancyvrb\fP interface. .IP \(bu 2 \fBpre_TeXextras=\efootnotesize\fP (as an example) is equivalent to setting \(aqfvset\(aq key value to \fBr\(aq\efvset{fontsize=\efootnotesize}\(aq\fP\&. .UNINDENT .sp Consider these options experimental and that some implementation details may change. For example if the \fBpre_TeXextras\fP LaTeX commands were put by Sphinx in another location it could override the \(aqfvset\(aq effect, perhaps this is what will be done in a future release. .IP \(bu 2 Rounded boxes are done using the pict2e \%<https://\:ctan\:.org/\:pkg/\:pict2e> interface to some basic PDF graphics operations. If this LaTeX package can not be found the build will proceed and render all boxes with straight corners. .IP \(bu 2 Elliptic corners use the ellipse \%<https://\:ctan\:.org/\:pkg/\:ellipse> LaTeX package which extends pict2e \%<https://\:ctan\:.org/\:pkg/\:pict2e>\&. If this LaTeX package can not be found rounded corners will be circular arcs (or straight if pict2e \%<https://\:ctan\:.org/\:pkg/\:pict2e> is not available). .UNINDENT .UNINDENT .UNINDENT .sp The following legacy behavior applies: .INDENT 0.0 .IP \(bu 2 For \fBcode\-block\fP \%<#\:directive-code-block> or \fBliteralinclude\fP \%<#\:directive-literalinclude>, padding and border\-width and shadow (if any) will go into the margin; the code lines remain at the same place independently of the values of the padding and border\-width, except for being shifted vertically of course to not overwrite other text due to the width of the border or external shadow. .IP \(bu 2 For the other directives, shadows extend horizontally into the page margins, but the border and the extra padding are kept within the text area. .IP \(bu 2 \fBcode\-block\fP \%<#\:directive-code-block> and \fBliteralinclude\fP \%<#\:directive-literalinclude> use the same LaTeX environment and commands and are not separately customizable. .UNINDENT .SS LaTeX macros and environments .sp The \(dqLaTeX package\(dq file \fBsphinx.sty\fP loads various components providing support macros (aka commands), and environments, which are used in the mark\-up produced on output from the \fBlatex\fP builder, before conversion to \fBpdf\fP via the LaTeX toolchain. Also the \(dqLaTeX class\(dq files \fBsphinxhowto.cls\fP and \fBsphinxmanual.cls\fP define or customize some environments. All of these files can be found in the latex build repertory. .sp Some of these provide facilities not available from pre\-existing LaTeX packages and work around LaTeX limitations with lists, table cells, verbatim rendering, footnotes, etc... .sp Others simply define macros with public names to make overwriting their defaults easy via user\-added contents to the preamble. We will survey most of those public names here, but defaults have to be looked at in their respective definition files. .sp \fBHint:\fP .INDENT 0.0 .INDENT 3.5 Sphinx LaTeX support code is split across multiple smaller\-sized files. Rather than adding code to the preamble via latex_elements[\fB\(aqpreamble\(aq\fP] it is also possible to replace entirely one of the component files of Sphinx LaTeX code with a custom version, simply by including a modified copy in the project source and adding the filename to the \fBlatex_additional_files\fP \%<#\:confval-latex_additional_files> list. Check the LaTeX build repertory for the filenames and contents. .UNINDENT .UNINDENT .sp Changed in version 4.0.0: split of \fBsphinx.sty\fP into multiple smaller units, to facilitate customization of many aspects simultaneously. .SS Macros .INDENT 0.0 .IP \(bu 2 Text styling commands: .TS box center; l|l. T{ Name, \fBmaps argument #1 to:\fP T} T{ T} _ T{ \fB\esphinxstrong\fP T} T{ \fB\etextbf{#1}\fP T} _ T{ \fB\esphinxcode\fP T} T{ \fB\etexttt{#1}\fP T} _ T{ \fB\esphinxbfcode\fP T} T{ \fB\etextbf{\esphinxcode{#1}}\fP T} _ T{ \fB\esphinxemail\fP T} T{ \fB\etextsf{#1}\fP T} _ T{ \fB\esphinxtablecontinued\fP T} T{ \fB\etextsf{#1}\fP T} _ T{ \fB\esphinxtitleref\fP T} T{ \fB\eemph{#1}\fP T} _ T{ \fB\esphinxmenuselection\fP T} T{ \fB\eemph{#1}\fP T} _ T{ \fB\esphinxguilabel\fP T} T{ \fB\eemph{#1}\fP T} _ T{ \fB\esphinxkeyboard\fP T} T{ \fB\esphinxcode{#1}\fP T} _ T{ \fB\esphinxaccelerator\fP T} T{ \fB\eunderline{#1}\fP T} _ T{ \fB\esphinxcrossref\fP T} T{ \fB\eemph{#1}\fP T} _ T{ \fB\esphinxtermref\fP T} T{ \fB\eemph{#1}\fP T} _ T{ \fB\esphinxsamedocref\fP T} T{ \fB\eemph{#1}\fP T} _ T{ \fB\esphinxparam\fP T} T{ \fB\eemph{#1}\fP T} _ T{ \fB\esphinxtypeparam\fP T} T{ \fB\eemph{#1}\fP T} _ T{ \fB\esphinxoptional\fP T} T{ \fB[#1]\fP with larger brackets, see source T} .TE .sp Added in version 1.4.5: Use of \fB\esphinx\fP prefixed macro names to limit possibilities of conflict with LaTeX packages. .sp Added in version 1.8: \fB\esphinxguilabel\fP .sp Added in version 3.0: \fB\esphinxkeyboard\fP .sp Added in version 6.2.0: \fB\esphinxparam\fP, \fB\esphinxsamedocref\fP .sp Added in version 7.1.0: \fB\esphinxparamcomma\fP which defaults to a comma followed by a space and \fB\esphinxparamcommaoneperline\fP\&. It is sed for one\-parameter\-per\-line signatures (see \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length>) and defaults to \fB\etexttt{,}\fP\&. .sp Signatures of Python functions are rendered as \fBname<space>(parameters)\fP or \fBname<space>[type parameters]<space>(parameters)\fP (see \fBPEP 695\fP \%<https://\:peps\:.python\:.org/\:pep-0695/>) where the length of \fB<space>\fP is set to \fB0pt\fP by default. This can be changed via \fB\esetlength{\esphinxsignaturelistskip}{1ex}\fP for instance. .IP \(bu 2 More text styling: .TS box center; l|l. T{ Name, \fBmaps argument #1 to:\fP T} T{ T} _ T{ \fB\esphinxstyleindexentry\fP T} T{ \fB\etexttt{#1}\fP T} _ T{ \fB\esphinxstyleindexextra\fP T} T{ \fB(\eemph{#1})\fP (with a space upfront) T} _ T{ \fB\esphinxstyleindexpageref\fP T} T{ \fB, \epageref{#1}\fP T} _ T{ \fB\esphinxstyleindexpagemain\fP T} T{ \fB\etextbf{#1}\fP T} _ T{ \fB\esphinxstyleindexlettergroup\fP T} T{ \fB{\eLarge\esffamily#1}\enopagebreak\evspace{1mm}\fP T} _ T{ \fB\esphinxstyleindexlettergroupDefault\fP T} T{ check source, too long for here T} _ T{ \fB\esphinxstyletopictitle\fP T} T{ \fB\etextbf{#1}\epar\emedskip\fP T} _ T{ \fB\esphinxstylesidebartitle\fP T} T{ \fB\etextbf{#1}\epar\emedskip\fP T} _ T{ \fB\esphinxstyleothertitle\fP T} T{ \fB\etextbf{#1}\fP T} _ T{ \fB\esphinxstylesidebarsubtitle\fP T} T{ \fB~\e\e\etextbf{#1} \esmallskip\fP T} _ T{ \fB\esphinxstyletheadfamily\fP T} T{ \fB\esffamily\fP (\fIthis one has no argument\fP) T} _ T{ \fB\esphinxstyleemphasis\fP T} T{ \fB\eemph{#1}\fP T} _ T{ \fB\esphinxstyleliteralemphasis\fP T} T{ \fB\eemph{\esphinxcode{#1}}\fP T} _ T{ \fB\esphinxstylestrong\fP T} T{ \fB\etextbf{#1}\fP T} _ T{ \fB\esphinxstyleliteralstrong\fP T} T{ \fB\esphinxbfcode{#1}\fP T} _ T{ \fB\esphinxstyleabbreviation\fP T} T{ \fB\etextsc{#1}\fP T} _ T{ \fB\esphinxstyleliteralintitle\fP T} T{ \fB\esphinxcode{#1}\fP T} _ T{ \fB\esphinxstylecodecontinued\fP T} T{ \fB{\efootnotesize(#1)}}\fP T} _ T{ \fB\esphinxstylecodecontinues\fP T} T{ \fB{\efootnotesize(#1)}}\fP T} _ T{ \fB\esphinxstylenotetitle\fP T} T{ \fB\esphinxdotitlerow{note}{#1}\fP T} _ T{ \fB\esphinxstylehinttitle\fP T} T{ \fB\esphinxdotitlerow{hint}{#1}\fP T} _ T{ \fB\esphinxstyleimportanttitle\fP T} T{ \fB\esphinxdotitlerow{important}{#1}\fP T} _ T{ \fB\esphinxstyletiptitle\fP T} T{ \fB\esphinxdotitlerow{tip}{#1}\fP T} _ T{ \fB\esphinxstylewarningtitle\fP T} T{ \fB\esphinxdotitlerow{warning}{#1}\fP T} _ T{ \fB\esphinxstylecautiontitle\fP T} T{ \fB\esphinxdotitlerow{caution}{#1}\fP T} _ T{ \fB\esphinxstyleattentiontitle\fP T} T{ \fB\esphinxdotitlerow{attention}{#1}\fP T} _ T{ \fB\esphinxstyledangertitle\fP T} T{ \fB\esphinxdotitlerow{danger}{#1}\fP T} _ T{ \fB\esphinxstyleerrortitle\fP T} T{ \fB\esphinxdotitlerow{error}{#1}\fP T} _ T{ \fB\esphinxstyleseealsotitle\fP T} T{ \fB\esphinxdotitlerow{seealso}{#1}\fP T} _ T{ \fB\esphinxstyletodotitle\fP T} T{ \fB\esphinxdotitlerow{todo}{#1}\fP T} _ T{ \fB\esphinxstyletopictitle\fP T} T{ \fB\esphinxdotitlerow{topic}{#1}\fP T} _ T{ \fB\esphinxstylecontentstitle\fP T} T{ \fB\esphinxdotitlerow{contents}{#1}\fP T} _ T{ \fB\esphinxstylesidebartitle\fP T} T{ \fB\esphinxdotitlerow{sidebar}{#1}\fP T} .TE .sp \fBNote:\fP .INDENT 2.0 .INDENT 3.5 To let this table fit on the page width in PDF output we have lied a bit. For instance, the actual definition of \fB\esphinxstylenotetitle\fP is: .INDENT 0.0 .INDENT 3.5 .sp .EX \enewcommand\esphinxstylenotetitle[1]% {\esphinxdotitlerow{note}{\esphinxremovefinalcolon{#1}}} .EE .UNINDENT .UNINDENT .sp The same remark applies to all other similar commands associated with admonitions. The topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> do not use \fB\esphinxremovefinalcolon\fP as they don\(aqt need it. .UNINDENT .UNINDENT .sp Added in version 1.5: These macros were formerly hard\-coded as non customizable \fB\etexttt\fP, \fB\eemph\fP, etc... .sp Added in version 1.6: \fB\esphinxstyletheadfamily\fP which defaults to \fB\esffamily\fP and allows multiple paragraphs in header cells of tables. .sp Added in version 1.6.3: \fB\esphinxstylecodecontinued\fP and \fB\esphinxstylecodecontinues\fP\&. .sp Added in version 1.8: \fB\esphinxstyleindexlettergroup\fP, \fB\esphinxstyleindexlettergroupDefault\fP\&. .sp Added in version 6.2.0: \fB\esphinxstylenotetitle\fP et al. The \fB#1\fP is the localized name of the directive, with a final colon. Wrap it as \fB\esphinxremovefinalcolon{#1}\fP if this final colon is to be removed. .sp Added in version 7.4.0: Added the \fB\esphinxdotitlerowwithicon\fP LaTeX command. .sp Changed in version 8.1.0: \fB\esphinxdotitlerowwithicon\fP now detects automatically if an icon is associated or not with the rendered element used as first argument. .sp Added in version 8.1.0: Make \fB\esphinxdotitlerow\fP an alias to \fB\esphinxdotitlerowwithicon\fP\&. .sp Added in version 8.1.0: Titles of topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> directives are also styled using \fB\esphinxdotitlerow\fP (they have no default icons associated with them). .IP \(bu 2 \fB\esphinxtableofcontents\fP: A wrapper (defined differently in \fBsphinxhowto.cls\fP and in \fBsphinxmanual.cls\fP) of standard \fB\etableofcontents\fP\&. The macro \fB\esphinxtableofcontentshook\fP is executed during its expansion right before \fB\etableofcontents\fP itself. .sp Changed in version 1.5: Formerly, the meaning of \fB\etableofcontents\fP was modified by Sphinx. .sp Changed in version 2.0: Hard\-coded redefinitions of \fB\el@section\fP and \fB\el@subsection\fP formerly done during loading of \fB\(aqmanual\(aq\fP docclass are now executed later via \fB\esphinxtableofcontentshook\fP\&. This macro is also executed by the \fB\(aqhowto\(aq\fP docclass, but defaults to empty with it. .sp \fBHint:\fP .INDENT 2.0 .INDENT 3.5 If adding to preamble the loading of \fBtocloft\fP package, also add to preamble \fB\erenewcommand\esphinxtableofcontentshook{}\fP else it will reset \fB\el@section\fP and \fB\el@subsection\fP cancelling \fBtocloft\fP customization. .UNINDENT .UNINDENT .IP \(bu 2 \fB\esphinxmaketitle\fP: Used as the default setting of the \fB\(aqmaketitle\(aq\fP \fBlatex_elements\fP \%<#\:confval-latex_elements> key. Defined in the class files \fBsphinxmanual.cls\fP and \fBsphinxhowto.cls\fP\&. .sp Changed in version 1.8.3: Formerly, \fB\emaketitle\fP from LaTeX document class was modified by Sphinx. .IP \(bu 2 \fB\esphinxbackoftitlepage\fP: For \fB\(aqmanual\(aq\fP docclass, and if it is defined, it gets executed at end of \fB\esphinxmaketitle\fP, before the final \fB\eclearpage\fP\&. Use either the \fB\(aqmaketitle\(aq\fP key or the \fB\(aqpreamble\(aq\fP key of \fBlatex_elements\fP \%<#\:confval-latex_elements> to add a custom definition of \fB\esphinxbackoftitlepage\fP\&. .sp Added in version 1.8.3. .IP \(bu 2 \fB\esphinxcite\fP: A wrapper of standard \fB\ecite\fP for citation references. .UNINDENT .SS The \fB\esphinxbox\fP command .sp Added in version 6.2.0. .sp The \fB\esphinxbox[key=value,...]{inline text}\fP command can be used to \(dqbox\(dq inline text elements with all the customizability which has been described in Additional CSS\-like \(aqsphinxsetup\(aq keys\&. It is a LaTeX command with one optional argument, which is a comma\-separated list of key=value pairs, as for The sphinxsetup configuration setting\&. Here is the complete list of keys. They don\(aqt use any prefix. .INDENT 0.0 .IP \(bu 2 \fBborder\-width\fP, .IP \(bu 2 \fBborder\-top\-width\fP, \fBborder\-right\-width\fP, \fBborder\-bottom\-width\fP, \fBborder\-left\-width\fP, .IP \(bu 2 \fBpadding\fP, .IP \(bu 2 \fBpadding\-top\fP, \fBpadding\-right\fP, \fBpadding\-bottom\fP, \fBpadding\-left\fP, .IP \(bu 2 \fBborder\-radius\fP, .IP \(bu 2 \fBborder\-top\-left\-radius\fP, \fBborder\-top\-right\-radius\fP, \fBborder\-bottom\-right\-radius\fP, \fBborder\-bottom\-left\-radius\fP, .IP \(bu 2 \fBbox\-shadow\fP, .IP \(bu 2 \fBborder\-TeXcolor\fP, \fBbackground\-TeXcolor\fP, \fBbox\-shadow\-TeXcolor\fP, \fBTeXcolor\fP, .IP \(bu 2 \fBTeXextras\fP, .IP \(bu 2 and \fBaddstrut\fP which is a boolean key, i.e. to be used as \fBaddstrut=true\fP, or \fBaddstrut\fP alone where \fB=true\fP is omitted, or \fBaddstrut=false\fP\&. .UNINDENT .sp This last key is specific to \fB\esphinxbox\fP and it means to add a \fB\estrut\fP so that heights and depths are equalized across various instances on the same line with varying contents. The default is \fBaddstrut=false\fP\&. The combination \fBaddstrut, padding\-bottom=0pt, padding\-top=1pt\fP is often satisfactory. .sp Refer to Additional CSS\-like \(aqsphinxsetup\(aq keys for important syntax information regarding the other keys. The default configuration uses no shadow, a border\-width of \fB\efboxrule\fP, a padding of \fB\efboxsep\fP, circular corners with radii \fB\efboxsep\fP and background and border colors as for the default rendering of code\-blocks. .sp When a \fB\esphinxbox\fP usage is nested within another one, it will ignore the options of the outer one: it first resets all options to their default state as they were prior to applying the outer box options, then it applies its own specific ones. .sp One can modify these defaults via the command \fB\esphinxboxsetup{key=value,...}\fP\&. The effect is cumulative, if one uses this command multiple times. Here the options are a mandatory argument so are within curly braces, not square brackets. .sp Here is some example of use: .INDENT 0.0 .INDENT 3.5 .sp .EX latex_elements = { \(aqpreamble\(aq: r\(aq\(aq\(aq % modify globally the defaults \esphinxboxsetup{border\-width=2pt,% border\-radius=4pt,% background\-TeXcolor=yellow!20} % configure some styling element with some extra specific options: \eprotected\edef\esphinxkeyboard#1{\esphinxbox[border\-TeXcolor=green]{\esphinxcode{#1}}} \(aq\(aq\(aq, } .EE .UNINDENT .UNINDENT .sp A utility \fB\enewsphinxbox\fP is provided to create a new boxing macro, say \fB\efoo\fP which will act exactly like \fB\esphinxbox\fP but with a given extra configuration: .INDENT 0.0 .INDENT 3.5 .sp .EX % the specific options to \efoo are within brackets \enewsphinxbox[border\-radius=0pt, box\-shadow=2pt 2pt]{\efoo} % then use this \efoo, possibly with some extra options still: \eprotected\edef\esphinxguilabel#1{\efoo{#1}} \eprotected\edef\esphinxmenuselection#1{\efoo[box\-shadow\-TeXcolor=gray]{#1}} .EE .UNINDENT .UNINDENT .sp Boxes rendered with \fB\efoo\fP obey as the ones using directly \fB\esphinxbox\fP the current configuration as set possibly mid\-way in document via \fB\esphinxboxsetup\fP (from a raw \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:raw> LaTeX mark\-up), the only difference is that they have an initial additional set of default extras. .sp In the above examples, you can probably use \fB\erenewcommand\fP syntax if you prefer it to \fB\eprotected\edef\fP (with \fB[1]\fP in place of \fB#1\fP then). .SS Environments .INDENT 0.0 .IP \(bu 2 A figure \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:figure> may have an optional legend with arbitrary body elements: they are rendered in a \fBsphinxlegend\fP environment. The default definition issues \fB\esmall\fP, and ends with \fB\epar\fP\&. .sp Added in version 1.5.6: Formerly, the \fB\esmall\fP was hardcoded in LaTeX writer and the ending \fB\epar\fP was lacking. .IP \(bu 2 Environments associated with admonitions: .INDENT 2.0 .IP \(bu 2 \fBsphinxnote\fP, .IP \(bu 2 \fBsphinxhint\fP, .IP \(bu 2 \fBsphinximportant\fP, .IP \(bu 2 \fBsphinxtip\fP, .IP \(bu 2 \fBsphinxwarning\fP, .IP \(bu 2 \fBsphinxcaution\fP, .IP \(bu 2 \fBsphinxattention\fP, .IP \(bu 2 \fBsphinxdanger\fP, .IP \(bu 2 \fBsphinxerror\fP\&. .UNINDENT .sp They may be \fB\erenewenvironment\fP \(aqd individually, and must then be defined with one argument (it is the heading of the notice, for example \fBWarning:\fP for warning \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:warning> directive, if English is the document language). Their default definitions use either the \fIsphinxheavybox\fP (for the last 5 ones) or the \fIsphinxlightbox\fP environments, configured to use the parameters (colors, border thickness) specific to each type, which can be set via \fB\(aqsphinxsetup\(aq\fP string. .sp Changed in version 1.5: Use of public environment names, separate customizability of the parameters, such as \fBnoteBorderColor\fP, \fBnoteborder\fP, \fBwarningBgColor\fP, \fBwarningBorderColor\fP, \fBwarningborder\fP, ... .IP \(bu 2 Environment for the \fBseealso\fP \%<#\:directive-seealso> directive: \fBsphinxseealso\fP\&. It takes one argument which will be the localized string \fBSee also\fP followed with a colon. .sp Added in version 6.1.0. .sp Changed in version 6.2.0: Colon made part of the mark\-up rather than being inserted by the environment for coherence with how admonitions are handled generally. .IP \(bu 2 Environment for the \fBtodo\fP \%<#\:directive-todo> directive: \fBsphinxtodo\fP\&. It takes one argument, namely the localization of \fBTodo\fP (with a colon at the end; the default rendering will remove that colon and put the localized string in its own colored title\-row). .sp Added in version 7.4.0. .IP \(bu 2 The topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents> and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> directives are associated with respectively \fBsphinxtopic\fP, \fBsphinxcontents\fP, and \fBsphinxsidebar\fP environments. .sp Added in version 1.4.2: Former code refactored into an environment allowing page breaks. .sp Changed in version 1.5: Options \fBshadowsep\fP, \fBshadowsize\fP, \fBshadowrule\fP\&. .sp Added in version 8.1.0: Separate environments (all three wrappers around \fBsphinxShadowBox\fP) and separate customizability. .IP \(bu 2 The literal blocks (via \fB::\fP or \fBcode\-block\fP \%<#\:directive-code-block>), and literal includes (\fBliteralinclude\fP \%<#\:directive-literalinclude>) are implemented using \fBsphinxVerbatim\fP environment which is a wrapper of \fBVerbatim\fP environment from package \fBfancyvrb.sty\fP\&. It adds the handling of the top caption and the wrapping of long lines, and a frame which allows page breaks. Inside tables the used environment is \fBsphinxVerbatimintable\fP (it does not draw a frame, but allows a caption). .sp Changed in version 1.5: \fBVerbatim\fP keeps exact same meaning as in \fBfancyvrb.sty\fP (also under the name \fBOriginalVerbatim\fP); \fBsphinxVerbatimintable\fP is used inside tables. .sp Added in version 1.5: Options \fBverbatimwithframe\fP, \fBverbatimwrapslines\fP, \fBverbatimsep\fP, \fBverbatimborder\fP\&. .sp Added in version 1.6.6: Support for \fB:emphasize\-lines:\fP option .sp Added in version 1.6.6: Easier customizability of the formatting via exposed to user LaTeX macros such as \fB\esphinxVerbatimHighlightLine\fP\&. .IP \(bu 2 The bibliography uses \fBsphinxthebibliography\fP and the Python Module index as well as the general index both use \fBsphinxtheindex\fP; these environments are wrappers of the \fBthebibliography\fP and respectively \fBtheindex\fP environments as provided by the document class (or packages). .sp Changed in version 1.5: Formerly, the original environments were modified by Sphinx. .UNINDENT .SS Miscellany .INDENT 0.0 .IP \(bu 2 Every text paragraph in document body starts with \fB\esphinxAtStartPar\fP\&. Currently, this is used to insert a zero width horizontal skip which is a trick to allow TeX hyphenation of the first word of a paragraph in a narrow context (like a table cell). For \fB\(aqlualatex\(aq\fP which does not need the trick, the \fB\esphinxAtStartPar\fP does nothing. .sp Added in version 3.5.0. .IP \(bu 2 The section, subsection, ... headings are set using \fItitlesec\fP\(aqs \fB\etitleformat\fP command. .IP \(bu 2 For the \fB\(aqmanual\(aq\fP docclass, the chapter headings can be customized using \fIfncychap\fP\(aqs commands \fB\eChNameVar\fP, \fB\eChNumVar\fP, \fB\eChTitleVar\fP\&. File \fBsphinx.sty\fP has custom re\-definitions in case of \fIfncychap\fP option \fBBjarne\fP\&. .sp Changed in version 1.5: Formerly, use of \fIfncychap\fP with other styles than \fBBjarne\fP was dysfunctional. .IP \(bu 2 The role \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:role> directive allows to mark inline text with class arguments. This is handled in LaTeX output via the \fB\eDUrole\fP dispatcher command as in Docutils \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:user/\:latex\:.html#\:custom-interpreted-text-roles>\&. Object signatures also use \fB\eDUrole\fP for some components, with one or two\-letters class names as in HTML output. .sp Changed in version 8.1.0: When multiple classes are injected via a a custom role, the LaTeX output uses nested \fB\eDUrole\fP\(aqs as in the Docutils documentation \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:user/\:latex\:.html#\:custom-interpreted-text-roles>\&. Formerly it used a single \fB\eDUrole\fP with comma separated classes, making the LaTeX customization more arduous. .UNINDENT .INDENT 0.0 .IP \(bu 2 Docutils container \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:container> directives are supported in LaTeX output: to let a container class with name \fBfoo\fP influence the final PDF via LaTeX, it is only needed to define in the preamble an environment \fBsphinxclassfoo\fP\&. A simple example would be: .INDENT 2.0 .INDENT 3.5 .sp .EX \enewenvironment{sphinxclassred}{\ecolor{red}}{} .EE .UNINDENT .UNINDENT .sp Currently the class names must contain only ASCII characters and avoid characters special to LaTeX such as \fB\e\fP\&. .sp Added in version 4.1.0. .UNINDENT .sp \fBHint:\fP .INDENT 0.0 .INDENT 3.5 As an experimental feature, Sphinx can use user\-defined template file for LaTeX source if you have a file named \fB_templates/latex.tex.jinja\fP in your project. .sp Additional files \fBlongtable.tex.jinja\fP, \fBtabulary.tex.jinja\fP and \fBtabular.tex.jinja\fP can be added to \fB_templates/\fP to configure some aspects of table rendering (such as the caption position). .sp Added in version 1.6: currently all template variables are unstable and undocumented. .sp Changed in version 7.4: Added support for the \fB\&.jinja\fP file extension, which is preferred. The old file names remain supported. (\fBlatex.tex_t\fP, \fBlongtable.tex_t\fP, \fBtabulary.tex_t\fP, and \fBtabular.tex_t\fP) .UNINDENT .UNINDENT .SH COMMUNITY GUIDE .sp Sphinx is community supported and welcomes contributions from anybody. The sections below should help you get started joining the Sphinx community as well as contributing. .sp See the Sphinx contributors\(aq guide \%<> if you would like to contribute to the project. .SS Get support .sp For questions or to report problems with Sphinx: .INDENT 0.0 .IP \(bu 2 Please verify that your question does not exist on StackOverflow \%<https://\:stackoverflow\:.com/\:questions/\:tagged/\:python-sphinx> (with the tag \fBpython\-sphinx\fP) .IP \(bu 2 open a topic at the Github discussions \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:discussions> page, .IP \(bu 2 open an issue at the Github issues \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:issues> page, .IP \(bu 2 or join the sphinx\-users \%<https://\:groups\:.google\:.com/\:group/\:sphinx-users> mailing list on Google Groups, .UNINDENT .sp Examples of other projects using Sphinx can be found in the examples page \%<>\&. .sp See also the guide by ReadTheDocs \%<https://\:docs\:.readthedocs\:.io/\:en/\:stable/\:intro/\:getting-started-with-sphinx\:.html> on how to get started with Sphinx. .sp There is a translation team in Transifex \%<https://\:www\:.transifex\:.com/\:sphinx-doc/\:sphinx-doc/\:dashboard/> of this documentation, thanks to the Sphinx document translators. .SS Contribute to Sphinx .sp This guide contains information about the Sphinx open source project itself. This is where you can find information about how Sphinx is managed and learn how to contribute to the project. .SS Contributing to Sphinx .sp There are many ways you can contribute to Sphinx, be it filing bug reports or feature requests, writing new documentation or submitting patches for new or fixed behavior. This guide serves to illustrate how you can get started with this. .SS Get help .sp The Sphinx community maintains a number of mailing lists and IRC channels. .INDENT 0.0 .TP .B Stack Overflow with tag python\-sphinx \%<https://\:stackoverflow\:.com/\:questions/\:tagged/\:python-sphinx> Questions and answers about use and development. .TP .B GitHub Discussions Q&A \%<https://\:github\:.com/\:orgs/\:sphinx-doc/\:discussions/\:categories/\:q-a> Question\-and\-answer style forum for discussions. .TP .B sphinx\-users <\%<sphinx-users@\:googlegroups\:.com>> Mailing list for user support. .TP .B sphinx\-dev <\%<sphinx-dev@\:googlegroups\:.com>> Mailing list for development related discussions. .TP .B #sphinx\-doc on irc.libera.chat IRC channel for development questions and user support. .UNINDENT .SS Bug Reports and Feature Requests .sp If you have encountered a problem with Sphinx or have an idea for a new feature, please submit it to the issue tracker \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:issues> on GitHub. .sp For bug reports, please include the output produced during the build process and also the log file Sphinx creates after it encounters an unhandled exception. The location of this file should be shown towards the end of the error message. Please also include the output of \fBsphinx\-build \-\-bug\-report\fP\&. .sp Including or providing a link to the source files involved may help us fix the issue. If possible, try to create a minimal project that produces the error and post that instead. .SS Contribute code .sp The Sphinx source code is managed using Git and is hosted on GitHub \%<https://\:github\:.com/\:sphinx-doc/\:sphinx>\&. The recommended way for new contributors to submit code to Sphinx is to fork this repository and submit a pull request after committing changes to their fork. The pull request will then need to be approved by one of the core developers before it is merged into the main repository. .SS Getting started .sp Before starting on a patch, we recommend checking for open issues or opening a fresh issue to start a discussion around a feature idea or a bug. If you feel uncomfortable or uncertain about an issue or your changes, feel free to start a discussion \%<https://\:github\:.com/\:orgs/\:sphinx-doc/\:discussions/>\&. .sp These are the basic steps needed to start developing on Sphinx. .INDENT 0.0 .IP 1. 4 Create an account on GitHub. .IP 2. 4 Fork \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:fork> the main Sphinx repository (sphinx\-doc/sphinx \%<https://\:github\:.com/\:sphinx-doc/\:sphinx>) using the GitHub interface. .IP 3. 4 Clone the forked repository to your machine. .INDENT 4.0 .INDENT 3.5 .sp .EX git clone https://github.com/<USERNAME>/sphinx cd sphinx .EE .UNINDENT .UNINDENT .IP 4. 4 Install uv and set up your environment. .sp We recommend using \fBuv\fP for dependency management. Install it with: .INDENT 4.0 .INDENT 3.5 .sp .EX python \-m pip install \-U uv .EE .UNINDENT .UNINDENT .sp Then, set up your environment: .INDENT 4.0 .INDENT 3.5 .sp .EX uv sync .EE .UNINDENT .UNINDENT .sp \fBAlternative:\fP If you prefer not to use \fBuv\fP, you can use \fBpip\fP: .INDENT 4.0 .INDENT 3.5 .sp .EX python \-m venv .venv \&. .venv/bin/activate python \-m pip install \-e . .EE .UNINDENT .UNINDENT .IP 5. 4 Create a new working branch. Choose any name you like. .INDENT 4.0 .INDENT 3.5 .sp .EX git switch \-c feature\-xyz .EE .UNINDENT .UNINDENT .IP 6. 4 Hack, hack, hack. .sp Write your code along with tests that shows that the bug was fixed or that the feature works as expected. .IP 7. 4 Add a bullet point to \fBCHANGES.rst\fP if the fix or feature is not trivial (small doc updates, typo fixes), then commit: .INDENT 4.0 .INDENT 3.5 .sp .EX git commit \-m \(aqAdd useful new feature that does this.\(aq .EE .UNINDENT .UNINDENT .IP 8. 4 Push changes in the branch to your forked repository on GitHub: .INDENT 4.0 .INDENT 3.5 .sp .EX git push origin feature\-xyz .EE .UNINDENT .UNINDENT .IP 9. 4 Submit a pull request from your branch to the \fBmaster\fP branch. .sp GitHub recognizes certain phrases that can be used to automatically update the issue tracker. For example, including \(aqCloses #42\(aq in the body of your pull request will close issue #42 if the PR is merged. .IP 10. 4 Wait for a core developer or contributor to review your changes. .sp You may be asked to address comments on the review. If so, please avoid force pushing to the branch. Sphinx uses the \fIsquash merge\fP strategy when merging PRs, so follow\-up commits will all be combined. .UNINDENT .SS Coding style .sp Please follow these guidelines when writing code for Sphinx: .INDENT 0.0 .IP \(bu 2 Try to use the same code style as used in the rest of the project. .IP \(bu 2 For non\-trivial changes, please update the \fBCHANGES.rst\fP file. If your changes alter existing behavior, please document this. .IP \(bu 2 New features should be documented. Include examples and use cases where appropriate. If possible, include a sample that is displayed in the generated output. .IP \(bu 2 When adding a new configuration variable, be sure to document it \%<> and update \fBsphinx/cmd/quickstart.py\fP if it\(aqs important enough. .IP \(bu 2 Add appropriate unit tests. .UNINDENT .sp Style and type checks can be run as follows: .INDENT 0.0 .INDENT 3.5 .sp .EX uv run ruff check uv run ruff format uv run mypy .EE .UNINDENT .UNINDENT .SS Unit tests .sp Sphinx is tested using pytest \%<https://\:docs\:.pytest\:.org/\:en/\:latest/> for Python code and Jasmine \%<https://\:jasmine\:.github\:.io/> for JavaScript. .sp To run Python unit tests, we recommend using \fBtox\fP, which provides a number of targets and allows testing against multiple different Python environments: .INDENT 0.0 .IP \(bu 2 To list all possible targets: .INDENT 2.0 .INDENT 3.5 .sp .EX tox \-av .EE .UNINDENT .UNINDENT .IP \(bu 2 To run unit tests for a specific Python version, such as Python 3.14: .INDENT 2.0 .INDENT 3.5 .sp .EX tox \-e py314 .EE .UNINDENT .UNINDENT .IP \(bu 2 Arguments to \fBpytest\fP can be passed via \fBtox\fP, e.g., in order to run a particular test: .INDENT 2.0 .INDENT 3.5 .sp .EX tox \-e py314 tests/test_module.py::test_new_feature .EE .UNINDENT .UNINDENT .UNINDENT .sp You can also test by installing dependencies in your local environment: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .EX uv run pytest .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp Or with \fBpip\fP: .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .INDENT 3.5 .sp .EX python \-m pip install . \-\-group test pytest .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp To run JavaScript tests, use \fBnpm\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX npm install npm run test .EE .UNINDENT .UNINDENT .sp \fBTip:\fP .INDENT 0.0 .INDENT 3.5 \fBjasmine\fP requires a Firefox binary to use as a test browser. .sp On Unix systems, you can check the presence and location of the \fBfirefox\fP binary at the command\-line by running \fBcommand \-v firefox\fP\&. .UNINDENT .UNINDENT .sp New unit tests should be included in the \fBtests/\fP directory where necessary: .INDENT 0.0 .IP \(bu 2 For bug fixes, first add a test that fails without your changes and passes after they are applied. .IP \(bu 2 Tests that need a \fBsphinx\-build\fP run should be integrated in one of the existing test modules if possible. .IP \(bu 2 Tests should be quick and only test the relevant components, as we aim that \fIthe test suite should not take more than a minute to run\fP\&. In general, avoid using the \fBapp\fP fixture and \fBapp.build()\fP unless a full integration test is required. .UNINDENT .sp Added in version 1.8: Sphinx also runs JavaScript tests. .sp Changed in version 1.5.2: Sphinx was switched from nose to pytest. .SS Contribute documentation .sp Contributing to documentation involves modifying the source files found in the \fBdoc/\fP folder. To get started, you should first follow Getting started, and then take the steps below to work with the documentation. .sp The following sections describe how to get started with contributing documentation, as well as key aspects of a few different tools that we use. .INDENT 0.0 .INDENT 3.5 .SS Todo .sp Add a more extensive documentation contribution guide. .UNINDENT .UNINDENT .SS Build the documentation .sp To build the documentation, run the following command: .INDENT 0.0 .INDENT 3.5 .sp .EX sphinx\-build \-M html ./doc ./build/sphinx \-\-fail\-on\-warning .EE .UNINDENT .UNINDENT .sp This will parse the Sphinx documentation\(aqs source files and generate HTML for you to preview in \fBbuild/sphinx/html\fP\&. .sp You can also build a \fBlive version of the documentation\fP that you can preview in the browser. It will detect changes and reload the page any time you make edits. To do so, use sphinx\-autobuild \%<https://\:github\:.com/\:sphinx-doc/\:sphinx-autobuild> to run the following command: .INDENT 0.0 .INDENT 3.5 .sp .EX sphinx\-autobuild ./doc ./build/sphinx/ .EE .UNINDENT .UNINDENT .SS Translations .sp The parts of messages in Sphinx that go into builds are translated into several locales. The translations are kept as gettext \fB\&.po\fP files translated from the master template \fBsphinx/locale/sphinx.pot\fP\&. .sp These Sphinx core messages are translated using the online Transifex \%<https://\:explore\:.transifex\:.com/\:sphinx-doc/\:sphinx-1/> platform. .sp Translated strings from the platform are pulled into the Sphinx repository by a maintainer before a new release. .sp We do not accept pull requests altering the translation files directly. Instead, please contribute translations via the Transifex platform. .SS Translations notes for maintainers .sp The transifex CLI \%<https://\:developers\:.transifex\:.com/\:docs/\:cli> (\fBtx\fP) can be used to pull translations in \fB\&.po\fP format from Transifex. To do this, go to \fBsphinx/locale\fP and then run \fBtx pull \-f \-l LANG\fP where \fBLANG\fP is an existing language identifier. It is good practice to run \fBpython utils/babel_runner.py update\fP afterwards to make sure the \fB\&.po\fP file has the canonical Babel formatting. .sp Sphinx uses Babel \%<https://\:babel\:.pocoo\:.org/\:en/\:latest/> to extract messages and maintain the catalog files. The \fButils\fP directory contains a helper script, \fButils/babel_runner.py\fP\&. .INDENT 0.0 .IP \(bu 2 Use \fBpython babel_runner.py extract\fP to update the \fB\&.pot\fP template. .IP \(bu 2 Use \fBpython babel_runner.py update\fP to update all existing language catalogs in \fBsphinx/locale/*/LC_MESSAGES\fP with the current messages in the template file. .IP \(bu 2 Use \fBpython babel_runner.py compile\fP to compile the \fB\&.po\fP files to binary \fB\&.mo\fP files and \fB\&.js\fP files. .UNINDENT .sp When an updated \fB\&.po\fP file is submitted, run \fBpython babel_runner.py compile\fP to commit both the source and the compiled catalogs. .sp When a new locale is added, add a new directory with the ISO 639\-1 language identifier and put \fBsphinx.po\fP in there. Don\(aqt forget to update the possible values for \fBlanguage\fP \%<#\:confval-language> in \fBdoc/usage/configuration.rst\fP\&. .SS Debugging tips .INDENT 0.0 .IP \(bu 2 Delete the build cache before building documents if you make changes in the code by running the command \fBmake clean\fP or using the \fBsphinx\-build \-\-fresh\-env\fP \%<#\:cmdoption-sphinx-build-E> option. .IP \(bu 2 Use the \fBsphinx\-build \-\-pdb\fP \%<#\:cmdoption-sphinx-build-P> option to run \fBpdb\fP on exceptions. .IP \(bu 2 Use \fBnode.pformat()\fP and \fBnode.asdom().toxml()\fP to generate a printable representation of the document structure. .IP \(bu 2 Set the configuration variable \fBkeep_warnings\fP \%<#\:confval-keep_warnings> to \fBTrue\fP so warnings will be displayed in the generated output. .IP \(bu 2 Set the configuration variable \fBnitpicky\fP \%<#\:confval-nitpicky> to \fBTrue\fP so that Sphinx will complain about references without a known target. .IP \(bu 2 Set the debugging options in the Docutils configuration file \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:user/\:config\:.html>\&. .UNINDENT .SS Updating generated files .INDENT 0.0 .IP \(bu 2 JavaScript stemming algorithms in \fBsphinx/search/non\-minified\-js/*.js\fP and stopword files in \fBsphinx/search/_stopwords/\fP are generated from the Snowball project \%<https://\:snowballstem\:.org/> by running \fButils/generate_snowball.py\fP\&. .sp Minified files in \fBsphinx/search/minified\-js/*.js\fP are generated from non\-minified ones using \fBuglifyjs\fP (installed via npm). See \fBsphinx/search/minified\-js/README.rst\fP\&. .IP \(bu 2 The \fBsearchindex.js\fP files found in the \fBtests/js/fixtures/*\fP directories are generated by using the standard Sphinx HTML builder on the corresponding input projects found in \fBtests/js/roots/*\fP\&. The fixtures provide test data used by the Sphinx JavaScript unit tests, and can be regenerated by running the \fButils/generate_js_fixtures.py\fP script. .UNINDENT .SS Sphinx\(aqs release process .SS Versioning .sp Sphinx adheres to \fBPEP 440\fP \%<https://\:peps\:.python\:.org/\:pep-0440/> versions, with a \fBmajor.minor.micro\fP scheme for the \fIrelease segment\fP (e.g. 1.2.3). The major, minor, and micro version parts should be altered as follows: .INDENT 0.0 .IP \(bu 2 The major version part should be incremented for incompatible behavior change and public API updates. .IP \(bu 2 The minor version part should be incremented for most releases of Sphinx, where backwards\-compatibility of API and features are preserves. .IP \(bu 2 The micro version part should only be incremented for urgent bugfix\-only releases. .UNINDENT .sp When the major version part is incremented, the minor and micro version parts must be set to \fB0\fP\&. When the minor version part is incremented, the micro version part must be set to \fB0\fP\&. .sp New major versions should come with a beta\-testing period before the final release. .SS Deprecating a feature .sp There are a couple reasons that code in Sphinx might be deprecated: .INDENT 0.0 .IP \(bu 2 If a feature has been improved or modified in a backwards\-incompatible way, the old feature or behavior will be deprecated. .IP \(bu 2 Sometimes Sphinx will include a backport of a Python library that\(aqs not included in a version of Python that Sphinx currently supports. When Sphinx no longer needs to support the older version of Python that doesn\(aqt include the library, the library will be deprecated in Sphinx. .UNINDENT .sp As the Deprecation policy describes, the first release of Sphinx that deprecates a feature (\fBA.B\fP) should raise a \fBRemovedInSphinxXXWarning\fP (where \fBXX\fP is the Sphinx version where the feature will be removed) when the deprecated feature is invoked. Assuming we have good test coverage, these warnings are converted to errors when running the test suite with warnings enabled: .INDENT 0.0 .INDENT 3.5 .sp .EX pytest \-Wall .EE .UNINDENT .UNINDENT .sp Thus, when adding a \fBRemovedInSphinxXXWarning\fP you need to eliminate or silence any warnings generated when running the tests. .SS Deprecation policy .sp MAJOR and MINOR releases may deprecate certain features from previous releases. If a feature is deprecated in a release A.x, it will continue to work in all A.x.x versions (for all versions of x). It will continue to work in all B.x.x versions but raise deprecation warnings. Deprecated features will be removed at the C.0.0. It means the deprecated feature will work during 2 MAJOR releases at least. .sp So, for example, if we decided to start the deprecation of a function in Sphinx 2.x: .INDENT 0.0 .IP \(bu 2 Sphinx 2.x will contain a backwards\-compatible replica of the function which will raise a \fBRemovedInSphinx40Warning\fP\&. This is a subclass of \fBPendingDeprecationWarning\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:PendingDeprecationWarning>, i.e. it will not get displayed by default. .IP \(bu 2 Sphinx 3.x will still contain the backwards\-compatible replica, but \fBRemovedInSphinx40Warning\fP will be a subclass of \fBDeprecationWarning\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:exceptions\:.html#\:DeprecationWarning> then, and gets displayed by default. .IP \(bu 2 Sphinx 4.0 will remove the feature outright. .UNINDENT .SS Deprecation warnings .sp Sphinx will enable its \fBRemovedInNextVersionWarning\fP warnings by default, if \fBPYTHONWARNINGS\fP \%<https://\:docs\:.python\:.org/\:3/\:using/\:cmdline\:.html#\:envvar-PYTHONWARNINGS> is not set. Therefore you can disable them using: .INDENT 0.0 .IP \(bu 2 \fBPYTHONWARNINGS= make html\fP (Linux/Mac) .IP \(bu 2 \fBexport PYTHONWARNINGS=\fP and do \fBmake html\fP (Linux/Mac) .IP \(bu 2 \fBset PYTHONWARNINGS=\fP and do \fBmake html\fP (Windows) .UNINDENT .sp But you can also explicitly enable the pending ones using e.g. \fBPYTHONWARNINGS=default\fP (see the Python docs on configuring warnings \%<https://\:docs\:.python\:.org/\:3/\:library/\:warnings\:.html#\:describing-warning-filters>) for more details. .SS Python version support policy .sp Sphinx supports at all minor versions of Python released in the past 3 years from the anticipated release date with a minimum of 3 minor versions of Python. This policy is derived from SPEC 0 \%<https://\:scientific-python\:.org/\:specs/\:spec-0000/>, a scientific Python domain standard. .sp For example, a version of Sphinx released in May 2025 would support Python 3.11, 3.12, and 3.13. .sp This is a summary table with the current policy: .TS box center; l|l. T{ Date T} T{ Python T} _ T{ 05 Oct 2023 T} T{ 3.10+ T} _ T{ 04 Oct 2024 T} T{ 3.11+ T} _ T{ 24 Oct 2025 T} T{ 3.12+ T} _ T{ 01 Oct 2026 T} T{ 3.13+ T} _ T{ 01 Oct 2027 T} T{ 3.14+ T} .TE .SS Release procedures .sp The release procedures are listed in \fButils/release\-checklist.rst\fP\&. .SS Organization of the Sphinx project .sp The guide explains how the Sphinx project is organized. .SS Core developers .sp The core developers of Sphinx have write access to the main repository. They can commit changes, accept/reject pull requests, and manage items on the issue tracker. .SS Guidelines .sp The following are some general guidelines for core developers: .INDENT 0.0 .IP \(bu 2 Questionable or extensive changes should be submitted as a pull request instead of being committed directly to the main repository. The pull request should be reviewed by another core developer before it is merged. .IP \(bu 2 Trivial changes can be committed directly but be sure to keep the repository in a good working state and that all tests pass before pushing your changes. .IP \(bu 2 When committing code written by someone else, please attribute the original author in the commit message and any relevant \fBCHANGES.rst\fP entry. .UNINDENT .SS Membership .sp Core membership is predicated on continued active contribution to the project. In general, prospective cores should demonstrate: .INDENT 0.0 .IP \(bu 2 a good understanding of one of more components of Sphinx .IP \(bu 2 a history of helpful, constructive contributions .IP \(bu 2 a willingness to invest time improving Sphinx .UNINDENT .sp Refer to Contributing to Sphinx \%<> for more information on how you can get started. .SS Other contributors .sp You do not need to be a core developer or have write access to be involved in the development of Sphinx. You can submit patches or create pull requests from forked repositories and have a core developer add the changes for you. .sp Similarly, contributions are not limited to code patches. We also welcome help triaging bugs, input on design decisions, reviews of existing patches and documentation improvements. More information can be found in Contributing to Sphinx \%<>\&. .sp A list of people that have contributed to Sphinx can be found in Sphinx authors \%<>\&. .SS Sphinx Code of Conduct .sp Like the technical community as a whole, the Sphinx team and community is made up of volunteers from all over the world. Diversity is a strength, but it can also lead to communication issues and unhappiness. To that end, we have a few ground rules that we ask people to adhere to. .INDENT 0.0 .IP \(bu 2 \fBBe friendly and patient.\fP .IP \(bu 2 \fBBe welcoming.\fP We strive to be a community that welcomes and supports people of all backgrounds and identities. This includes, but is not limited to members of any race, ethnicity, culture, national origin, colour, immigration status, social and economic class, educational level, sex, sexual orientation, gender identity and expression, age, size, family status, political belief, religion, and mental and physical ability. .IP \(bu 2 \fBBe considerate.\fP Your work will be used by other people, and you in turn will depend on the work of others. Any decision you take will affect users and colleagues, and you should take those consequences into account when making decisions. Remember that we\(aqre a world\-wide community, so you might not be communicating in someone else\(aqs primary language. .IP \(bu 2 \fBBe respectful.\fP Not all of us will agree all the time, but disagreement is no excuse for poor behavior and poor manners. We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It\(aqs important to remember that a community where people feel uncomfortable or threatened is not a productive one. Members of the Sphinx community should be respectful when dealing with other members as well as with people outside the Sphinx community. .IP \(bu 2 \fBBe careful in the words that you choose.\fP We are a community of professionals, and we conduct ourselves professionally. Be kind to others. Do not insult or put down other participants. Harassment and other exclusionary behavior aren\(aqt acceptable. This includes, but is not limited to: .INDENT 2.0 .IP \(bu 2 Violent threats or language directed against another person. .IP \(bu 2 Discriminatory jokes and language. .IP \(bu 2 Posting sexually explicit or violent material. .IP \(bu 2 Posting (or threatening to post) other people\(aqs personally identifying information (\(dqdoxing\(dq). .IP \(bu 2 Personal insults, especially those using racist or sexist terms. .IP \(bu 2 Unwelcome sexual attention. .IP \(bu 2 Advocating for, or encouraging, any of the above behavior. .IP \(bu 2 Repeated harassment of others. In general, if someone asks you to stop, then stop. .UNINDENT .IP \(bu 2 \fBWhen we disagree, try to understand why.\fP Disagreements, both social and technical, happen all the time and Sphinx is no exception. It is important that we resolve disagreements and differing views constructively. Remember that we\(aqre different. Different people have different perspectives on issues. Being unable to understand why someone holds a viewpoint doesn\(aqt mean that they\(aqre wrong. Don\(aqt forget that it is human to err and blaming each other doesn\(aqt get us anywhere. Instead, focus on helping to resolve issues and learning from mistakes. .UNINDENT .sp This isn\(aqt an exhaustive list of things that you can\(aqt do. Rather, take it in the spirit in which it\(aqs intended \- a guide to make it easier to enrich all of us and the technical communities in which we participate. This code of conduct applies to all spaces of the Sphinx community. .sp Attribution .sp Original text courtesy of the Speak Up! project: \%<http://\:web\:.archive\:.org/\:web/\:20141109123859/\:http://\:speakup\:.io/\:coc\:.html>\&. .SS Sphinx FAQ .sp This is a list of Frequently Asked Questions about Sphinx. Feel free to suggest new entries! .SS How do I... .INDENT 0.0 .TP .B \&... create PDF files without LaTeX? rinohtype \%<https://\:github\:.com/\:brechtm/\:rinohtype> provides a PDF builder that can be used as a drop\-in replacement for the LaTeX builder. .TP .B \&... get section numbers? They are automatic in LaTeX output; for HTML, give a \fB:numbered:\fP option to the \fBtoctree\fP \%<#\:directive-toctree> directive where you want to start numbering. .TP .B \&... customize the look of the built HTML files? Use themes, see HTML theming \%<>\&. .TP .B \&... add global substitutions or includes? Add them in the \fBrst_prolog\fP \%<#\:confval-rst_prolog> or \fBrst_epilog\fP \%<#\:confval-rst_epilog> config value. .TP .B \&... display the whole TOC tree in the sidebar? Use the \fBtoctree\fP \%<#\:toctree> callable in a custom layout template, probably in the \fBsidebartoc\fP block. .TP .B \&... write my own extension? See the Tutorials \%<#\:extension-tutorials-index>\&. .TP .B \&... convert from my existing docs using MoinMoin markup? The easiest way is to convert to xhtml, then convert xhtml to reStructuredText \%<https://\:docutils\:.sourceforge\:.io/\:sandbox/\:xhtml2rest/\:xhtml2rest\:.py>\&. You\(aqll still need to mark up classes and such, but the headings and code examples come through cleanly. .UNINDENT .sp For many more extensions and other contributed stuff, see the sphinx\-contrib \%<https://\:github\:.com/\:sphinx-contrib/> repository. .SS Using Sphinx with... .INDENT 0.0 .TP .B Read the Docs Read the Docs \%<https://\:readthedocs\:.org> is a documentation hosting service based around Sphinx. They will host sphinx documentation, along with supporting a number of other features including version support, PDF generation, and more. The Getting Started \%<https://\:docs\:.readthedocs\:.io/\:en/\:stable/\:intro/\:getting-started-with-sphinx\:.html> guide is a good place to start. .TP .B Epydoc There\(aqs a third\-party extension providing an api role \%<https://\:git\:.savannah\:.gnu\:.org/\:cgit/\:kenozooid\:.git/\:tree/\:doc/\:extapi\:.py> which refers to Epydoc\(aqs API docs for a given identifier. .TP .B Doxygen Michael Jones has developed a reStructuredText/Sphinx bridge to doxygen called breathe \%<https://\:github\:.com/\:breathe-doc/\:breathe/\:tree/\:master>\&. .TP .B SCons Glenn Hutchings has written a SCons build script to build Sphinx documentation; it is hosted here: \%<https://\:bitbucket-archive\:.softwareheritage\:.org/\:projects/\:zo/\:zondo/\:sphinx-scons\:.html> .TP .B PyPI Jannis Leidel wrote a setuptools command \%<https://\:pypi\:.org/\:project/\:Sphinx-PyPI-upload/> that automatically uploads Sphinx documentation to the PyPI package documentation area at \%<https://\:pythonhosted\:.org/>\&. .TP .B GitHub Pages Please add \fBsphinx.ext.githubpages\fP \%<#\:module-sphinx\:.ext\:.githubpages> to your project. It allows you to publish your document in GitHub Pages. It generates helper files for GitHub Pages on building HTML document automatically. .TP .B MediaWiki See sphinx\-wiki \%<https://\:bitbucket-archive\:.softwareheritage\:.org/\:projects/\:ke/\:kevindunn/\:sphinx-wiki\:.html>, a project by Kevin Dunn. .TP .B Google Analytics You can use a custom \fBlayout.html\fP template, like this: .INDENT 7.0 .INDENT 3.5 .sp .EX {% extends \(dq!layout.html\(dq %} {%\- block extrahead %} {{ super() }} <script> var _gaq = _gaq || []; _gaq.push([\(aq_setAccount\(aq, \(aqXXX account number XXX\(aq]); _gaq.push([\(aq_trackPageview\(aq]); </script> {% endblock %} {% block footer %} {{ super() }} <div class=\(dqfooter\(dq>This page uses <a href=\(dqhttps://analytics.google.com/\(dq> Google Analytics</a> to collect statistics. You can disable it by blocking the JavaScript coming from www.google\-analytics.com. <script> (function() { var ga = document.createElement(\(aqscript\(aq); ga.src = (\(aqhttps:\(aq == document.location.protocol ? \(aqhttps://ssl\(aq : \(aqhttps://www\(aq) + \(aq.google\-analytics.com/ga.js\(aq; ga.setAttribute(\(aqasync\(aq, \(aqtrue\(aq); document.documentElement.firstChild.appendChild(ga); })(); </script> </div> {% endblock %} .EE .UNINDENT .UNINDENT .TP .B Google Search To replace Sphinx\(aqs built\-in search function with Google Search, proceed as follows: .INDENT 7.0 .IP 1. 3 Go to \%<https://\:cse\:.google\:.com/\:cse/\:all> to create the Google Search code snippet. .IP 2. 3 Copy the code snippet and paste it into \fB_templates/searchbox.html\fP in your Sphinx project: .INDENT 3.0 .INDENT 3.5 .sp .EX <div> <h3>{{ _(\(aqQuick search\(aq) }}</h3> <script> (function() { var cx = \(aq......\(aq; var gcse = document.createElement(\(aqscript\(aq); gcse.async = true; gcse.src = \(aqhttps://cse.google.com/cse.js?cx=\(aq + cx; var s = document.getElementsByTagName(\(aqscript\(aq)[0]; s.parentNode.insertBefore(gcse, s); })(); </script> <gcse:search></gcse:search> </div> .EE .UNINDENT .UNINDENT .IP 3. 3 Add \fBsearchbox.html\fP to the \fBhtml_sidebars\fP \%<#\:confval-html_sidebars> configuration value. .UNINDENT .UNINDENT .SS Sphinx vs. Docutils .sp tl;dr: \fIdocutils\fP converts reStructuredText to multiple output formats. Sphinx builds upon docutils to allow construction of cross\-referenced and indexed bodies of documentation. .sp docutils \%<https://\:docutils\:.sourceforge\:.io/> is a text processing system for converting plain text documentation into other, richer formats. As noted in the docutils documentation \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:dev/\:hacking\:.html>, docutils uses \fIreaders\fP to read a document, \fIparsers\fP for parsing plain text formats into an internal tree representation made up of different types of \fInodes\fP, and \fIwriters\fP to output this tree in various document formats. docutils provides parsers for one plain text format \- reStructuredText \%<https://\:docutils\:.sourceforge\:.io/\:rst\:.html> \- though other, \fIout\-of\-tree\fP parsers have been implemented including Sphinx\(aqs Markdown parser \%<>\&. On the other hand, it provides writers for many different formats including HTML, LaTeX, man pages, Open Document Format and XML. .sp docutils exposes all of its functionality through a variety of front\-end tools \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:user/\:tools\:.html>, such as \fBrst2html\fP, \fBrst2odt\fP and \fBrst2xml\fP\&. Crucially though, all of these tools, and docutils itself, are concerned with individual documents. They don\(aqt support concepts such as cross\-referencing, indexing of documents, or the construction of a document hierarchy (typically manifesting in a table of contents). .sp Sphinx builds upon docutils by harnessing docutils\(aq readers and parsers and providing its own Builders \%<>\&. As a result, Sphinx wraps some of the \fIwriters\fP provided by docutils. This allows Sphinx to provide many features that would simply not be possible with docutils, such as those outlined above. .SS Epub info .sp The following list gives some hints for the creation of epub files: .INDENT 0.0 .IP \(bu 2 Split the text into several files. The longer the individual HTML files are, the longer it takes the ebook reader to render them. In extreme cases, the rendering can take up to one minute. .IP \(bu 2 Try to minimize the markup. This also pays in rendering time. .IP \(bu 2 For some readers you can use embedded or external fonts using the CSS \fB@font\-face\fP directive. This is \fIextremely\fP useful for code listings which are often cut at the right margin. The default Courier font (or variant) is quite wide and you can only display up to 60 characters on a line. If you replace it with a narrower font, you can get more characters on a line. You may even use FontForge \%<https://\:fontforge\:.github\:.io/> and create narrow variants of some free font. In my case I get up to 70 characters on a line. .sp You may have to experiment a little until you get reasonable results. .IP \(bu 2 Test the created epubs. You can use several alternatives. The ones I am aware of are Epubcheck \%<https://\:github\:.com/\:IDPF/\:epubcheck>, Calibre \%<https://\:calibre-ebook\:.com/>, FBreader \%<https://\:fbreader\:.org/> (although it does not render the CSS), and Bookworm \%<https://\:www\:.oreilly\:.com/\:bookworm/\:index\:.html>\&. For Bookworm, you can download the source from \%<https://\:code\:.google\:.com/\:archive/\:p/\:threepress> and run your own local server. .IP \(bu 2 Large floating divs are not displayed properly. If they cover more than one page, the div is only shown on the first page. In that case you can copy the \fBepub.css\fP from the \fBsphinx/themes/epub/static/\fP directory to your local \fB_static/\fP directory and remove the float settings. .IP \(bu 2 Files that are inserted outside of the \fBtoctree\fP directive must be manually included. This sometimes applies to appendixes, e.g. the glossary or the indices. You can add them with the \fBepub_post_files\fP \%<#\:confval-epub_post_files> option. .IP \(bu 2 The handling of the epub cover page differs from the reStructuredText procedure which automatically resolves image paths and puts the images into the \fB_images\fP directory. For the epub cover page put the image in the \fBhtml_static_path\fP \%<#\:confval-html_static_path> directory and reference it with its full path in the \fBepub_cover\fP \%<#\:confval-epub_cover> config option. .IP \(bu 2 kindlegen \%<https://\:www\:.amazon\:.com/\:gp/\:feature\:.html?\:docId=1000765211> command can convert from epub3 resulting file to \fB\&.mobi\fP file for Kindle. You can get \fByourdoc.mobi\fP under \fB_build/epub\fP after the following command: .INDENT 2.0 .INDENT 3.5 .sp .EX $ make epub $ kindlegen _build/epub/yourdoc.epub .EE .UNINDENT .UNINDENT .sp The kindlegen command doesn\(aqt accept documents that have section titles surrounding \fBtoctree\fP directive: .INDENT 2.0 .INDENT 3.5 .sp .EX Section Title ============= \&.. toctree:: subdocument Section After Toc Tree ====================== .EE .UNINDENT .UNINDENT .sp kindlegen assumes all documents order in line, but the resulting document has complicated order for kindlegen: .INDENT 2.0 .INDENT 3.5 .sp .EX \(ga\(gaparent.xhtml\(ga\(ga \-> \(ga\(gachild.xhtml\(ga\(ga \-> \(ga\(gaparent.xhtml\(ga\(ga .EE .UNINDENT .UNINDENT .sp If you get the following error, fix your document structure: .INDENT 2.0 .INDENT 3.5 .sp .EX Error(prcgen):E24011: TOC section scope is not included in the parent chapter:(title) Error(prcgen):E24001: The table of content could not be built. .EE .UNINDENT .UNINDENT .UNINDENT .SS Texinfo info .sp There are two main programs for reading Info files, \fBinfo\fP and GNU Emacs. The \fBinfo\fP program has less features but is available in most Unix environments and can be quickly accessed from the terminal. Emacs provides better font and color display and supports extensive customization (of course). .SS Displaying Links .sp One noticeable problem you may encounter with the generated Info files is how references are displayed. If you read the source of an Info file, a reference to this section would look like: .INDENT 0.0 .INDENT 3.5 .sp .EX * note Displaying Links: target\-id .EE .UNINDENT .UNINDENT .sp In the stand\-alone reader, \fBinfo\fP, references are displayed just as they appear in the source. Emacs, on the other\-hand, will by default replace \fB*note:\fP with \fBsee\fP and hide the \fBtarget\-id\fP\&. For example: .INDENT 0.0 .INDENT 3.5 Displaying Links .UNINDENT .UNINDENT .sp One can disable generation of the inline references in a document with \fBtexinfo_cross_references\fP \%<#\:confval-texinfo_cross_references>\&. That makes an info file more readable with stand\-alone reader (\fBinfo\fP). .sp The exact behavior of how Emacs displays references is dependent on the variable \fBInfo\-hide\-note\-references\fP\&. If set to the value of \fBhide\fP, Emacs will hide both the \fB*note:\fP part and the \fBtarget\-id\fP\&. This is generally the best way to view Sphinx\-based documents since they often make frequent use of links and do not take this limitation into account. However, changing this variable affects how all Info documents are displayed and most do take this behavior into account. .sp If you want Emacs to display Info files produced by Sphinx using the value \fBhide\fP for \fBInfo\-hide\-note\-references\fP and the default value for all other Info files, try adding the following Emacs Lisp code to your start\-up file, \fB~/.emacs.d/init.el\fP\&. .INDENT 0.0 .INDENT 3.5 .sp .EX (defadvice info\-insert\-file\-contents (after sphinx\-info\-insert\-file\-contents activate) \(dqHack to make \(gaInfo\-hide\-note\-references\(aq buffer\-local and automatically set to \(gahide\(aq iff it can be determined that this file was created from a Texinfo file generated by Docutils or Sphinx.\(dq (set (make\-local\-variable \(aqInfo\-hide\-note\-references) (default\-value \(aqInfo\-hide\-note\-references)) (save\-excursion (save\-restriction (widen) (goto\-char (point\-min)) (when (re\-search\-forward \(dq^Generated by \e\e(Sphinx\e\e|Docutils\e\e)\(dq (save\-excursion (search\-forward \(dq\ex1f\(dq nil t)) t) (set (make\-local\-variable \(aqInfo\-hide\-note\-references) \(aqhide))))) .EE .UNINDENT .UNINDENT .SS Notes .sp The following notes may be helpful if you want to create Texinfo files: .INDENT 0.0 .IP \(bu 2 Each section corresponds to a different \fBnode\fP in the Info file. .IP \(bu 2 Colons (\fB:\fP) cannot be properly escaped in menu entries and xrefs. They will be replaced with semicolons (\fB;\fP). .IP \(bu 2 Links to external Info files can be created using the somewhat official URI scheme \fBinfo\fP\&. For example: .INDENT 2.0 .INDENT 3.5 .sp .EX info:Texinfo#makeinfo_options .EE .UNINDENT .UNINDENT .UNINDENT .SS Sphinx authors .SS Maintainers .sp \fIListed alphabetically in forename, surname order\fP .INDENT 0.0 .IP \(bu 2 Adam Turner <@AA\-Turner> .IP \(bu 2 Bénédikt Tran <@picnixz> .IP \(bu 2 Chris Sewell <@chrisjsewell> .IP \(bu 2 François Freitag <@francoisfreitag> .IP \(bu 2 Jakob Lykke Andersen <@jakobandersen> .IP \(bu 2 Jean\-François B. <@jfbu> .IP \(bu 2 Stephen Finucane <@stephenfin> .IP \(bu 2 Takayuki Shimizukawa <@shimizukawa> .IP \(bu 2 Takeshi Komiya <@tk0miya> .UNINDENT .SS Contributors .sp \fIListed alphabetically in forename, surname order\fP .INDENT 0.0 .IP \(bu 2 Aaron Carlisle \-\- basic theme and templating improvements .IP \(bu 2 Adam Dangoor \-\- improved static typing .IP \(bu 2 Adrián Chaves (Gallaecio) \-\- coverage builder improvements .IP \(bu 2 Alastair Houghton \-\- Apple Help builder .IP \(bu 2 Alex Gaynor \-\- linkcheck retry on errors .IP \(bu 2 Alexander Todorov \-\- inheritance_diagram tests and improvements .IP \(bu 2 Andi Albrecht \-\- agogo theme .IP \(bu 2 Antonio Valentino \-\- qthelp builder, docstring inheritance .IP \(bu 2 Antti Kaihola \-\- doctest extension (skipif option) .IP \(bu 2 Barry Warsaw \-\- setup command improvements .IP \(bu 2 Bart Kamphorst \-\- warning improvements .IP \(bu 2 Ben Egan \-\- Napoleon improvements & viewcode improvements .IP \(bu 2 Benjamin Peterson \-\- unittests .IP \(bu 2 Blaise Laflamme \-\- pyramid theme .IP \(bu 2 Brecht Machiels \-\- builder entry\-points .IP \(bu 2 Bruce Mitchener \-\- Minor epub improvement .IP \(bu 2 Buck Evan \-\- dummy builder .IP \(bu 2 Charles Duffy \-\- original graphviz extension .IP \(bu 2 Chris Barrick \-\- Napoleon type preprocessing logic .IP \(bu 2 Chris Holdgraf \-\- improved documentation structure .IP \(bu 2 Chris Lamb \-\- reproducibility fixes .IP \(bu 2 Christopher Perkins \-\- autosummary integration .IP \(bu 2 Dan MacKinlay \-\- metadata fixes .IP \(bu 2 Daniel Bültmann \-\- todo extension .IP \(bu 2 Daniel Eades \-\- improved static typing .IP \(bu 2 Daniel Hahler \-\- testing and CI improvements .IP \(bu 2 Daniel Pizetta \-\- inheritance diagram improvements .IP \(bu 2 Dave Hoese \-\- \fBsphinx.ext.viewcode\fP and \fBsphinx.ext.apidoc\fP bug fixes .IP \(bu 2 Dave Kuhlman \-\- original LaTeX writer .IP \(bu 2 Dimitri Papadopoulos Orfanos \-\- linting and spelling .IP \(bu 2 Dmitry Shachnev \-\- modernisation and reproducibility .IP \(bu 2 Doug Hellmann \-\- graphviz improvements .IP \(bu 2 Eric Larson \-\- better error messages .IP \(bu 2 Eric N. Vander Weele \-\- autodoc improvements .IP \(bu 2 Eric Wieser \-\- autodoc improvements .IP \(bu 2 Erik Bedard \-\- config options for \fBsphinx.ext.duration\fP \%<#\:module-sphinx\:.ext\:.duration> .IP \(bu 2 Etienne Desautels \-\- apidoc module .IP \(bu 2 Ezio Melotti \-\- collapsible sidebar JavaScript .IP \(bu 2 Filip Vavera \-\- napoleon todo directive .IP \(bu 2 Florian Best \-\- log improvements .IP \(bu 2 Glenn Matthews \-\- python domain signature improvements .IP \(bu 2 Gregory Szorc \-\- performance improvements .IP \(bu 2 Günter Milde \-\- various small fixes .IP \(bu 2 Henrique Bastos \-\- SVG support for graphviz extension .IP \(bu 2 Hernan Grecco \-\- search improvements .IP \(bu 2 Hong Xu \-\- svg support in imgmath extension and various bug fixes .IP \(bu 2 Horst Gutmann \-\- internationalization support .IP \(bu 2 Hugo van Kemenade \-\- support FORCE_COLOR and NO_COLOR .IP \(bu 2 Ian Hunt\-Isaak \-\- typealias reference improvement .IP \(bu 2 Ian Lee \-\- quickstart improvements .IP \(bu 2 Jacob Mason \-\- websupport library (GSOC project) .IP \(bu 2 James Addison \-\- linkcheck and HTML search improvements .IP \(bu 2 Jeppe Pihl \-\- literalinclude improvements .IP \(bu 2 Jeremy Maitin\-Shepard \-\- C++ domain improvements .IP \(bu 2 Joel Wurtz \-\- cellspanning support in LaTeX .IP \(bu 2 John Waltman \-\- Texinfo builder .IP \(bu 2 Jon Dufresne \-\- modernisation .IP \(bu 2 Josip Dzolonga \-\- coverage builder .IP \(bu 2 Juan Luis Cano Rodríguez \-\- new tutorial (2021) .IP \(bu 2 Julien Palard \-\- Colspan and rowspan in text builder .IP \(bu 2 Justus Magin \-\- napoleon improvements .IP \(bu 2 Kazuya Take \-\- \fBsphinx.testing.path\fP bug fix .IP \(bu 2 Kevin Dunn \-\- MathJax extension .IP \(bu 2 KINEBUCHI Tomohiko \-\- typing Sphinx as well as docutils .IP \(bu 2 Kurt McKee \-\- documentation updates .IP \(bu 2 Lars Hupfeldt Nielsen \- OpenSSL FIPS mode md5 bug fix .IP \(bu 2 Louis Maddox \-\- better docstrings .IP \(bu 2 Łukasz Langa \-\- partial support for autodoc .IP \(bu 2 Marco Buttu \-\- doctest extension (pyversion option) .IP \(bu 2 Mark Ostroth \-\- semantic HTML contributions .IP \(bu 2 Martin Hans \-\- autodoc improvements .IP \(bu 2 Martin Larralde \-\- additional napoleon admonitions .IP \(bu 2 Martin Liška \-\- option directive and role improvements .IP \(bu 2 Martin Mahner \-\- nature theme .IP \(bu 2 Martin Matouš \-\- initial support for PEP 695 .IP \(bu 2 Matthew Fernandez \-\- todo extension fix .IP \(bu 2 Matthew Woodcraft \-\- text output improvements .IP \(bu 2 Matthias Geier \-\- style improvements .IP \(bu 2 Michael Droettboom \-\- inheritance_diagram extension .IP \(bu 2 Michael Wilson \-\- Intersphinx HTTP basic auth support .IP \(bu 2 Nathan Damon \-\- bugfix in validation of static paths in html builders .IP \(bu 2 Nils Kattenbeck \-\- pygments dark style .IP \(bu 2 Pauli Virtanen \-\- autodoc improvements, autosummary extension .IP \(bu 2 Rafael Fontenelle \-\- internationalisation .IP \(bu 2 A. Rafey Khan \-\- improved intersphinx typing .IP \(bu 2 Rui Pinheiro \-\- Python 3.14 forward references support .IP \(bu 2 Roland Meister \-\- epub builder .IP \(bu 2 Sebastian Wiesner \-\- image handling, distutils support .IP \(bu 2 Slawek Figiel \-\- additional warning suppression .IP \(bu 2 Stefan Seefeld \-\- toctree improvements .IP \(bu 2 Stefan van der Walt \-\- autosummary extension .IP \(bu 2 Steve Piercy \-\- documentation improvements .IP \(bu 2 Szymon Karpinski \-\- intersphinx improvements .IP \(bu 2 T. Powers \-\- HTML output improvements .IP \(bu 2 Taku Shimizu \-\- epub3 builder .IP \(bu 2 Tamika Nomara \-\- bug fixes .IP \(bu 2 Thomas Lamb \-\- linkcheck builder .IP \(bu 2 Thomas Waldmann \-\- apidoc module fixes .IP \(bu 2 Till Hoffmann \-\- doctest option to exit after first failed test .IP \(bu 2 Tim Hoffmann \-\- theme improvements .IP \(bu 2 Valentin Heinisch \-\- warning types improvement .IP \(bu 2 Victor Wheeler \-\- documentation improvements .IP \(bu 2 Vince Salvino \-\- JavaScript search improvements .IP \(bu 2 Will Maier \-\- directory HTML builder .IP \(bu 2 Zac Hatfield\-Dodds \-\- doctest reporting improvements, intersphinx performance .UNINDENT .SS Former maintainers .sp \fIListed alphabetically in forename, surname order\fP .sp Former maintainers are those who haven\(aqt committed in the last two years. Those on the list below may become active maintainers again at any time. .INDENT 0.0 .IP \(bu 2 Armin Ronacher <@mitsuhiko> .IP \(bu 2 Daniel Neuhäuser <@DasIch> .IP \(bu 2 Georg Brandl <\%<georg@\:python\:.org>> .IP \(bu 2 Rob Ruana <@RobRuana> .IP \(bu 2 Robert Lehmann <@lehmannro> .IP \(bu 2 Timotheus Kampik <@TimKam> .IP \(bu 2 Yoshiki Shibukawa <@shibukawa> .UNINDENT .sp Many thanks for all contributions! .SH REFERENCE GUIDE .sp Reference documentation is more complete and programmatic in nature, it is a collection of information that can be quickly referenced. If you would like usecase\-driven documentation, see Get started or User guide\&. .SS Command\-line tools .sp These are the applications provided as part of Sphinx. .SS Core applications .SS sphinx\-quickstart .SS Synopsis .sp \fBsphinx\-quickstart\fP .SS Description .sp \fBsphinx\-quickstart\fP is an interactive tool that asks some questions about your project and then generates a complete documentation directory and sample Makefile to be used with \fBsphinx\-build(1)\fP\&. .SS Options .INDENT 0.0 .TP .B \-q, \-\-quiet Quiet mode that skips the interactive wizard for specifying options. This option requires \fI\-p\fP, \fI\-a\fP and \fI\-v\fP options. .UNINDENT .INDENT 0.0 .TP .B \-h, \-\-help, \-\-version Display usage summary or Sphinx version. .UNINDENT .sp Structure Options .INDENT 0.0 .TP .B \-\-sep If specified, separate source and build directories. .UNINDENT .INDENT 0.0 .TP .B \-\-no\-sep If specified, create build directory under source directory. .UNINDENT .INDENT 0.0 .TP .B \-\-dot=DOT Inside the root directory, two more directories will be created; \(dq_templates\(dq for custom HTML templates and \(dq_static\(dq for custom stylesheets and other static files. You can enter another prefix (such as \(dq.\(dq) to replace the underscore. .UNINDENT .sp Project Basic Options .INDENT 0.0 .TP .B \-p PROJECT, \-\-project=PROJECT Project name will be set. (see \fBproject\fP \%<#\:confval-project>). .UNINDENT .INDENT 0.0 .TP .B \-a AUTHOR, \-\-author=AUTHOR Author names. (see \fBcopyright\fP \%<#\:confval-copyright>). .UNINDENT .INDENT 0.0 .TP .B \-v VERSION Version of project. (see \fBversion\fP \%<#\:confval-version>). .UNINDENT .INDENT 0.0 .TP .B \-r RELEASE, \-\-release=RELEASE Release of project. (see \fBrelease\fP \%<#\:confval-release>). .UNINDENT .INDENT 0.0 .TP .B \-l LANGUAGE, \-\-language=LANGUAGE Document language. (see \fBlanguage\fP \%<#\:confval-language>). .UNINDENT .INDENT 0.0 .TP .B \-\-suffix=SUFFIX Source file suffix. (see \fBsource_suffix\fP \%<#\:confval-source_suffix>). .UNINDENT .INDENT 0.0 .TP .B \-\-master=MASTER Master document name. (see \fBroot_doc\fP \%<#\:confval-root_doc>). .UNINDENT .sp Extension Options .INDENT 0.0 .TP .B \-\-ext\-autodoc Enable \fBsphinx.ext.autodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> extension. .UNINDENT .INDENT 0.0 .TP .B \-\-ext\-doctest Enable \fIsphinx.ext.doctest\fP extension. .UNINDENT .INDENT 0.0 .TP .B \-\-ext\-intersphinx Enable \fIsphinx.ext.intersphinx\fP extension. .UNINDENT .INDENT 0.0 .TP .B \-\-ext\-todo Enable \fIsphinx.ext.todo\fP extension. .UNINDENT .INDENT 0.0 .TP .B \-\-ext\-coverage Enable \fIsphinx.ext.coverage\fP extension. .UNINDENT .INDENT 0.0 .TP .B \-\-ext\-imgmath Enable \fIsphinx.ext.imgmath\fP extension. .UNINDENT .INDENT 0.0 .TP .B \-\-ext\-mathjax Enable \fIsphinx.ext.mathjax\fP extension. .UNINDENT .INDENT 0.0 .TP .B \-\-ext\-ifconfig Enable \fIsphinx.ext.ifconfig\fP extension. .UNINDENT .INDENT 0.0 .TP .B \-\-ext\-viewcode Enable \fIsphinx.ext.viewcode\fP extension. .UNINDENT .INDENT 0.0 .TP .B \-\-ext\-githubpages Enable \fIsphinx.ext.githubpages\fP extension. .UNINDENT .INDENT 0.0 .TP .B \-\-extensions=EXTENSIONS Enable arbitrary extensions. .UNINDENT .sp Makefile and Batchfile Creation Options .INDENT 0.0 .TP .B \-\-use\-make\-mode (\-m), \-\-no\-use\-make\-mode (\-M) \fBMakefile/make.bat\fP uses (or doesn\(aqt use) make\-mode \%<#\:make-mode>\&. Default is \fBuse\fP, which generates a more concise \fBMakefile/make.bat\fP\&. .sp Changed in version 1.5: make\-mode is default. .sp Changed in version 7.3: Support for disabling the make\-mode will be removed in Sphinx 8. .sp Removed in version 8.0: The \fB\-\-no\-use\-make\-mode\fP option. The \fB\-\-use\-make\-mode\fP now has no effect. .UNINDENT .INDENT 0.0 .TP .B \-\-makefile, \-\-no\-makefile Create (or not create) makefile. .UNINDENT .INDENT 0.0 .TP .B \-\-batchfile, \-\-no\-batchfile Create (or not create) batchfile .UNINDENT .sp Project templating .sp Added in version 1.5: Project templating options for sphinx\-quickstart .INDENT 0.0 .TP .B \-t, \-\-templatedir=TEMPLATEDIR Template directory for template files. You can modify the templates of sphinx project files generated by quickstart. Following Jinja2 template files are allowed: .INDENT 7.0 .IP \(bu 2 \fBroot_doc.rst.jinja\fP .IP \(bu 2 \fBconf.py.jinja\fP .IP \(bu 2 \fBMakefile.jinja\fP .IP \(bu 2 \fBMakefile.new.jinja\fP .IP \(bu 2 \fBmake.bat.jinja\fP .IP \(bu 2 \fBmake.bat.new.jinja\fP .UNINDENT .sp In detail, please refer the system template files Sphinx provides. (\fBsphinx/templates/quickstart\fP) .UNINDENT .INDENT 0.0 .TP .B \-d NAME=VALUE Define a template variable .UNINDENT .SS See also .sp \fBsphinx\-build(1)\fP .SS sphinx\-build .SS Synopsis .sp \fBsphinx\-build\fP [\fIoptions\fP] <\fIsourcedir\fP> <\fIoutputdir\fP> [\fIfilenames\fP ...] .SS Description .sp \fBsphinx\-build\fP generates documentation from the files in \fB<sourcedir>\fP and places it in the \fB<outputdir>\fP\&. .sp \fBsphinx\-build\fP looks for \fB<sourcedir>/conf.py\fP for the configuration settings. \fBsphinx\-quickstart(1)\fP may be used to generate template files, including \fBconf.py\fP\&. .sp \fBsphinx\-build\fP can create documentation in different formats. A format is selected by specifying the builder name on the command line; it defaults to HTML. Builders can also perform other tasks related to documentation processing. For a list of available builders, refer to Builders \%<>\&. .sp By default, everything that is outdated is built. Output only for selected files can be built by specifying individual filenames. .SS Options .INDENT 0.0 .TP .B \-M buildername Select a builder, using the \fImake\-mode\fP\&. See Builders \%<> for a list of all of Sphinx\(aqs built\-in builders. Extensions can add their own builders. .sp \fBImportant:\fP .INDENT 7.0 .INDENT 3.5 Sphinx only recognizes the \fB\-M\fP option if it is used first, along with the source and output directories, before any other options are passed. For example: .INDENT 0.0 .INDENT 3.5 .sp .EX sphinx\-build \-M html ./source ./build \-\-fail\-on\-warning .EE .UNINDENT .UNINDENT .UNINDENT .UNINDENT .sp The \fImake\-mode\fP provides the same build functionality as a default Makefile or Make.bat, and provides the following additional build pipelines: .INDENT 7.0 .TP .B \fIlatexpdf\fP Build LaTeX files and run them through \fBpdflatex\fP, or as per \fBlatex_engine\fP \%<#\:confval-latex_engine> setting. If \fBlanguage\fP \%<#\:confval-language> is set to \fB\(aqja\(aq\fP, will use automatically the \fBplatex/dvipdfmx\fP latex to PDF pipeline. .TP .B \fIinfo\fP Build Texinfo files and run them through \fBmakeinfo\fP\&. .TP .B \fIhelp\fP Output a list of valid builder targets, and exit. .UNINDENT .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 The default output directory locations when using \fImake\-mode\fP differ from the defaults when using \fB\-b\fP\&. .INDENT 0.0 .IP \(bu 2 doctrees are saved to \fB<outputdir>/doctrees\fP .IP \(bu 2 output files are saved to \fB<outputdir>/<builder name>\fP .UNINDENT .UNINDENT .UNINDENT .sp Added in version 1.2.1. .UNINDENT .INDENT 0.0 .TP .B \-b buildername, \-\-builder buildername Selects a builder. .sp See Builders \%<> for a list of all of Sphinx\(aqs built\-in builders. Extensions can add their own builders. .sp Changed in version 7.3: Add \fB\-\-builder\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-a, \-\-write\-all If given, always write all output files. The default is to only write output files for new and changed source files. (This may not apply to all builders.) .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 This option does not re\-read source files. To read and re\-process every file, use \fB\-\-fresh\-env\fP instead. .UNINDENT .UNINDENT .sp Changed in version 7.3: Add \fB\-\-write\-all\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-E, \-\-fresh\-env Don\(aqt use a saved environment \%<#\:term-environment> (the structure caching all cross\-references), but rebuild it completely. The default is to only read and parse source files that are new or have changed since the last run. .sp Changed in version 7.3: Add \fB\-\-fresh\-env\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-t tag, \-\-tag tag Define the tag \fItag\fP\&. This is relevant for \fBonly\fP \%<#\:directive-only> directives that include their content only if certain tags are set. See including content based on tags \%<#\:tags> for further detail. .sp Added in version 0.6. .sp Changed in version 7.3: Add \fB\-\-tag\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-d path, \-\-doctree\-dir path Since Sphinx has to read and parse all source files before it can write an output file, the parsed source files are cached as \(dqdoctree pickles\(dq. Normally, these files are put in a directory called \fB\&.doctrees\fP under the build directory; with this option you can select a different cache directory (the doctrees can be shared between all builders). .sp Changed in version 7.3: Add \fB\-\-doctree\-dir\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-j N, \-\-jobs N Distribute the build over \fIN\fP processes in parallel, to make building on multiprocessor machines more effective. This feature only works on systems supporting \(dqfork\(dq. Windows is not supported. Note that not all parts and not all builders of Sphinx can be parallelized. If \fBauto\fP argument is given, Sphinx uses the number of CPUs as \fIN\fP\&. Defaults to 1. .sp Added in version 1.2: This option should be considered \fIexperimental\fP\&. .sp Changed in version 1.7: Support \fBauto\fP argument. .sp Changed in version 6.2: Add \fB\-\-jobs\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-c path, \-\-conf\-dir path Don\(aqt look for the \fBconf.py\fP in the source directory, but use the given configuration directory instead. Note that various other files and paths given by configuration values are expected to be relative to the configuration directory, so they will have to be present at this location too. .sp Added in version 0.3. .sp Changed in version 7.3: Add \fB\-\-conf\-dir\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-C, \-\-isolated Don\(aqt look for a configuration file; only take options via the \fB\-\-define\fP option. .sp Added in version 0.5. .sp Changed in version 7.3: Add \fB\-\-isolated\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-D setting=value, \-\-define setting=value Override a configuration value set in the \fBconf.py\fP file. The value must be a number, string, list or dictionary value. .sp For lists, you can separate elements with a comma like this: \fB\-D html_theme_path=path1,path2\fP\&. .sp For dictionary values, supply the setting name and key like this: \fB\-D latex_elements.docclass=scrartcl\fP\&. .sp For boolean values, use \fB0\fP or \fB1\fP as the value. .sp Changed in version 0.6: The value can now be a dictionary value. .sp Changed in version 1.3: The value can now also be a list value. .sp Changed in version 7.3: Add \fB\-\-define\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-A name=value, \-\-html\-define name=value Make the \fIname\fP assigned to \fIvalue\fP in the HTML templates. .sp Added in version 0.5. .sp Changed in version 7.3: Add \fB\-\-html\-define\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-n, \-\-nitpicky Run in nitpicky mode. Currently, this generates warnings for all missing references. See the config value \fBnitpick_ignore\fP \%<#\:confval-nitpick_ignore> for a way to exclude some references as \(dqknown missing\(dq. .sp Changed in version 7.3: Add \fB\-\-nitpicky\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-N, \-\-no\-color Do not emit colored output. .sp Changed in version 1.6: Add \fB\-\-no\-color\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-\-color Emit colored output. Auto\-detected by default. .sp Added in version 1.6. .UNINDENT .INDENT 0.0 .TP .B \-v, \-\-verbose Increase verbosity (log\-level). This option can be given up to three times to get more debug logging output. It implies \fB\-T\fP\&. .sp Added in version 1.2. .sp Changed in version 7.3: Add \fB\-\-verbose\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-q, \-\-quiet Do not output anything on standard output, only write warnings and errors to standard error. .sp Changed in version 7.3: Add \fB\-\-quiet\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-Q, \-\-silent Do not output anything on standard output, also suppress warnings. Only errors are written to standard error. .sp Changed in version 7.3: Add \fB\-\-silent\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-w file, \-\-warning\-file file Write warnings (and errors) to the given file, in addition to standard error. .sp Changed in version 7.3: ANSI control sequences are stripped when writing to \fIfile\fP\&. .sp Changed in version 7.3: Add \fB\-\-warning\-file\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-W, \-\-fail\-on\-warning Turn warnings into errors. This means that \fBsphinx\-build\fP exits with exit status 1 if any warnings are generated during the build. .sp Changed in version 7.3: Add \fB\-\-fail\-on\-warning\fP long option. .sp Changed in version 8.1: \fBsphinx\-build\fP no longer exits on the first warning, but instead runs the entire build and exits with exit status 1 if any warnings were generated. This behaviour was previously enabled with \fB\-\-keep\-going\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-\-keep\-going From Sphinx 8.1, \fB\-\-keep\-going\fP is always enabled. Previously, it was only applicable whilst using \fB\-\-fail\-on\-warning\fP, which by default exited \fBsphinx\-build\fP on the first warning. Using \fB\-\-keep\-going\fP runs \fBsphinx\-build\fP to completion and exits with exit status 1 if errors are encountered. .sp Added in version 1.8. .sp Changed in version 8.1: \fBsphinx\-build\fP no longer exits on the first warning, meaning that in effect \fB\-\-keep\-going\fP is always enabled. The option is retained for compatibility, but may be removed at some later date. .UNINDENT .INDENT 0.0 .TP .B \-T, \-\-show\-traceback Display the full traceback when an unhandled exception occurs. Otherwise, only a summary is displayed and the traceback information is saved to a file for further analysis. .sp Added in version 1.2. .sp Changed in version 7.3: Add \fB\-\-show\-traceback\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-P, \-\-pdb (Useful for debugging only.) Run the Python debugger, \fBpdb\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:pdb\:.html#\:module-pdb>, if an unhandled exception occurs while building. .sp Changed in version 7.3: Add \fB\-\-pdb\fP long option. .UNINDENT .INDENT 0.0 .TP .B \-\-exception\-on\-warning Raise an exception when a warning is emitted during the build. This can be useful in combination with \fB\-\-pdb\fP to debug warnings. .sp Added in version 8.1. .UNINDENT .INDENT 0.0 .TP .B \-h, \-\-help, \-\-version Display usage summary or Sphinx version. .sp Added in version 1.2. .UNINDENT .sp You can also give one or more filenames on the command line after the source and build directories. Sphinx will then try to build only these output files (and their dependencies). .SS Environment Variables .sp The \fBsphinx\-build\fP refers following environment variables: .INDENT 0.0 .TP .B MAKE A path to make command. A command name is also allowed. \fBsphinx\-build\fP uses it to invoke sub\-build process on make\-mode. .UNINDENT .sp Makefile Options .sp The \fBMakefile\fP and \fBmake.bat\fP files created by \fBsphinx\-quickstart\fP usually run \fBsphinx\-build\fP only with the \fB\-b\fP and \fB\-d\fP options. However, they support the following variables to customize behavior: .INDENT 0.0 .TP .B PAPER This sets the \fB\(aqpapersize\(aq\fP key of \fBlatex_elements\fP \%<#\:confval-latex_elements>: i.e. \fBPAPER=a4\fP sets it to \fB\(aqa4paper\(aq\fP and \fBPAPER=letter\fP to \fB\(aqletterpaper\(aq\fP\&. .sp \fBNote:\fP .INDENT 7.0 .INDENT 3.5 Usage of this environment variable got broken at Sphinx 1.5 as \fBa4\fP or \fBletter\fP ended up as option to LaTeX document in place of the needed \fBa4paper\fP, resp. \fBletterpaper\fP\&. Fixed at 1.7.7. .UNINDENT .UNINDENT .UNINDENT .INDENT 0.0 .TP .B SPHINXBUILD The command to use instead of \fBsphinx\-build\fP\&. .UNINDENT .INDENT 0.0 .TP .B BUILDDIR The build directory to use instead of the one chosen in \fBsphinx\-quickstart\fP\&. .UNINDENT .INDENT 0.0 .TP .B SPHINXOPTS Additional options for \fBsphinx\-build\fP\&. These options can also be set via the shortcut variable \fBO\fP (capital \(aqo\(aq). .UNINDENT .INDENT 0.0 .TP .B NO_COLOR When set (regardless of value), \fBsphinx\-build\fP will not use color in terminal output. \fBNO_COLOR\fP takes precedence over \fBFORCE_COLOR\fP\&. See no\-color.org \%<https://\:no-color\:.org/> for other libraries supporting this community standard. .sp Added in version 4.5.0. .UNINDENT .INDENT 0.0 .TP .B FORCE_COLOR When set (regardless of value), \fBsphinx\-build\fP will use color in terminal output. \fBNO_COLOR\fP takes precedence over \fBFORCE_COLOR\fP\&. .sp Added in version 4.5.0. .UNINDENT .SS Deprecation Warnings .sp If any deprecation warning like \fBRemovedInSphinxXXXWarning\fP are displayed when building a user\(aqs document, some Sphinx extension is using deprecated features. In that case, please report it to author of the extension. .sp To disable the deprecation warnings, please set \fBPYTHONWARNINGS=\fP environment variable to your environment. For example: .INDENT 0.0 .IP \(bu 2 \fBPYTHONWARNINGS= make html\fP (Linux/Mac) .IP \(bu 2 \fBexport PYTHONWARNINGS=\fP and do \fBmake html\fP (Linux/Mac) .IP \(bu 2 \fBset PYTHONWARNINGS=\fP and do \fBmake html\fP (Windows) .IP \(bu 2 modify your Makefile/make.bat and set the environment variable .UNINDENT .SS See also .sp \fBsphinx\-quickstart(1)\fP .SS Additional applications .SS sphinx\-apidoc .SS Synopsis .sp \fBsphinx\-apidoc\fP [\fIOPTIONS\fP] \-o <\fIOUTPUT_PATH\fP> <\fIMODULE_PATH\fP> [\fIEXCLUDE_PATTERN\fP ...] .SS Description .sp \fBsphinx\-apidoc\fP is a tool for automatic generation of Sphinx sources that, using the \fBautodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> extension, document a whole package in the style of other automatic API documentation tools. .sp \fIMODULE_PATH\fP is the path to a Python package to document, and \fIOUTPUT_PATH\fP is the directory where the generated sources are placed. Any \fIEXCLUDE_PATTERN\fPs given are fnmatch\-style \%<https://\:docs\:.python\:.org/\:3/\:library/\:fnmatch\:.html> file and/or directory patterns that will be excluded from generation. .sp \fBWarning:\fP .INDENT 0.0 .INDENT 3.5 \fBsphinx\-apidoc\fP generates source files that use \fBsphinx.ext.autodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> to document all found modules. If any modules have side effects on import, these will be executed by \fBautodoc\fP when \fBsphinx\-build\fP is run. .sp If you document scripts (as opposed to library modules), make sure their main routine is protected by a \fBif __name__ == \(aq__main__\(aq\fP condition. .UNINDENT .UNINDENT .SS Options .INDENT 0.0 .TP .B \-o <OUTPUT_PATH> Directory to place the output files. If it does not exist, it is created. .UNINDENT .INDENT 0.0 .TP .B \-q Do not output anything on standard output, only write warnings and errors to standard error. .UNINDENT .INDENT 0.0 .TP .B \-f, \-\-force Force overwriting of any existing generated files. .UNINDENT .INDENT 0.0 .TP .B \-l, \-\-follow\-links Follow symbolic links. Defaults to \fBFalse\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-n, \-\-dry\-run Do not create or remove any files. .UNINDENT .INDENT 0.0 .TP .B \-s <suffix> Suffix for the source files generated. Defaults to \fBrst\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-d <MAXDEPTH> Maximum depth for the generated table of contents file. Defaults to \fB4\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-\-tocfile Filename for a table of contents file. Defaults to \fBmodules\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-T, \-\-no\-toc Do not create a table of contents file. Ignored when \fB\-\-full\fP is provided. .UNINDENT .INDENT 0.0 .TP .B \-\-remove\-old Remove existing files in the output directory that are not created anymore. Not compatible with \fB\-\-full\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-F, \-\-full Generate a full Sphinx project (\fBconf.py\fP, \fBMakefile\fP etc.) using the same mechanism as \fBsphinx\-quickstart\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-e, \-\-separate Put documentation for each module on its own page. .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B \-E, \-\-no\-headings Do not create headings for the modules/packages. This is useful, for example, when docstrings already contain headings. .UNINDENT .INDENT 0.0 .TP .B \-P, \-\-private Include \(dq_private\(dq modules. .sp Added in version 1.2. .UNINDENT .INDENT 0.0 .TP .B \-\-implicit\-namespaces Without this option, \fBsphinx\-apidoc\fP searches \fBsys.path\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:sys\:.html#\:sys\:.path> for Python packages containing \fB__init__.py\fP files, or single\-file Python modules. .sp This option instead uses \fBPEP 420\fP \%<https://\:peps\:.python\:.org/\:pep-0420/> implicit namespaces that allow layouts paths such as \fBfoo/bar/module.py\fP or \fBfoo/bar/baz/__init__.py\fP (note that \fBbar\fP and \fBfoo\fP are namespaces, not modules). .UNINDENT .INDENT 0.0 .TP .B \-M, \-\-module\-first Put module documentation before submodule documentation. .UNINDENT .sp These options are used when \fB\-\-full\fP is specified: .INDENT 0.0 .TP .B \-a Append module_path to sys.path. .UNINDENT .INDENT 0.0 .TP .B \-H <project> Sets the project name to put in generated files (see \fBproject\fP \%<#\:confval-project>). .UNINDENT .INDENT 0.0 .TP .B \-A <author> Sets the author name(s) to put in generated files (see \fBcopyright\fP \%<#\:confval-copyright>). .UNINDENT .INDENT 0.0 .TP .B \-V <version> Sets the project version to put in generated files (see \fBversion\fP \%<#\:confval-version>). .UNINDENT .INDENT 0.0 .TP .B \-R <release> Sets the project release to put in generated files (see \fBrelease\fP \%<#\:confval-release>). .UNINDENT .sp Project templating .sp Added in version 2.2: Project templating options for sphinx\-apidoc .INDENT 0.0 .TP .B \-t, \-\-templatedir=TEMPLATEDIR Template directory for template files. You can modify the templates of sphinx project files generated by apidoc. Following Jinja2 template files are allowed: .INDENT 7.0 .IP \(bu 2 \fBmodule.rst.jinja\fP .IP \(bu 2 \fBpackage.rst.jinja\fP .IP \(bu 2 \fBtoc.rst.jinja\fP .IP \(bu 2 \fBroot_doc.rst.jinja\fP .IP \(bu 2 \fBconf.py.jinja\fP .IP \(bu 2 \fBMakefile.jinja\fP .IP \(bu 2 \fBMakefile.new.jinja\fP .IP \(bu 2 \fBmake.bat.jinja\fP .IP \(bu 2 \fBmake.bat.new.jinja\fP .UNINDENT .sp In detail, please refer the system template files Sphinx provides. (\fBsphinx/templates/apidoc\fP and \fBsphinx/templates/quickstart\fP) .UNINDENT .SS Environment .INDENT 0.0 .TP .B SPHINX_APIDOC_OPTIONS A comma\-separated list of option to append to generated \fBautomodule\fP directives. Defaults to \fBmembers,undoc\-members,show\-inheritance\fP\&. .UNINDENT .SS See also .sp \fBsphinx\-build(1)\fP, \fBsphinx\-autogen(1)\fP .SS sphinx\-autogen .SS Synopsis .sp \fBsphinx\-autogen\fP [\fIoptions\fP] <sourcefile> ... .SS Description .sp \fBsphinx\-autogen\fP is a tool for automatic generation of Sphinx sources that, using the \fBautodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> extension, document items included in \fBautosummary\fP \%<#\:directive-autosummary> listing(s). .sp \fIsourcefile\fP is the path to one or more reStructuredText documents containing \fBautosummary\fP \%<#\:directive-autosummary> entries with the \fB:toctree:\fP option set. \fIsourcefile\fP can be an \fBfnmatch\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:fnmatch\:.html#\:module-fnmatch>\-style pattern. .SS Options .INDENT 0.0 .TP .B \-o <outputdir> Directory to place the output file. If it does not exist, it is created. Defaults to the value passed to the \fB:toctree:\fP option. .UNINDENT .INDENT 0.0 .TP .B \-s <suffix>, \-\-suffix <suffix> Default suffix to use for generated files. Defaults to \fBrst\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-t <templates>, \-\-templates <templates> Custom template directory. Defaults to \fBNone\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-i, \-\-imported\-members Document imported members. .UNINDENT .INDENT 0.0 .TP .B \-a, \-\-respect\-module\-all Document exactly the members in a module\(aqs \fB__all__\fP attribute. .UNINDENT .INDENT 0.0 .TP .B \-\-remove\-old Remove existing files in the output directory that are not generated anymore. .UNINDENT .SS Example .sp Given the following directory structure: .INDENT 0.0 .INDENT 3.5 .sp .EX docs ├── index.rst └── ... foobar ├── foo │ └── __init__.py └── bar ├── __init__.py └── baz └── __init__.py .EE .UNINDENT .UNINDENT .sp and assuming \fBdocs/index.rst\fP contained the following: .INDENT 0.0 .INDENT 3.5 .sp .EX Modules ======= \&.. autosummary:: :toctree: modules foobar.foo foobar.bar foobar.bar.baz .EE .UNINDENT .UNINDENT .sp If you run the following: .INDENT 0.0 .INDENT 3.5 .sp .EX $ PYTHONPATH=. sphinx\-autogen docs/index.rst .EE .UNINDENT .UNINDENT .sp then the following stub files will be created in \fBdocs\fP: .INDENT 0.0 .INDENT 3.5 .sp .EX docs ├── index.rst └── modules ├── foobar.bar.rst ├── foobar.bar.baz.rst └── foobar.foo.rst .EE .UNINDENT .UNINDENT .sp and each of those files will contain a \fBautodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> directive and some other information. .SS See also .sp \fBsphinx\-build(1)\fP, \fBsphinx\-apidoc(1)\fP .SS Glossary .INDENT 0.0 .TP .B builder A class (inheriting from \fBBuilder\fP \%<#\:sphinx\:.builders\:.Builder>) that takes parsed documents and performs an action on them. Normally, builders translate the documents to an output format, but it is also possible to use builders that e.g. check for broken links in the documentation, or build coverage information. .sp See Builders \%<> for an overview over Sphinx\(aqs built\-in builders. .TP .B configuration directory The directory containing \fBconf.py\fP\&. By default, this is the same as the source directory, but can be set differently with the \fB\-c\fP command\-line option. .TP .B directive A reStructuredText markup element that allows marking a block of content with special meaning. Directives are supplied not only by docutils, but Sphinx and custom extensions can add their own. The basic directive syntax looks like this: .INDENT 7.0 .INDENT 3.5 .sp .EX \&.. directive\-name:: argument ... :option: value Content of the directive. .EE .UNINDENT .UNINDENT .sp See Directives \%<#\:rst-directives> for more information. .TP .B document name Since reStructuredText source files can have different extensions (some people like \fB\&.txt\fP, some like \fB\&.rst\fP \-\- the extension can be configured with \fBsource_suffix\fP \%<#\:confval-source_suffix>) and different OSes have different path separators, Sphinx abstracts them: \fIdocument names\fP are always relative to the source directory, the extension is stripped, and path separators are converted to slashes. All values, parameters and such referring to \(dqdocuments\(dq expect such document names. .sp Examples for document names are \fBindex\fP, \fBlibrary/zipfile\fP, or \fBreference/datamodel/types\fP\&. Note that there is no leading or trailing slash. .TP .B domain A domain is a collection of markup (reStructuredText directives and roles) to describe and link to objects belonging together, e.g. elements of a programming language. Directive and role names in a domain have names like \fBdomain:name\fP, e.g. \fBpy:function\fP\&. .sp Having domains means that there are no naming problems when one set of documentation wants to refer to e.g. C++ and Python classes. It also means that extensions that support the documentation of whole new languages are much easier to write. .sp For more information, refer to Domains \%<>\&. .TP .B environment A structure where information about all documents under the root is saved, and used for cross\-referencing. The environment is pickled after the parsing stage, so that successive runs only need to read and parse new and changed documents. .TP .B extension A custom role, directive or other aspect of Sphinx that allows users to modify any aspect of the build process within Sphinx. .sp For more information, refer to Extensions \%<>\&. .TP .B master document .TQ .B root document The document that contains the root \fBtoctree\fP \%<#\:directive-toctree> directive. .TP .B object The basic building block of Sphinx documentation. Every \(dqobject directive\(dq (e.g. \fBpy:function\fP \%<#\:directive-py-function> or \fBobject\fP \%<#\:directive-object>) creates such a block; and most objects can be cross\-referenced to. .TP .B RemoveInSphinxXXXWarning The feature which is warned will be removed in Sphinx\-XXX version. It usually caused from Sphinx extensions which is using deprecated. See also Deprecation Warnings \%<#\:when-deprecation-warnings-are-displayed>\&. .TP .B role A reStructuredText markup element that allows marking a piece of text. Like directives, roles are extensible. The basic syntax looks like this: \fB:rolename:\(gacontent\(ga\fP\&. See Inline markup \%<#\:rst-inline-markup> for details. .TP .B source directory The directory which, including its subdirectories, contains all source files for one Sphinx project. .TP .B reStructuredText An easy\-to\-read, what\-you\-see\-is\-what\-you\-get plaintext markup syntax and parser system. .UNINDENT .SS Changelog .SS Release 9.1.0 (released Dec 31, 2025) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #14153: Drop Python 3.11 support. .IP \(bu 2 #12555: Drop Docutils 0.20 support. Patch by Adam Turner .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 Add \fBadd_static_dir()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_static_dir> for copying static assets from extensions to the build output. Patch by Jared Dillard .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #14189: autodoc: Fix duplicate \fB:no\-index\-entry:\fP for modules. Patch by Adam Turner .IP \(bu 2 #13713: Fix compatibility with MyST\-Parser. Patch by Adam Turner .IP \(bu 2 Fix tests for Python 3.15. Patch by Adam Turner .IP \(bu 2 #14089: autodoc: Fix default option parsing. Patch by Adam Turner .IP \(bu 2 Remove incorrect static typing assertions. Patch by Adam Turner .IP \(bu 2 #14050: LaTeXTranslator fails to build documents using the \(dqacronym\(dq standard role. Patch by Günter Milde .IP \(bu 2 LaTeX: Fix rendering for grid filled merged vertical cell. Patch by Tim Nordell .IP \(bu 2 #14228: LaTeX: Fix overrun footer for cases of merged vertical table cells. Patch by Tim Nordell .IP \(bu 2 #14207: Fix creating \fBHTMLThemeFactory\fP objects in third\-party extensions. Patch by Adam Turner .IP \(bu 2 #3099: LaTeX: PDF build crashes if a code\-block contains more than circa 1350 codelines (about 27 a4\-sized pages at default pointsize). Patch by Jean\-François B. .IP \(bu 2 #14064: LaTeX: TABs ending up in sphinxVerbatim fail to obey tab stops. Patch by Jean\-François B. .IP \(bu 2 #14089: autodoc: Improve support for non\-weakreferencable objects. Patch by Adam Turner .IP \(bu 2 LaTeX: Fix accidental removal at \fB3.5.0\fP (#8854) of the documentation of \fBliteralblockcappos\fP key of \(aqsphinxsetup\(aq \%<#\:latexsphinxsetup>\&. Patch by Jean\-François B. .UNINDENT .SS Prior releases .SS Sphinx 9.0 .SS Release 9.0.4 (released Dec 04, 2025) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #14143: Fix spurious build warnings when translators reorder references in strings, or use translated display text in references. Patch by Matt Wang. .UNINDENT .SS Release 9.0.3 (released Dec 04, 2025) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #14142: autodoc: Restore some missing exports in \fBsphinx.ext.autodoc\fP\&. Patch by Adam Turner. .UNINDENT .SS Release 9.0.2 (released Dec 03, 2025) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #14142: autodoc: Restore \fBsphinx.ext.autodoc.mock\fP\&. Patch by Adam Turner. .UNINDENT .SS Release 9.0.1 (released Dec 01, 2025) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #13942: autodoc: Restore the mapping interface for options objects. Patch by Adam Turner. .IP \(bu 2 #13942: autodoc: Deprecate the mapping interface for options objects. Patch by Adam Turner. .IP \(bu 2 #13387: Update translations. .UNINDENT .SS Release 9.0.0 (released Nov 30, 2025) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #13786: Support Docutils 0.22 \%<https://\:docutils\:.sourceforge\:.io/\:RELEASE-NOTES\:.html#\:release-0-22-2026-07-29>\&. Patch by Adam Turner. .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #13639: \fBSphinxComponentRegistry.create_source_parser()\fP no longer has an \fIapp\fP parameter, instead taking \fIconfig\fP and \fIenv\fP\&. Patch by Adam Turner. .IP \(bu 2 #13679: Non\-decodable characters in source files now raise an error. Such bytes have been replaced with \(aq?\(aq along with logging a warning since Sphinx 2.0. Patch by Adam Turner. .IP \(bu 2 #13751, #14089: \fBsphinx.ext.autodoc\fP \%<#\:module-sphinx\:.ext\:.autodoc> has been substantially rewritten, and there may be some incompatible changes in edge cases, especially when extensions interact with autodoc internals. The \fBautodoc_use_legacy_class_based\fP \%<#\:confval-autodoc_use_legacy_class_based> option has been added to use the legacy (pre\-9.0) implementation of autodoc. Patches by Adam Turner. .IP \(bu 2 #13355: Don\(aqt include escaped title content in the search index. Patch by Will Lachance. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 13627: Deprecate remaining public \fB\&.app\fP attributes, including \fBbuilder.app\fP, \fBenv.app\fP, \fBevents.app\fP, and \fBSphinxTransform.app\fP\&. Patch by Adam Turner. .IP \(bu 2 #13637: Deprecate the \fBset_application()\fP method of \fBParser\fP \%<#\:sphinx\:.parsers\:.Parser> objects. Patch by Adam Turner. .IP \(bu 2 #13644: Deprecate the \fBParser.config\fP and \fBenv\fP attributes. Patch by Adam Turner. .IP \(bu 2 #13665: Deprecate support for non\-UTF 8 source encodings, scheduled for removal in Sphinx 10. Patch by Adam Turner. .IP \(bu 2 #13682: Deprecate \fBsphinx.io\fP\&. Sphinx no longer uses the \fBsphinx.io\fP classes, having replaced them with standard Python I/O. The entire \fBsphinx.io\fP module will be removed in Sphinx 10. Patch by Adam Turner. .IP \(bu 2 #13631: \fBsphinx.environment.adapters.toctree.global_toctree_for_doc()\fP and \fBsphinx.environment.BuildEnvironment.get_and_resolve_doctree()\fP will require a \fItags\fP keyword argument from Sphinx 11. It may optionally be passed from Sphinx 9 onwards. Patch by Adam Turner. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #13332: Add \fBdoctest_fail_fast\fP \%<#\:confval-doctest_fail_fast> option to exit after the first failed test. Patch by Till Hoffmann. .IP \(bu 2 #13439: linkcheck: Permit warning on every redirect with \fBlinkcheck_allowed_redirects = {}\fP\&. Patch by Adam Turner and James Addison. .IP \(bu 2 #13497: Support C domain objects in the table of contents. .IP \(bu 2 #13500: LaTeX: add support for \fBfontawesome6\fP package. Patch by Jean\-François B. .IP \(bu 2 #13509: autodoc: Detect \fBtyping_extensions.overload\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:typing\:.html#\:typing\:.overload> and \fBfinal()\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:typing\:.html#\:typing\:.final> decorators. Patch by Spencer Brown. .IP \(bu 2 #13535: html search: Update to the latest version of Snowball (v3.0.1). Patch by Adam Turner. .IP \(bu 2 #13647: LaTeX: allow more cases of table nesting. Patch by Jean\-François B. .IP \(bu 2 #13657: LaTeX: support CSS3 length units. Patch by Jean\-François B. .IP \(bu 2 #13684: intersphinx: Add a file\-based cache for remote inventories. The location of the cache directory must not be relied upon externally, as it may change without notice or warning in future releases. Patch by Adam Turner. .IP \(bu 2 #13805: LaTeX: add support for \fBfontawesome7\fP package. Patch by Jean\-François B. .IP \(bu 2 #13508: autodoc: Initial support for \fBPEP 695\fP \%<https://\:peps\:.python\:.org/\:pep-0695/> type aliases. Patch by Martin Matouš, Jeremy Maitin\-Shepard, and Adam Turner. .IP \(bu 2 #14023: Add the new \fBmathjax_config_path\fP \%<#\:confval-mathjax_config_path> option to load MathJax configuration from a file. Patch by Randolf Scholz and Adam Turner. .IP \(bu 2 #14046: linkcheck: Add the \fBlinkcheck_case_insensitive_urls\fP \%<#\:confval-linkcheck_case_insensitive_urls> option to allow case\-insensitive URL comparison for specific URL patterns. This is useful for links to websites that normalise URL casing (e.g. GitHub) or case\-insensitive servers. Patch by Fazeel Usmani and James Addison. .IP \(bu 2 #14075: autosummary: Provide more context in import exception stack traces. Patch by Philipp A. .IP \(bu 2 #13468: Add config options to \fBsphinx.ext.duration\fP \%<#\:module-sphinx\:.ext\:.duration>\&. Patch by Erik Bedard and Adam Turner. .IP \(bu 2 #14022: Use MathJax v4 by default in the \fBsphinx.ext.mathjax\fP \%<#\:module-sphinx\:.ext\:.mathjax> extension, from v3 previously. To keep using an older version, set the \fBmathjax_path\fP \%<#\:confval-mathjax_path> option. Also add the new \fBmathjax4_config\fP \%<#\:confval-mathjax4_config> option to configure MathJax v4. Note that MathJax v3 is mostly compatible with MathJax v4, so existing \fBmathjax3_config\fP \%<#\:confval-mathjax3_config> settings should not need to change. Patch by Matthias Geier. .IP \(bu 2 #14029: intersphinx: Fix error in format string interpolation. Patch by Matthieu de Cibeins. .IP \(bu 2 #13894: Add \fBsource_code_parser\fP type to \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings> for grouping issues related to the C and C++ parsers. Patch by Valentin H. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #13926: multiple py:type directives for the same canonical type no longer result in spurious duplicate object description warnings. Patch by Jeremy Maitin\-Shepard. .IP \(bu 2 #1327: LaTeX: tables using longtable raise error if \fBtabularcolumns\fP \%<#\:directive-tabularcolumns> specifies automatic widths (\fBL\fP, \fBR\fP, \fBC\fP, or \fBJ\fP). Patch by Jean\-François B. .IP \(bu 2 #3447: LaTeX: when assigning longtable class to table for PDF, it may render \(dqhorizontally\(dq and overflow in right margin. Patch by Jean\-François B. .IP \(bu 2 #8828: LaTeX: adding a footnote to a longtable cell causes table to occupy full width. Patch by Jean\-François B. .IP \(bu 2 #11498: LaTeX: Table in cell fails to build if it has many rows. Patch by Jean\-François B. .IP \(bu 2 #11515: LaTeX: longtable does not allow nested table. Patch by Jean\-François B. .IP \(bu 2 #11973: LaTeX: links in table captions do not work in PDF. Patch by Jean\-François B. .IP \(bu 2 #12821: LaTeX: URLs/links in section titles should render in PDF. Patch by Jean\-François B. .IP \(bu 2 #13369: Correctly parse and cross\-reference unpacked type annotations. Patch by Alicia Garcia\-Raboso. .IP \(bu 2 #13528: Add tilde \fB~\fP prefix support for \fBpy:deco\fP \%<#\:role-py-deco>\&. Patch by Shengyu Zhang and Adam Turner. .IP \(bu 2 #13597: LaTeX: table nested in a merged cell leads to invalid LaTeX mark\-up and PDF cannot be built. Patch by Jean\-François B. .IP \(bu 2 #13619: LaTeX: possible duplicated footnotes in PDF from object signatures (typically if \fBlatex_show_urls\fP \%<#\:confval-latex_show_urls> \fB= \(aqfootnote\(aq\fP). Patch by Jean\-François B. .IP \(bu 2 #13635: LaTeX: if a cell contains a table, row coloring is turned off for the next table cells. Patch by Jean\-François B. .IP \(bu 2 #13685: gettext: Correctly ignore trailing backslashes. Patch by Bénédikt Tran. .IP \(bu 2 #13712: intersphinx: Don\(aqt add \(dqv\(dq prefix to non\-numeric versions. Patch by Szymon Karpinski. .IP \(bu 2 #13688: HTML builder: Replace \fB<em class=\(dqproperty\(dq>\fP with \fB<span class=\(dqproperty\(dq>\fP for attribute type annotations to improve semantic HTML structure \%<https://\:html\:.spec\:.whatwg\:.org/\:multipage/\:text-level-semantics\:.html>\&. Patch by Mark Ostroth. .IP \(bu 2 #13812 (discussion): LaTeX: long \fBconfval\fP \%<#\:directive-confval> value does not wrap at spaces in PDF. Patch by Jean\-François B. .IP \(bu 2 #10785: Autodoc: Allow type aliases defined in the project to be properly cross\-referenced when used as type annotations. This makes it possible for objects documented as \fB:py:data:\fP to be hyperlinked in function signatures. .IP \(bu 2 #13858: doctest: doctest blocks are now correctly added to a group defined by the configuration variable \fBdoctest_test_doctest_blocks\fP\&. .IP \(bu 2 #13885: Coverage builder: Fix TypeError when warning about missing modules. Patch by Damien Ayers. .IP \(bu 2 #13929: Duplicate equation label warnings now have a new warning sub\-type, \fBref.equation\fP\&. Patch by Jared Dillard. .IP \(bu 2 #13935: autoclass: parent class members no longer considered directly defined in certain cases, depending on autodoc processing order. Patch by Jeremy Maitin\-Shepard. .IP \(bu 2 #13939: LaTeX: page break can separate admonition title from contents. Patch by Jean\-François B. .IP \(bu 2 #14004: Fix \fBautodoc_type_aliases\fP \%<#\:confval-autodoc_type_aliases> when they appear in PEP 604 union syntax (\fBAlias | Type\fP). Patch by Tamika Nomara. .IP \(bu 2 #14059: LaTeX: Footnotes cause pdflatex error with French language (since late June 2025 upstream change to LaTeX \fBbabel\-french\fP). Patch by Jean\-François B. .IP \(bu 2 #13916: HTML Search: do not clear text fragments from the URL on page load. Patch by Harmen Stoppels. .IP \(bu 2 #13944: autodoc: show traceback during import in human readable representation. Patch by Florian Best. .IP \(bu 2 #14006: Support images with data URIs that aren\(aqt base64\-encoded. Patch by Shengyu Zhang and Adam Turner. .IP \(bu 2 #12797: Fix \fBSome type variables (...) are not listed in Generic[...]\fP TypeError when inheriting from both Generic and autodoc mocked class. Patch by Ikor Jefocur and Daniel Sperber. .IP \(bu 2 #13945: autodoc: Fix handling of undefined names in annotations by using the \fBFORWARDREF\fP \fBannotationlib\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:annotationlib\:.html#\:module-annotationlib> format. Patch by Rui Pinheiro and Adam Turner. .IP \(bu 2 #14067: EPUB: unify path separators in manifest items to forward slashes; resolve duplicates in the manifest on Windows. Patch by Akihiro Takizawa. .IP \(bu 2 #13741: text builder: fix an infinite loop when processing CSV tables. Patch by Bénédikt Tran. .IP \(bu 2 #13217: Remove extra parentheses from \fBjs:function\fP \%<#\:directive-js-function> arguments and errors. Patch by Shengyu Zhang. .UNINDENT .SS Sphinx 8.2 .SS Release 8.2.3 (released Mar 02, 2025) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #13403: Define \fB_StrPath.__radd__()\fP\&. Patch by Adam Turner. .IP \(bu 2 #13399: Fix _CurrentDocument membership testing with \(aq{c,cpp}:parent_symbol\(aq. Patch by Adam Turner. .UNINDENT .SS Release 8.2.2 (released Mar 02, 2025) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #13392: Fix argument type for \fBjieba.load_userdict()\fP\&. .IP \(bu 2 Add workaround for \fBnbsphinx\fP implicit imports. Patch by Adam Turner. .IP \(bu 2 #13402: Ensure inline \fB<script/>\fP tags are written exactly once. Patch by Dmitry Shachnev and Adam Turner. .IP \(bu 2 #13391: apidoc: Fix TOC file not having a title. Patch by Dave Hoese and Adam Turner. .UNINDENT .SS Release 8.2.1 (released Feb 21, 2025) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #13367: Correct spelling of \fBhighlighting_failure\fP in warning sub\-type. Patch by Bart Kamphorst. .IP \(bu 2 #13377: Restore support for using \fBsphinx.testing.path\fP paths with \fBsphinx.testing.fixtures\fP\&. Patch by Kazuya Takei. .IP \(bu 2 #13380: viewcode: Fix importing modules more than once. Patch by Dave Hoese. .IP \(bu 2 #13382: Napoleon: Use the right valid types for configuration values. Patch by Adam Turner. .IP \(bu 2 #13376: Fix copying assets from relative \fBhtml_static_path\fP \%<#\:confval-html_static_path> and \fBhtml_extra_path\fP \%<#\:confval-html_extra_path> entries. Patch by Adam Turner. .UNINDENT .SS Release 8.2.0 (released Feb 18, 2025) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #13000: Drop Python 3.10 support. .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #13044: Remove the internal and undocumented \fBhas_equations\fP data from the \fBMathDomain\fP domain. The undocumented \fBMathDomain.has_equations()\fP method now unconditionally returns \fBTrue\fP\&. These are replaced by the \fBhas_maths_elements\fP key of the page context dict. Patch by Adam Turner. .IP \(bu 2 #13227: HTML output for sequences of keys in the \fBkbd\fP \%<#\:role-kbd> role no longer uses a \fB<kbd class=\(dqkbd compound\(dq>\fP element to wrap the keys and separators, but places them directly in the relevant parent node. This means that CSS rulesets targeting \fBkbd.compound\fP or \fB\&.kbd.compound\fP will no longer have any effect. Patch by Adam Turner. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 #13037: Deprecate the \fBSingleHTMLBuilder.fix_refuris\fP method. Patch by James Addison. .IP \(bu 2 #13083, #13330: Un\-deprecate \fBsphinx.util.import_object\fP\&. Patch by Matthias Geier. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #13173: Add a new \fBduplicate_declaration\fP warning type, with \fBduplicate_declaration.c\fP and \fBduplicate_declaration.cpp\fP subtypes. Patch by Julien Lecomte and Adam Turner. .IP \(bu 2 #11824: linkcode: Allow extensions to add support for a domain by defining the keys that should be present. Patch by Nicolas Peugnet. .IP \(bu 2 #13144: Add a \fBclass\fP option to the \fBautosummary\fP \%<#\:directive-autosummary> directive. Patch by Tim Hoffmann. .IP \(bu 2 #13146: Napoleon: Unify the type preprocessing logic to allow Google\-style docstrings to use the optional and default keywords. Patch by Chris Barrick. .IP \(bu 2 #13227: Implement the \fBkbd\fP \%<#\:role-kbd> role as a \fBSphinxRole\fP\&. Patch by Adam Turner. .IP \(bu 2 #13065: Enable colour by default in when running on CI. Patch by Adam Turner. .IP \(bu 2 #13230: Allow supressing warnings from the \fBtoctree\fP \%<#\:directive-toctree> directive when a glob pattern doesn\(aqt match any documents, via the new \fBtoc.empty_glob\fP warning sub\-type. Patch by Slawek Figiel. .IP \(bu 2 #9732: Add the new \fBautodoc.mocked_object\fP warnings sub\-type. Patch by Cyril Roelandt. .IP \(bu 2 #7630, #4824: autodoc: Use \fB\&.pyi\fP type stub files to auto\-document native modules. Patch by Adam Turner, partially based on work by Allie Fitter. .IP \(bu 2 #12975: Enable configuration of trailing commas in multi\-line signatures in the Python and Javascript domains, via the new \fBpython_trailing_comma_in_multi_line_signatures\fP \%<#\:confval-python_trailing_comma_in_multi_line_signatures> and \fBjavascript_trailing_comma_in_multi_line_signatures\fP \%<#\:confval-javascript_trailing_comma_in_multi_line_signatures> configuration options. .IP \(bu 2 #13264: Rename the \fBmath\fP \%<#\:directive-math> directive\(aqs \fBnowrap\fP option to \fBmath:no\-wrap\fP \%<#\:directive-option-math-no-wrap>\&. Patch by Adam Turner. .IP \(bu 2 #13269: Added the option to disable the use of type comments in via the new \fBautodoc_use_type_comments\fP \%<#\:confval-autodoc_use_type_comments> option, which defaults to \fBTrue\fP for backwards compatibility. The default will change to \fBFalse\fP in Sphinx 10. Patch by Adam Turner. .IP \(bu 2 #9732: Add the new \fBref.any\fP warnings sub\-type to allow suppressing the ambiguous \(aqany\(aq cross\-reference warning. Patch by Simão Afonso and Adam Turner. .IP \(bu 2 #13272: The Python and JavaScript module directives now support the \fB:no\-index\-entry:\fP option. Patch by Adam Turner. .IP \(bu 2 #12233: autodoc: Allow directives to use \fB:no\-index\-entry:\fP and include the \fB:no\-index:\fP and \fB:no\-index\-entry:\fP options within \fBautodoc_default_options\fP \%<#\:confval-autodoc_default_options>\&. Patch by Jonny Saunders and Adam Turner. .IP \(bu 2 #13172: Add support for short signatures in autosummary. Patch by Tim Hoffmann. .IP \(bu 2 #13271: Change the signature prefix for abstract methods in the Python domain to \fIabstractmethod\fP from \fIabstract\fP\&. Patch by Adam Turner. .IP \(bu 2 #13271: Support the \fB:abstract:\fP option for classes, methods, and properties in the Python domain. Patch by Adam Turner. .IP \(bu 2 #12507: Add the collapsible \%<#\:collapsible-admonitions> option to admonition directives. Patch by Chris Sewell. .IP \(bu 2 #8191, #8159: Add \fBinheritance\-diagram:include\-subclasses\fP \%<#\:directive-option-inheritance-diagram-include-subclasses> option to the \fBinheritance\-diagram\fP \%<#\:directive-inheritance-diagram> directive. Patch by Walter Dörwald. .IP \(bu 2 #11995: autodoc: Add support for \fBpython_display_short_literal_types\fP \%<#\:confval-python_display_short_literal_types>\&. Patch by Bénédikt Tran and Adam Turner. .IP \(bu 2 #13163: Always print the full context when Sphinx encounters an internal error. Patch by Kevin Deldycke and Adam Turner. .IP \(bu 2 #13105: Introduce the \fBpy:deco\fP \%<#\:role-py-deco> role to cross\-reference decorator functions and methods in the Python domain. Patch by Adam Turner. .IP \(bu 2 #9169: Add the \fBintersphinx_resolve_self\fP \%<#\:confval-intersphinx_resolve_self> option to resolve an intersphinx reference to the current project. Patch by Jakob Lykke Andersen and Adam Turner. .IP \(bu 2 #11280: Add ability to skip a particular section using the \fBno\-search\fP class. Patch by Will Lachance. .IP \(bu 2 #13326: Remove hardcoding from handling \fBproductionlist\fP \%<#\:sphinx\:.addnodes\:.productionlist> nodes in all writers, to improve flexibility. Patch by Adam Turner. .IP \(bu 2 #13335: Use \fBmisc.highlighting_failure\fP subtype for Pygments unknown lexers. Patch by Bart Kamphorst. .IP \(bu 2 #13354: Insert abbreviation nodes (hover text) for positional\- and keyword\-only separators in Python signatures. Patch by Adam Turner. .IP \(bu 2 #13333: Add the \fBsphinx.ext.apidoc\fP \%<#\:module-sphinx\:.ext\:.apidoc> extension, to automate API documentation generation from Python modules. Patch by Chris Sewell and Adam Turner. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12463: autosummary: Respect an empty module \fB__all__\fP\&. Patch by Valentin Pratz .IP \(bu 2 #13060: HTML Search: use \fBMap\fP to store per\-file term scores. Patch by James Addison .IP \(bu 2 #13130: LaTeX docs: \fBpdflatex\fP index creation may fail for index entries in French. See \fBlatex_use_xindy\fP \%<#\:confval-latex_use_xindy>\&. Patch by Jean\-François B. .IP \(bu 2 #13152: LaTeX: fix a typo from v7.4.0 in a default for \fB\esphinxboxsetup\fP\&. Patch by Jean\-François B. .IP \(bu 2 #13096: HTML Search: check that query terms exist as properties in term indices before accessing them. .IP \(bu 2 #11233: linkcheck: match redirect URIs against \fBlinkcheck_ignore\fP \%<#\:confval-linkcheck_ignore> by overriding session\-level \fBrequests.get_redirect_target\fP\&. .IP \(bu 2 #13195: viewcode: Fix issue where import paths differ from the directory structure. Patch by Ben Egan and Adam Turner. .IP \(bu 2 #13188: autodoc: fix detection of class methods implemented in C. Patch by Bénédikt Tran. .IP \(bu 2 #1810: Always copy static files when building, regardless of whether any documents have changed since the previous build. Patch by Adam Turner. .IP \(bu 2 #13201: autodoc: fix ordering of members when using \fBgroupwise\fP for \fBautodoc_member_order\fP \%<#\:confval-autodoc_member_order>\&. Class methods are now rendered before static methods, which themselves are rendered before regular methods and attributes. Patch by Bénédikt Tran. .IP \(bu 2 #12975: Avoid rendering a trailing comma in C and C++ multi\-line signatures. .IP \(bu 2 #13178: autodoc: Fix resolution for \fBpathlib\fP types. Patch by Adam Turner. .IP \(bu 2 #13136: autodoc: Correctly handle multiple inheritance. Patch by Pavel Holica .IP \(bu 2 #13273, #13318: Properly convert command\-line overrides for Boolean types. Patch by Adam Turner. .IP \(bu 2 #13302, #13319: Use the correct indentation for continuation lines in \fBproductionlist\fP \%<#\:directive-productionlist> directives. Patch by Adam Turner. .IP \(bu 2 #13328: Fix parsing of PEP 695 functions with return annotations. Patch by Bénédikt Tran. Initial work by Arash Badie\-Modiri. .UNINDENT .SS Testing .INDENT 0.0 .IP \(bu 2 #13224: Correctness fixup for \fBtest_html_multi_line_copyright\fP\&. Patch by Colin Watson, applied by James Addison. .UNINDENT .SS Sphinx 8.1 .SS Release 8.1.3 (released Oct 13, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #13013: Restore support for \fBcut_lines()\fP with no object type. Patch by Adam Turner. .UNINDENT .SS Release 8.1.2 (released Oct 12, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #13012: Expose \fBsphinx.errors.ExtensionError\fP \%<#\:sphinx\:.errors\:.ExtensionError> in \fBsphinx.util\fP for backwards compatibility. This will be removed in Sphinx 9, as exposing the exception in \fBsphinx.util\fP was never intentional. \fBExtensionError\fP has been part of \fBsphinx.errors\fP since Sphinx 0.9. Patch by Adam Turner. .UNINDENT .SS Release 8.1.1 (released Oct 11, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #13006: Use the preferred \%<https://\:www\:.cve\:.org/> URL for the \fB:cve:\fP \%<#\:role-cve> role. Patch by Hugo van Kemenade. .IP \(bu 2 #13007: LaTeX: Improve resiliency when the required \fBfontawesome\fP or \fBfontawesome5\fP packages are not installed. Patch by Jean\-François B. .UNINDENT .SS Release 8.1.0 (released Oct 10, 2024) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #12756: Add lower\-bounds to the \fBsphinxcontrib\-*\fP dependencies. Patch by Adam Turner. .IP \(bu 2 #12833: Update the LaTeX \fBparskip\fP package from 2001 to 2018. Patch by Jean\-François B. .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #12763: Remove unused internal class \fBsphinx.util.Tee\fP\&. Patch by Adam Turner. .IP \(bu 2 #12822: LaTeX: for Unicode engines, the \(aqfvset\(aq \%<#\:fvset> default is changed to \fB\(aq\e\efvset{fontsize=auto}\(aq\fP from \fB\(aq\e\efvset{fontsize=\e\esmall}\(aq\fP\&. Code\-blocks are unchanged as FreeMono is now loaded with \fBScale=0.9\fP\&. An adjustment to existing projects is needed only if they used a custom \(aqfontpkg\(aq \%<#\:fontpkg> configuration and did not set \(aqfvset\(aq \%<#\:fvset>\&. Patch by Jean\-François B. .IP \(bu 2 #12875: Disable smartquotes for languages: \fBzh_CN\fP and \fBzh_TW\fP by default. Patch by A. Rafey Khan. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 #12762: Deprecate \fBsphinx.util.import_object\fP\&. Use \fBimportlib.import_module()\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:importlib\:.html#\:importlib\:.import_module> instead. Patch by Adam Turner. .IP \(bu 2 #12766: Deprecate \fBsphinx.util.FilenameUniqDict\fP and \fBsphinx.util.DownloadFiles\fP\&. Patch by Adam Turner. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #11328: Mention evaluation of templated content during production of static output files. Patch by James Addison. .IP \(bu 2 #12704: LaTeX: make contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>, topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic>, and sidebar \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:sidebar> directives separately customizable for PDF output. Patch by Jean\-François B. and Bénédikt Tran. .IP \(bu 2 #12474: Support type\-dependent search result highlighting via CSS. Patch by Tim Hoffmann. .IP \(bu 2 #12652: LaTeX: Add \fBmath_numsep\fP \%<#\:confval-math_numsep> support to latex builder. Patch by Thomas Fanning and Jean\-François B. .IP \(bu 2 #12743: No longer exit on the first warning when \fB\-\-fail\-on\-warning\fP \%<#\:cmdoption-sphinx-build-W> is used. Instead, exit with a non\-zero status if any warnings were generated during the build. Patch by Adam Turner. .IP \(bu 2 #12743: Add \fBsphinx\-build \-\-exception\-on\-warning\fP \%<#\:cmdoption-sphinx-build-exception-on-warning>, to raise an exception when warnings are emitted during the build. Patch by Adam Turner and Jeremy Maitin\-Shepard. .IP \(bu 2 #12907: Add \fBhtml_last_updated_use_utc\fP \%<#\:confval-html_last_updated_use_utc> to allow using universal time (GMT/UTC) instead of local time for the date\-time supplied to \fBhtml_last_updated_fmt\fP \%<#\:confval-html_last_updated_fmt>\&. Patch by Adam Turner. .IP \(bu 2 #12910: Copyright entries now support the \fB\(aq%Y\(aq\fP placeholder to substitute the current year. This is helpful for reducing the reliance on Python modules such as \fBtime\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:time\:.html#\:module-time> or \fBdatetime\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:datetime\:.html#\:module-datetime> in \fBconf.py\fP\&. See the docs \%<#\:config-copyright> for further detail. Patch by Adam Turner. .IP \(bu 2 #11781: Add roles for referencing CVEs (\fB:cve:\fP \%<#\:role-cve>) and CWEs (\fB:cwe:\fP \%<#\:role-cwe>). Patch by Hugo van Kemenade. .IP \(bu 2 #11809: Improve the formatting for RFC section anchors. Patch by Jakub Stasiak and Adam Turner. .IP \(bu 2 #12852: Support a \fBBuilder.supported_linkcode\fP \%<#\:sphinx\:.builders\:.Builder\:.supported_linkcode> attribute for builders to enable use of \fBsphinx.ext.linkcode\fP \%<#\:module-sphinx\:.ext\:.linkcode>\-generated references. Patch by James Knight. .IP \(bu 2 #12949: Print configuration options that differ from the pickled environment. This can be helpful in diagnosing the cause of a full rebuild. Patch by Adam Turner. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12514: intersphinx: fix the meaning of a negative value for \fBintersphinx_cache_limit\fP \%<#\:confval-intersphinx_cache_limit>\&. Patch by Shengyu Zhang. .IP \(bu 2 #12722: LaTeX: avoid TeX reporting \fBOverfull \ehbox\fP from too long strings in a codeline when the problem has actually been solved thanks to verbatimforcewraps \%<#\:latexsphinxsetupforcewraps>\&. Patch by Jean\-François B. .IP \(bu 2 #12730: The \fBUnreferencedFootnotesDetector\fP transform has been improved to more consistently detect unreferenced footnotes. Note, the priority of the transform has been changed from 200 to 622, so that it now runs after the docutils \fBFootnotes\fP resolution transform. Patch by Chris Sewell. .IP \(bu 2 #12778: LaTeX: let \(aqsphinxsetup\(aq \%<#\:latexsphinxsetup> \fBdiv.topic_box\-shadow\fP key if used with only one dimension set both x\-offset and y\-offset as per documentation. Patch by Jean\-François B. .IP \(bu 2 #12587: Do not warn when potential ambiguity detected during Intersphinx resolution occurs due to duplicate targets that differ case\-insensitively. Patch by James Addison. .IP \(bu 2 #12639: Fix singular and plural search results text. Patch by Hugo van Kemenade. .IP \(bu 2 #12645: Correctly support custom gettext output templates. Patch by Jeremy Bowman. .IP \(bu 2 #12717: LaTeX: let \fB\-q\fP \%<#\:cmdoption-sphinx-build-q> (quiet) option for \fBsphinx\-build \-M latexpdf\fP or \fBmake latexpdf\fP (\fBO=\-q\fP) get passed to \fBlatexmk\fP\&. Let \fB\-Q\fP \%<#\:cmdoption-sphinx-build-Q> (silent) apply as well to the PDF build phase. Patch by Jean\-François B. .IP \(bu 2 #12744: LaTeX: Classes injected by a custom interpreted text role now give rise to nested \fB\eDUrole\fP\(aqs, rather than a single one with comma separated classes. Patch by Jean\-François B. .IP \(bu 2 #12831: LaTeX: avoid large voids sometimes occurring at page bottoms. Patch by Jean\-François B. .IP \(bu 2 #11970, #12551: singlehtml builder: make target URIs to be same\-document references in the sense of \fBRFC 3986, §4.4\fP \%<https://\:datatracker\:.ietf\:.org/\:doc/\:html/\:rfc3986\:.html#\:section-4.4>, e.g., \fBindex.html#foo\fP becomes \fB#foo\fP\&. (note: continuation of a partial fix added in Sphinx 7.3.0) Patch by James Addison (with reference to prior work by Eric Norige). .IP \(bu 2 #12735: Fix \fBPEP 695\fP \%<https://\:peps\:.python\:.org/\:pep-0695/> generic classes LaTeX output formatting. Patch by Jean\-François B. and Bénédikt Tran. .IP \(bu 2 #12782: intersphinx: fix double forward slashes when generating the inventory file URL (user\-defined base URL of an intersphinx project are left untouched even if they end with double forward slashes). Patch by Bénédikt Tran. .IP \(bu 2 #12796: Enable parallel reading if requested, even if there are fewer than 6 documents. Patch by Matthias Geier. .IP \(bu 2 #12844: Restore support for \fB:noindex:\fP for the \fBjs:module\fP \%<#\:directive-js-module> and \fBpy:module\fP \%<#\:directive-py-module> directives. Patch by Stephen Finucane. .IP \(bu 2 #12916: Restore support for custom templates named with the legacy \fB_t\fP suffix during \fBapidoc\fP RST rendering (regression in 7.4.0). Patch by James Addison. .IP \(bu 2 #12451: Only substitute copyright notice years with values from \fBSOURCE_DATE_EPOCH\fP for entries that match the current system clock year, and disallow substitution of future years. Patch by James Addison and Adam Turner. .IP \(bu 2 #12905: intersphinx: fix flipped use of \fBintersphinx_cache_limit\fP \%<#\:confval-intersphinx_cache_limit>, which always kept the cache for positive values, and always refreshed it for negative ones. Patch by Nico Madysa. .IP \(bu 2 #12888: Add a warning when document is included in multiple toctrees and ensure deterministic resolution of global toctree in parallel builds by choosing the lexicographically greatest parent document. Patch by A. Rafey Khan .IP \(bu 2 #12995: Significantly improve performance when building the search index for Chinese languages. Patch by Adam Turner. .IP \(bu 2 #12767: \fBBuilder.write()\fP \%<#\:sphinx\:.builders\:.Builder\:.write> is typed as \fBfinal\fP, meaning that the \fBwrite\-started\fP \%<#\:event-write-started> event may be relied upon by extensions. A new \fBBuilder.write_documents()\fP \%<#\:sphinx\:.builders\:.Builder\:.write_documents> method has been added to control how documents are written. This is intended for builders that do not output a file for each document. Patch by Adam Turner. .UNINDENT .SS Testing .INDENT 0.0 .IP \(bu 2 #12141: Migrate from the deprecated \fBkarma\fP JavaScript test framework to the actively\-maintained \fBjasmine\fP framework. Test coverage is unaffected. Patch by James Addison. .UNINDENT .SS Sphinx 8.0 .SS Release 8.0.2 (released Jul 30, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Fix the \fBpygments.Formatter.__class_getitem__\fP patch. Patch by Adam Turner. .UNINDENT .SS Release 8.0.1 (released Jul 30, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Patch \fBpygments.Formatter.__class_getitem__\fP in Pygments 2.17. Patch by Adam Turner. .UNINDENT .SS Release 8.0.0 (released Jul 29, 2024) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #12633: Drop Python 3.9 support. .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Remove deprecated functions from \fBsphinx.util\fP: .INDENT 2.0 .IP \(bu 2 Removed \fBsphinx.util.path_stabilize\fP (use \fBsphinx.util.osutil.path_stabilize\fP). .IP \(bu 2 Removed \fBsphinx.util.display_chunk\fP (use \fBsphinx.util.display.display_chunk\fP). .IP \(bu 2 Removed \fBsphinx.util.status_iterator\fP (use \fBsphinx.util.display.status_iterator\fP). .IP \(bu 2 Removed \fBsphinx.util.SkipProgressMessage\fP (use \fBsphinx.util.display.SkipProgressMessage\fP). .IP \(bu 2 Removed \fBsphinx.util.progress_message\fP (use \fBsphinx.util.display.progress_message\fP). .IP \(bu 2 Removed \fBsphinx.util.epoch_to_rfc1123\fP (use \fBsphinx.http_date.epoch_to_rfc1123\fP). .IP \(bu 2 Removed \fBsphinx.util.rfc1123_to_epoch\fP (use \fBsphinx.http_date.rfc1123_to_epoch\fP). .IP \(bu 2 Removed \fBsphinx.util.save_traceback\fP (use \fBsphinx.exceptions.save_traceback\fP). .IP \(bu 2 Removed \fBsphinx.util.format_exception_cut_frames\fP (use \fBsphinx.exceptions.format_exception_cut_frames\fP). .IP \(bu 2 Removed \fBsphinx.util.xmlname_checker\fP (use \fBsphinx.builders.epub3._XML_NAME_PATTERN\fP). .UNINDENT .sp Patch by Adam Turner. .IP \(bu 2 Removed \fBsphinx.util.osutil.cd()\fP (use \fBcontextlib.chdir()\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:contextlib\:.html#\:contextlib\:.chdir>). Patch by Adam Turner. .IP \(bu 2 Removed \fBsphinx.util.typing.stringify()\fP (use \fBsphinx.util.typing.stringify_annotation()\fP). Patch by Adam Turner. .IP \(bu 2 #12593: Raise an error for invalid \fBhtml_sidebars\fP \%<#\:confval-html_sidebars> values. Patch by Adam Turner. .IP \(bu 2 #12593: Raise an error in \fBTheme.get_config()\fP for invalid sections. Patch by Adam Turner. .IP \(bu 2 #11693: Remove support for old\-style \fBMakefile\fP and \fBmake.bat\fP output in \fBsphinx\-quickstart\fP\&. .IP \(bu 2 #11693: Remove the \fB\-\-no\-use\-make\-mode\fP, \fB\-M\fP, \fB\-\-use\-make\-mode\fP, and \fB\-m\fP options from \fBsphinx\-quickstart\fP\&. Patch by Adam Turner. .IP \(bu 2 Removed the tuple interface to \fBsphinx.ext.autodoc.ObjectMember\fP\&. Patch by Adam Turner. .IP \(bu 2 #12630: Sphinx 8 makes two changes to the \fBlinkcheck\fP configuration defaults: .INDENT 2.0 .IP \(bu 2 \fBlinkcheck_allow_unauthorized\fP \%<#\:confval-linkcheck_allow_unauthorized> is now \fBFalse\fP by default. .IP \(bu 2 \fBlinkcheck_report_timeouts_as_broken\fP \%<#\:confval-linkcheck_report_timeouts_as_broken> is now \fBFalse\fP by default. .UNINDENT .sp Patch by James Addison. .IP \(bu 2 #12597: Change the default of \fBshow_warning_types\fP \%<#\:confval-show_warning_types> from \fBFalse\fP to \fBTrue\fP\&. Patch by Chris Sewell. .IP \(bu 2 #12083: Remove support for the old (2008\-\-2010) Sphinx 0.5 and Sphinx 0.6 \fBintersphinx_mapping\fP \%<#\:confval-intersphinx_mapping> format. Patch by Bénédikt Tran and Adam Turner. .IP \(bu 2 #12096: Do not overwrite user\-supplied files when copying assets unless forced with \fBforce=True\fP\&. Patch by Adam Turner. .IP \(bu 2 #12646: Remove \fBsphinx.util.inspect.isNewType()\fP\&. Use \fBisinstance(obj, typing.NewType)\fP instead on Python 3.10 and newer. Patch by Adam Turner. .IP \(bu 2 Remove the long\-deprecated (since Sphinx 2) alias to \fBVersionChange\fP in \fBsphinx.directives.other\fP (Deprecated since Sphinx 2). Use \fBsphinx.domains.changeset.VersionChange\fP directly. Patch by Adam Turner. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 #12643: Renamed \fBsphinx.ext.intersphinx.normalize_intersphinx_mapping\fP to \fBsphinx.ext.intersphinx.validate_intersphinx_mapping\fP\&. The old name will be removed in Sphinx 10. Patch by Adam Turner. .IP \(bu 2 #12650, #12686, #12690: Extend the deprecation for string methods on \fBPath\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:pathlib\:.html#\:pathlib\:.Path> objects to Sphinx 9. Use \fBos.fspath()\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.fspath> to convert \fBPath\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:pathlib\:.html#\:pathlib\:.Path> objects to strings, or \fBPath\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:pathlib\:.html#\:pathlib\:.Path>\(aqs methods to work with path objects. Patch by Adam Turner. .UNINDENT .SS Sphinx 7.4 .SS Release 7.4.7 (released Jul 20, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12096: Warn when files are overwritten in the build directory. Patch by Adam Turner and Bénédikt Tran. .IP \(bu 2 #12620: Ensure that old\-style object description options are respected. Patch by Adam Turner. .IP \(bu 2 #12601, #12625: Support callable objects in \fBAnnotated\fP type metadata in the Python domain. Patch by Adam Turner. .IP \(bu 2 #12601, #12622: Resolve \fBAnnotated\fP warnings with \fBsphinx.ext.autodoc\fP, especially when using \fBdataclasses\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:dataclasses\:.html#\:module-dataclasses> as type metadata. Patch by Adam Turner. .IP \(bu 2 #12589, #12626: autosummary: Fix warnings with \fBautolink\fP\&. Patch by Adam Turner. .UNINDENT .SS Release 7.4.6 (released Jul 18, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12589, #9743, #12609: autosummary: Do not add the package prefix when generating autosummary directives for modules within a package. Patch by Adam Turner. .IP \(bu 2 #12613: Reduce log severity for ambiguity detection during inventory loading. Patch by James Addison. .UNINDENT .SS Release 7.4.5 (released Jul 16, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12593, #12600: Revert coercing the type of selected \fBhtml_sidebars\fP \%<#\:confval-html_sidebars> values to a list. Log an error message when string values are detected. Patch by Adam Turner. .IP \(bu 2 #12594: LaTeX: since 7.4.0, \fBseealso\fP \%<#\:directive-seealso> and other \(dqlight\(dq admonitions now break PDF builds if they contain a figure \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:figure> directive; and also if they are contained in a table cell (rendered by \fBtabulary\fP). Patch by Jean\-François B. .UNINDENT .SS Release 7.4.4 (released Jul 15, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12585, #12586: Do not warn when an intersphinx inventory contains case\-insensitively ambiguous duplicate items. Patch by James Addison. .UNINDENT .SS Release 7.4.3 (released Jul 15, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12582: Restore support for list\-styled \fBsource_suffix\fP \%<#\:confval-source_suffix> values with extensions that register parsers. Patch by Adam Turner. .UNINDENT .SS Release 7.4.2 (released Jul 15, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12580, #12583: Resolve failures with the C domain on incremental builds with Sphinx 7.3.7 and earlier. Patch by Adam Turner. .UNINDENT .SS Release 7.4.1 (released Jul 15, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Fix invalid HTML when a rubric node with invalid \fBheading\-level\fP is used. Patch by Adam Turner. .IP \(bu 2 #12579, #12581: Restore support for \fBtyping.ParamSpec\fP in autodoc. Patch by Adam Turner. .UNINDENT .SS Release 7.4.0 (released Jul 15, 2024) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #12555: Drop Docutils 0.18.1 and Docutils 0.19 support. Patch by Adam Turner. .IP \(bu 2 LaTeX: the \fBxcolor\fP package is now required (but is for example part of Ubuntu \fBtexlive\-latex\-recommended\fP which has always been required). .IP \(bu 2 LaTeX: the \fBfontawesome5\fP LaTeX package is needed for the default choices of icons now used in admonition titles in PDF output; but if unavailable the PDF build will simply silently omit rendering such icons. Check the documentation of the \fBiconpackage\fP key of \(aqsphinxsetup\(aq \%<#\:latexsphinxsetup> for more. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 LaTeX: the \fBsphinxlightbox\fP environment is not used anymore, all types of admonitions use (by default) only \fBsphinxheavybox\fP\&. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #11165: Support the officially recommended \%<https://\:jinja\:.palletsprojects\:.com/\:en/\:latest/\:templates/#\:template-file-extension> \fB\&.jinja\fP suffix for template files. Patch by James Addison and Adam Turner .IP \(bu 2 #12325: Flatten \fBUnion[Literal[T], Literal[U], ...]\fP to \fBLiteral[T, U, ...]\fP when turning annotations into strings. Patch by Adam Turner. .IP \(bu 2 #12319: \fBsphinx.ext.extlinks\fP: Add \fBextlink\-{name}\fP CSS class to links. Patch by Hugo van Kemenade. .IP \(bu 2 #12387: Improve CLI progress message, when copying assets. Patch by INADA Nakoi and Bénédikt Tran. .IP \(bu 2 #12361: Add \fBBuildEnvironment.parser\fP \%<#\:sphinx\:.environment\:.BuildEnvironment\:.parser>\&. Patch by Chris Sewell. .IP \(bu 2 #12358: Add \fBSphinx.fresh_env_used\fP \%<#\:sphinx\:.application\:.Sphinx\:.fresh_env_used>\&. Patch by Chris Sewell. .IP \(bu 2 #12329: Add detection of ambiguous \fBstd:label\fP and \fBstd:term\fP references during loading and resolution of Intersphinx targets. Patch by James Addison. .IP \(bu 2 #12422: Do not duplicate \(dqnavigation\(dq in aria\-label of built\-in themes. Patch by Thomas Weißschuh .IP \(bu 2 #12421: Include project name in \fBlogo_alt\fP of built\-in themes. Patch by Thomas Weißschuh .IP \(bu 2 #12448: Add \fBsphinx\-apidoc \-\-remove\-old\fP \%<#\:cmdoption-sphinx-apidoc-remove-old> option. Patch by Chris Sewell. .IP \(bu 2 #12456: Add \fBsphinx\-autogen \-\-remove\-old\fP \%<#\:cmdoption-sphinx-autogen-remove-old> option. Patch by Chris Sewell. .IP \(bu 2 #12479: Add warning subtype \fBtoc.no_title\fP\&. Patch by Ondřej Navrátil. .IP \(bu 2 #12492: Add helper methods for parsing reStructuredText content into nodes from within a directive. .INDENT 2.0 .IP \(bu 2 \fBparse_content_to_nodes()\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxDirective\:.parse_content_to_nodes> parses the directive\(aqs content and returns a list of Docutils nodes. .IP \(bu 2 \fBparse_text_to_nodes()\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxDirective\:.parse_text_to_nodes> parses the provided text and returns a list of Docutils nodes. .IP \(bu 2 \fBparse_inline()\fP \%<#\:sphinx\:.util\:.docutils\:.SphinxDirective\:.parse_inline> parses the provided text into inline elements and text nodes. .UNINDENT .sp Patch by Adam Turner. .IP \(bu 2 #12258: Support \fBtyping_extensions.Unpack\fP Patch by Bénédikt Tran and Adam Turner. .IP \(bu 2 #12524: Add a \fBclass\fP option to the \fBtoctree\fP \%<#\:directive-toctree> directive. Patch by Tim Hoffmann. .IP \(bu 2 #12536: Add the \fBconfval\fP \%<#\:directive-confval> directive. Patch by Adam Turner. .IP \(bu 2 #12537: \fBc_id_attributes\fP \%<#\:confval-c_id_attributes>, \fBc_paren_attributes\fP \%<#\:confval-c_paren_attributes>, \fBcpp_id_attributes\fP \%<#\:confval-cpp_id_attributes>, and \fBcpp_paren_attributes\fP \%<#\:confval-cpp_paren_attributes> can now be a tuple of strings. \fBc_extra_keywords\fP \%<#\:confval-c_extra_keywords>, \fBgettext_additional_targets\fP \%<#\:confval-gettext_additional_targets>, \fBhtml_domain_indices\fP \%<#\:confval-html_domain_indices>, \fBlatex_domain_indices\fP \%<#\:confval-latex_domain_indices>, and \fBtexinfo_domain_indices\fP \%<#\:confval-texinfo_domain_indices>, can now be a set of strings. Patch by Adam Turner. .IP \(bu 2 #12523: Added configuration option, \fBmath_numsep\fP \%<#\:confval-math_numsep>, to define the separator for math numbering. Patch by Thomas Fanning .IP \(bu 2 #11592: Add \fBcoverage_modules\fP \%<#\:confval-coverage_modules> to the coverage builder to allow explicitly specifying which modules should be documented. Patch by Stephen Finucane. .IP \(bu 2 #7896, #11989: Add a \fBpy:type\fP \%<#\:directive-py-type> directive for documenting type aliases, and a \fBpy:type\fP \%<#\:role-py-type> role for linking to them. Patch by Ashley Whetter. .IP \(bu 2 #12549: Add optional \fBdescription\fP argument to \fBSphinx.add_config_value()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_config_value>\&. Patch by Chris Sewell. .IP \(bu 2 #6792: Prohibit module import cycles in \fBsphinx.ext.autosummary\fP \%<#\:module-sphinx\:.ext\:.autosummary>\&. Patch by Trevor Bekolay. .IP \(bu 2 #12508: LaTeX: Revamped styling of all admonitions, with addition of a title row with icon. Patch by Jean\-François B. .IP \(bu 2 #11773: Display \fBAnnotated\fP annotations with their metadata in the Python domain. Patch by Adam Turner and David Stansby. .IP \(bu 2 #12506: Add \fBheading\-level\fP option to \fBrubric\fP \%<#\:directive-rubric> directive. Patch by Chris Sewell. .IP \(bu 2 #12567: Add the \fBwrite\-started\fP \%<#\:event-write-started> event. Patch by Chris Sewell. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12314: Properly format \fBcollections.abc.Callable\fP in annotations. Patch by Adam Turner. .IP \(bu 2 #12162: Fix a performance regression in the C domain that has been present since version 3.0.0. Patch by Donald Hunter. .IP \(bu 2 #12320: Fix removal of anchors from search summaries (regression in 7.3.0). Patch by Will Lachance. .IP \(bu 2 #12251: Fix \fBmerge_domaindata()\fP in \fBsphinx.ext.duration\fP\&. Patch by Matthias Geier. .IP \(bu 2 #12224: Properly detect WebP files. Patch by Benjamin Cabé. .IP \(bu 2 #12380: LaTeX: Avoid footnote markers \fBPage N\fP when \fBN\fP is already the current page number. Patch by Jean\-François B. .IP \(bu 2 #12410: LaTeX: for French and \fB\(aqlualatex\(aq\fP as \fBlatex_engine\fP \%<#\:confval-latex_engine> use \fBbabel\fP as with \fB\(aqxelatex\(aq\fP (and not \fBpolyglossia\fP). Patch by Jean\-François B. .IP \(bu 2 #8807, #12520: LaTeX: let \fBtodolist\fP \%<#\:directive-todolist> produce correct hyperlinks in PDF. Patch by Jean\-François B. .IP \(bu 2 #12416: Ensure that configuration setting aliases are always synchronised when one value or the other is modified. Patch by Bénédikt Tran. .IP \(bu 2 #12220: Fix loading custom template translations for \fBen\fP locale. Patch by Nicolas Peugnet. .IP \(bu 2 #12459: Add valid\-type arguments to the \fBlinkcheck_rate_limit_timeout\fP configuration setting. Patch by James Addison. .IP \(bu 2 #12331: Resolve data\-URI\-image\-extraction regression from v7.3.0 affecting builders without native support for data\-URIs in their output format. Patch by James Addison. .IP \(bu 2 #12494: Fix invalid genindex.html file produced with translated docs (regression in 7.1.0). Patch by Nicolas Peugnet. .IP \(bu 2 #11961: Omit anchor references from document title entries in the search index, removing duplication of search results. Patch by James Addison. .IP \(bu 2 #12425: Use Docutils\(aq SVG processing in the HTML builder and remove Sphinx\(aqs custom logic. Patch by Tunç Başar Köse. .IP \(bu 2 #12391: Adjust scoring of matches during HTML search so that document main titles tend to rank higher than subsection titles. In addition, boost matches on the name of programming domain objects relative to title/subtitle matches. Patch by James Addison and Will Lachance. .IP \(bu 2 #9634: Do not add a fallback language by stripping the country code. Patch by Alvin Wong. .IP \(bu 2 #12352: Add domain objects to the table of contents in the same order as defined in the document. Previously, each domain used language\-specific nesting rules, which removed control from document authors. Patch by Jakob Lykke Andersen and Adam Turner. .IP \(bu 2 #11041: linkcheck: Ignore URLs that respond with non\-Unicode content. Patch by James Addison. .IP \(bu 2 #12543: Fix \fBPEP 695\fP \%<https://\:peps\:.python\:.org/\:pep-0695/> formatting for LaTeX output. Patch by Bénédikt Tran. .UNINDENT .SS Testing .INDENT 0.0 .IP \(bu 2 karma: refactor HTML search tests to use fixtures generated by Sphinx. Patch by James Addison. .UNINDENT .SS Sphinx 7.3 .SS Release 7.3.7 (released Apr 19, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12299: Defer loading themes defined via entry points until their explicit use by the user or a child theme. Patch by Adam Turner. .IP \(bu 2 #12305: Return the default value for \fBtheme.get_config()\fP with an unsupported theme configuration section. Patch by Adam Turner. .UNINDENT .SS Release 7.3.6 (released Apr 17, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12295: Re\-export all AST types in the C and C++ domains. Patch by Adam Turner. .IP \(bu 2 #12295: Re\-export various objects from \fBsphinx.domains.python._annotations\fP in \fBsphinx.domains.python\fP\&. Patch by Jacob Chesslo and Adam Turner. .UNINDENT .SS Release 7.3.5 (released Apr 17, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12295: Re\-export various objects from \fBsphinx.domains.python._object\fP in \fBsphinx.domains.python\fP\&. Patch by Jacob Chesslo and Adam Turner. .UNINDENT .SS Release 7.3.4 (released Apr 17, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Handle cases when \fBAny\fP is not an instance of \fBtype\fP\&. Patch by Adam Turner. .UNINDENT .SS Release 7.3.3 (released Apr 17, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #12290: Fix a false\-positive warning when setting a configuration value with \fBAny\fP as the valid type to a type other than the value\(aqs default. Patch by Adam Turner. .UNINDENT .SS Release 7.3.2 (released Apr 17, 2024) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Preload all themes defined via entry points. Patch by Adam Turner. .IP \(bu 2 Fix a bad interaction between the \fB\(aqFuro\(aq\fP theme and the new\-style for configuration values. Patch by Adam Turner. .UNINDENT .SS Release 7.3.1 (released Apr 17, 2024) .SS Dependencies .INDENT 0.0 .IP \(bu 2 Require \fBtomli\fP on Python 3.10 and earlier. Patch by Adam Turner. .UNINDENT .SS Release 7.3.0 (released Apr 16, 2024) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #11858: Increase the minimum supported version of Alabaster to 0.7.14. Patch by Adam Turner. .IP \(bu 2 #12267: Support Docutils 0.21 \%<https://\:docutils\:.sourceforge\:.io/\:RELEASE-NOTES\:.html#\:release-0-21-2024-04-09>\&. Patch by Adam Turner. .IP \(bu 2 #12012: Use \fBtypes\-docutils\fP instead of \fBdocutils\-stubs\fP\&. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 #11693: Support for old\-style \fBMakefile\fP and \fBmake.bat\fP output in \fBsphinx\-quickstart\fP, and the associated options \fB\-M\fP, \fB\-m\fP, \fB\-\-no\-use\-make\-mode\fP, and \fB\-\-use\-make\-mode\fP\&. .IP \(bu 2 #11285: Direct access to \fBsphinx.testing.util.SphinxTestApp._status\fP or \fBsphinx.testing.util.SphinxTestApp._warning\fP is deprecated. Use the public properties \fBsphinx.testing.util.SphinxTestApp.status\fP and \fBsphinx.testing.util.SphinxTestApp.warning\fP instead. Patch by Bénédikt Tran. .IP \(bu 2 tests: \fBsphinx.testing.util.strip_escseq()\fP is deprecated in favour of \fBsphinx.util.console.strip_colors()\fP\&. Patch by Bénédikt Tran. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #12265: Support theme configuration via \fBtheme.toml\fP\&. .IP \(bu 2 #11701: HTML Search: Adopt the new <search> \%<https://\:developer\:.mozilla\:.org/\:en-US/\:docs/\:Web/\:HTML/\:Element/\:search> element. Patch by Bénédikt Tran. .IP \(bu 2 #11776: Add long option names to \fBsphinx\-build\fP\&. Patch by Hugo van Kemenade, Adam Turner, Bénédikt Tran, and Ezio Melotti. .IP \(bu 2 Organise the \fBsphinx\-build\fP options into groups. Patch by Adam Turner. .IP \(bu 2 #11855: Defer computation of configuration values. Patch by Adam Turner. .IP \(bu 2 Add \fB:no\-search:\fP as an alias of the \fB:nosearch:\fP metadata field. Patch by Adam Turner. .IP \(bu 2 #11803: autodoc: Use an overridden \fB__repr__()\fP function in an enum, if defined. Patch by Shengyu Zhang. .IP \(bu 2 #11825: Allow custom targets in the manpage role. Patch by Nicolas Peugnet. .IP \(bu 2 #11892: Improved performance when resolving cross references in the C++ domain. Patch by Rouslan Korneychuk. .IP \(bu 2 #11905: Add a \fBversionremoved\fP \%<#\:directive-versionremoved> directive. Patch by Hugo van Kemenade, Adam Turner, and C.A.M. Gerlach. .IP \(bu 2 #11981: Improve rendering of signatures using \fBslice\fP syntax, e.g., \fBdef foo(arg: np.float64[:,:]) \-> None: ...\fP\&. .IP \(bu 2 The manpage builder now adds OSC 8 \%<https://\:gist\:.github\:.com/\:egmontkob/\:eb114294efbcd5adb1944c9f3cb5feda> anchors to hyperlinks, using the groff \%<https://\:lists\:.gnu\:.org/\:archive/\:html/\:groff/\:2021-10/\:msg00000\:.html> device control command. .IP \(bu 2 #11015: Change the text of the \fBversionadded\fP \%<#\:directive-versionadded> directive from \fBNew in [...]\fP to \fBAdded in [...]\fP\&. Patch by Bénédikt Tran. .IP \(bu 2 #12131: Added \fBshow_warning_types\fP \%<#\:confval-show_warning_types> configuration option. Patch by Chris Sewell. .IP \(bu 2 #12193: Improve \fBexternal\fP warnings for unknown roles. In particular, suggest related role names if an object type is mistakenly used. Patch by Chris Sewell. .IP \(bu 2 Add public type alias \fBsphinx.util.typing.ExtensionMetadata\fP \%<#\:sphinx\:.util\:.typing\:.ExtensionMetadata>\&. This can be used by extension developers to annotate the return type of their \fBsetup\fP function. Patch by Chris Sewell. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11668: Raise a useful error when \fBtheme.conf\fP is missing. Patch by Vinay Sajip. .IP \(bu 2 #11622: Ensure that the order of keys in \fBsearchindex.js\fP is deterministic. Patch by Pietro Albini. .IP \(bu 2 #11617: ANSI control sequences are stripped from the output when writing to a warnings file with \fB\-w\fP \%<#\:cmdoption-sphinx-build-w>\&. Patch by Bénédikt Tran. .IP \(bu 2 #11666: Skip all hidden directories in \fBCatalogRepository.pofiles\fP\&. Patch by Aryaz Eghbali. .IP \(bu 2 #9686: html builder: Fix MathJax lazy loading when equations appear in titles. Patch by Bénédikt Tran. .IP \(bu 2 #11483: singlehtml builder: Fix MathJax lazy loading when the index does not contain any math equations. Patch by Bénédikt Tran. .IP \(bu 2 #11697: HTML Search: add \(aqnoindex\(aq meta robots tag. Patch by James Addison. .IP \(bu 2 #11678: Fix a possible \fBZeroDivisionError\fP in \fBsphinx.ext.coverage\fP\&. Patch by Stephen Finucane. .IP \(bu 2 #11756: LaTeX: build error with recent TeXLive due to missing \fBsubstitutefont\fP package (triggered if using \fBfontenc\fP with \fBT2A\fP option and document language is not a Cyrillic one). Patch by Jean\-François B. .IP \(bu 2 #11675: Fix rendering of progression bars in environments that do not support ANSI control sequences. Patch by Bénédikt Tran. .IP \(bu 2 #11861: Whitelist more types with an incorrect \fB__module__\fP attribute. Patch by Adam Turner. .IP \(bu 2 #11715: Apply \fBtls_verify\fP and \fBtls_cacerts\fP config to \fBImageDownloader\fP\&. Patch by Nick Touran. .IP \(bu 2 Allow hyphens in group names for \fBproductionlist\fP \%<#\:directive-productionlist> cross\-references. Patch by Adam Turner. .IP \(bu 2 #11433: Added the \fBlinkcheck_allow_unauthorized\fP \%<#\:confval-linkcheck_allow_unauthorized> configuration option. Set this option to \fBFalse\fP to report HTTP 401 (unauthorized) server responses as broken. Patch by James Addison. .IP \(bu 2 #11868: linkcheck: added a distinct \fBtimeout\fP reporting status code. This can be enabled by setting \fBlinkcheck_report_timeouts_as_broken\fP \%<#\:confval-linkcheck_report_timeouts_as_broken> to \fBFalse\fP\&. Patch by James Addison. .IP \(bu 2 #11869: Refresh the documentation for the \fBlinkcheck_timeout\fP setting. Patch by James Addison. .IP \(bu 2 #11874: Configure a default 30\-second value for \fBlinkcheck_timeout\fP\&. Patch by James Addison. .IP \(bu 2 #11886: Print the Jinja2 template path chain in \fBTemplateNotFound\fP exceptions. Patch by Colin Marquardt. .IP \(bu 2 #11598: Do not use query components in URLs for assets in EPUB rendering. Patch by David Runge. .IP \(bu 2 #11904: Support unary subtraction when parsing annotations. Patch by James Addison. .IP \(bu 2 #11925: Blacklist the \fBsphinxprettysearchresults\fP extension; the functionality it provides was merged into Sphinx v2.0.0. Patch by James Addison. .IP \(bu 2 #11917: Fix rendering of annotated inherited members for Python 3.9. Patch by Janet Carson. .IP \(bu 2 #11935: C Domain: Fix namespace\-pop context. Patch by Frank Dana. .IP \(bu 2 #11923: Avoid zombie processes when parallel builds fail. Patch by Felix von Drigalski. .IP \(bu 2 #11353: Support enumeration classes inheriting from mixin or data types. Patch by Bénédikt Tran. .IP \(bu 2 #11962: Fix target resolution when using \fB:paramtype:\fP fields. Patch by Bénédikt Tran. .IP \(bu 2 #11944: Use anchor in search preview. Patch by Will Lachance. .IP \(bu 2 #12008: Fix case\-sensitive lookup of \fBstd:label\fP names in intersphinx inventory. Patch by Michael Goerz. .IP \(bu 2 #11958: HTML Search: Fix partial matches overwriting full matches. Patch by William Lachance. .IP \(bu 2 #11959: Fix multiple term matching when word appears in both title and document. Patch by Will Lachance. .IP \(bu 2 #11474: Fix doctrees caching causing files not be rebuilt in some cases, e.g., when \fBnumfig\fP \%<#\:confval-numfig> is \fBTrue\fP\&. Patch by Bénédikt Tran. .IP \(bu 2 #11278: autodoc: Fix rendering of \fBfunctools.singledispatchmethod\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:functools\:.html#\:functools\:.singledispatchmethod> combined with \fB@classmethod\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:functions\:.html#\:classmethod>\&. Patch by Bénédikt Tran. .IP \(bu 2 #11894: Do not add checksums to css files if building using the htmlhelp builder. Patch by reduerK akiM. .IP \(bu 2 #12052: Remove \fB<script>\fP and \fB<style>\fP tags from the content of search result summary snippets. Patch by James Addison. .IP \(bu 2 #11578: HTML Search: Order non\-main index entries after other results. Patch by Brad King. .IP \(bu 2 #12147: autosummary: Fix a bug whereby the wrong file extension may be used, when multiple suffixes are specified in \fBsource_suffix\fP \%<#\:confval-source_suffix>\&. Patch by Sutou Kouhei. .IP \(bu 2 #10786: improve the error message when a file to be copied (e.g., an asset) is removed during Sphinx execution. Patch by Bénédikt Tran. .IP \(bu 2 #12040: HTML Search: Ensure that document titles that are partially\-matched by the user search query are included in search results. Patch by James Addison. .IP \(bu 2 #11970: singlehtml builder: make target URIs to be same\-document references in the sense of \fBRFC 3986, §4.4\fP \%<https://\:datatracker\:.ietf\:.org/\:doc/\:html/\:rfc3986\:.html#\:section-4.4>, e.g., \fBindex.html#foo\fP becomes \fB#foo\fP\&. Patch by Eric Norige. .IP \(bu 2 #12271: Partially revert Docutils\(aq r9562 \%<https://\:sourceforge\:.net/\:p/\:docutils/\:code/\:9562/> to fix EPUB files. Patch by Adam Turner. .IP \(bu 2 #12253: Escape reserved path characters in the remote images post\-transform download cache. Patch by James Addison and Adam Turner. .UNINDENT .SS Testing .INDENT 0.0 .IP \(bu 2 Reorganise tests into directories. Patch by Adam Turner. .IP \(bu 2 Clean up global state in \fBSphinxTestApp\fP\&. Patch by Adam Turner. .IP \(bu 2 #11285: \fBpytest.mark.sphinx()\fP and \fBsphinx.testing.util.SphinxTestApp\fP accept \fIwarningiserror\fP, \fIkeep_going\fP and \fIverbosity\fP as keyword arguments. Patch by Bénédikt Tran. .IP \(bu 2 #11285: \fBsphinx.testing.util.SphinxTestApp\fP \fIstatus\fP and \fIwarning\fP arguments are checked to be \fBio.StringIO\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:io\:.html#\:io\:.StringIO> objects (the public API incorrectly assumed this without checking it). Patch by Bénédikt Tran. .IP \(bu 2 Report the result of \fBtest_run_epubcheck\fP as \fBskipped\fP instead of \fBsuccess\fP when either Java or \fBepubcheck\fP are not available. .IP \(bu 2 Use dynamic allocation of unused port numbers for the test HTTP(S) servers. As a side\-effect, this removes the need for test server lockfiles, meaning that any remaining \fBtests/test\-server.lock\fP files can safely be deleted. .UNINDENT .SS Sphinx 7.2 .SS Release 7.2.6 (released Sep 13, 2023) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11679: Add the \fBSPHINX_AUTODOC_RELOAD_MODULES\fP environment variable, which if set reloads modules when using autodoc with \fBTYPE_CHECKING = True\fP\&. Patch by Matt Wozniski and Adam Turner. .IP \(bu 2 #11679: Use \fBimportlib.reload()\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:importlib\:.html#\:importlib\:.reload> to reload modules in autodoc. Patch by Matt Wozniski and Adam Turner. .UNINDENT .SS Release 7.2.5 (released Aug 30, 2023) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11645: Fix a regression preventing autodoc from importing modules within packages that make use of \fBif typing.TYPE_CHECKING:\fP to guard circular imports needed by type checkers. Patch by Matt Wozniski. .IP \(bu 2 #11634: Fixed inheritance diagram relative link resolution for sibling files in a subdirectory. Patch by Albert Shih. .IP \(bu 2 #11659: Allow \fB?config=...\fP in \fBmathjax_path\fP \%<#\:confval-mathjax_path>\&. .IP \(bu 2 #11654: autodoc: Fail with a more descriptive error message when an object claims to be an instance of \fBtype\fP, but is not a class. Patch by James Braza. .IP \(bu 2 11620: Cease emitting \fBsource\-read\fP \%<#\:event-source-read> events for files read via the include \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:include> directive. .IP \(bu 2 11620: Add a new \fBinclude\-read\fP \%<#\:event-include-read> for observing and transforming the content of included files via the include \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:include> directive. .IP \(bu 2 #11627: Restore support for copyright lines of the form \fBYYYY\fP when \fBSOURCE_DATE_EPOCH\fP is set. .UNINDENT .SS Release 7.2.4 (released Aug 28, 2023) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11618: Fix a regression in the MoveModuleTargets transform, introduced in #10478 (#9662). .IP \(bu 2 #11649: linkcheck: Resolve hanging tests for timezones west of London and incorrect conversion from UTC to offsets from the UNIX epoch. Patch by Dmitry Shachnev and Adam Turner. .UNINDENT .SS Release 7.2.3 (released Aug 23, 2023) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #11576: Require sphinxcontrib\-serializinghtml 1.1.9. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Fix regression in \fBautodoc.Documenter.parse_name()\fP\&. .IP \(bu 2 Fix regression in JSON serialisation. .IP \(bu 2 #11543: autodoc: Support positional\-only parameters in \fBclassmethod\fP methods when \fBautodoc_preserve_defaults\fP is \fBTrue\fP\&. .IP \(bu 2 Restore support string methods on path objects. This is deprecated and will be removed in Sphinx 8. Use \fBos.fspath()\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:os\:.html#\:os\:.fspath> to convert \fBPath\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:pathlib\:.html#\:pathlib\:.Path> objects to strings, or \fBPath\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:pathlib\:.html#\:pathlib\:.Path>\(aqs methods to work with path objects. .UNINDENT .SS Release 7.2.2 (released Aug 17, 2023) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Fix the signature of the \fBStateMachine.insert_input()\fP patch, for when calling with keyword arguments. .IP \(bu 2 Fixed membership testing (\fBin\fP) for the \fBstr\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> interface of the asset classes (\fB_CascadingStyleSheet\fP and \fB_JavaScript\fP), which several extensions relied upon. .IP \(bu 2 Fixed a type error in \fBSingleFileHTMLBuilder._get_local_toctree\fP, \fBincludehidden\fP may be passed as a string or a boolean. .IP \(bu 2 Fix \fB:noindex:\fP for \fBPyModule\fP and \fBJSModule\fP\&. .UNINDENT .SS Release 7.2.1 (released Aug 17, 2023) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Restored the the \fBstr\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:stdtypes\:.html#\:str> interface of the asset classes (\fB_CascadingStyleSheet\fP and \fB_JavaScript\fP), which several extensions relied upon. This will be removed in Sphinx 9. .IP \(bu 2 Restored calls to \fBBuilder.add_{css,js}_file()\fP, which several extensions relied upon. .IP \(bu 2 Restored the private API \fBTocTree.get_toctree_ancestors()\fP, which several extensions relied upon. .UNINDENT .SS Release 7.2.0 (released Aug 17, 2023) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #11511: Drop Python 3.8 support. .IP \(bu 2 #11576: Require Pygments 2.14 or later. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 #11512: Deprecate \fBsphinx.util.md5\fP and \fBsphinx.util.sha1\fP\&. Use \fBhashlib\fP instead. .IP \(bu 2 #11526: Deprecate \fBsphinx.testing.path\fP\&. Use \fBos.path\fP or \fBpathlib\fP instead. .IP \(bu 2 #11528: Deprecate \fBsphinx.util.split_index_msg\fP and \fBsphinx.util.split_into\fP\&. Use \fBsphinx.util.index_entries.split_index_msg\fP instead. .IP \(bu 2 Deprecate \fBsphinx.builders.html.Stylesheet\fP and \fBsphinx.builders.html.Javascript\fP\&. Use \fBsphinx.application.Sphinx.add_css_file()\fP and \fBsphinx.application.Sphinx.add_js_file()\fP instead. .IP \(bu 2 #11582: Deprecate \fBsphinx.builders.html.StandaloneHTMLBuilder.css_files\fP and \fBsphinx.builders.html.StandaloneHTMLBuilder.script_files\fP\&. Use \fBsphinx.application.Sphinx.add_css_file()\fP and \fBsphinx.application.Sphinx.add_js_file()\fP instead. .IP \(bu 2 #11459: Deprecate \fBsphinx.ext.autodoc.preserve_defaults.get_function_def()\fP\&. Patch by Bénédikt Tran. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #11526: Support \fBos.PathLike\fP types and \fBpathlib.Path\fP objects in many more places. .IP \(bu 2 #5474: coverage: Print summary statistics tables. Patch by Jorge Leitao. .IP \(bu 2 #6319: viewcode: Add \fBviewcode_line_numbers\fP \%<#\:confval-viewcode_line_numbers> to control whether line numbers are added to rendered source code. Patch by Ben Krikler. .IP \(bu 2 #9662: Add the \fB:no\-typesetting:\fP option to suppress textual output and only create a linkable anchor. Patch by Latosha Maltba. .IP \(bu 2 #11221: C++: Support domain objects in the table of contents. Patch by Rouslan Korneychuk. .IP \(bu 2 #10938: doctest: Add \fBdoctest_show_successes\fP \%<#\:confval-doctest_show_successes> option. Patch by Trey Hunner. .IP \(bu 2 #11533: Add \fB:no\-index:\fP, \fB:no\-index\-entry:\fP, and \fB:no\-contents\-entry:\fP\&. .IP \(bu 2 #11572: Improve \fBdebug\fP logging of reasons why files are detected as out of date. Patch by Eric Larson. .IP \(bu 2 #10678: Emit \fBsource\-read\fP \%<#\:event-source-read> events for files read via the include \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:include> directive. Patch by Halldor Fannar. .IP \(bu 2 #11570: Use short names when using \fBPEP 585\fP \%<https://\:peps\:.python\:.org/\:pep-0585/> built\-in generics. Patch by Riccardo Mori. .IP \(bu 2 #11300: Improve \fBSigElementFallbackTransform\fP fallback logic and signature text elements nodes. See the documentation \%<> for more details. Patch by Bénédikt Tran. .IP \(bu 2 Allow running Sphinx with \fBpython \-m sphinx build ...\fP\&. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11077: graphviz: Fix relative links from within the graph. Patch by Ralf Grubenmann. .IP \(bu 2 #11529: Line Block in LaTeX builder outputs spurious empty token. Patch by Adrian Vollmer. .IP \(bu 2 #11196: autosummary: Summary line extraction failed with \(dqe.g.\(dq .IP \(bu 2 #10614: Fixed a number of bugs in inheritance diagrams that resulted in missing or broken links. Patch by Albert Shih. .IP \(bu 2 #9428: Exclude substitution definitions when running the \fBgettext\fP builder. Patch by Alvin Wong. .IP \(bu 2 #10795: Raise a descriptive error if \fBgraphviz_dot\fP is falsy. .IP \(bu 2 #11546: Translated nodes identical to their original text are now marked with the \fBtranslated=True\fP attribute. .IP \(bu 2 #10049: html: Change \(dqPermalink\(dq to \(dqLink\(dq for title text in link anchors. .IP \(bu 2 #4225: Relax Pygments parsing on lexing failures. .IP \(bu 2 #11246: Allow inline links in the first line of a docstring and one\-line type comments \fB#: :meta ...:\fP when using \fBsphinx.ext.napoleon\fP \%<#\:module-sphinx\:.ext\:.napoleon>\&. Patch by Bénédikt Tran. .IP \(bu 2 #10930: Highlight all search terms on the search results page. Patch by Dmitry Shachnev. .IP \(bu 2 #11473: Type annotations containing \fBLiteral\fP \%<https://\:docs\:.python\:.org/\:3/\:library/\:typing\:.html#\:typing\:.Literal> enumeration values now render correctly. Patch by Bénédikt Tran. .IP \(bu 2 #11591: Fix support for C coverage in \fBsphinx.ext.coverage\fP extension. Patch by Stephen Finucane. .IP \(bu 2 #11594: HTML Theme: Enhancements to horizontal scrolling on smaller devices in the \fBagogo\fP theme. Patch by Lukas Engelter. .IP \(bu 2 #11459: Fix support for async and lambda functions in \fBsphinx.ext.autodoc.preserve_defaults\fP\&. Patch by Bénédikt Tran. .UNINDENT .SS Testing .INDENT 0.0 .IP \(bu 2 #11577: pytest: Fail tests on \(dqXPASS\(dq. .IP \(bu 2 #11577: pytest: Use \(dqimportlib\(dq import mode. .IP \(bu 2 #11577: pytest: Set PYTHONWARNINGS=error. .IP \(bu 2 #11577: pytest: Set strict config and strict markers. .UNINDENT .SS Sphinx 7.1 .SS Release 7.1.2 (released Aug 02, 2023) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11542: linkcheck: Properly respect \fBlinkcheck_anchors\fP \%<#\:confval-linkcheck_anchors> and do not spuriously report failures to validate anchors. Patch by James Addison. .UNINDENT .SS Release 7.1.1 (released Jul 27, 2023) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11514: Fix \fBSOURCE_DATE_EPOCH\fP in multi\-line copyright footer. Patch by Bénédikt Tran. .UNINDENT .SS Release 7.1.0 (released Jul 24, 2023) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Releases are no longer signed, given the change in PyPI policy \%<https://\:blog\:.pypi\:.org/\:posts/\:2023-05-23-removing-pgp/>\&. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 #11412: Emit warnings on using a deprecated Python\-specific index entry type (namely, \fBmodule\fP, \fBkeyword\fP, \fBoperator\fP, \fBobject\fP, \fBexception\fP, \fBstatement\fP, and \fBbuiltin\fP) in the \fBindex\fP \%<#\:directive-index> directive, and set the removal version to Sphinx 9. Patch by Adam Turner. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #11415: Add a checksum to JavaScript and CSS asset URIs included within generated HTML, using the CRC32 algorithm. .IP \(bu 2 \fBrequire_sphinx()\fP \%<#\:sphinx\:.application\:.Sphinx\:.require_sphinx> now allows the version requirement to be specified as \fB(major, minor)\fP\&. .IP \(bu 2 #11011: Allow configuring a line\-length limit for object signatures, via \fBmaximum_signature_line_length\fP \%<#\:confval-maximum_signature_line_length> and the domain\-specific variants. If the length of the signature (in characters) is greater than the configured limit, each parameter in the signature will be split to its own logical line. This behaviour may also be controlled by options on object description directives, for example \fBpy:function:single\-line\-parameter\-list\fP \%<#\:directive-option-py-function-single-line-parameter-list>\&. Patch by Thomas Louf, Adam Turner, and Jean\-François B. .IP \(bu 2 #10983: Support for multiline copyright statements in the footer block. Patch by Stefanie Molin .IP \(bu 2 \fBsphinx.util.display.status_iterator\fP now clears the current line with ANSI control codes, rather than overprinting with space characters. .IP \(bu 2 #11431: linkcheck: Treat SSL failures as broken links. Patch by James Addison. .IP \(bu 2 #11157: Keep the \fBtranslated\fP attribute on translated nodes. .IP \(bu 2 #11451: Improve the traceback displayed when using \fBsphinx\-build \-T\fP \%<#\:cmdoption-sphinx-build-T> in parallel builds. Patch by Bénédikt Tran .IP \(bu 2 #11324: linkcheck: Use session\-basd HTTP requests. .IP \(bu 2 #11438: Add support for the \fBpy:class\fP \%<#\:directive-py-class> and \fBpy:function\fP \%<#\:directive-py-function> directives for PEP 695 (generic classes and functions declarations) and PEP 696 (default type parameters). Multi\-line support (#11011) is enabled for type parameters list and can be locally controlled on object description directives, e.g., \fBpy:function:single\-line\-type\-parameter\-list\fP \%<#\:directive-option-py-function-single-line-type-parameter-list>\&. Patch by Bénédikt Tran. .IP \(bu 2 #11484: linkcheck: Allow HTML anchors to be ignored on a per\-URL basis via \fBlinkcheck_anchors_ignore_for_url\fP \%<#\:confval-linkcheck_anchors_ignore_for_url> while still checking the validity of the page itself. Patch by Bénédikt Tran .IP \(bu 2 #1246: Add translation progress statistics and inspection support, via a new substitution (\fB|translation progress|\fP) and a new configuration variable (\fBtranslation_progress_classes\fP \%<#\:confval-translation_progress_classes>). These enable determining the percentage of translated elements within a document, and the remaining translated and untranslated elements. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Restored the \fBfootnote\-reference\fP class that has been removed in the latest (unreleased) version of Docutils. .IP \(bu 2 #11486: Use \fBRFC 8081\fP \%<https://\:datatracker\:.ietf\:.org/\:doc/\:html/\:rfc8081\:.html> font file MIME types in the EPUB builder. Using the correct MIME type will prevent warnings from \fBepubcheck\fP and will generate a valid EPUB. .IP \(bu 2 #11435: Use microsecond\-resolution timestamps for outdated file detection in \fBBuildEnvironment.get_outdated_files\fP\&. .IP \(bu 2 #11437: Top\-level headings starting with a reStructuredText role now render properly when \fBrst_prolog\fP \%<#\:confval-rst_prolog> is set. Previously, a file starting with the below would have improperly rendered due to where the prologue text was inserted into the document. .INDENT 2.0 .INDENT 3.5 .sp .EX :mod:\(galobster\(ga \-\- The lobster module ==================================== \&... .EE .UNINDENT .UNINDENT .sp Patch by Bénédikt Tran. .IP \(bu 2 #11337: Fix a \fBMemoryError\fP in \fBsphinx.ext.intersphinx\fP when using \fBNone\fP or \fBtyping.*\fP as inline type references. Patch by Bénédikt Tran (picnixz) .UNINDENT .SS Testing .INDENT 0.0 .IP \(bu 2 #11345: Always delete \fBdocutils.conf\fP in test directories when running \fBSphinxTestApp.cleanup()\fP\&. .UNINDENT .SS Sphinx 7.0 .SS Release 7.0.1 (released May 12, 2023) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #11411: Support Docutils 0.20 \%<https://\:docutils\:.sourceforge\:.io/\:RELEASE-NOTES\:.html#\:release-0-20-2023-05-04>\&. Patch by Adam Turner. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11418: Clean up remaining references to \fBsphinx.setup_command\fP following the removal of support for setuptools. Patch by Willem Mulder. .UNINDENT .SS Release 7.0.0 (released Apr 29, 2023) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #11359: Remove long\-deprecated aliases for \fBMecabSplitter\fP and \fBDefaultSplitter\fP in \fBsphinx.search.ja\fP\&. .IP \(bu 2 #11360: Remove deprecated \fBmake_old_id\fP functions in domain object description classes. .IP \(bu 2 #11363: Remove the Setuptools integration (\fBbuild_sphinx\fP hook in \fBsetup.py\fP). .IP \(bu 2 #11364: Remove deprecated \fBsphinx.ext.napoleon.iterators\fP module. .IP \(bu 2 #11365: Remove support for the \fBjsdump\fP format in \fBsphinx.search\fP\&. .IP \(bu 2 #11366: Make \fBlocale\fP a required argument to \fBsphinx.util.i18n.format_date()\fP\&. .IP \(bu 2 #11370: Remove deprecated \fBsphinx.util.stemmer\fP module. .IP \(bu 2 #11371: Remove deprecated \fBsphinx.pycode.ast.parse()\fP function. .IP \(bu 2 #11372: Remove deprecated \fBsphinx.io.read_doc()\fP function. .IP \(bu 2 #11373: Removed deprecated \fBsphinx.util.get_matching_files()\fP function. .IP \(bu 2 #11378: Remove deprecated \fBsphinx.util.docutils.is_html5_writer_available()\fP function. .IP \(bu 2 #11379: Make the \fBenv\fP argument to \fBBuilder\fP subclasses required. .IP \(bu 2 #11380: autosummary: Always emit grouped import exceptions. .IP \(bu 2 #11381: Remove deprecated \fBstyle\fP key for HTML templates. .IP \(bu 2 #11382: Remove deprecated \fBsphinx.writers.latex.LaTeXTranslator.docclasses\fP attribute. .IP \(bu 2 #11383: Remove deprecated \fBsphinx.builders.html.html5_ready\fP and \fBsphinx.builders.html.HTMLTranslator\fP attributes. .IP \(bu 2 #11385: Remove support for HTML 4 output. .UNINDENT .SS Sphinx 6.2 .SS Release 6.2.1 (released Apr 25, 2023) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11355: Revert the default type of \fBnitpick_ignore\fP \%<#\:confval-nitpick_ignore> and \fBnitpick_ignore_regex\fP \%<#\:confval-nitpick_ignore_regex> to \fBlist\fP\&. .UNINDENT .SS Release 6.2.0 (released Apr 23, 2023) .SS Dependencies .INDENT 0.0 .IP \(bu 2 Require Docutils 0.18.1 or greater. .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 LaTeX: removal of some internal TeX \fB\edimen\fP registers (not previously publicly documented) as per 5.1.0 code comments in \fBsphinx.sty\fP: \fB\esphinxverbatimsep\fP, \fB\esphinxverbatimborder\fP, \fB\esphinxshadowsep\fP, \fB\esphinxshadowsize\fP, and \fB\esphinxshadowrule\fP\&. (refs: #11105) .IP \(bu 2 Remove \fB\&.egg\fP support from pycode \fBModuleAnalyser\fP; Python eggs are a now\-obsolete binary distribution format .IP \(bu 2 #11089: Remove deprecated code in \fBsphinx.builders.linkcheck\fP\&. Patch by Daniel Eades .IP \(bu 2 Remove internal\-only \fBsphinx.locale.setlocale\fP .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 #11247: Deprecate the legacy \fBintersphinx_mapping\fP format .IP \(bu 2 \fBsphinx.util.osutil.cd\fP is deprecated in favour of \fBcontextlib.chdir\fP\&. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #11277: \fBautoproperty\fP \%<#\:directive-autoproperty> allows the return type to be specified as a type comment (e.g., \fB# type: () \-> int\fP). Patch by Bénédikt Tran .IP \(bu 2 #10811: Autosummary: extend \fB__all__\fP to imported members for template rendering when option \fBautosummary_ignore_module_all\fP is set to \fBFalse\fP\&. Patch by Clement Pinard .IP \(bu 2 #11147: Add a \fBcontent_offset\fP parameter to \fBnested_parse_with_titles()\fP, allowing for correct line numbers during nested parsing. Patch by Jeremy Maitin\-Shepard .IP \(bu 2 Update to Unicode CLDR 42 .IP \(bu 2 Add a \fB\-\-jobs\fP synonym for \fB\-j\fP\&. Patch by Hugo van Kemenade .IP \(bu 2 LaTeX: a command \fB\esphinxbox\fP for styling text elements with a (possibly rounded) box, optional background color and shadow, has been added. See The \esphinxbox command \%<#\:sphinxbox>\&. (refs: #11224) .IP \(bu 2 LaTeX: add \fB\esphinxstylenotetitle\fP, ..., \fB\esphinxstylewarningtitle\fP, ..., for an extra layer of mark\-up freeing up \fB\esphinxstrong\fP for other uses. See Macros \%<#\:latex-macros>\&. (refs: #11267) .IP \(bu 2 LaTeX: note \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:note>, hint \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:hint>, important \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:important> and tip \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:tip> can now each be styled as the other admonitions, i.e. possibly with a background color, individual border widths and paddings, possibly rounded corners, and optional shadow. See Additional CSS\-like \(aqsphinxsetup\(aq keys \%<#\:additionalcss>\&. (refs: #11234) .IP \(bu 2 LaTeX: admonitions and topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic> (and contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents>) directives, and not only \fBcode\-block\fP \%<#\:directive-code-block>, support \fBbox\-decoration\-break=slice\fP\&. .IP \(bu 2 LaTeX: let rounded boxes support up to 4 distinct border\-widths (refs: #11243) .IP \(bu 2 LaTeX: new options \fBnoteTextColor\fP, \fBnoteTeXextras\fP et al. See Additional CSS\-like \(aqsphinxsetup\(aq keys \%<#\:additionalcss>\&. .IP \(bu 2 LaTeX: support elliptical corners in rounded boxes. (refs: #11254) .IP \(bu 2 #11150: Include source location in highlighting warnings, when lexing fails. Patch by Jeremy Maitin\-Shepard .IP \(bu 2 #11281: Support for \fBimgmath_latex\fP \%<#\:confval-imgmath_latex> \fB= \(aqtectonic\(aq\fP or \fB= \(aqxelatex\(aq\fP\&. Patch by Dimitar Dimitrov .IP \(bu 2 #11109, #9643: Add \fBpython_display_short_literal_types\fP \%<#\:confval-python_display_short_literal_types> option for condensed rendering of \fBLiteral\fP types. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11079: LaTeX: figures with align attribute may disappear and strangely impact following lists .IP \(bu 2 #11093: LaTeX: fix \(dqmultiply\-defined references\(dq PDF build warnings when one or more reST labels directly precede an \fBpy:module\fP \%<#\:directive-py-module> or \fBautomodule\fP \%<#\:directive-automodule> directive. Patch by Bénédikt Tran (picnixz) .IP \(bu 2 #11110: LaTeX: Figures go missing from latex pdf if their files have the same base name and they use a post transform. Patch by aaron\-cooper .IP \(bu 2 LaTeX: fix potential color leak from shadow to border of rounded boxes, if shadow color is set but border color is not .IP \(bu 2 LaTeX: fix unintended 1pt upwards vertical shift of code blocks frames respective to contents (when using rounded corners) .IP \(bu 2 #11235: LaTeX: added \fB\ecolor\fP in topic (or admonition) contents may cause color leak to the shadow and border at a page break .IP \(bu 2 #11264: LaTeX: missing space before colon after \(dqVoir aussi\(dq for \fBseealso\fP \%<#\:directive-seealso> directive in French .IP \(bu 2 #11268: LaTeX: longtable with left alignment breaks out of current list indentation context in PDF. Thanks to picnixz. .IP \(bu 2 #11274: LaTeX: external links are not properly escaped for \fB\esphinxupquote\fP compatibility .IP \(bu 2 #11147: Fix source file/line number info in object description content and in other uses of \fBnested_parse_with_titles\fP\&. Patch by Jeremy Maitin\-Shepard. .IP \(bu 2 #11192: Restore correct parallel search index building. Patch by Jeremy Maitin\-Shepard .IP \(bu 2 Use the new Transifex \fBtx\fP client .UNINDENT .SS Testing .INDENT 0.0 .IP \(bu 2 Fail testing when any Python warnings are emitted .IP \(bu 2 Migrate remaining \fBunittest.TestCase\fP style test functions to pytest style .IP \(bu 2 Remove tests that rely on setuptools .UNINDENT .SS Sphinx 6.1 .SS Release 6.1.3 (released Jan 10, 2023) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11116: Reverted to previous Sphinx 5 node copying method .IP \(bu 2 #11117: Reverted changes to parallel image processing from Sphinx 6.1.0 .IP \(bu 2 #11119: Suppress \fBValueError\fP in the \fBlinkcheck\fP builder .UNINDENT .SS Release 6.1.2 (released Jan 07, 2023) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11101: LaTeX: \fBdiv.topic_padding\fP key of sphinxsetup documented at 5.1.0 was implemented with name \fBtopic_padding\fP .IP \(bu 2 #11099: LaTeX: \fBshadowrule\fP key of sphinxsetup causes PDF build to crash since Sphinx 5.1.0 .IP \(bu 2 #11096: LaTeX: \fBshadowsize\fP key of sphinxsetup causes PDF build to crash since Sphinx 5.1.0 .IP \(bu 2 #11095: LaTeX: shadow of topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic> and contents \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:table-of-contents> boxes not in page margin since Sphinx 5.1.0 .IP \(bu 2 #11100: Fix copying images when running under parallel mode. .UNINDENT .SS Release 6.1.1 (released Jan 05, 2023) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #11091: Fix \fButil.nodes.apply_source_workaround\fP for \fBliteral_block\fP nodes with no source information in the node or the node\(aqs parents. .UNINDENT .SS Release 6.1.0 (released Jan 05, 2023) .SS Dependencies .INDENT 0.0 .IP \(bu 2 Adopted the Ruff \%<https://\:github\:.com/\:charliermarsh/\:ruff> code linter. .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #10979: gettext: Removed support for pluralisation in \fBget_translation\fP\&. This was unused and complicated other changes to \fBsphinx.locale\fP\&. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 \fBsphinx.util\fP functions: .INDENT 2.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 Renamed \fBsphinx.util.typing.stringify()\fP to \fBsphinx.util.typing.stringify_annotation()\fP .IP \(bu 2 Moved \fBsphinx.util.xmlname_checker()\fP to \fBsphinx.builders.epub3._XML_NAME_PATTERN\fP .UNINDENT .sp Moved to \fBsphinx.util.display\fP: .INDENT 0.0 .IP \(bu 2 \fBsphinx.util.status_iterator\fP .IP \(bu 2 \fBsphinx.util.display_chunk\fP .IP \(bu 2 \fBsphinx.util.SkipProgressMessage\fP .IP \(bu 2 \fBsphinx.util.progress_message\fP .UNINDENT .sp Moved to \fBsphinx.util.http_date\fP: .INDENT 0.0 .IP \(bu 2 \fBsphinx.util.epoch_to_rfc1123\fP .IP \(bu 2 \fBsphinx.util.rfc1123_to_epoch\fP .UNINDENT .sp Moved to \fBsphinx.util.exceptions\fP: .INDENT 0.0 .IP \(bu 2 \fBsphinx.util.save_traceback\fP .IP \(bu 2 \fBsphinx.util.format_exception_cut_frames\fP .UNINDENT .UNINDENT .UNINDENT .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 Cache doctrees in the build environment during the writing phase. .IP \(bu 2 Make all writing phase tasks support parallel execution. .IP \(bu 2 #11072: Use PEP 604 (\fBX | Y\fP) display conventions for \fBtyping.Optional\fP and \fBtyping.Optional\fP types within the Python domain and autodoc. .IP \(bu 2 #10700: autodoc: Document \fBtyping.NewType()\fP types as classes rather than \(aqdata\(aq. .IP \(bu 2 Cache doctrees between the reading and writing phases. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #10962: HTML: Fix the multi\-word key name lookup table. .IP \(bu 2 Fixed support for Python 3.12 alpha 3 (changes in the \fBenum\fP module). .IP \(bu 2 #11069: HTML Theme: Removed outdated \(dqshortcut\(dq link relation keyword. .IP \(bu 2 #10952: Properly terminate parallel processes on programme interruption. .IP \(bu 2 #10988: Speed up \fBTocTree.resolve()\fP through more efficient copying. .IP \(bu 2 #6744: LaTeX: support for seealso directive should be via an environment to allow styling. .IP \(bu 2 #11074: LaTeX: Can\(aqt change sphinxnote to use sphinxheavybox starting with 5.1.0 .UNINDENT .SS Sphinx 6.0 .SS Release 6.0.1 (released Jan 05, 2023) .SS Dependencies .INDENT 0.0 .IP \(bu 2 Require Pygments 2.13 or later. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #10944: imgmath: Fix resolving image paths for files in nested folders. .UNINDENT .SS Release 6.0.0 (released Dec 29, 2022) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #10468: Drop Python 3.6 support .IP \(bu 2 #10470: Drop Python 3.7, Docutils 0.14, Docutils 0.15, Docutils 0.16, and Docutils 0.17 support. Patch by Adam Turner .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #7405: Removed the jQuery and underscore.js JavaScript frameworks. .sp These frameworks are no longer be automatically injected into themes from Sphinx 6.0. If you develop a theme or extension that uses the \fBjQuery\fP, \fB$\fP, or \fB$u\fP global objects, you need to update your JavaScript to modern standards, or use the mitigation below. .sp The first option is to use the sphinxcontrib.jquery \%<https://\:github\:.com/\:sphinx-contrib/\:jquery/> extension, which has been developed by the Sphinx team and contributors. To use this, add \fBsphinxcontrib.jquery\fP to the \fBextensions\fP list in \fBconf.py\fP, or call \fBapp.setup_extension(\(dqsphinxcontrib.jquery\(dq)\fP if you develop a Sphinx theme or extension. .sp The second option is to manually ensure that the frameworks are present. To re\-add jQuery and underscore.js, you will need to copy \fBjquery.js\fP and \fBunderscore.js\fP from the Sphinx repository \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:tree/\:v5\:.3\:.0/\:sphinx/\:themes/\:basic/\:static> to your \fBstatic\fP directory, and add the following to your \fBlayout.html\fP: .INDENT 2.0 .INDENT 3.5 .sp .EX {%\- block scripts %} <script src=\(dq{{ pathto(\(aq_static/jquery.js\(aq, resource=True) }}\(dq></script> <script src=\(dq{{ pathto(\(aq_static/underscore.js\(aq, resource=True) }}\(dq></script> {{ super() }} {%\- endblock %} .EE .UNINDENT .UNINDENT .sp Patch by Adam Turner. .IP \(bu 2 #10471, #10565: Removed deprecated APIs scheduled for removal in Sphinx 6.0. See Deprecated APIs \%<#\:dev-deprecated-apis> for details. Patch by Adam Turner. .IP \(bu 2 #10901: C Domain: Remove support for parsing pre\-v3 style type directives and roles. Also remove associated configuration variables \fBc_allow_pre_v3\fP and \fBc_warn_on_allowed_pre_v3\fP\&. Patch by Adam Turner. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #10924: LaTeX: adopt better looking defaults for tables and code\-blocks. See \fBlatex_table_style\fP \%<#\:confval-latex_table_style> and the \fBpre_border\-radius\fP and \fBpre_background\-TeXcolor\fP Additional CSS\-like \(aqsphinxsetup\(aq keys \%<#\:additionalcss> for the former defaults and how to re\-enact them if desired. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #10984: LaTeX: Document \fBlatex_additional_files\fP \%<#\:confval-latex_additional_files> behavior for files with \fB\&.tex\fP extension. .UNINDENT .SS Sphinx 5.3 .SS Release 5.3.0 (released Oct 16, 2022) .INDENT 0.0 .IP \(bu 2 #10759: LaTeX: add \fBlatex_table_style\fP \%<#\:confval-latex_table_style> and support the \fB\(aqbooktabs\(aq\fP, \fB\(aqborderless\(aq\fP, and \fB\(aqcolorrows\(aq\fP styles. (thanks to Stefan Wiehler for initial pull requests #6666, #6671). Using the \fB\(aqbooktabs\(aq\fP style solves #6740 (Removing LaTeX column borders for automatic colspec). Patch by Jean\-François B. .IP \(bu 2 #10840: One can cross\-reference including an option value like \fB:option:\(ga\-\-module=foobar\(ga\fP, \fB:option:\(ga\-\-module[=foobar]\(ga\fP, or \fB:option:\(ga\-\-module foobar\(ga\fP\&. Patch by Martin Liska. .IP \(bu 2 #10881: autosectionlabel: Record the generated section label to the debug log. .IP \(bu 2 #10268: Correctly URI\-escape image filenames. .IP \(bu 2 #10887: domains: Allow sections in all the content of all object description directives (e.g. \fBpy:function\fP \%<#\:directive-py-function>). Patch by Adam Turner .UNINDENT .SS Sphinx 5.2 .SS Release 5.2.3 (released Sep 30, 2022) .INDENT 0.0 .IP \(bu 2 #10878: Fix base64 image embedding in \fBsphinx.ext.imgmath\fP .IP \(bu 2 #10886: Add \fB:nocontentsentry:\fP flag and global domain table of contents entry control option. Patch by Adam Turner .UNINDENT .SS Release 5.2.2 (released Sep 27, 2022) .INDENT 0.0 .IP \(bu 2 #10872: Restore link targets for autodoc modules to the top of content. Patch by Dominic Davis\-Foster. .UNINDENT .SS Release 5.2.1 (released Sep 25, 2022) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #10861: Always normalise the \fBpycon3\fP lexer to \fBpycon\fP\&. .IP \(bu 2 Fix using \fBsphinx.ext.autosummary\fP with modules containing titles in the module\-level docstring. .UNINDENT .SS Release 5.2.0.post0 (released Sep 24, 2022) .INDENT 0.0 .IP \(bu 2 Recreated source tarballs for Debian maintainers. .UNINDENT .SS Release 5.2.0 (released Sep 24, 2022) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #10356: Sphinx now uses declarative metadata with \fBpyproject.toml\fP to create packages, using PyPA\(aqs \fBflit\fP project as a build backend. Patch by Adam Turner. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 #10843: Support for HTML 4 output. Patch by Adam Turner. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #10738: napoleon: Add support for docstring types using \(aqof\(aq, like \fBtype of type\fP\&. Example: \fBtuple of int\fP\&. .IP \(bu 2 #10286: C++, support requires clauses not just between the template parameter lists and the declaration. .IP \(bu 2 #10755: linkcheck: Check the source URL of raw directives that use the \fBurl\fP option. .IP \(bu 2 #10781: Allow \fBref\fP \%<#\:role-ref> role to be used with definitions and fields. .IP \(bu 2 #10717: HTML Search: Increase priority for full title and subtitle matches in search results .IP \(bu 2 #10718: HTML Search: Save search result score to the HTML element for debugging .IP \(bu 2 #10673: Make toctree accept \(aqgenindex\(aq, \(aqmodindex\(aq and \(aqsearch\(aq docnames .IP \(bu 2 #6316, #10804: Add domain objects to the table of contents. Patch by Adam Turner .IP \(bu 2 #6692: HTML Search: Include explicit \fBindex\fP \%<#\:directive-index> directive index entries in the search index and search results. Patch by Adam Turner .IP \(bu 2 #10816: imgmath: Allow embedding images in HTML as base64 .IP \(bu 2 #10854: HTML Search: Use browser localstorage for highlight control, stop storing highlight parameters in URL query strings. Patch by Adam Turner. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #10723: LaTeX: 5.1.0 has made the \(aqsphinxsetup\(aq \fBverbatimwithframe=false\fP become without effect. .IP \(bu 2 #10257: C++, ensure consistent non\-specialization template argument representation. .IP \(bu 2 #10729: C++, fix parsing of certain non\-type template parameter packs. .IP \(bu 2 #10715: Revert #10520: \(dqFix\(dq use of sidebar classes in \fBagogo.css_t\fP .UNINDENT .SS Sphinx 5.1 .SS Release 5.1.1 (released Jul 26, 2022) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #10701: Fix ValueError in the new \fBdeque\fP based \fBsphinx.ext.napoleon\fP iterator implementation. .IP \(bu 2 #10702: Restore compatibility with third\-party builders. .UNINDENT .SS Release 5.1.0 (released Jul 24, 2022) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #10656: Support Docutils 0.19 \%<https://\:docutils\:.sourceforge\:.io/\:RELEASE-NOTES\:.html#\:release-0-19-2022-07-05>\&. Patch by Adam Turner. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 #10467: Deprecated \fBsphinx.util.stemmer\fP in favour of \fBsnowballstemmer\fP\&. Patch by Adam Turner. .IP \(bu 2 #9856: Deprecated \fBsphinx.ext.napoleon.iterators\fP\&. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #10444: html theme: Allow specifying multiple CSS files through the \fBstylesheet\fP setting in \fBtheme.conf\fP or by setting \fBhtml_style\fP to an iterable of strings. .IP \(bu 2 #10366: std domain: Add support for emphasising placeholders in \fBoption\fP \%<#\:directive-option> directives through a new \fBoption_emphasise_placeholders\fP \%<#\:confval-option_emphasise_placeholders> configuration option. .IP \(bu 2 #10439: std domain: Use the repr of some variables when displaying warnings, making whitespace issues easier to identify. .IP \(bu 2 #10571: quickstart: Reduce content in the generated \fBconf.py\fP file. Patch by Pradyun Gedam. .IP \(bu 2 #10648: LaTeX: CSS\-named\-alike additional \(aqsphinxsetup\(aq \%<#\:latexsphinxsetup> keys allow to configure four separate border\-widths, four paddings, four corner radii, a shadow (possibly inset), colours for border, background, shadow for each of the code\-block, topic, attention, caution, danger, error and warning directives. .IP \(bu 2 #10655: LaTeX: Explain non\-standard encoding in LatinRules.xdy .IP \(bu 2 #10599: HTML Theme: Wrap consecutive footnotes in an \fB<aside>\fP element when using Docutils 0.18 or later, to allow for easier styling. This matches the behaviour introduced in Docutils 0.19. Patch by Adam Turner. .IP \(bu 2 #10518: config: Add \fBinclude_patterns\fP as the opposite of \fBexclude_patterns\fP\&. Patch by Adam Turner. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #10594: HTML Theme: field term colons are doubled if using Docutils 0.18+ .IP \(bu 2 #10596: Build failure if Docutils version is 0.18 (not 0.18.1) due to missing \fBNode.findall()\fP .IP \(bu 2 #10506: LaTeX: build error if highlighting inline code role in figure caption (refs: #10251) .IP \(bu 2 #10634: Make \-P (pdb) option work better with exceptions triggered from events .IP \(bu 2 #10550: py domain: Fix spurious whitespace in unparsing various operators (\fB+\fP, \fB\-\fP, \fB~\fP, and \fB**\fP). Patch by Adam Turner (refs: #10551). .IP \(bu 2 #10460: logging: Always show node source locations as absolute paths. .IP \(bu 2 HTML Search: HTML tags are displayed as a part of object name .IP \(bu 2 HTML Search: search snippets should not be folded .IP \(bu 2 HTML Search: Minor errors are emitted on fetching search snippets .IP \(bu 2 HTML Search: The markers for header links are shown in the search result .IP \(bu 2 #10520: HTML Theme: Fix use of sidebar classes in \fBagogo.css_t\fP\&. .IP \(bu 2 #6679: HTML Theme: Fix inclusion of hidden toctrees in the agogo theme. .IP \(bu 2 #10566: HTML Theme: Fix enable_search_shortcuts does not work .IP \(bu 2 #8686: LaTeX: Text can fall out of code\-block at end of page and leave artifact on next page .IP \(bu 2 #10633: LaTeX: user injected \fB\ecolor\fP commands in topic or admonition boxes may cause color leaks in PDF due to upstream framed.sty \%<https://\:ctan\:.org/\:pkg/\:framed> bug .IP \(bu 2 #10638: LaTeX: framed coloured boxes in highlighted code (e.g. highlighted diffs using Pygments style \fB\(aqmanni\(aq\fP) inherit thickness of code\-block frame .IP \(bu 2 #10647: LaTeX: Only one \fB\elabel\fP is generated for \fBdesc_signature\fP node even if it has multiple node IDs .IP \(bu 2 #10579: i18n: UnboundLocalError is raised on translating raw directive .IP \(bu 2 #9577, #10088: py domain: Fix warning for duplicate Python references when using \fB:any:\fP and autodoc. .IP \(bu 2 #10548: HTML Search: fix minor summary issues. .UNINDENT .SS Sphinx 5.0 .SS Release 5.0.2 (released Jun 17, 2022) .SS Features added .INDENT 0.0 .IP \(bu 2 #10523: HTML Theme: Expose the Docutils\(aqs version info tuple as a template variable, \fBdocutils_version_info\fP\&. Patch by Adam Turner. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #10538: autodoc: Inherited class attribute having docstring is documented even if \fBautodoc_inherit_docstring\fP is disabled .IP \(bu 2 #10509: autosummary: autosummary fails with a shared library .IP \(bu 2 #10497: py domain: Failed to resolve strings in Literal. Patch by Adam Turner. .IP \(bu 2 #10523: HTML Theme: Fix double brackets on citation references in Docutils 0.18+. Patch by Adam Turner. .IP \(bu 2 #10534: Missing CSS for nav.contents in Docutils 0.18+. Patch by Adam Turner. .UNINDENT .SS Release 5.0.1 (released Jun 03, 2022) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #10498: gettext: TypeError is raised when sorting warning messages if a node has no line number. Patch by Adam Turner. .IP \(bu 2 #10493: HTML Theme: topic \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:topic> directive is rendered incorrectly with Docutils 0.18. Patch by Adam Turner. .IP \(bu 2 #10495: IndexError is raised for a \fBkbd\fP \%<#\:role-kbd> role having a separator. Patch by Adam Turner. .UNINDENT .SS Release 5.0.0 (released May 30, 2022) .SS Dependencies .sp 5.0.0 b1 .INDENT 0.0 .IP \(bu 2 #10164: Support Docutils 0.18 \%<https://\:docutils\:.sourceforge\:.io/\:RELEASE-NOTES\:.html#\:release-0-18-2021-10-26>\&. Patch by Adam Turner. .UNINDENT .SS Incompatible changes .sp 5.0.0 b1 .INDENT 0.0 .IP \(bu 2 #10031: autosummary: \fBsphinx.ext.autosummary.import_by_name()\fP now raises \fBImportExceptionGroup\fP instead of \fBImportError\fP when it failed to import target object. Please handle the exception if your extension uses the function to import Python object. As a workaround, you can disable the behavior via \fBgrouped_exception=False\fP keyword argument until v7.0. .IP \(bu 2 #9962: texinfo: Customizing styles of emphasized text via \fB@definfoenclose\fP command was not supported because the command was deprecated since texinfo 6.8 .IP \(bu 2 #2068: \fBintersphinx_disabled_reftypes\fP \%<#\:confval-intersphinx_disabled_reftypes> has changed default value from an empty list to \fB[\(aqstd:doc\(aq]\fP as avoid too surprising silent intersphinx resolutions. To migrate: either add an explicit inventory name to the references intersphinx should resolve, or explicitly set the value of this configuration variable to an empty list. .IP \(bu 2 #10197: html theme: Reduce \fBbody_min_width\fP setting in basic theme to 360px .IP \(bu 2 #9999: LaTeX: separate terms from their definitions by a CR (refs: #9985) .IP \(bu 2 #10062: Change the default language to \fB\(aqen\(aq\fP if any language is not set in \fBconf.py\fP .UNINDENT .sp 5.0.0 final .INDENT 0.0 .IP \(bu 2 #10474: \fBlanguage\fP \%<#\:confval-language> does not accept \fBNone\fP as it value. The default value of \fBlanguage\fP becomes to \fB\(aqen\(aq\fP now. Patch by Adam Turner and Takeshi KOMIYA. .UNINDENT .SS Deprecated .sp 5.0.0 b1 .INDENT 0.0 .IP \(bu 2 #10028: jQuery and underscore.js will no longer be automatically injected into themes from Sphinx 6.0. If you develop a theme or extension that uses the \fBjQuery\fP, \fB$\fP, or \fB$u\fP global objects, you need to update your JavaScript or use the mitigation below. .sp To re\-add jQuery and underscore.js, you will need to copy \fBjquery.js\fP and \fBunderscore.js\fP from the Sphinx repository \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/\:tree/\:v5\:.3\:.0/\:sphinx/\:themes/\:basic/\:static> to your \fBstatic\fP directory, and add the following to your \fBlayout.html\fP: .INDENT 2.0 .INDENT 3.5 .sp .EX {%\- block scripts %} <script src=\(dq{{ pathto(\(aq_static/jquery.js\(aq, resource=True) }}\(dq></script> <script src=\(dq{{ pathto(\(aq_static/underscore.js\(aq, resource=True) }}\(dq></script> {{ super() }} {%\- endblock %} .EE .UNINDENT .UNINDENT .sp Patch by Adam Turner. .IP \(bu 2 setuptools integration. The \fBbuild_sphinx\fP sub\-command for setup.py is marked as deprecated to follow the policy of setuptools team. .IP \(bu 2 The \fBlocale\fP argument of \fBsphinx.util.i18n:babel_format_date()\fP becomes required .IP \(bu 2 The \fBlanguage\fP argument of \fBsphinx.util.i18n:format_date()\fP becomes required .IP \(bu 2 \fBsphinx.builders.html.html5_ready\fP .IP \(bu 2 \fBsphinx.io.read_doc()\fP .IP \(bu 2 \fBsphinx.util.docutils.__version_info__\fP .IP \(bu 2 \fBsphinx.util.docutils.is_html5_writer_available()\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXWriter.docclasses\fP .UNINDENT .SS Features added .sp 5.0.0 b1 .INDENT 0.0 .IP \(bu 2 #9075: autodoc: The default value of \fBautodoc_typehints_format\fP \%<#\:confval-autodoc_typehints_format> is changed to \fB\(aqsmart\(aq\fP\&. It will suppress the leading module names of typehints (ex. \fBio.StringIO\fP \-> \fBStringIO\fP). .IP \(bu 2 #8417: autodoc: \fB:inherited\-members:\fP option now takes multiple classes. It allows to suppress inherited members of several classes on the module at once by specifying the option to \fBautomodule\fP \%<#\:directive-automodule> directive .IP \(bu 2 #9792: autodoc: Add new option for \fBautodoc_typehints_description_target\fP to include undocumented return values but not undocumented parameters. .IP \(bu 2 #10285: autodoc: singledispatch functions having typehints are not documented .IP \(bu 2 autodoc: \fBautodoc_typehints_format\fP \%<#\:confval-autodoc_typehints_format> now also applies to attributes, data, properties, and type variable bounds. .IP \(bu 2 #10258: autosummary: Recognize a documented attribute of a module as non\-imported .IP \(bu 2 #10028: Removed internal usages of JavaScript frameworks (jQuery and underscore.js) and modernised \fBdoctools.js\fP and \fBsearchtools.js\fP to EMCAScript 2018. Patch by Adam Turner. .IP \(bu 2 #10302: C++, add support for conditional expressions (\fB?:\fP). .IP \(bu 2 #5157, #10251: Inline code is able to be highlighted via role \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:role> directive .IP \(bu 2 #10337: Make sphinx\-build faster by caching Publisher object during build. Patch by Adam Turner. .UNINDENT .SS Bugs fixed .sp 5.0.0 b1 .INDENT 0.0 .IP \(bu 2 #10200: apidoc: Duplicated submodules are shown for modules having both .pyx and .so files. Patch by Adam Turner and Takeshi KOMIYA. .IP \(bu 2 #10279: autodoc: Default values for keyword only arguments in overloaded functions are rendered as a string literal .IP \(bu 2 #10280: autodoc: \fBautodoc_docstring_signature\fP \%<#\:confval-autodoc_docstring_signature> unexpectedly generates return value typehint for constructors if docstring has multiple signatures .IP \(bu 2 #10266: autodoc: \fBautodoc_preserve_defaults\fP \%<#\:confval-autodoc_preserve_defaults> does not work for mixture of keyword only arguments with/without defaults .IP \(bu 2 #10310: autodoc: class methods are not documented when decorated with mocked function .IP \(bu 2 #10305: autodoc: Failed to extract optional forward\-ref\(aqed typehints correctly via \fBautodoc_type_aliases\fP \%<#\:confval-autodoc_type_aliases> .IP \(bu 2 #10421: autodoc: \fBautodoc_preserve_defaults\fP \%<#\:confval-autodoc_preserve_defaults> doesn\(aqt work on class methods .IP \(bu 2 #10214: html: invalid language tag was generated if \fBlanguage\fP \%<#\:confval-language> contains a country code (ex. zh_CN) .IP \(bu 2 #9974: html: Updated jQuery version from 3.5.1 to 3.6.0 .IP \(bu 2 #10236: html search: objects are duplicated in search result .IP \(bu 2 #9962: texinfo: Deprecation message for \fB@definfoenclose\fP command on building texinfo document .IP \(bu 2 #10000: LaTeX: glossary terms with common definition are rendered with too much vertical whitespace .IP \(bu 2 #10188: LaTeX: alternating multiply referred footnotes produce a \fB?\fP in pdf output .IP \(bu 2 #10363: LaTeX: make \fB\(aqhowto\(aq\fP title page rule use \fB\elinewidth\fP for compatibility with usage of a \fBtwocolumn\fP class option .IP \(bu 2 #10318: \fB:prepend:\fP option of \fBliteralinclude\fP \%<#\:directive-literalinclude> directive does not work with \fB:dedent:\fP option .UNINDENT .sp 5.0.0 final .INDENT 0.0 .IP \(bu 2 #9575: autodoc: The annotation of return value should not be shown when \fBautodoc_typehints=\(dqdescription\(dq\fP .IP \(bu 2 #9648: autodoc: \fB*args\fP and \fB**kwargs\fP entries are duplicated when \fBautodoc_typehints=\(dqdescription\(dq\fP .IP \(bu 2 #8180: autodoc: Docstring metadata ignored for attributes .IP \(bu 2 #10443: epub: EPUB builder can\(aqt detect the mimetype of .webp file .IP \(bu 2 #10104: gettext: Duplicated locations are shown if 3rd party extension does not provide correct information .IP \(bu 2 #10456: py domain: \fB:meta:\fP fields are displayed if docstring contains two or more meta\-field .IP \(bu 2 #9096: sphinx\-build: the value of progress bar for parallel build is wrong .IP \(bu 2 #10110: sphinx\-build: exit code is not changed when error is raised on builder\-finished event .UNINDENT .SS Sphinx 4.5 .SS Release 4.5.0 (released Mar 28, 2022) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #10112: extlinks: Disable hardcoded links detector by default .IP \(bu 2 #9993, #10177: std domain: Disallow to refer an inline target via \fBref\fP \%<#\:role-ref> role .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 \fBsphinx.ext.napoleon.docstring.GoogleDocstring._qualify_name()\fP .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #10260: Enable \fBFORCE_COLOR\fP and \fBNO_COLOR\fP for terminal colouring .IP \(bu 2 #10234: autosummary: Add \(dqautosummary\(dq CSS class to summary tables .IP \(bu 2 #10125: extlinks: Improve suggestion message for a reference having title .IP \(bu 2 #10112: extlinks: Add \fBextlinks_detect_hardcoded_links\fP \%<#\:confval-extlinks_detect_hardcoded_links> to enable hardcoded links detector feature .IP \(bu 2 #9494, #9456: html search: Add a config variable \fBhtml_show_search_summary\fP \%<#\:confval-html_show_search_summary> to enable/disable the search summaries .IP \(bu 2 #9337: HTML theme, add option \fBenable_search_shortcuts\fP that enables \fB/\fP as a Quick search shortcut and \fBEsc\fP shortcut that removes search highlighting. .IP \(bu 2 #10107: i18n: Allow to suppress translation warnings by adding \fB#noqa\fP comment to the tail of each translation message .IP \(bu 2 #10252: C++, support attributes on classes, unions, and enums. .IP \(bu 2 #10253: \fBpep\fP \%<#\:role-pep> role now generates URLs based on peps.python.org \%<https://\:peps\:.python\:.org> .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9876: autodoc: Failed to document an imported class that is built from native binary module .IP \(bu 2 #10133: autodoc: Crashed when mocked module is used for type annotation .IP \(bu 2 #10146: autodoc: \fBautodoc_default_options\fP \%<#\:confval-autodoc_default_options> does not support \fBno\-value\fP option .IP \(bu 2 #9971: autodoc: TypeError is raised when the target object is annotated by unhashable object .IP \(bu 2 #10205: extlinks: Failed to compile regexp on checking hardcoded links .IP \(bu 2 #10277: html search: Could not search short words (ex. \(dquse\(dq) .IP \(bu 2 #9529: LaTeX: named auto numbered footnote (ex. \fB[#named]\fP) that is referred multiple times was rendered to a question mark .IP \(bu 2 #9924: LaTeX: multi\-line \fBcpp:function\fP \%<#\:directive-cpp-function> directive has big vertical spacing in Latexpdf .IP \(bu 2 #10158: LaTeX: excessive whitespace since v4.4.0 for undocumented variables/structure members .IP \(bu 2 #10175: LaTeX: named footnote reference is linked to an incorrect footnote if the name is also used in the different document .IP \(bu 2 #10269: manpage: Failed to resolve the title of \fBref\fP \%<#\:role-ref> cross references .IP \(bu 2 #10179: i18n: suppress \(dqrST localization\(dq warning .IP \(bu 2 #10118: imgconverter: Unnecessary availability check is called for remote URIs .IP \(bu 2 #10181: napoleon: attributes are displayed like class attributes for google style docstrings when \fBnapoleon_use_ivar\fP \%<#\:confval-napoleon_use_ivar> is enabled .IP \(bu 2 #10122: sphinx\-build: make.bat does not check the installation of sphinx\-build command before showing help .UNINDENT .SS Sphinx 4.4 .SS Release 4.4.0 (released Jan 17, 2022) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #10007: Use \fBimportlib_metadata\fP for python\-3.9 or older .IP \(bu 2 #10007: Drop \fBsetuptools\fP .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #9075: autodoc: Add a config variable \fBautodoc_typehints_format\fP \%<#\:confval-autodoc_typehints_format> to suppress the leading module names of typehints of function signatures (ex. \fBio.StringIO\fP \-> \fBStringIO\fP) .IP \(bu 2 #9831: Autosummary now documents only the members specified in a module\(aqs \fB__all__\fP attribute if \fBautosummary_ignore_module_all\fP \%<#\:confval-autosummary_ignore_module_all> is set to \fBFalse\fP\&. The default behaviour is unchanged. Autogen also now supports this behavior with the \fB\-\-respect\-module\-all\fP switch. .IP \(bu 2 #9555: autosummary: Improve error messages on failure to load target object .IP \(bu 2 #9800: extlinks: Emit warning if a hardcoded link is replaceable by an extlink, suggesting a replacement. .IP \(bu 2 #9961: html: Support nested <kbd> HTML elements in other HTML builders .IP \(bu 2 #10013: html: Allow to change the loading method of JS via \fBloading_method\fP parameter for \fBSphinx.add_js_file()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_js_file> .IP \(bu 2 #9551: html search: \(dqHide Search Matches\(dq link removes \(dqhighlight\(dq parameter from URL .IP \(bu 2 #9815: html theme: Wrap sidebar components in div to allow customizing their layout via CSS .IP \(bu 2 #9827: i18n: Sort items in glossary by translated terms .IP \(bu 2 #9899: py domain: Allows to specify cross\-reference specifier (\fB\&.\fP and \fB~\fP) as \fB:type:\fP option .IP \(bu 2 #9894: linkcheck: add option \fBlinkcheck_exclude_documents\fP to disable link checking in matched documents. .IP \(bu 2 #9793: sphinx\-build: Allow to use the parallel build feature in macOS on macOS and Python3.8+ .IP \(bu 2 #10055: sphinx\-build: Create directories when \fB\-w\fP option given .IP \(bu 2 #9993: std domain: Allow to refer an inline target (ex. \fB_\(gatarget name\(ga\fP) via \fBref\fP \%<#\:role-ref> role .IP \(bu 2 #9981: std domain: Strip value part of the option directive from general index .IP \(bu 2 #9391: texinfo: improve variable in \fBsamp\fP role .IP \(bu 2 #9578: texinfo: Add \fBtexinfo_cross_references\fP \%<#\:confval-texinfo_cross_references> to disable cross references for readability with standalone readers .IP \(bu 2 #9822, #9062: add new Intersphinx role \fBexternal\fP \%<#\:role-external> for explicit lookup in the external projects, without resolving to the local project. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9866: autodoc: doccomment for the imported class was ignored .IP \(bu 2 #9883: autodoc: doccomment for the alias to mocked object was ignored .IP \(bu 2 #9908: autodoc: debug message is shown on building document using NewTypes with Python 3.10 .IP \(bu 2 #9968: autodoc: instance variables are not shown if __init__ method has position\-only\-arguments .IP \(bu 2 #9194: autodoc: types under the \(dqtyping\(dq module are not hyperlinked .IP \(bu 2 #10009: autodoc: Crashes if target object raises an error on getting docstring .IP \(bu 2 #10058: autosummary: Imported members are not shown when \fBautodoc_class_signature = \(aqseparated\(aq\fP .IP \(bu 2 #9947: i18n: topic directive having a bullet list can\(aqt be translatable .IP \(bu 2 #9878: mathjax: MathJax configuration is placed after loading MathJax itself .IP \(bu 2 #9932: napoleon: empty \(dqreturns\(dq section is generated even if no description .IP \(bu 2 #9857: Generated RFC links use outdated base url .IP \(bu 2 #9909: HTML, prevent line\-wrapping in literal text. .IP \(bu 2 #10061: html theme: Configuration values added by themes are not be able to override from conf.py .IP \(bu 2 #10073: imgconverter: Unnecessary availability check is called for \(dqdata\(dq URIs .IP \(bu 2 #9925: LaTeX: prohibit also with \fB\(aqxelatex\(aq\fP line splitting at dashes of inline and parsed literals .IP \(bu 2 #9944: LaTeX: extra vertical whitespace for some nested declarations .IP \(bu 2 #9940: LaTeX: Multi\-function declaration in Python domain has cramped vertical spacing in latexpdf output .IP \(bu 2 #10015: py domain: types under the \(dqtyping\(dq module are not hyperlinked defined at info\-field\-list .IP \(bu 2 #9390: texinfo: Do not emit labels inside footnotes .IP \(bu 2 #9413: xml: Invalid XML was generated when cross referencing python objects .IP \(bu 2 #9979: Error level messages were displayed as warning messages .IP \(bu 2 #10057: Failed to scan documents if the project is placed onto the root directory .IP \(bu 2 #9636: code\-block: \fB:dedent:\fP without argument did strip newlines .UNINDENT .SS Sphinx 4.3 .SS Release 4.3.2 (released Dec 19, 2021) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9917: C and C++, parse fundamental types no matter the order of simple type specifiers. .UNINDENT .SS Release 4.3.1 (released Nov 28, 2021) .SS Features added .INDENT 0.0 .IP \(bu 2 #9864: mathjax: Support changing the loading method of MathJax to \(dqdefer\(dq via \fBmathjax_options\fP \%<#\:confval-mathjax_options> .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9838: autodoc: AttributeError is raised on building document for functions decorated by functools.lru_cache .IP \(bu 2 #9879: autodoc: AttributeError is raised on building document for an object having invalid __doc__ attribute .IP \(bu 2 #9844: autodoc: Failed to process a function wrapped with functools.partial if \fBautodoc_preserve_defaults\fP \%<#\:confval-autodoc_preserve_defaults> enabled .IP \(bu 2 #9872: html: Class namespace collision between autodoc signatures and Docutils 0.17 .IP \(bu 2 #9868: imgmath: Crashed if the dvisvgm command failed to convert equation .IP \(bu 2 #9864: mathjax: Failed to render equations via MathJax v2. The loading method of MathJax is back to \(dqasync\(dq method again .UNINDENT .SS Release 4.3.0 (released Nov 11, 2021) .SS Dependencies .INDENT 0.0 .IP \(bu 2 Support Python 3.10 .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #9649: \fBsearchindex.js\fP: the embedded data has changed format to allow objects with the same name in different domains. .IP \(bu 2 #9672: The rendering of Python domain declarations is implemented with more Docutils nodes to allow better CSS styling. It may break existing styling. .IP \(bu 2 #9672: the signature of \fBdomains.python.PyObject.get_signature_prefix\fP has changed to return a list of nodes instead of a plain string. .IP \(bu 2 #9695: \fBdomains.js.JSObject.display_prefix\fP has been changed into a method \fBget_display_prefix\fP which now returns a list of nodes instead of a plain string. .IP \(bu 2 #9695: The rendering of Javascript domain declarations is implemented with more Docutils nodes to allow better CSS styling. It may break existing styling. .IP \(bu 2 #9450: mathjax: Load MathJax via \(dqdefer\(dq strategy .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 \fBsphinx.ext.autodoc.AttributeDocumenter._datadescriptor\fP .IP \(bu 2 \fBsphinx.writers.html.HTMLTranslator._fieldlist_row_index\fP .IP \(bu 2 \fBsphinx.writers.html.HTMLTranslator._table_row_index\fP .IP \(bu 2 \fBsphinx.writers.html5.HTML5Translator._fieldlist_row_index\fP .IP \(bu 2 \fBsphinx.writers.html5.HTML5Translator._table_row_index\fP .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #9639: autodoc: Support asynchronous generator functions .IP \(bu 2 #9664: autodoc: \fBautodoc\-process\-bases\fP supports to inject reST snippet as a base class .IP \(bu 2 #9691: C, added new info\-field \fBretval\fP for \fBc:function\fP \%<#\:directive-c-function> and \fBc:macro\fP \%<#\:directive-c-macro>\&. .IP \(bu 2 C++, added new info\-field \fBretval\fP for \fBcpp:function\fP \%<#\:directive-cpp-function>\&. .IP \(bu 2 #9618: i18n: Add \fBgettext_allow_fuzzy_translations\fP \%<#\:confval-gettext_allow_fuzzy_translations> to allow \(dqfuzzy\(dq messages for translation .IP \(bu 2 #9672: More CSS classes on Python domain descriptions .IP \(bu 2 #9695: More CSS classes on Javascript domain descriptions .IP \(bu 2 #9683: Revert the removal of \fBadd_stylesheet()\fP API. It will be kept until the Sphinx 6.0 release .IP \(bu 2 #2068, add \fBintersphinx_disabled_reftypes\fP \%<#\:confval-intersphinx_disabled_reftypes> for disabling interphinx resolution of cross\-references that do not have an explicit inventory specification. Specific types of cross\-references can be disabled, e.g., \fBstd:doc\fP or all cross\-references in a specific domain, e.g., \fBstd:*\fP\&. .IP \(bu 2 #9623: Allow to suppress \(dqtoctree contains reference to excluded document\(dq warnings using \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings> .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9630: autodoc: Failed to build cross references if \fBprimary_domain\fP \%<#\:confval-primary_domain> is not \(aqpy\(aq .IP \(bu 2 #9644: autodoc: Crashed on getting source info from problematic object .IP \(bu 2 #9655: autodoc: mocked object having doc comment is warned unexpectedly .IP \(bu 2 #9651: autodoc: return type field is not generated even if \fBautodoc_typehints_description_target\fP \%<#\:confval-autodoc_typehints_description_target> is set to \(dqdocumented\(dq when its info\-field\-list contains \fB:returns:\fP field .IP \(bu 2 #9657: autodoc: The base class for a subclass of mocked object is incorrect .IP \(bu 2 #9607: autodoc: Incorrect base class detection for the subclasses of the generic class .IP \(bu 2 #9755: autodoc: memory addresses are shown for aliases .IP \(bu 2 #9752: autodoc: Failed to detect type annotation for slots attribute .IP \(bu 2 #9756: autodoc: Crashed if classmethod does not have __func__ attribute .IP \(bu 2 #9757: autodoc: \fBautodoc_inherit_docstrings\fP \%<#\:confval-autodoc_inherit_docstrings> does not effect to overridden classmethods .IP \(bu 2 #9781: autodoc: \fBautodoc_preserve_defaults\fP \%<#\:confval-autodoc_preserve_defaults> does not support hexadecimal numeric .IP \(bu 2 #9630: autosummary: Failed to build summary table if \fBprimary_domain\fP \%<#\:confval-primary_domain> is not \(aqpy\(aq .IP \(bu 2 #9670: html: Fix download file with special characters .IP \(bu 2 #9710: html: Wrong styles for even/odd rows in nested tables .IP \(bu 2 #9763: html: parameter name and its type annotation are not separated in HTML .IP \(bu 2 #9649: HTML search: when objects have the same name but in different domains, return all of them as result instead of just one. .IP \(bu 2 #7634: intersphinx: references on the file in sub directory are broken .IP \(bu 2 #9737: LaTeX: hlist is rendered as a list containing \(dqaggedright\(dq text .IP \(bu 2 #9678: linkcheck: file extension was shown twice in warnings .IP \(bu 2 #9697: py domain: An index entry with parens was registered for \fBpy:method\fP directive with \fB:property:\fP option .IP \(bu 2 #9775: py domain: Literal typehint was converted to a cross reference when \fBautodoc_typehints\fP \%<#\:confval-autodoc_typehints>\fB=\(aqdescription\(aq\fP .IP \(bu 2 #9708: needs_extension failed to check double\-digit version correctly .IP \(bu 2 #9688: Fix Sphinx patched code \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:code> does not recognize \fB:class:\fP option .IP \(bu 2 #9733: Fix for logging handler flushing warnings in the middle of the docs build .IP \(bu 2 #9656: Fix warnings without subtype being incorrectly suppressed .IP \(bu 2 Intersphinx, for unresolved references with an explicit inventory, e.g., \fBproj:myFunc\fP, leave the inventory prefix in the unresolved text. .UNINDENT .SS Sphinx 4.2 .SS Release 4.2.0 (released Sep 12, 2021) .SS Features added .INDENT 0.0 .IP \(bu 2 #9445: autodoc: Support class properties .IP \(bu 2 #9479: autodoc: Emit a warning if target is a mocked object .IP \(bu 2 #9560: autodoc: Allow to refer NewType instances with module name in Python 3.10 or above .IP \(bu 2 #9447: html theme: Expose the version of Sphinx in the form of tuple as a template variable \fBsphinx_version_tuple\fP .IP \(bu 2 #9594: manpage: Suppress the title of man page if description is empty .IP \(bu 2 #9445: py domain: \fBpy:property\fP \%<#\:directive-py-property> directive supports \fB:classmethod:\fP option to describe the class property .IP \(bu 2 #9524: test: SphinxTestApp can take \fBbuilddir\fP as an argument .IP \(bu 2 #9535: C and C++, support more fundamental types, including GNU extensions. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9608: apidoc: apidoc does not generate a module definition for implicit namespace package .IP \(bu 2 #9504: autodoc: generate incorrect reference to the parent class if the target class inherites the class having \fB_name\fP attribute .IP \(bu 2 #9537, #9589: autodoc: Some objects under \fBtyping\fP module are not displayed well with the HEAD of 3.10 .IP \(bu 2 #9487: autodoc: typehint for cached_property is not shown .IP \(bu 2 #9509: autodoc: AttributeError is raised on failed resolving typehints .IP \(bu 2 #9518: autodoc: autodoc_docstring_signature does not effect to \fB__init__()\fP and \fB__new__()\fP .IP \(bu 2 #9522: autodoc: PEP 585 style typehints having arguments (ex. \fBlist[int]\fP) are not displayed well .IP \(bu 2 #9481: autosummary: some warnings contain non\-existing filenames .IP \(bu 2 #9568: autosummary: summarise overlined sectioned headings correctly .IP \(bu 2 #9600: autosummary: Type annotations which contain commas in autosummary table are not removed completely .IP \(bu 2 #9481: c domain: some warnings contain non\-existing filenames .IP \(bu 2 #9481: cpp domain: some warnings contain non\-existing filenames .IP \(bu 2 #9456: html search: abbreation marks are inserted to the search result if failed to fetch the content of the page .IP \(bu 2 #9617: html search: The JS requirement warning is shown if browser is slow .IP \(bu 2 #9267: html theme: CSS and JS files added by theme were loaded twice .IP \(bu 2 #9585: py domain: \fB:type:\fP option for \fBpy:property\fP \%<#\:directive-py-property> directive does not create a hyperlink .IP \(bu 2 #9576: py domain: Literal typehint was converted to a cross reference .IP \(bu 2 #9535 comment: C++, fix parsing of defaulted function parameters that are function pointers. .IP \(bu 2 #9564: smartquotes: don\(aqt adjust typography for text with language\-highlighted \fB:code:\fP role. .IP \(bu 2 #9512: sphinx\-build: crashed with the HEAD of Python 3.10 .UNINDENT .SS Sphinx 4.1 .SS Release 4.1.2 (released Jul 27, 2021) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #9435: linkcheck: Disable checking automatically generated anchors on github.com (ex. anchors in reST/Markdown documents) .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9489: autodoc: Custom types using \fBtyping.NewType\fP are not displayed well with the HEAD of 3.10 .IP \(bu 2 #9490: autodoc: Some objects under \fBtyping\fP module are not displayed well with the HEAD of 3.10 .IP \(bu 2 #9436, #9471: autodoc: crashed if \fBautodoc_class_signature = \(dqseparated\(dq\fP .IP \(bu 2 #9456: html search: html_copy_source can\(aqt control the search summaries .IP \(bu 2 #9500: LaTeX: Failed to build Japanese document on Windows .IP \(bu 2 #9435: linkcheck: Failed to check anchors in github.com .UNINDENT .SS Release 4.1.1 (released Jul 15, 2021) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #9434: sphinxcontrib\-htmlhelp\-2.0.0 or above .IP \(bu 2 #9434: sphinxcontrib\-serializinghtml\-1.1.5 or above .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9438: html: HTML logo or Favicon specified as file not being found on output .UNINDENT .SS Release 4.1.0 (released Jul 12, 2021) .SS Dependencies .INDENT 0.0 .IP \(bu 2 Support jinja2\-3.0 .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 The \fBapp\fP argument of \fBsphinx.environment.BuildEnvironment\fP becomes required .IP \(bu 2 \fBsphinx.application.Sphinx.html_theme\fP .IP \(bu 2 \fBsphinx.ext.autosummary._app\fP .IP \(bu 2 \fBsphinx.util.docstrings.extract_metadata()\fP .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #8107: autodoc: Add \fBclass\-doc\-from\fP option to \fBautoclass\fP \%<#\:directive-autoclass> directive to control the content of the specific class like \fBautoclass_content\fP \%<#\:confval-autoclass_content> .IP \(bu 2 #8588: autodoc: \fBautodoc_type_aliases\fP \%<#\:confval-autodoc_type_aliases> now supports dotted name. It allows you to define an alias for a class with module name like \fBfoo.bar.BazClass\fP .IP \(bu 2 #9175: autodoc: Special member is not documented in the module .IP \(bu 2 #9195: autodoc: The arguments of \fBtyping.Literal\fP are wrongly rendered .IP \(bu 2 #9185: autodoc: \fBautodoc_typehints\fP \%<#\:confval-autodoc_typehints> allows \fB\(aqboth\(aq\fP setting to allow typehints to be included both in the signature and description .IP \(bu 2 #4257: autodoc: Add \fBautodoc_class_signature\fP \%<#\:confval-autodoc_class_signature> to separate the class entry and the definition of \fB__init__()\fP method .IP \(bu 2 #8061, #9218: autodoc: Support variable comment for alias classes .IP \(bu 2 #3014: autodoc: Add \fBautodoc\-process\-bases\fP \%<#\:event-autodoc-process-bases> to modify the base classes of the class definitions .IP \(bu 2 #9272: autodoc: Render enum values for the default argument value better .IP \(bu 2 #9384: autodoc: \fBautodoc_typehints=\(aqnone\(aq\fP now erases typehints for variables, attributes and properties .IP \(bu 2 #3257: autosummary: Support instance attributes for classes .IP \(bu 2 #9358: html: Add \(dqheading\(dq role to the toctree items .IP \(bu 2 #9225: html: Add span tag to the return typehint of method/function .IP \(bu 2 #9129: html search: Show search summaries when \fBhtml_copy_source = False\fP .IP \(bu 2 #9307: html search: Prevent corrections and completions in search field .IP \(bu 2 #9120: html theme: Eliminate prompt characters of code\-block from copyable text .IP \(bu 2 #9176: i18n: Emit a debug message if message catalog file not found under \fBlocale_dirs\fP \%<#\:confval-locale_dirs> .IP \(bu 2 #9414: LaTeX: Add xeCJKVerbAddon to default fvset config for Chinese documents .IP \(bu 2 #9016: linkcheck: Support checking anchors on github.com .IP \(bu 2 #9016: linkcheck: Add a new event \fBlinkcheck\-process\-uri\fP \%<#\:event-linkcheck-process-uri> to modify URIs before checking hyperlinks .IP \(bu 2 #6525: linkcheck: Add \fBlinkcheck_allowed_redirects\fP \%<#\:confval-linkcheck_allowed_redirects> to mark hyperlinks that are redirected to expected URLs as \(dqworking\(dq .IP \(bu 2 #1874: py domain: Support union types using \fB|\fP in info\-field\-list .IP \(bu 2 #9268: py domain: \fBpython_use_unqualified_type_names\fP \%<#\:confval-python_use_unqualified_type_names> supports type field in info\-field\-list .IP \(bu 2 #9097: Optimize the parallel build .IP \(bu 2 #9131: Add \fBnitpick_ignore_regex\fP \%<#\:confval-nitpick_ignore_regex> to ignore nitpicky warnings using regular expressions .IP \(bu 2 #9174: Add \fBSphinx.set_html_assets_policy\fP to tell extensions to include HTML assets in all the pages. Extensions can check this via \fBSphinx.registry.html_assets_policy\fP .IP \(bu 2 C++, add support for .INDENT 2.0 .IP \(bu 2 \fBinline\fP variables, .IP \(bu 2 \fBconsteval\fP functions, .IP \(bu 2 \fBconstinit\fP variables, .IP \(bu 2 \fBchar8_t\fP, .IP \(bu 2 \fBexplicit(<constant expression>)\fP specifier, .IP \(bu 2 digit separators in literals, and .IP \(bu 2 constraints in placeholder type specifiers, aka. adjective syntax (e.g., \fBSortable auto &v\fP). .UNINDENT .IP \(bu 2 C, add support for digit separators in literals. .IP \(bu 2 #9166: LaTeX: support containers in LaTeX output .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #8872: autodoc: stacked singledispatches are wrongly rendered .IP \(bu 2 #8597: autodoc: a docsting having metadata only should be treated as undocumented .IP \(bu 2 #9185: autodoc: typehints for overloaded functions and methods are inaccurate .IP \(bu 2 #9250: autodoc: The inherited method not having docstring is wrongly parsed .IP \(bu 2 #9283: autodoc: autoattribute directive failed to generate document for an attribute not having any comment .IP \(bu 2 #9364: autodoc: single element tuple on the default argument value is wrongly rendered .IP \(bu 2 #9362: autodoc: AttributeError is raised on processing a subclass of Tuple[()] .IP \(bu 2 #9404: autodoc: TypeError is raised on processing dict\-like object (not a class) via autoclass directive .IP \(bu 2 #9317: html: Pushing left key causes visiting the next page at the first page .IP \(bu 2 #9381: html: URL for html_favicon and html_log does not work .IP \(bu 2 #9270: html theme : pyramid theme generates incorrect logo links .IP \(bu 2 #9217: manpage: The name of manpage directory that is generated by \fBman_make_section_directory\fP \%<#\:confval-man_make_section_directory> is not correct .IP \(bu 2 #9350: manpage: Fix font isn\(aqt reset after keyword at the top of samp role .IP \(bu 2 #9306: Linkcheck reports broken link when remote server closes the connection on HEAD request .IP \(bu 2 #9280: py domain: \(dqexceptions\(dq module is not displayed .IP \(bu 2 #9418: py domain: a Callable annotation with no parameters (e.g. \fBCallable[[], None])\fP will be rendered with a bracket missing (\fBCallable[], None]\fP) .IP \(bu 2 #9319: quickstart: Make sphinx\-quickstart exit when conf.py already exists .IP \(bu 2 #9387: xml: XML Builder ignores custom visitors .IP \(bu 2 #9224: \fB:param:\fP and \fB:type:\fP fields does not support a type containing whitespace (ex. \fBDict[str, str]\fP) .IP \(bu 2 #8945: when transforming typed fields, call the specified role instead of making an single xref. For C and C++, use the \fBexpr\fP role for typed fields. .UNINDENT .SS Sphinx 4.0 .SS Release 4.0.3 (released Jul 05, 2021) .SS Features added .INDENT 0.0 .IP \(bu 2 C, add C23 keywords \fB_Decimal32\fP, \fB_Decimal64\fP, and \fB_Decimal128\fP\&. .IP \(bu 2 #9354: C, add \fBc_extra_keywords\fP \%<#\:confval-c_extra_keywords> to allow user\-defined keywords during parsing. .IP \(bu 2 Revert the removal of \fBsphinx.util:force_decode()\fP to become some 3rd party extensions available again during 5.0 .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9330: changeset domain: \fBversionchanged\fP \%<#\:directive-versionchanged> with contents being a list will cause error during pdf build .IP \(bu 2 #9313: LaTeX: complex table with merged cells broken since 4.0 .IP \(bu 2 #9305: LaTeX: backslash may cause Improper discretionary list pdf build error with Japanese engines .IP \(bu 2 #9354: C, remove special macro names from the keyword list. See also \fBc_extra_keywords\fP \%<#\:confval-c_extra_keywords>\&. .IP \(bu 2 #9322: KeyError is raised on PropagateDescDomain transform .UNINDENT .SS Release 4.0.2 (released May 20, 2021) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #9216: Support jinja2\-3.0 .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #9222: Update Underscore.js to 1.13.1 .IP \(bu 2 #9217: manpage: Stop creating a section directory on build manpage by default (see \fBman_make_section_directory\fP \%<#\:confval-man_make_section_directory>) .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9210: viewcode: crashed if non importable modules found on parallel build .IP \(bu 2 #9240: Unknown node error for pending_xref_condition is raised if an extension that does not support the node installs a missing\-reference handler .UNINDENT .SS Release 4.0.1 (released May 11, 2021) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9189: autodoc: crashed when ValueError is raised on generating signature from a property of the class .IP \(bu 2 #9188: autosummary: warning is emitted if list value is set to autosummary_generate .IP \(bu 2 #8380: html search: tags for search result are broken .IP \(bu 2 #9198: i18n: Babel emits errors when running compile_catalog .IP \(bu 2 #9205: py domain: The :canonical: option causes \(dqmore than one target for cross\-reference\(dq warning .IP \(bu 2 #9201: websupport: UndefinedError is raised: \(aqcss_tag\(aq is undefined .UNINDENT .SS Release 4.0.0 (released May 09, 2021) .SS Dependencies .sp 4.0.0b1 .INDENT 0.0 .IP \(bu 2 Drop python 3.5 support .IP \(bu 2 Drop Docutils 0.12 and 0.13 support .IP \(bu 2 LaTeX: add \fBtex\-gyre\fP font dependency .UNINDENT .sp 4.0.0b2 .INDENT 0.0 .IP \(bu 2 Support Docutils 0.17. Please notice it changes the output of HTML builder. Some themes do not support it, and you need to update your custom CSS to upgrade it. .UNINDENT .SS Incompatible changes .sp 4.0.0b1 .INDENT 0.0 .IP \(bu 2 #8539: autodoc: info\-field\-list is generated into the class description when \fBautodoc_typehints\fP \%<#\:confval-autodoc_typehints>\fB=\(aqdescription\(aq\fP and \fBautoclass_content\fP \%<#\:confval-autoclass_content>\fB=\(aqclass\(aq\fP set .IP \(bu 2 #8898: extlinks: \(dq%s\(dq becomes required keyword in the link caption string .IP \(bu 2 domain: The \fBIndex\fP class becomes subclasses of \fBabc.ABC\fP to indicate methods that must be overridden in the concrete classes .IP \(bu 2 #4826: py domain: The structure of python objects is changed. A boolean value is added to indicate that the python object is canonical one .IP \(bu 2 #7425: MathJax: The MathJax was changed from 2 to 3. Users using a custom MathJax configuration may have to set the old MathJax path or update their configuration for version 3. See \fBsphinx.ext.mathjax\fP \%<#\:module-sphinx\:.ext\:.mathjax>\&. .IP \(bu 2 #7784: i18n: The msgid for alt text of image is changed .IP \(bu 2 #5560: napoleon: \fBnapoleon_use_param\fP \%<#\:confval-napoleon_use_param> also affect \(dqother parameters\(dq section .IP \(bu 2 #7996: manpage: Make a section directory on build manpage by default (see \fBman_make_section_directory\fP \%<#\:confval-man_make_section_directory>) .IP \(bu 2 #7849: html: Change the default setting of \fBhtml_codeblock_linenos_style\fP \%<#\:confval-html_codeblock_linenos_style> to \fB\(aqinline\(aq\fP .IP \(bu 2 #8380: html search: search results are wrapped with \fB<p>\fP instead of \fB<div>\fP .IP \(bu 2 html theme: Move a script tag for documentation_options.js in basic/layout.html to \fBscript_files\fP variable .IP \(bu 2 html theme: Move CSS tags in basic/layout.html to \fBcss_files\fP variable .IP \(bu 2 #8915: html theme: Emit a warning for \fBsphinx_rtd_theme\fP 0.2.4 or older .IP \(bu 2 #8508: LaTeX: uplatex becomes a default setting of latex_engine for Japanese documents .IP \(bu 2 #5977: py domain: \fB:var:\fP, \fB:cvar:\fP and \fB:ivar:\fP fields do not create cross\-references .IP \(bu 2 #4550: The \fBalign\fP attribute of \fBfigure\fP and \fBtable\fP nodes becomes \fBNone\fP by default instead of \fB\(aqdefault\(aq\fP .IP \(bu 2 #8769: LaTeX refactoring: split sphinx.sty into multiple files and rename some auxiliary files created in \fBlatex\fP build output repertory .IP \(bu 2 #8937: Use explicit title instead of <no title> .IP \(bu 2 #8487: The :file: option for csv\-table directive now recognizes an absolute path as a relative path from source directory .UNINDENT .sp 4.0.0b2 .INDENT 0.0 .IP \(bu 2 #9023: Change the CSS classes on \fBcpp:expr\fP \%<#\:role-cpp-expr> and \fBcpp:texpr\fP \%<#\:role-cpp-texpr>\&. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 \fBhtml_codeblock_linenos_style\fP \%<#\:confval-html_codeblock_linenos_style> .IP \(bu 2 \fBfavicon\fP and \fBlogo\fP variable in HTML templates .IP \(bu 2 \fBsphinx.directives.patches.CSVTable\fP .IP \(bu 2 \fBsphinx.directives.patches.ListTable\fP .IP \(bu 2 \fBsphinx.directives.patches.RSTTable\fP .IP \(bu 2 \fBsphinx.ext.autodoc.directive.DocumenterBridge.filename_set\fP .IP \(bu 2 \fBsphinx.ext.autodoc.directive.DocumenterBridge.warn()\fP .IP \(bu 2 \fBsphinx.registry.SphinxComponentRegistry.get_source_input()\fP .IP \(bu 2 \fBsphinx.registry.SphinxComponentRegistry.source_inputs\fP .IP \(bu 2 \fBsphinx.transforms.FigureAligner\fP .IP \(bu 2 \fBsphinx.util.pycompat.convert_with_2to3()\fP .IP \(bu 2 \fBsphinx.util.pycompat.execfile_()\fP .IP \(bu 2 \fBsphinx.util.smartypants\fP .IP \(bu 2 \fBsphinx.util.typing.DirectiveOption\fP .UNINDENT .SS Features added .sp 4.0.0b1 .INDENT 0.0 .IP \(bu 2 #8924: autodoc: Support \fBbound\fP argument for TypeVar .IP \(bu 2 #7383: autodoc: Support typehints for properties .IP \(bu 2 #5603: autodoc: Allow to refer to a python class using its canonical name when the class has two different names; a canonical name and an alias name .IP \(bu 2 #8539: autodoc: Add \fBautodoc_typehints_description_target\fP \%<#\:confval-autodoc_typehints_description_target> to control the behavior of \fBautodoc_typehints=description\fP .IP \(bu 2 #8841: autodoc: \fBautodoc_docstring_signature\fP \%<#\:confval-autodoc_docstring_signature> will continue to look for multiple signature lines without backslash character .IP \(bu 2 #7549: autosummary: Enable \fBautosummary_generate\fP \%<#\:confval-autosummary_generate> by default .IP \(bu 2 #8898: extlinks: Allow %s in link caption string .IP \(bu 2 #4826: py domain: Add \fB:canonical:\fP option to python directives to describe the location where the object is defined .IP \(bu 2 #7199: py domain: Add \fBpython_use_unqualified_type_names\fP \%<#\:confval-python_use_unqualified_type_names> to suppress the module name of the python reference if it can be resolved (experimental) .IP \(bu 2 #7068: py domain: Add \fBpy:property\fP \%<#\:directive-py-property> directive to describe a property .IP \(bu 2 #7784: i18n: The alt text for image is translated by default (without \fBgettext_additional_targets\fP \%<#\:confval-gettext_additional_targets> setting) .IP \(bu 2 #2018: html: \fBhtml_favicon\fP \%<#\:confval-html_favicon> and \fBhtml_logo\fP \%<#\:confval-html_logo> now accept URL for the image .IP \(bu 2 #8070: html search: Support searching for 2characters word .IP \(bu 2 #9036: html theme: Allow to inherite the search page .IP \(bu 2 #8938: imgconverter: Show the error of the command availability check .IP \(bu 2 #7830: Add debug logs for change detection of sources and templates .IP \(bu 2 #8201: Emit a warning if toctree contains duplicated entries .IP \(bu 2 #8326: \fBmaster_doc\fP is now renamed to \fBroot_doc\fP \%<#\:confval-root_doc> .IP \(bu 2 #8942: C++, add support for the C++20 spaceship operator, \fB<=>\fP\&. .IP \(bu 2 #7199: A new node, \fBsphinx.addnodes.pending_xref_condition\fP has been added. It can be used to choose appropriate content of the reference by conditions. .UNINDENT .sp 4.0.0b2 .INDENT 0.0 .IP \(bu 2 #8818: autodoc: Super class having \fBAny\fP arguments causes nitpicky warning .IP \(bu 2 #9095: autodoc: TypeError is raised on processing broken metaclass .IP \(bu 2 #9110: autodoc: metadata of GenericAlias is not rendered as a reference in py37+ .IP \(bu 2 #9098: html: copy\-range protection for doctests doesn\(aqt work in Safari .IP \(bu 2 #9103: LaTeX: imgconverter: conversion runs even if not needed .IP \(bu 2 #8127: py domain: Ellipsis in info\-field\-list causes nitpicky warning .IP \(bu 2 #9121: py domain: duplicated warning is emitted when both canonical and its alias objects are defined on the document .IP \(bu 2 #9023: More CSS classes on domain descriptions, see Doctree node classes added by Sphinx \%<#\:nodes> for details. .IP \(bu 2 #8195: mathjax: Rename \fBmathjax_config\fP \%<#\:confval-mathjax_config> to \fBmathjax2_config\fP \%<#\:confval-mathjax2_config> and add \fBmathjax3_config\fP \%<#\:confval-mathjax3_config> .UNINDENT .SS Bugs fixed .sp 4.0.0b1 .INDENT 0.0 .IP \(bu 2 #8917: autodoc: Raises a warning if function has wrong __globals__ value .IP \(bu 2 #8415: autodoc: a TypeVar imported from other module is not resolved (in Python 3.7 or above) .IP \(bu 2 #8992: autodoc: Failed to resolve types.TracebackType type annotation .IP \(bu 2 #8905: html: \fBhtml_add_permalinks=None\fP and \fBhtml_add_permalinks=\(dq\(dq\fP are ignored .IP \(bu 2 #8380: html search: Paragraphs in search results are not identified as \fB<p>\fP .IP \(bu 2 #8915: html theme: The translation of \fBsphinx_rtd_theme\fP does not work .IP \(bu 2 #8342: Emit a warning if a unknown domain is given for directive or role (ex. \fB:unknown:doc:\fP) .IP \(bu 2 #7241: LaTeX: No wrapping for \fBcpp:enumerator\fP .IP \(bu 2 #8711: LaTeX: backticks in code\-blocks trigger latexpdf build warning (and font change) with late TeXLive 2019 .IP \(bu 2 #8253: LaTeX: Figures with no size defined get overscaled (compared to images with size explicitly set in pixels) (fixed for \fB\(aqpdflatex\(aq/\(aqlualatex\(aq\fP only) .IP \(bu 2 #8881: LaTeX: The depth of bookmarks panel in PDF is not enough for navigation .IP \(bu 2 #8874: LaTeX: the fix to two minor Pygments LaTeXFormatter output issues ignore Pygments style .IP \(bu 2 #8925: LaTeX: 3.5.0 \fBverbatimmaxunderfull\fP setting does not work as expected .IP \(bu 2 #8980: LaTeX: missing line break in \fB\epysigline\fP .IP \(bu 2 #8995: LaTeX: legacy \fB\epysiglinewithargsret\fP does not compute correctly available horizontal space and should use a ragged right style .IP \(bu 2 #9009: LaTeX: \(dqrelease\(dq value with underscore leads to invalid LaTeX .IP \(bu 2 #8911: C++: remove the longest matching prefix in \fBcpp_index_common_prefix\fP \%<#\:confval-cpp_index_common_prefix> instead of the first that matches. .IP \(bu 2 C, properly reject function declarations when a keyword is used as parameter name. .IP \(bu 2 #8933: viewcode: Failed to create back\-links on parallel build .IP \(bu 2 #8960: C and C++, fix rendering of (member) function pointer types in function parameter lists. .IP \(bu 2 C++, fix linking of names in array declarators, pointer to member (function) declarators, and in the argument to \fBsizeof...\fP\&. .IP \(bu 2 C, fix linking of names in array declarators. .UNINDENT .sp 4.0.0b2 .INDENT 0.0 .IP \(bu 2 C, C++, fix \fBKeyError\fP when an \fBalias\fP directive is the first C/C++ directive in a file with another C/C++ directive later. .UNINDENT .sp 4.0.0b3 .INDENT 0.0 .IP \(bu 2 #9167: html: Failed to add CSS files to the specific page .UNINDENT .SS Sphinx 3.5 .SS Release 3.5.4 (released Apr 11, 2021) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #9071: Restrict Docutils to 0.16 .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #9078: autodoc: Async staticmethods and classmethods are considered as non async coroutine\-functions with Python3.10 .IP \(bu 2 #8870, #9001, #9051: html theme: The style are not applied with Docutils 0.17 .INDENT 2.0 .IP \(bu 2 toctree captions .IP \(bu 2 The content of \fBsidebar\fP directive .IP \(bu 2 figures .UNINDENT .UNINDENT .SS Release 3.5.3 (released Mar 20, 2021) .SS Features added .INDENT 0.0 .IP \(bu 2 #8959: using UNIX path separator in image directive confuses Sphinx on Windows .UNINDENT .SS Release 3.5.2 (released Mar 06, 2021) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #8943: i18n: Crashed by broken translation messages in ES, EL and HR .IP \(bu 2 #8936: LaTeX: A custom LaTeX builder fails with unknown node error .IP \(bu 2 #8952: Exceptions raised in a Directive cause parallel builds to hang .UNINDENT .SS Release 3.5.1 (released Feb 16, 2021) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #8883: autodoc: AttributeError is raised on assigning __annotations__ on read\-only class .IP \(bu 2 #8884: html: minified js stemmers not included in the distributed package .IP \(bu 2 #8885: html: AttributeError is raised if CSS/JS files are installed via \fBhtml_context\fP \%<#\:confval-html_context> .IP \(bu 2 #8880: viewcode: ExtensionError is raised on incremental build after unparsable python module found .UNINDENT .SS Release 3.5.0 (released Feb 14, 2021) .SS Dependencies .INDENT 0.0 .IP \(bu 2 LaTeX: \fBmulticol\fP (it is anyhow a required part of the official latex2e base distribution) .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Update Underscore.js to 1.12.0 .IP \(bu 2 #6550: html: The config variable \fBhtml_add_permalinks\fP is replaced by \fBhtml_permalinks\fP \%<#\:confval-html_permalinks> and \fBhtml_permalinks_icon\fP \%<#\:confval-html_permalinks_icon> .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 pending_xref node for viewcode extension .IP \(bu 2 \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.anchors_ignore\fP .IP \(bu 2 \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.auth\fP .IP \(bu 2 \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.broken\fP .IP \(bu 2 \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.good\fP .IP \(bu 2 \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.redirected\fP .IP \(bu 2 \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.rqueue\fP .IP \(bu 2 \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.to_ignore\fP .IP \(bu 2 \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.workers\fP .IP \(bu 2 \fBsphinx.builders.linkcheck.CheckExternalLinksBuilder.wqueue\fP .IP \(bu 2 \fBsphinx.builders.linkcheck.node_line_or_0()\fP .IP \(bu 2 \fBsphinx.ext.autodoc.AttributeDocumenter.isinstanceattribute()\fP .IP \(bu 2 \fBsphinx.ext.autodoc.directive.DocumenterBridge.reporter\fP .IP \(bu 2 \fBsphinx.ext.autodoc.importer.get_module_members()\fP .IP \(bu 2 \fBsphinx.ext.autosummary.generate._simple_info()\fP .IP \(bu 2 \fBsphinx.ext.autosummary.generate._simple_warn()\fP .IP \(bu 2 \fBsphinx.writers.html.HTMLTranslator.permalink_text\fP .IP \(bu 2 \fBsphinx.writers.html5.HTML5Translator.permalink_text\fP .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #8022: autodoc: autodata and autoattribute directives does not show right\-hand value of the variable if docstring contains \fB:meta hide\-value:\fP in info\-field\-list .IP \(bu 2 #8514: autodoc: Default values of overloaded functions are taken from actual implementation if they\(aqre ellipsis .IP \(bu 2 #8775: autodoc: Support type union operator (PEP\-604) in Python 3.10 or above .IP \(bu 2 #8297: autodoc: Allow to extend \fBautodoc_default_options\fP \%<#\:confval-autodoc_default_options> via directive options .IP \(bu 2 #759: autodoc: Add a new configuration \fBautodoc_preserve_defaults\fP \%<#\:confval-autodoc_preserve_defaults> as an experimental feature. It preserves the default argument values of functions in source code and keep them not evaluated for readability. .IP \(bu 2 #8619: html: kbd role generates customizable HTML tags for compound keys .IP \(bu 2 #8634: html: Allow to change the order of JS/CSS via \fBpriority\fP parameter for \fBSphinx.add_js_file()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_js_file> and \fBSphinx.add_css_file()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_css_file> .IP \(bu 2 #6241: html: Allow to add JS/CSS files to the specific page when an extension calls \fBapp.add_js_file()\fP or \fBapp.add_css_file()\fP on \fBhtml\-page\-context\fP \%<#\:event-html-page-context> event .IP \(bu 2 #6550: html: Allow to use HTML permalink texts via \fBhtml_permalinks_icon\fP \%<#\:confval-html_permalinks_icon> .IP \(bu 2 #1638: html: Add permalink icons to glossary terms .IP \(bu 2 #8868: html search: performance issue with massive lists .IP \(bu 2 #8867: html search: Update JavaScript stemmer code to the latest version of Snowball (v2.1.0) .IP \(bu 2 #8852: i18n: Allow to translate heading syntax in MyST\-Parser .IP \(bu 2 #8649: imgconverter: Skip availability check if builder supports the image type .IP \(bu 2 #8573: napoleon: Allow to change the style of custom sections using \fBnapoleon_custom_sections\fP \%<#\:confval-napoleon_custom_sections> .IP \(bu 2 #8004: napoleon: Type definitions in Google style docstrings are rendered as references when \fBnapoleon_preprocess_types\fP \%<#\:confval-napoleon_preprocess_types> enabled .IP \(bu 2 #6241: mathjax: Include mathjax.js only on the document using equations .IP \(bu 2 #8775: py domain: Support type union operator (PEP\-604) .IP \(bu 2 #8651: std domain: cross\-reference for a rubric having inline item is broken .IP \(bu 2 #7642: std domain: Optimize case\-insensitive match of term .IP \(bu 2 #8681: viewcode: Support incremental build .IP \(bu 2 #8132: Add \fBproject_copyright\fP \%<#\:confval-project_copyright> as an alias of \fBcopyright\fP \%<#\:confval-copyright> .IP \(bu 2 #207: Now \fBhighlight_language\fP \%<#\:confval-highlight_language> supports multiple languages .IP \(bu 2 #2030: \fBcode\-block\fP \%<#\:directive-code-block> and \fBliteralinclude\fP \%<#\:directive-literalinclude> supports automatic dedent via no\-argument \fB:dedent:\fP option .IP \(bu 2 C++, also hyperlink operator overloads in expressions and alias declarations. .IP \(bu 2 #8247: Allow production lists to refer to tokens from other production groups .IP \(bu 2 #8813: Show what extension (or module) caused it on errors on event handler .IP \(bu 2 #8213: C++: add \fBmaxdepth\fP option to \fBcpp:alias\fP \%<#\:directive-cpp-alias> to insert nested declarations. .IP \(bu 2 C, add \fBnoroot\fP option to \fBc:alias\fP \%<#\:directive-c-alias> to render only nested declarations. .IP \(bu 2 C++, add \fBnoroot\fP option to \fBcpp:alias\fP \%<#\:directive-cpp-alias> to render only nested declarations. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #8727: apidoc: namespace module file is not generated if no submodules there .IP \(bu 2 #741: autodoc: inherited\-members doesn\(aqt work for instance attributes on super class .IP \(bu 2 #8592: autodoc: \fB:meta public:\fP does not effect to variables .IP \(bu 2 #8594: autodoc: empty \fB__all__\fP attribute is ignored .IP \(bu 2 #8315: autodoc: Failed to resolve struct.Struct type annotation .IP \(bu 2 #8652: autodoc: All variable comments in the module are ignored if the module contains invalid type comments .IP \(bu 2 #8693: autodoc: Default values for overloaded functions are rendered as string .IP \(bu 2 #8134: autodoc: crashes when mocked decorator takes arguments .IP \(bu 2 #8800: autodoc: Uninitialized attributes in superclass are recognized as undocumented .IP \(bu 2 #8655: autodoc: Failed to generate document if target module contains an object that raises an exception on \fBhasattr()\fP .IP \(bu 2 #8306: autosummary: mocked modules are documented as empty page when using :recursive: option .IP \(bu 2 #8232: graphviz: Image node is not rendered if graph file is in subdirectory .IP \(bu 2 #8618: html: kbd role produces incorrect HTML when compound\-key separators (\-, + or ^) are used as keystrokes .IP \(bu 2 #8629: html: A type warning for html_use_opensearch is shown twice .IP \(bu 2 #8714: html: kbd role with \(dqCaps Lock\(dq rendered incorrectly .IP \(bu 2 #8123: html search: fix searching for terms containing + (Requires a custom search language that does not split on +) .IP \(bu 2 #8665: html theme: Could not override globaltoc_maxdepth in theme.conf .IP \(bu 2 #8446: html: consecutive spaces are displayed as single space .IP \(bu 2 #8745: i18n: crashes with KeyError when translation message adds a new auto footnote reference .IP \(bu 2 #4304: linkcheck: Fix race condition that could lead to checking the availability of the same URL twice .IP \(bu 2 #8791: linkcheck: The docname for each hyperlink is not displayed .IP \(bu 2 #7118: sphinx\-quickstart: questionnaire got Mojibake if libreadline unavailable .IP \(bu 2 #8094: texinfo: image files on the different directory with document are not copied .IP \(bu 2 #8782: todo: Cross references in todolist get broken .IP \(bu 2 #8720: viewcode: module pages are generated for epub on incremental build .IP \(bu 2 #8704: viewcode: anchors are generated in incremental build after singlehtml .IP \(bu 2 #8756: viewcode: highlighted code is generated even if not referenced .IP \(bu 2 #8671: \fBhighlight_options\fP \%<#\:confval-highlight_options> is not working .IP \(bu 2 #8341: C, fix intersphinx lookup types for names in declarations. .IP \(bu 2 C, C++: in general fix intersphinx and role lookup types. .IP \(bu 2 #8683: \fBhtml_last_updated_fmt\fP \%<#\:confval-html_last_updated_fmt> does not support UTC offset (%z) .IP \(bu 2 #8683: \fBhtml_last_updated_fmt\fP \%<#\:confval-html_last_updated_fmt> generates wrong time zone for %Z .IP \(bu 2 #1112: \fBdownload\fP role creates duplicated copies when relative path is specified .IP \(bu 2 #2616 (fifth item): LaTeX: footnotes from captions are not clickable, and for manually numbered footnotes only first one with same number is an hyperlink .IP \(bu 2 #7576: LaTeX with French babel and memoir crash: \(dqIllegal parameter number in definition of \fB\eFNH@prefntext\fP\(dq .IP \(bu 2 #8055: LaTeX (docs): A potential display bug with the LaTeX generation step in Sphinx (how to generate one\-column index) .IP \(bu 2 #8072: LaTeX: Directive \fBhlist\fP \%<#\:directive-hlist> not implemented in LaTeX .IP \(bu 2 #8214: LaTeX: The \fBindex\fP \%<#\:role-index> role and the glossary generate duplicate entries in the LaTeX index (if both used for same term) .IP \(bu 2 #8735: LaTeX: wrong internal links in pdf to captioned code\-blocks when \fBnumfig\fP \%<#\:confval-numfig> is not \fBTrue\fP .IP \(bu 2 #8442: LaTeX: some indexed terms are ignored when using xelatex engine (or pdflatex and \fBlatex_use_xindy\fP \%<#\:confval-latex_use_xindy> set to \fBTrue\fP) with memoir class .IP \(bu 2 #8750: LaTeX: URLs as footnotes fail to show in PDF if originating from inside function type signatures .IP \(bu 2 #8780: LaTeX: long words in narrow columns may not be hyphenated .IP \(bu 2 #8788: LaTeX: \fB\etitleformat\fP last argument in sphinx.sty should be bracketed, not braced (and is anyhow not needed) .IP \(bu 2 #8849: LaTex: code\-block printed out of margin (see the opt\-in LaTeX syntax boolean verbatimforcewraps \%<#\:latexsphinxsetupforcewraps> for use via the \(aqsphinxsetup\(aq \%<#\:latexsphinxsetup> key of \fBlatex_elements\fP) .IP \(bu 2 #8183: LaTeX: Remove substitution_reference nodes from doctree only on LaTeX builds .IP \(bu 2 #8865: LaTeX: Restructure the index nodes inside title nodes only on LaTeX builds .IP \(bu 2 #8796: LaTeX: potentially critical low level TeX coding mistake has gone unnoticed so far .IP \(bu 2 C, \fBc:alias\fP \%<#\:directive-c-alias> skip symbols without explicit declarations instead of crashing. .IP \(bu 2 C, \fBc:alias\fP \%<#\:directive-c-alias> give a warning when the root symbol is not declared. .IP \(bu 2 C, \fBexpr\fP role should start symbol lookup in the current scope. .UNINDENT .SS Sphinx 3.4 .SS Release 3.4.3 (released Jan 08, 2021) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #8655: autodoc: Failed to generate document if target module contains an object that raises an exception on \fBhasattr()\fP .UNINDENT .SS Release 3.4.2 (released Jan 04, 2021) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #8164: autodoc: Classes that inherit mocked class are not documented .IP \(bu 2 #8602: autodoc: The \fBautodoc\-process\-docstring\fP event is emitted to the non\-datadescriptors unexpectedly .IP \(bu 2 #8616: autodoc: AttributeError is raised on non\-class object is passed to autoclass directive .UNINDENT .SS Release 3.4.1 (released Dec 25, 2020) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #8559: autodoc: AttributeError is raised when using forward\-reference type annotations .IP \(bu 2 #8568: autodoc: TypeError is raised on checking slots attribute .IP \(bu 2 #8567: autodoc: Instance attributes are incorrectly added to Parent class .IP \(bu 2 #8566: autodoc: The \fBautodoc\-process\-docstring\fP event is emitted to the alias classes unexpectedly .IP \(bu 2 #8583: autodoc: Unnecessary object comparison via \fB__eq__\fP method .IP \(bu 2 #8565: linkcheck: Fix PriorityQueue crash when link tuples are not comparable .UNINDENT .SS Release 3.4.0 (released Dec 20, 2020) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #8105: autodoc: the signature of class constructor will be shown for decorated classes, not a signature of decorator .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 The \fBfollow_wrapped\fP argument of \fBsphinx.util.inspect.signature()\fP .IP \(bu 2 The \fBno_docstring\fP argument of \fBsphinx.ext.autodoc.Documenter.add_content()\fP .IP \(bu 2 \fBsphinx.ext.autodoc.Documenter.get_object_members()\fP .IP \(bu 2 \fBsphinx.ext.autodoc.DataDeclarationDocumenter\fP .IP \(bu 2 \fBsphinx.ext.autodoc.GenericAliasDocumenter\fP .IP \(bu 2 \fBsphinx.ext.autodoc.InstanceAttributeDocumenter\fP .IP \(bu 2 \fBsphinx.ext.autodoc.SlotsAttributeDocumenter\fP .IP \(bu 2 \fBsphinx.ext.autodoc.TypeVarDocumenter\fP .IP \(bu 2 \fBsphinx.ext.autodoc.importer._getannotations()\fP .IP \(bu 2 \fBsphinx.ext.autodoc.importer._getmro()\fP .IP \(bu 2 \fBsphinx.pycode.ModuleAnalyzer.parse()\fP .IP \(bu 2 \fBsphinx.util.osutil.movefile()\fP .IP \(bu 2 \fBsphinx.util.requests.is_ssl_error()\fP .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #8119: autodoc: Allow to determine whether a member not included in \fB__all__\fP attribute of the module should be documented or not via \fBautodoc\-skip\-member\fP \%<#\:event-autodoc-skip-member> event .IP \(bu 2 #8219: autodoc: Parameters for generic class are not shown when super class is a generic class and show\-inheritance option is given (in Python 3.7 or above) .IP \(bu 2 autodoc: Add \fBDocumenter.config\fP as a shortcut to access the config object .IP \(bu 2 autodoc: Add \fBOptional[t]\fP to annotation of function and method if a default value equal to \fBNone\fP is set. .IP \(bu 2 #8209: autodoc: Add \fB:no\-value:\fP option to \fBautoattribute\fP \%<#\:directive-autoattribute> and \fBautodata\fP \%<#\:directive-autodata> directive to suppress the default value of the variable .IP \(bu 2 #8460: autodoc: Support custom types defined by typing.NewType .IP \(bu 2 #8285: napoleon: Add \fBnapoleon_attr_annotations\fP \%<#\:confval-napoleon_attr_annotations> to merge type hints on source code automatically if any type is specified in docstring .IP \(bu 2 #8236: napoleon: Support numpydoc\(aqs \(dqReceives\(dq section .IP \(bu 2 #6914: Add a new event \fBwarn\-missing\-reference\fP \%<#\:event-warn-missing-reference> to custom warning messages when failed to resolve a cross\-reference .IP \(bu 2 #6914: Emit a detailed warning when failed to resolve a \fB:ref:\fP reference .IP \(bu 2 #6629: linkcheck: The builder now handles rate limits. See \fBlinkcheck_rate_limit_timeout\fP \%<#\:confval-linkcheck_rate_limit_timeout> for details. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7613: autodoc: autodoc does not respect __signature__ of the class .IP \(bu 2 #4606: autodoc: the location of the warning is incorrect for inherited method .IP \(bu 2 #8105: autodoc: the signature of class constructor is incorrect if the class is decorated .IP \(bu 2 #8434: autodoc: \fBautodoc_type_aliases\fP \%<#\:confval-autodoc_type_aliases> does not effect to variables and attributes .IP \(bu 2 #8443: autodoc: autodata directive can\(aqt create document for PEP\-526 based type annotated variables .IP \(bu 2 #8443: autodoc: autoattribute directive can\(aqt create document for PEP\-526 based uninitialized variables .IP \(bu 2 #8480: autodoc: autoattribute could not create document for __slots__ attributes .IP \(bu 2 #8503: autodoc: autoattribute could not create document for a GenericAlias as class attributes correctly .IP \(bu 2 #8534: autodoc: autoattribute could not create document for a commented attribute in alias class .IP \(bu 2 #8452: autodoc: autodoc_type_aliases doesn\(aqt work when autodoc_typehints is set to \(dqdescription\(dq .IP \(bu 2 #8541: autodoc: autodoc_type_aliases doesn\(aqt work for the type annotation to instance attributes .IP \(bu 2 #8460: autodoc: autodata and autoattribute directives do not display type information of TypeVars .IP \(bu 2 #8493: autodoc: references to builtins not working in class aliases .IP \(bu 2 #8522: autodoc: \fB__bool__\fP method could be called .IP \(bu 2 #8067: autodoc: A typehint for the instance variable having type_comment on super class is not displayed .IP \(bu 2 #8545: autodoc: a __slots__ attribute is not documented even having docstring .IP \(bu 2 #741: autodoc: inherited\-members doesn\(aqt work for instance attributes on super class .IP \(bu 2 #8477: autosummary: non utf\-8 reST files are generated when template contains multibyte characters .IP \(bu 2 #8501: autosummary: summary extraction splits text after \(dqel at.\(dq unexpectedly .IP \(bu 2 #8524: html: Wrong url_root has been generated on a document named \(dqindex\(dq .IP \(bu 2 #8419: html search: Do not load \fBlanguage_data.js\fP in non\-search pages .IP \(bu 2 #8549: i18n: \fB\-D gettext_compact=0\fP is no longer working .IP \(bu 2 #8454: graphviz: The layout option for graph and digraph directives don\(aqt work .IP \(bu 2 #8131: linkcheck: Use GET when HEAD requests cause Too Many Redirects, to accommodate infinite redirect loops on HEAD .IP \(bu 2 #8437: Makefile: \fBmake clean\fP with empty BUILDDIR is dangerous .IP \(bu 2 #8365: py domain: \fB:type:\fP and \fB:rtype:\fP gives false ambiguous class lookup warnings .IP \(bu 2 #8352: std domain: Failed to parse an option that starts with bracket .IP \(bu 2 #8519: LaTeX: Prevent page brake in the middle of a seealso .IP \(bu 2 #8520: C, fix copying of AliasNode. .UNINDENT .SS Sphinx 3.3 .SS Release 3.3.1 (released Nov 12, 2020) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #8372: autodoc: autoclass directive became slower than Sphinx 3.2 .IP \(bu 2 #7727: autosummary: raise PycodeError when documenting python package without __init__.py .IP \(bu 2 #8350: autosummary: autosummary_mock_imports causes slow down builds .IP \(bu 2 #8364: C, properly initialize attributes in empty symbols. .IP \(bu 2 #8399: i18n: Put system locale path after the paths specified by configuration .UNINDENT .SS Release 3.3.0 (released Nov 02, 2020) .SS Deprecated .INDENT 0.0 .IP \(bu 2 \fBsphinx.builders.latex.LaTeXBuilder.usepackages\fP .IP \(bu 2 \fBsphinx.builders.latex.LaTeXBuilder.usepackages_afger_hyperref\fP .IP \(bu 2 \fBsphinx.ext.autodoc.SingledispatchFunctionDocumenter\fP .IP \(bu 2 \fBsphinx.ext.autodoc.SingledispatchMethodDocumenter\fP .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #8100: html: Show a better error message for failures on copying html_static_files .IP \(bu 2 #8141: C: added a \fBmaxdepth\fP option to \fBc:alias\fP \%<#\:directive-c-alias> to insert nested declarations. .IP \(bu 2 #8081: LaTeX: Allow to add LaTeX package via \fBapp.add_latex_package()\fP until just before writing .tex file .IP \(bu 2 #7996: manpage: Add \fBman_make_section_directory\fP \%<#\:confval-man_make_section_directory> to make a section directory on build man page .IP \(bu 2 #8289: epub: Allow to suppress \(dqduplicated ToC entry found\(dq warnings from epub builder using \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings>\&. .IP \(bu 2 #8298: sphinx\-quickstart: Add \fBsphinx\-quickstart \-\-no\-sep\fP \%<#\:cmdoption-sphinx-quickstart-no-sep> option .IP \(bu 2 #8304: sphinx.testing: Register public markers in sphinx.testing.fixtures .IP \(bu 2 #8051: napoleon: use the obj role for all See Also items .IP \(bu 2 #8050: napoleon: Apply \fBnapoleon_preprocess_types\fP \%<#\:confval-napoleon_preprocess_types> to every field .IP \(bu 2 C and C++, show line numbers for previous declarations when duplicates are detected. .IP \(bu 2 #8183: Remove substitution_reference nodes from doctree only on LaTeX builds .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #8085: i18n: Add support for having single text domain .IP \(bu 2 #6640: i18n: Failed to override system message translation .IP \(bu 2 #8143: autodoc: \fBAttributeError\fP is raised when \fBFalse\fP value is passed to \fBautodoc_default_options\fP \%<#\:confval-autodoc_default_options> .IP \(bu 2 #8103: autodoc: functools.cached_property is not considered as a property .IP \(bu 2 #8190: autodoc: parsing error is raised if some extension replaces docstring by string not ending with blank lines .IP \(bu 2 #8142: autodoc: Wrong constructor signature for the class derived from typing.Generic .IP \(bu 2 #8157: autodoc: TypeError is raised when annotation has invalid __args__ .IP \(bu 2 #7964: autodoc: Tuple in default value is wrongly rendered .IP \(bu 2 #8200: autodoc: type aliases break type formatting of autoattribute .IP \(bu 2 #7786: autodoc: can\(aqt detect overloaded methods defined in other file .IP \(bu 2 #8294: autodoc: single\-string __slots__ is not handled correctly .IP \(bu 2 #7785: autodoc: autodoc_typehints=\(aqnone\(aq does not effect to overloaded functions .IP \(bu 2 #8192: napoleon: description is disappeared when it contains inline literals .IP \(bu 2 #8142: napoleon: Potential of regex denial of service in google style docs .IP \(bu 2 #8169: LaTeX: pxjahyper loaded even when latex_engine is not platex .IP \(bu 2 #8215: LaTeX: \(aqoneside\(aq classoption causes build warning .IP \(bu 2 #8175: intersphinx: Potential of regex denial of service by broken inventory .IP \(bu 2 #8277: sphinx\-build: missing and redundant spacing (and etc) for console output on building .IP \(bu 2 #7973: imgconverter: Check availability of imagemagick many times .IP \(bu 2 #8255: py domain: number in default argument value is changed from hexadecimal to decimal .IP \(bu 2 #8316: html: Prevent arrow keys changing page when button elements are focused .IP \(bu 2 #8343: html search: Fix unnecessary load of images when parsing the document .IP \(bu 2 #8254: html theme: Line numbers misalign with code lines .IP \(bu 2 #8093: The highlight warning has wrong location in some builders (LaTeX, singlehtml and so on) .IP \(bu 2 #8215: Eliminate Fancyhdr build warnings for oneside documents .IP \(bu 2 #8239: Failed to refer a token in productionlist if it is indented .IP \(bu 2 #8268: linkcheck: Report HTTP errors when \fBlinkcheck_anchors\fP is \fBTrue\fP .IP \(bu 2 #8245: linkcheck: take source directory into account for local files .IP \(bu 2 #8321: linkcheck: \fBtel:\fP schema hyperlinks are detected as errors .IP \(bu 2 #8323: linkcheck: An exit status is incorrect when links having unsupported schema found .IP \(bu 2 #8188: C, add missing items to internal object types dictionary, e.g., preventing intersphinx from resolving them. .IP \(bu 2 C, fix anon objects in intersphinx. .IP \(bu 2 #8270, C++, properly reject functions as duplicate declarations if a non\-function declaration of the same name already exists. .IP \(bu 2 C, fix references to function parameters. Link to the function instead of a non\-existing anchor. .IP \(bu 2 #6914: figure numbers are unexpectedly assigned to uncaptioned items .IP \(bu 2 #8320: make \(dqinline\(dq line numbers un\-selectable .UNINDENT .SS Testing .INDENT 0.0 .IP \(bu 2 #8257: Support parallel build in sphinx.testing .UNINDENT .SS Sphinx 3.2 .SS Release 3.2.1 (released Aug 14, 2020) .SS Features added .INDENT 0.0 .IP \(bu 2 #8095: napoleon: Add \fBnapoleon_preprocess_types\fP \%<#\:confval-napoleon_preprocess_types> to enable the type preprocessor for numpy style docstrings .IP \(bu 2 #8114: C and C++, parse function attributes after parameters and qualifiers. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #8074: napoleon: Crashes during processing C\-ext module .IP \(bu 2 #8088: napoleon: \(dqInline literal start\-string without end\-string\(dq warning in Numpy style Parameters section .IP \(bu 2 #8084: autodoc: KeyError is raised on documenting an attribute of the broken class .IP \(bu 2 #8091: autodoc: AttributeError is raised on documenting an attribute on Python 3.5.2 .IP \(bu 2 #8099: autodoc: NameError is raised when target code uses \fBTYPE_CHECKING\fP .IP \(bu 2 C++, fix parsing of template template parameters, broken by the fix of #7944 .UNINDENT .SS Release 3.2.0 (released Aug 08, 2020) .SS Deprecated .INDENT 0.0 .IP \(bu 2 \fBsphinx.ext.autodoc.members_set_option()\fP .IP \(bu 2 \fBsphinx.ext.autodoc.merge_special_members_option()\fP .IP \(bu 2 \fBsphinx.writers.texinfo.TexinfoWriter.desc\fP .IP \(bu 2 C, parsing of pre\-v3 style type directives and roles, along with the options \fBc_allow_pre_v3\fP and \fBc_warn_on_allowed_pre_v3\fP\&. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #2076: autodoc: Allow overriding of exclude\-members in skip\-member function .IP \(bu 2 #8034: autodoc: \fB:private\-member:\fP can take an explicit list of member names to be documented .IP \(bu 2 #2024: autosummary: Add \fBautosummary_filename_map\fP \%<#\:confval-autosummary_filename_map> to avoid conflict of filenames between two object with different case .IP \(bu 2 #8011: autosummary: Support instance attributes as a target of autosummary directive .IP \(bu 2 #7849: html: Add \fBhtml_codeblock_linenos_style\fP \%<#\:confval-html_codeblock_linenos_style> to change the style of line numbers for code\-blocks .IP \(bu 2 #7853: C and C++, support parameterized GNU style attributes. .IP \(bu 2 #7888: napoleon: Add aliases Warn and Raise. .IP \(bu 2 #7690: napoleon: parse type strings and make them hyperlinks as possible. The conversion rule can be updated via \fBnapoleon_type_aliases\fP \%<#\:confval-napoleon_type_aliases> .IP \(bu 2 #8049: napoleon: Create a hyperlink for each the type of parameter when \fBnapoleon_use_param\fP \%<#\:confval-napoleon_use_param> is \fBFalse\fP .IP \(bu 2 C, added \fBc:alias\fP \%<#\:directive-c-alias> directive for inserting copies of existing declarations. .IP \(bu 2 #7745: html: inventory is broken if the docname contains a space .IP \(bu 2 #7991: html search: Allow searching for numbers .IP \(bu 2 #7902: html theme: Add a new option \fBglobaltoc_maxdepth\fP to control the behavior of globaltoc in sidebar .IP \(bu 2 #7840: i18n: Optimize the dependencies check on bootstrap .IP \(bu 2 #7768: i18n: \fBfigure_language_filename\fP \%<#\:confval-figure_language_filename> supports \fBdocpath\fP token .IP \(bu 2 #5208: linkcheck: Support checks for local links .IP \(bu 2 #5090: setuptools: Link verbosity to distutils\(aq \-v and \-q option .IP \(bu 2 #6698: doctest: Add \fB:trim\-doctest\-flags:\fP and \fB:no\-trim\-doctest\-flags:\fP options to doctest, testcode and testoutput directives .IP \(bu 2 #7052: add \fB:noindexentry:\fP to the Python, C, C++, and Javascript domains. Update the documentation to better reflect the relationship between this option and the \fB:noindex:\fP option. .IP \(bu 2 #7899: C, add possibility of parsing of some pre\-v3 style type directives and roles and try to convert them to equivalent v3 directives/roles. Set the new option \fBc_allow_pre_v3\fP to \fBTrue\fP to enable this. The warnings printed from this functionality can be suppressed by setting \fBc_warn_on_allowed_pre_v3\fP to \fBTrue\fP\&. The functionality is immediately deprecated. .IP \(bu 2 #7999: C, add support for named variadic macro arguments. .IP \(bu 2 #8071: Allow to suppress \(dqself referenced toctrees\(dq warning .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7886: autodoc: TypeError is raised on mocking generic\-typed classes .IP \(bu 2 #7935: autodoc: function signature is not shown when the function has a parameter having \fBinspect._empty\fP as its default value .IP \(bu 2 #7901: autodoc: type annotations for overloaded functions are not resolved .IP \(bu 2 #904: autodoc: An instance attribute cause a crash of autofunction directive .IP \(bu 2 #1362: autodoc: \fBprivate\-members\fP option does not work for class attributes .IP \(bu 2 #7983: autodoc: Generator type annotation is wrongly rendered in py36 .IP \(bu 2 #8030: autodoc: An uninitialized annotated instance variable is not documented when \fB:inherited\-members:\fP option given .IP \(bu 2 #8032: autodoc: A type hint for the instance variable defined at parent class is not shown in the document of the derived class .IP \(bu 2 #8041: autodoc: An annotated instance variable on super class is not documented when derived class has other annotated instance variables .IP \(bu 2 #7839: autosummary: cannot handle umlauts in function names .IP \(bu 2 #7865: autosummary: Failed to extract summary line when abbreviations found .IP \(bu 2 #7866: autosummary: Failed to extract correct summary line when docstring contains a hyperlink target .IP \(bu 2 #7469: autosummary: \(dqModule attributes\(dq header is not translatable .IP \(bu 2 #7940: apidoc: An extra newline is generated at the end of the rst file if a module has submodules .IP \(bu 2 #4258: napoleon: decorated special methods are not shown .IP \(bu 2 #7799: napoleon: parameters are not escaped for combined params in numpydoc .IP \(bu 2 #7780: napoleon: multiple parameters declaration in numpydoc was wrongly recognized when \fBnapoleon_use_param=True\fP .IP \(bu 2 #7715: LaTeX: \fBnumfig_secnum_depth > 1\fP leads to wrong figure links .IP \(bu 2 #7846: html theme: XML\-invalid files were generated .IP \(bu 2 #7894: gettext: Wrong source info is shown when using rst_epilog .IP \(bu 2 #7691: linkcheck: HEAD requests are not used for checking .IP \(bu 2 #4888: i18n: Failed to add an explicit title to \fB:ref:\fP role on translation .IP \(bu 2 #7928: py domain: failed to resolve a type annotation for the attribute .IP \(bu 2 #8008: py domain: failed to parse a type annotation containing ellipsis .IP \(bu 2 #7994: std domain: option directive does not generate old node_id compatible with 2.x or older .IP \(bu 2 #7968: i18n: The content of \fBmath\fP directive is interpreted as reST on translation .IP \(bu 2 #7768: i18n: The \fBroot\fP element for \fBfigure_language_filename\fP \%<#\:confval-figure_language_filename> is not a path that user specifies in the document .IP \(bu 2 #7993: texinfo: TypeError is raised for nested object descriptions .IP \(bu 2 #7993: texinfo: a warning not supporting desc_signature_line node is shown .IP \(bu 2 #7869: \fBabbr\fP \%<#\:role-abbr> role without an explanation will show the explanation from the previous abbr role .IP \(bu 2 #8048: graphviz: graphviz.css was copied on building non\-HTML document .IP \(bu 2 C and C++, removed \fBnoindex\fP directive option as it did nothing. .IP \(bu 2 #7619: Duplicated node IDs are generated if node has multiple IDs .IP \(bu 2 #2050: Symbols sections are appeared twice in the index page .IP \(bu 2 #8017: Fix circular import in sphinx.addnodes .IP \(bu 2 #7986: CSS: make \(dqhighlight\(dq selector more robust .IP \(bu 2 #7944: C++, parse non\-type template parameters starting with a dependent qualified name. .IP \(bu 2 C, don\(aqt deepcopy the entire symbol table and make a mess every time an enumerator is handled. .UNINDENT .SS Sphinx 3.1 .SS Release 3.1.2 (released Jul 05, 2020) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #7650: autodoc: the signature of base function will be shown for decorated functions, not a signature of decorator .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7844: autodoc: Failed to detect module when relative module name given .IP \(bu 2 #7856: autodoc: AttributeError is raised when non\-class object is given to the autoclass directive .IP \(bu 2 #7850: autodoc: KeyError is raised for invalid mark up when autodoc_typehints is \(aqdescription\(aq .IP \(bu 2 #7812: autodoc: crashed if the target name matches to both an attribute and module that are same name .IP \(bu 2 #7650: autodoc: function signature becomes \fB(*args, **kwargs)\fP if the function is decorated by generic decorator .IP \(bu 2 #7812: autosummary: generates broken stub files if the target code contains an attribute and module that are same name .IP \(bu 2 #7806: viewcode: Failed to resolve viewcode references on 3rd party builders .IP \(bu 2 #7838: html theme: List items have extra vertical space .IP \(bu 2 #7878: html theme: Undesired interaction between \(dqoverflow\(dq and \(dqfloat\(dq .UNINDENT .SS Release 3.1.1 (released Jun 14, 2020) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #7808: napoleon: a type for attribute are represented as typed field .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #7807: autodoc: Show detailed warning when type_comment is mismatched with its signature .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7808: autodoc: Warnings raised on variable and attribute type annotations .IP \(bu 2 #7802: autodoc: EOFError is raised on parallel build .IP \(bu 2 #7821: autodoc: TypeError is raised for overloaded C\-ext function .IP \(bu 2 #7805: autodoc: an object which descriptors returns is unexpectedly documented .IP \(bu 2 #7807: autodoc: wrong signature is shown for the function using contextmanager .IP \(bu 2 #7812: autosummary: generates broken stub files if the target code contains an attribute and module that are same name .IP \(bu 2 #7808: napoleon: Warnings raised on variable and attribute type annotations .IP \(bu 2 #7811: sphinx.util.inspect causes circular import problem .UNINDENT .SS Release 3.1.0 (released Jun 08, 2020) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #7746: mathjax: Update to 2.7.5 .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #7477: imgconverter: Invoke \(dqmagick convert\(dq command by default on Windows .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 The first argument for sphinx.ext.autosummary.generate.AutosummaryRenderer has been changed to Sphinx object .IP \(bu 2 \fBsphinx.ext.autosummary.generate.AutosummaryRenderer\fP takes an object type as an argument .IP \(bu 2 The \fBignore\fP argument of \fBsphinx.ext.autodoc.Documenter.get_doc()\fP .IP \(bu 2 The \fBtemplate_dir\fP argument of \fBsphinx.ext.autosummary.generate. AutosummaryRenderer\fP .IP \(bu 2 The \fBmodule\fP argument of \fBsphinx.ext.autosummary.generate. find_autosummary_in_docstring()\fP .IP \(bu 2 The \fBbuilder\fP argument of \fBsphinx.ext.autosummary.generate. generate_autosummary_docs()\fP .IP \(bu 2 The \fBtemplate_dir\fP argument of \fBsphinx.ext.autosummary.generate. generate_autosummary_docs()\fP .IP \(bu 2 The \fBignore\fP argument of \fBsphinx.util.docstring.prepare_docstring()\fP .IP \(bu 2 \fBsphinx.ext.autosummary.generate.AutosummaryRenderer.exists()\fP .IP \(bu 2 \fBsphinx.util.rpartition()\fP .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 LaTeX: Make the \fBtoplevel_sectioning\fP setting optional in LaTeX theme .IP \(bu 2 LaTeX: Allow to override papersize and pointsize from LaTeX themes .IP \(bu 2 LaTeX: Add \fBlatex_theme_options\fP \%<#\:confval-latex_theme_options> to override theme options .IP \(bu 2 #7410: Allow to suppress \(dqcircular toctree references detected\(dq warnings using \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings> .IP \(bu 2 C, added scope control directives, \fBc:namespace\fP \%<#\:directive-c-namespace>, \fBc:namespace\-push\fP \%<#\:directive-c-namespace-push>, and \fBc:namespace\-pop\fP \%<#\:directive-c-namespace-pop>\&. .IP \(bu 2 #2044: autodoc: Suppress default value for instance attributes .IP \(bu 2 #7473: autodoc: consider a member public if docstring contains \fB:meta public:\fP in info\-field\-list .IP \(bu 2 #7487: autodoc: Allow to generate docs for singledispatch functions by py:autofunction .IP \(bu 2 #7143: autodoc: Support final classes and methods .IP \(bu 2 #7384: autodoc: Support signatures defined by \fB__new__()\fP, metaclasses and builtin base classes .IP \(bu 2 #2106: autodoc: Support multiple signatures on docstring .IP \(bu 2 #4422: autodoc: Support GenericAlias in Python 3.7 or above .IP \(bu 2 #3610: autodoc: Support overloaded functions .IP \(bu 2 #7722: autodoc: Support TypeVar .IP \(bu 2 #7466: autosummary: headings in generated documents are not translated .IP \(bu 2 #7490: autosummary: Add \fB:caption:\fP option to autosummary directive to set a caption to the toctree .IP \(bu 2 #7469: autosummary: Support module attributes .IP \(bu 2 #248, #6040: autosummary: Add \fB:recursive:\fP option to autosummary directive to generate stub files recursively .IP \(bu 2 #4030: autosummary: Add \fBautosummary_context\fP \%<#\:confval-autosummary_context> to add template variables for custom templates .IP \(bu 2 #7530: html: Support nested <kbd> elements .IP \(bu 2 #7481: html theme: Add right margin to footnote/citation labels .IP \(bu 2 #7482, #7717: html theme: CSS spacing for code blocks with captions and line numbers .IP \(bu 2 #7443: html theme: Add new options \fBglobaltoc_collapse\fP and \fBglobaltoc_includehidden\fP to control the behavior of globaltoc in sidebar .IP \(bu 2 #7484: html theme: Avoid clashes between sidebar and other blocks .IP \(bu 2 #7476: html theme: Relbar breadcrumb should contain current page .IP \(bu 2 #7506: html theme: A canonical URL is not escaped .IP \(bu 2 #7533: html theme: Avoid whitespace at the beginning of genindex.html .IP \(bu 2 #7541: html theme: Add a \(dqclearer\(dq at the end of the \(dqbody\(dq .IP \(bu 2 #7542: html theme: Make admonition/topic/sidebar scrollable .IP \(bu 2 #7543: html theme: Add top and bottom margins to tables .IP \(bu 2 #7695: html theme: Add viewport meta tag for basic theme .IP \(bu 2 #7721: html theme: classic: default codetextcolor/codebgcolor doesn\(aqt override Pygments .IP \(bu 2 C and C++: allow semicolon in the end of declarations. .IP \(bu 2 C++, parse parameterized noexcept specifiers. .IP \(bu 2 #7294: C++, parse expressions with user\-defined literals. .IP \(bu 2 C++, parse trailing return types. .IP \(bu 2 #7143: py domain: Add \fB:final:\fP option to \fBpy:class\fP \%<#\:directive-py-class>, \fBpy:exception\fP \%<#\:directive-py-exception> and \fBpy:method\fP \%<#\:directive-py-method> directives .IP \(bu 2 #7596: py domain: Change a type annotation for variables to a hyperlink .IP \(bu 2 #7770: std domain: \fBoption\fP \%<#\:directive-option> directive support arguments in the form of \fBfoo[=bar]\fP .IP \(bu 2 #7582: napoleon: a type for attribute are represented like type annotation .IP \(bu 2 #7734: napoleon: overescaped trailing underscore on attribute .IP \(bu 2 #7247: linkcheck: Add \fBlinkcheck_request_headers\fP \%<#\:confval-linkcheck_request_headers> to send custom HTTP headers for specific host .IP \(bu 2 #7792: setuptools: Support \fB\-\-verbosity\fP option .IP \(bu 2 #7683: Add \fBallowed_exceptions\fP parameter to \fBSphinx.emit()\fP to allow handlers to raise specified exceptions .IP \(bu 2 #7295: C++, parse (trailing) requires clauses. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #6703: autodoc: incremental build does not work for imported objects .IP \(bu 2 #7564: autodoc: annotations not to be shown for descriptors .IP \(bu 2 #6588: autodoc: Decorated inherited method has no documentation .IP \(bu 2 #7469: autodoc: The change of autodoc\-process\-docstring for variables is cached unexpectedly .IP \(bu 2 #7559: autodoc: misdetects a sync function is async .IP \(bu 2 #6857: autodoc: failed to detect a classmethod on Enum class .IP \(bu 2 #7562: autodoc: a typehint contains spaces is wrongly rendered under \fBautodoc_typehints\fP \%<#\:confval-autodoc_typehints>\fB=\(aqdescription\(aq\fP mode .IP \(bu 2 #7551: autodoc: failed to import nested class .IP \(bu 2 #7362: autodoc: does not render correct signatures for built\-in functions .IP \(bu 2 #7654: autodoc: \fBOptional[Union[foo, bar]]\fP is presented as \fBUnion[foo, bar, None]\fP .IP \(bu 2 #7629: autodoc: autofunction emits an unfriendly warning if an invalid object specified .IP \(bu 2 #7650: autodoc: undecorated signature is shown for decorated functions .IP \(bu 2 #7676: autodoc: typo in the default value of autodoc_member_order .IP \(bu 2 #7676: autodoc: wrong value for :member\-order: option is ignored silently .IP \(bu 2 #7676: autodoc: member\-order=\(dqbysource\(dq does not work for C module .IP \(bu 2 #3673: autodoc: member\-order=\(dqbysource\(dq does not work for a module having \fB__all__\fP .IP \(bu 2 #7668: autodoc: wrong retann value is passed to a handler of autodoc\-process\-signature .IP \(bu 2 #7711: autodoc: fails with ValueError when processing numpy objects .IP \(bu 2 #7791: autodoc: TypeError is raised on documenting singledispatch function .IP \(bu 2 #7551: autosummary: a nested class is indexed as non\-nested class .IP \(bu 2 #7661: autosummary: autosummary directive emits warnings twices if failed to import the target module .IP \(bu 2 #7685: autosummary: The template variable \(dqmembers\(dq contains imported members even if \fBautossummary_imported_members\fP is \fBFalse\fP .IP \(bu 2 #7671: autosummary: The location of import failure warning is missing .IP \(bu 2 #7535: sphinx\-autogen: crashes when custom template uses inheritance .IP \(bu 2 #7536: sphinx\-autogen: crashes when template uses i18n feature .IP \(bu 2 #7781: sphinx\-build: Wrong error message when outdir is not directory .IP \(bu 2 #7653: sphinx\-quickstart: Fix multiple directory creation for nested relpath .IP \(bu 2 #2785: html: Bad alignment of equation links .IP \(bu 2 #7718: html theme: some themes does not respect background color of Pygments style (agogo, haiku, nature, pyramid, scrolls, sphinxdoc and traditional) .IP \(bu 2 #7544: html theme: inconsistent padding in admonitions .IP \(bu 2 #7581: napoleon: bad parsing of inline code in attribute docstrings .IP \(bu 2 #7628: imgconverter: runs imagemagick once unnecessary for builders not supporting images .IP \(bu 2 #7610: incorrectly renders consecutive backslashes for Docutils 0.16 .IP \(bu 2 #7646: handle errors on event handlers .IP \(bu 2 #4187: LaTeX: EN DASH disappears from PDF bookmarks in Japanese documents .IP \(bu 2 #7701: LaTeX: Anonymous indirect hyperlink target causes duplicated labels .IP \(bu 2 #7723: LaTeX: pdflatex crashed when URL contains a single quote .IP \(bu 2 #7756: py domain: The default value for positional only argument is not shown .IP \(bu 2 #7760: coverage: Add \fBcoverage_show_missing_items\fP \%<#\:confval-coverage_show_missing_items> to show coverage result to console .IP \(bu 2 C++, fix rendering and xrefs in nested names explicitly starting in global scope, e.g., \fB::A::B\fP\&. .IP \(bu 2 C, fix rendering and xrefs in nested names explicitly starting in global scope, e.g., \fB\&.A.B\fP\&. .IP \(bu 2 #7763: C and C++, don\(aqt crash during display stringification of unary expressions and fold expressions. .UNINDENT .SS Sphinx 3.0 .SS Release 3.0.4 (released May 27, 2020) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7567: autodoc: parametrized types are shown twice for generic types .IP \(bu 2 #7637: autodoc: system defined TypeVars are shown in Python 3.9 .IP \(bu 2 #7696: html: Updated jQuery version from 3.4.1 to 3.5.1 for security reasons .IP \(bu 2 #7611: md5 fails when OpenSSL FIPS is enabled .IP \(bu 2 #7626: release package does not contain \fBCODE_OF_CONDUCT\fP .UNINDENT .SS Release 3.0.3 (released Apr 26, 2020) .SS Features added .INDENT 0.0 .IP \(bu 2 C, parse array declarators with static, qualifiers, and VLA specification. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7516: autodoc: crashes if target object raises an error on accessing its attributes .UNINDENT .SS Release 3.0.2 (released Apr 19, 2020) .SS Features added .INDENT 0.0 .IP \(bu 2 C, parse attributes and add \fBc_id_attributes\fP \%<#\:confval-c_id_attributes> and \fBc_paren_attributes\fP \%<#\:confval-c_paren_attributes> to support user\-defined attributes. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7461: py domain: fails with IndexError for empty tuple in type annotation .IP \(bu 2 #7510: py domain: keyword\-only arguments are documented as having a default of None .IP \(bu 2 #7418: std domain: \fBterm\fP \%<#\:role-term> role could not match case\-insensitively .IP \(bu 2 #7461: autodoc: empty tuple in type annotation is not shown correctly .IP \(bu 2 #7479: autodoc: Sphinx builds has been slower since 3.0.0 on mocking .IP \(bu 2 C++, fix spacing issue in east\-const declarations. .IP \(bu 2 #7414: LaTeX: Xindy language options were incorrect .IP \(bu 2 Sphinx crashes with ImportError on python3.5.1 .UNINDENT .SS Release 3.0.1 (released Apr 11, 2020) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #7418: std domain: \fBterm\fP \%<#\:role-term> role becomes case sensitive .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7428: py domain: a reference to class \fBNone\fP emits a nitpicky warning .IP \(bu 2 #7445: py domain: a return annotation \fBNone\fP in the function signature is not converted to a hyperlink when using intersphinx .IP \(bu 2 #7418: std domain: duplication warning for glossary terms is case insensitive .IP \(bu 2 #7438: C++, fix merging overloaded functions in parallel builds. .IP \(bu 2 #7422: autodoc: fails with ValueError when using autodoc_mock_imports .IP \(bu 2 #7435: autodoc: \fBautodoc_typehints\fP \%<#\:confval-autodoc_typehints>\fB=\(aqdescription\(aq\fP doesn\(aqt suppress typehints in signature for classes/methods .IP \(bu 2 #7451: autodoc: fails with AttributeError when an object returns non\-string object as a \fB__doc__\fP member .IP \(bu 2 #7423: crashed when giving a non\-string object to logger .IP \(bu 2 #7479: html theme: Do not include xmlns attribute with HTML 5 doctype .IP \(bu 2 #7426: html theme: Escape some links in HTML templates .UNINDENT .SS Release 3.0.0 (released Apr 06, 2020) .SS Dependencies .sp 3.0.0b1 .INDENT 0.0 .IP \(bu 2 LaTeX: drop dependency on \fBextractbb\fP for image inclusion in Japanese documents as \fB\&.xbb\fP files are unneeded by \fBdvipdfmx\fP since TeXLive2015 (refs: #6189) .IP \(bu 2 babel\-2.0 or above is available (Unpinned) .UNINDENT .SS Incompatible changes .sp 3.0.0b1 .INDENT 0.0 .IP \(bu 2 Drop features and APIs deprecated in 1.8.x .IP \(bu 2 #247: autosummary: stub files are overwritten automatically by default. see \fBautosummary_generate_overwrite\fP \%<#\:confval-autosummary_generate_overwrite> to change the behavior .IP \(bu 2 #5923: autodoc: the members of \fBobject\fP class are not documented by default when \fB:inherited\-members:\fP and \fB:special\-members:\fP are given. .IP \(bu 2 #6830: py domain: \fBmeta\fP fields in info\-field\-list becomes reserved. They are not displayed on output document now .IP \(bu 2 #6417: py domain: doctree of desc_parameterlist has been changed. The argument names, annotations and default values are wrapped with inline node .IP \(bu 2 The structure of \fBsphinx.events.EventManager.listeners\fP has changed .IP \(bu 2 Due to the scoping changes for \fBproductionlist\fP \%<#\:directive-productionlist> some uses of \fBtoken\fP \%<#\:role-token> must be modified to include the scope which was previously ignored. .IP \(bu 2 #6903: Internal data structure of Python, reST and standard domains have changed. The node_id is added to the index of objects and modules. Now they contains a pair of docname and node_id for cross reference. .IP \(bu 2 #7276: C++ domain: Non intended behavior is removed such as \fBsay_hello_\fP links to \fB\&.. cpp:function:: say_hello()\fP .IP \(bu 2 #7210: js domain: Non intended behavior is removed such as \fBparseInt_\fP links to \fB\&.. js:function:: parseInt\fP .IP \(bu 2 #7229: rst domain: Non intended behavior is removed such as \fBnumref_\fP links to \fB\&.. rst:role:: numref\fP .IP \(bu 2 #6903: py domain: Non intended behavior is removed such as \fBsay_hello_\fP links to \fB\&.. py:function:: say_hello()\fP .IP \(bu 2 #7246: py domain: Drop special cross reference helper for exceptions, functions and methods .IP \(bu 2 The C domain has been rewritten, with additional directives and roles. The existing ones are now more strict, resulting in new warnings. .IP \(bu 2 The attribute \fBsphinx_cpp_tagname\fP in the \fBdesc_signature_line\fP node has been renamed to \fBsphinx_line_type\fP\&. .IP \(bu 2 #6462: double backslashes in domain directives are no longer replaced by single backslashes as default. A new configuration value \fBstrip_signature_backslash\fP \%<#\:confval-strip_signature_backslash> can be used by users to re\-enable it. .UNINDENT .sp 3.0.0 final .INDENT 0.0 .IP \(bu 2 #7222: \fBsphinx.util.inspect.unwrap()\fP is renamed to \fBunwrap_all()\fP .UNINDENT .SS Deprecated .sp 3.0.0b1 .INDENT 0.0 .IP \(bu 2 \fBdesc_signature[\(aqfirst\(aq]\fP .IP \(bu 2 \fBsphinx.directives.DescDirective\fP .IP \(bu 2 \fBsphinx.domains.std.StandardDomain.add_object()\fP .IP \(bu 2 \fBsphinx.domains.python.PyDecoratorMixin\fP .IP \(bu 2 \fBsphinx.ext.autodoc.get_documenters()\fP .IP \(bu 2 \fBsphinx.ext.autosummary.process_autosummary_toc()\fP .IP \(bu 2 \fBsphinx.parsers.Parser.app\fP .IP \(bu 2 \fBsphinx.testing.path.Path.text()\fP .IP \(bu 2 \fBsphinx.testing.path.Path.bytes()\fP .IP \(bu 2 \fBsphinx.util.inspect.getargspec()\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXWriter.format_docclass()\fP .UNINDENT .SS Features added .sp 3.0.0b1 .INDENT 0.0 .IP \(bu 2 #247: autosummary: Add \fBautosummary_generate_overwrite\fP \%<#\:confval-autosummary_generate_overwrite> to overwrite old stub file .IP \(bu 2 #5923: autodoc: \fB:inherited\-members:\fP option takes a name of ancestor class not to document inherited members of the class and uppers .IP \(bu 2 #6830: autodoc: consider a member private if docstring contains \fB:meta private:\fP in info\-field\-list .IP \(bu 2 #7165: autodoc: Support Annotated type (PEP\-593) .IP \(bu 2 #2815: autodoc: Support singledispatch functions and methods .IP \(bu 2 #7079: autodoc: \fBautodoc_typehints\fP \%<#\:confval-autodoc_typehints> accepts \fB\(dqdescription\(dq\fP configuration. It shows typehints as object description .IP \(bu 2 #7314: apidoc: Propagate \fB\-\-maxdepth\fP option through package documents .IP \(bu 2 #6558: glossary: emit a warning for duplicated glossary entry .IP \(bu 2 #3106: domain: Register hyperlink target for index page automatically .IP \(bu 2 #6558: std domain: emit a warning for duplicated generic objects .IP \(bu 2 #6830: py domain: Add new event: \fBobject\-description\-transform\fP \%<#\:event-object-description-transform> .IP \(bu 2 #6895: py domain: Do not emit nitpicky warnings for built\-in types .IP \(bu 2 py domain: Support lambda functions in function signature .IP \(bu 2 #6417: py domain: Allow to make a style for arguments of functions and methods .IP \(bu 2 #7238, #7239: py domain: Emit a warning on describing a python object if the entry is already added as the same name .IP \(bu 2 #7341: py domain: type annotations in signature are converted to cross refs .IP \(bu 2 Support priority of event handlers. For more detail, see \fBSphinx.connect()\fP \%<#\:sphinx\:.application\:.Sphinx\:.connect> .IP \(bu 2 #3077: Implement the scoping for \fBproductionlist\fP \%<#\:directive-productionlist> as indicated in the documentation. .IP \(bu 2 #1027: Support backslash line continuation in \fBproductionlist\fP \%<#\:directive-productionlist>\&. .IP \(bu 2 #7108: config: Allow to show an error message from conf.py via \fBConfigError\fP .IP \(bu 2 #7032: html: \fBhtml_scaled_image_link\fP \%<#\:confval-html_scaled_image_link> will be disabled for images having \fBno\-scaled\-link\fP class .IP \(bu 2 #7144: Add CSS class indicating its domain for each desc node .IP \(bu 2 #7211: latex: Use babel for Chinese document when using XeLaTeX .IP \(bu 2 #6672: LaTeX: Support LaTeX Theming (experimental) .IP \(bu 2 #7005: LaTeX: Add LaTeX styling macro for \fBkbd\fP \%<#\:role-kbd> role .IP \(bu 2 #7220: genindex: Show \(dqmain\(dq index entries at first .IP \(bu 2 #7103: linkcheck: writes all links to \fBoutput.json\fP .IP \(bu 2 #7025: html search: full text search can be disabled for individual document using \fB:nosearch:\fP file\-wide metadata .IP \(bu 2 #7293: html search: Allow to override JavaScript splitter via \fBSearchLanguage.js_splitter_code\fP .IP \(bu 2 #7142: html theme: Add a theme option: \fBpygments_dark_style\fP to switch the style of code\-blocks in dark mode .IP \(bu 2 The C domain has been rewritten adding for example: .INDENT 2.0 .IP \(bu 2 Cross\-referencing respecting the current scope. .IP \(bu 2 Possible to document anonymous entities. .IP \(bu 2 More specific directives and roles for each type of entity, e.g., handling scoping of enumerators. .IP \(bu 2 New role \fBc:expr\fP \%<#\:role-c-expr> for rendering expressions and types in text. .UNINDENT .IP \(bu 2 Added \fBSphinxDirective.get_source_info()\fP and \fBSphinxRole.get_source_info()\fP\&. .IP \(bu 2 #7324: sphinx\-build: Emit a warning if multiple files having different file extensions for same document found .UNINDENT .sp 3.0.0 final .INDENT 0.0 .IP \(bu 2 Added \fBObjectDescription.transform_content()\fP\&. .UNINDENT .SS Bugs fixed .sp 3.0.0b1 .INDENT 0.0 .IP \(bu 2 C++, fix cross reference lookup in certain cases involving function overloads. .IP \(bu 2 #5078: C++, fix cross reference lookup when a directive contains multiple declarations. .IP \(bu 2 C++, suppress warnings for directly dependent typenames in cross references generated automatically in signatures. .IP \(bu 2 #5637: autodoc: Incorrect handling of nested class names on show\-inheritance .IP \(bu 2 #7267: autodoc: error message for invalid directive options has wrong location .IP \(bu 2 #7329: autodoc: info\-field\-list is wrongly generated from type hints into the class description even if \fBautoclass_content=\(aqclass\(aq\fP set .IP \(bu 2 #7331: autodoc: a cython\-function is not recognized as a function .IP \(bu 2 #5637: inheritance_diagram: Incorrect handling of nested class names .IP \(bu 2 #7139: \fBcode\-block:: guess\fP does not work .IP \(bu 2 #7325: html: source_suffix containing dot leads to wrong source link .IP \(bu 2 #7357: html: Resizing SVG image fails with ValueError .IP \(bu 2 #7278: html search: Fix use of \fBhtml_file_suffix\fP instead of \fBhtml_link_suffix\fP in search results .IP \(bu 2 #7297: html theme: \fBbizstyle\fP does not support \fBsidebarwidth\fP .IP \(bu 2 #3842: singlehtml: Path to images broken when master doc is not in source root .IP \(bu 2 #7179: std domain: Fix whitespaces are suppressed on referring GenericObject .IP \(bu 2 #7289: console: use bright colors instead of bold .IP \(bu 2 #1539: C, parse array types. .IP \(bu 2 #2377: C, parse function pointers even in complex types. .IP \(bu 2 #7345: sphinx\-build: Sphinx crashes if output directory exists as a file .IP \(bu 2 #7290: sphinx\-build: Ignore bdb.BdbQuit when handling exceptions .IP \(bu 2 #6240: napoleon: Attributes and Methods sections ignore :noindex: option .UNINDENT .sp 3.0.0 final .INDENT 0.0 .IP \(bu 2 #7364: autosummary: crashed when \fBautosummary_generate\fP \%<#\:confval-autosummary_generate> is \fBFalse\fP .IP \(bu 2 #7370: autosummary: raises UnboundLocalError when unknown module given .IP \(bu 2 #7367: C++, alternate operator spellings are now supported. .IP \(bu 2 C, alternate operator spellings are now supported. .IP \(bu 2 #7368: C++, comma operator in expressions, pack expansion in template argument lists, and more comprehensive error messages in some cases. .IP \(bu 2 C, C++, fix crash and wrong duplicate warnings related to anon symbols. .IP \(bu 2 #6477: Escape first \(dq!\(dq in a cross reference linking no longer possible .IP \(bu 2 #7219: py domain: The index entry generated by \fBpy:function\fP directive is different with one from \fBindex\fP directive with \(dqbuiltin\(dq type .IP \(bu 2 #7301: capital characters are not allowed for node_id .IP \(bu 2 #7301: epub: duplicated node_ids are generated .IP \(bu 2 #6564: html: a width of table was ignored on HTML builder .IP \(bu 2 #7401: Incorrect argument is passed for \fBenv\-get\-outdated\fP \%<#\:event-env-get-outdated> handlers .IP \(bu 2 #7355: autodoc: a signature of cython\-function is not recognized well .IP \(bu 2 #7222: autodoc: \fB__wrapped__\fP functions are not documented correctly .IP \(bu 2 #7409: intersphinx: ValueError is raised when an extension sets up \fBintersphinx_mapping\fP \%<#\:confval-intersphinx_mapping> on \fBconfig\-inited\fP \%<#\:event-config-inited> event .IP \(bu 2 #7343: Sphinx builds has been slower since 2.4.0 on debug mode .UNINDENT .SS Sphinx 2.4 .SS Release 2.4.5 (released Nov 18, 2021) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #9807: Restrict Docutils to 0.17.x or older .UNINDENT .SS Release 2.4.4 (released Mar 05, 2020) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7197: LaTeX: platex cause error to build image directive with target url .IP \(bu 2 #7223: Sphinx builds has been slower since 2.4.0 .UNINDENT .SS Release 2.4.3 (released Feb 22, 2020) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7184: autodoc: \fB*args\fP and \fB**kwarg\fP in type comments are not handled properly .IP \(bu 2 #7189: autodoc: classmethod coroutines are not detected .IP \(bu 2 #7183: intersphinx: \fB:attr:\fP reference to property is broken .IP \(bu 2 #6244, #6387: html search: Search breaks/hangs when built with dirhtml builder .IP \(bu 2 #7195: todo: emit doctree\-resolved event with non\-document node incorrectly .UNINDENT .SS Release 2.4.2 (released Feb 19, 2020) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7138: autodoc: \fBautodoc.typehints\fP crashed when variable has unbound object as a value .IP \(bu 2 #7156: autodoc: separator for keyword only arguments is not shown .IP \(bu 2 #7146: autodoc: IndexError is raised on suppressed type_comment found .IP \(bu 2 #7161: autodoc: typehints extension does not support parallel build .IP \(bu 2 #7178: autodoc: TypeError is raised on fetching type annotations .IP \(bu 2 #7151: crashed when extension assigns a value to \fBenv.indexentries\fP .IP \(bu 2 #7170: text: Remove debug print .IP \(bu 2 #7137: viewcode: Avoid to crash when non\-python code given .UNINDENT .SS Release 2.4.1 (released Feb 11, 2020) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #7120: html: crashed when on scaling SVG images which have float dimensions .IP \(bu 2 #7126: autodoc: TypeError: \(aqgetset_descriptor\(aq object is not iterable .UNINDENT .SS Release 2.4.0 (released Feb 09, 2020) .SS Deprecated .INDENT 0.0 .IP \(bu 2 The \fBdecode\fP argument of \fBsphinx.pycode.ModuleAnalyzer()\fP .IP \(bu 2 \fBsphinx.directives.other.Index\fP .IP \(bu 2 \fBsphinx.environment.temp_data[\(aqgloss_entries\(aq]\fP .IP \(bu 2 \fBsphinx.environment.BuildEnvironment.indexentries\fP .IP \(bu 2 \fBsphinx.environment.collectors.indexentries.IndexEntriesCollector\fP .IP \(bu 2 \fBsphinx.ext.apidoc.INITPY\fP .IP \(bu 2 \fBsphinx.ext.apidoc.shall_skip()\fP .IP \(bu 2 \fBsphinx.io.FiletypeNotFoundError\fP .IP \(bu 2 \fBsphinx.io.get_filetype()\fP .IP \(bu 2 \fBsphinx.pycode.ModuleAnalyzer.encoding\fP .IP \(bu 2 \fBsphinx.roles.Index\fP .IP \(bu 2 \fBsphinx.util.detect_encoding()\fP .IP \(bu 2 \fBsphinx.util.get_module_source()\fP .IP \(bu 2 \fBsphinx.util.inspect.Signature\fP .IP \(bu 2 \fBsphinx.util.inspect.safe_getmembers()\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.settings.author\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.settings.contentsname\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.settings.docclass\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.settings.docname\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.settings.title\fP .IP \(bu 2 \fBsphinx.writers.latex.ADDITIONAL_SETTINGS\fP .IP \(bu 2 \fBsphinx.writers.latex.DEFAULT_SETTINGS\fP .IP \(bu 2 \fBsphinx.writers.latex.LUALATEX_DEFAULT_FONTPKG\fP .IP \(bu 2 \fBsphinx.writers.latex.PDFLATEX_DEFAULT_FONTPKG\fP .IP \(bu 2 \fBsphinx.writers.latex.XELATEX_DEFAULT_FONTPKG\fP .IP \(bu 2 \fBsphinx.writers.latex.XELATEX_GREEK_DEFAULT_FONTPKG\fP .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #6910: inheritance_diagram: Make the background of diagrams transparent .IP \(bu 2 #6446: duration: Add \fBsphinx.ext.durations\fP to inspect which documents slow down the build .IP \(bu 2 #6837: LaTeX: Support a nested table .IP \(bu 2 #7115: LaTeX: Allow to override LATEXOPTS and LATEXMKOPTS via environment variable .IP \(bu 2 #6966: graphviz: Support \fB:class:\fP option .IP \(bu 2 #6696: html: \fB:scale:\fP option of image/figure directive not working for SVG images (imagesize\-1.2.0 or above is required) .IP \(bu 2 #6994: imgconverter: Support illustrator file (.ai) to .png conversion .IP \(bu 2 autodoc: Support Positional\-Only Argument separator (PEP\-570 compliant) .IP \(bu 2 autodoc: Support type annotations for variables .IP \(bu 2 #2755: autodoc: Add new event: \fBautodoc\-before\-process\-signature\fP \%<#\:event-autodoc-before-process-signature> .IP \(bu 2 #2755: autodoc: Support type_comment style (ex. \fB# type: (str) \-> str\fP) annotation (python3.8+ or typed_ast \%<https://\:github\:.com/\:python/\:typed_ast> is required) .IP \(bu 2 #7051: autodoc: Support instance variables without defaults (PEP\-526) .IP \(bu 2 #6418: autodoc: Add a new extension \fBsphinx.ext.autodoc.typehints\fP\&. It shows typehints as object description if \fBautodoc_typehints = \(dqdescription\(dq\fP set. This is an experimental extension and it will be integrated into autodoc core in Sphinx 3.0 .IP \(bu 2 SphinxTranslator now calls visitor/departure method for super node class if visitor/departure method for original node class not found .IP \(bu 2 #6418: Add new event: \fBobject\-description\-transform\fP \%<#\:event-object-description-transform> .IP \(bu 2 py domain: \fBpy:data\fP \%<#\:directive-py-data> and \fBpy:attribute\fP \%<#\:directive-py-attribute> take new options named \fB:type:\fP and \fB:value:\fP to describe its type and initial value .IP \(bu 2 #6785: py domain: \fB:py:attr:\fP is able to refer properties again .IP \(bu 2 #6772: apidoc: Add \fB\-q\fP option for quiet mode .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #6925: html: Remove redundant type=\(dqtext/javascript\(dq from <script> elements .IP \(bu 2 #7112: html: SVG image is not layouted as float even if aligned .IP \(bu 2 #6906, #6907: autodoc: failed to read the source codes encoded in cp1251 .IP \(bu 2 #6961: latex: warning for babel shown twice .IP \(bu 2 #7059: latex: LaTeX compilation falls into infinite loop (wrapfig issue) .IP \(bu 2 #6581: latex: \fB:reversed:\fP option for toctree does not effect to LaTeX build .IP \(bu 2 #6559: Wrong node\-ids are generated in glossary directive .IP \(bu 2 #6986: apidoc: misdetects module name for .so file inside module .IP \(bu 2 #6899: apidoc: private members are not shown even if \fB\-\-private\fP given .IP \(bu 2 #6327: apidoc: Support a python package consisted of __init__.so file .IP \(bu 2 #6999: napoleon: fails to parse tilde in :exc: role .IP \(bu 2 #7019: gettext: Absolute path used in message catalogs .IP \(bu 2 #7023: autodoc: nested partial functions are not listed .IP \(bu 2 #7023: autodoc: partial functions imported from other modules are listed as module members without :impoprted\-members: option .IP \(bu 2 #6889: autodoc: Trailing comma in \fB:members::\fP option causes cryptic warning .IP \(bu 2 #6568: autosummary: \fBautosummary_imported_members\fP is ignored on generating a stub file for submodule .IP \(bu 2 #7055: linkcheck: redirect is treated as an error .IP \(bu 2 #7088: HTML template: If \fBnavigation_with_keys\fP option is activated, modifier keys are ignored, which means the feature can interfere with browser features .IP \(bu 2 #7090: std domain: Can\(aqt assign numfig\-numbers for custom container nodes .IP \(bu 2 #7106: std domain: enumerated nodes are marked as duplicated when extensions call \fBnote_explicit_target()\fP .IP \(bu 2 #7095: dirhtml: Cross references are broken via intersphinx and \fB:doc:\fP role .IP \(bu 2 C++: .INDENT 2.0 .IP \(bu 2 Don\(aqt crash when using the \fBstruct\fP role in some cases. .IP \(bu 2 Don\(aqt warn when using the \fBvar\fP/\fBmember\fP role for function parameters. .IP \(bu 2 Render call and braced\-init expressions correctly. .UNINDENT .IP \(bu 2 #7097: Filenames of images generated by \fBsphinx.transforms.post_transforms.images.ImageConverter\fP or its subclasses (used for latex build) are now sanitized, to prevent broken paths .UNINDENT .SS Sphinx 2.3 .SS Release 2.3.1 (released Dec 22, 2019) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #6936: sphinx\-autogen: raises AttributeError .UNINDENT .SS Release 2.3.0 (released Dec 15, 2019) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #6742: \fBend\-before\fP option of \fBliteralinclude\fP \%<#\:directive-literalinclude> directive does not match the first line of the code block. .IP \(bu 2 #1331: Change default User\-Agent header to \fB\(dqSphinx/X.Y.Z requests/X.Y.Z python/X.Y.Z\(dq\fP\&. It can be changed via \fBuser_agent\fP \%<#\:confval-user_agent>\&. .IP \(bu 2 #6867: text: content of admonitions starts after a blank line .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 \fBsphinx.builders.gettext.POHEADER\fP .IP \(bu 2 \fBsphinx.io.SphinxStandaloneReader.app\fP .IP \(bu 2 \fBsphinx.io.SphinxStandaloneReader.env\fP .IP \(bu 2 \fBsphinx.util.texescape.tex_escape_map\fP .IP \(bu 2 \fBsphinx.util.texescape.tex_hl_escape_map_new\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.no_contractions\fP .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #6707: C++, support bit\-fields. .IP \(bu 2 #267: html: Eliminate prompt characters of doctest block from copyable text .IP \(bu 2 #6548: html: Use favicon for OpenSearch if available .IP \(bu 2 #6729: html theme: agogo theme now supports \fBrightsidebar\fP option .IP \(bu 2 #6780: Add PEP\-561 Support .IP \(bu 2 #6762: latex: Allow to load additional LaTeX packages via \fBextrapackages\fP key of \fBlatex_elements\fP \%<#\:confval-latex_elements> .IP \(bu 2 #1331: Add new config variable: \fBuser_agent\fP \%<#\:confval-user_agent> .IP \(bu 2 #6000: LaTeX: have backslash also be an inline literal word wrap break character .IP \(bu 2 #4186: LaTeX: Support upLaTeX as a new \fBlatex_engine\fP \%<#\:confval-latex_engine> (experimental) .IP \(bu 2 #6812: Improve a warning message when extensions are not parallel safe .IP \(bu 2 #6818: Improve Intersphinx performance for multiple remote inventories. .IP \(bu 2 #2546: apidoc: .so file support .IP \(bu 2 #6798: autosummary: emit \fBautodoc\-skip\-member\fP event on generating stub file .IP \(bu 2 #6483: i18n: make explicit titles in toctree translatable .IP \(bu 2 #6816: linkcheck: Add \fBlinkcheck_auth\fP \%<#\:confval-linkcheck_auth> option to provide authentication information when doing \fBlinkcheck\fP builds .IP \(bu 2 #6872: linkcheck: Handles HTTP 308 Permanent Redirect .IP \(bu 2 #6613: html: Wrap section number in span tag .IP \(bu 2 #6781: gettext: Add \fBgettext_last_translator\fP and \fBgettext_language_team\fP to customize headers of POT file .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #6668: LaTeX: Longtable before header has incorrect distance (refs: latex3/latex2e#173 \%<https://\:github\:.com/\:latex3/\:latex2e/\:issues/\:173>) .IP \(bu 2 #6618: LaTeX: Avoid section names at the end of a page .IP \(bu 2 #6738: LaTeX: Do not replace unicode characters by LaTeX macros on unicode supported LaTeX engines: ¶, §, €, ∞, ±, →, ‣, –, superscript and subscript digits go through \(dqas is\(dq (as default OpenType font supports them) .IP \(bu 2 #6704: linkcheck: Be defensive and handle newly defined HTTP error code .IP \(bu 2 #6806: linkcheck: Failure on parsing content .IP \(bu 2 #6655: image URLs containing \fBdata:\fP causes gettext builder crashed .IP \(bu 2 #6584: i18n: Error when compiling message catalogs on Hindi .IP \(bu 2 #6718: i18n: KeyError is raised if section title and table title are same .IP \(bu 2 #6743: i18n: \fBrst_prolog\fP \%<#\:confval-rst_prolog> breaks the translation .IP \(bu 2 #6708: mathbase: Some deprecated functions have removed .IP \(bu 2 #6709: autodoc: mock object does not work as a class decorator .IP \(bu 2 #5070: epub: Wrong internal href fragment links .IP \(bu 2 #6712: Allow not to install sphinx.testing as runtime (mainly for ALT Linux) .IP \(bu 2 #6741: html: search result was broken with empty \fBhtml_file_suffix\fP \%<#\:confval-html_file_suffix> .IP \(bu 2 #6001: LaTeX does not wrap long code lines at backslash character .IP \(bu 2 #6804: LaTeX: PDF build breaks if admonition of danger type contains code\-block long enough not to fit on one page .IP \(bu 2 #6809: LaTeX: code\-block in a danger type admonition can easily spill over bottom of page .IP \(bu 2 #6793: texinfo: Code examples broken following \(dqsidebar\(dq .IP \(bu 2 #6813: An orphan warning is emitted for included document on Windows. Thanks to @drillan .IP \(bu 2 #6850: Fix smartypants module calls re.sub() with wrong options .IP \(bu 2 #6824: HTML search: If a search term is partially matched in the title and fully matched in a text paragraph on the same page, the search does not include this match. .IP \(bu 2 #6848: config.py shouldn\(aqt pop extensions from overrides .IP \(bu 2 #6867: text: extra spaces are inserted to hyphenated words on folding lines .IP \(bu 2 #6886: LaTeX: xelatex converts straight double quotes into right curly ones (shows when \fBsmartquotes\fP \%<#\:confval-smartquotes> is \fBFalse\fP) .IP \(bu 2 #6890: LaTeX: even with smartquotes off, PDF output transforms straight quotes and consecutive hyphens into curly quotes and dashes .IP \(bu 2 #6876: LaTeX: multi\-line display of authors on title page has ragged edges .IP \(bu 2 #6887: Sphinx crashes with Docutils 0.16b0 .IP \(bu 2 #6920: sphinx\-build: A console message is wrongly highlighted .IP \(bu 2 #6900: sphinx\-build: \fB\-D\fP option does not considers \fB0\fP and \fB1\fP as a boolean value .UNINDENT .SS Sphinx 2.2 .SS Release 2.2.2 (released Dec 03, 2019) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #6803: For security reason of python, parallel mode is disabled on macOS and Python3.8+ .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #6776: LaTeX: 2019\-10\-01 LaTeX release breaks \fBsphinxcyrillic.sty\fP .IP \(bu 2 #6815: i18n: French, Hindi, Chinese, Japanese and Korean translation messages has been broken .IP \(bu 2 #6803: parallel build causes AttributeError on macOS and Python3.8 .UNINDENT .SS Release 2.2.1 (released Oct 26, 2019) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #6641: LaTeX: Undefined control sequence \fB\esphinxmaketitle\fP .IP \(bu 2 #6710: LaTeX not well configured for Greek language as main language .IP \(bu 2 #6759: validation of html static paths and extra paths no longer throws an error if the paths are in different directories .UNINDENT .SS Release 2.2.0 (released Aug 19, 2019) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 apidoc: template files are renamed to \fB\&.rst_t\fP .IP \(bu 2 html: Field lists will be styled by grid layout .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 \fBsphinx.domains.math.MathDomain.add_equation()\fP .IP \(bu 2 \fBsphinx.domains.math.MathDomain.get_next_equation_number()\fP .IP \(bu 2 The \fBinfo\fP and \fBwarn\fP arguments of \fBsphinx.ext.autosummary.generate.generate_autosummary_docs()\fP .IP \(bu 2 \fBsphinx.ext.autosummary.generate._simple_info()\fP .IP \(bu 2 \fBsphinx.ext.autosummary.generate._simple_warn()\fP .IP \(bu 2 \fBsphinx.ext.todo.merge_info()\fP .IP \(bu 2 \fBsphinx.ext.todo.process_todo_nodes()\fP .IP \(bu 2 \fBsphinx.ext.todo.process_todos()\fP .IP \(bu 2 \fBsphinx.ext.todo.purge_todos()\fP .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #5124: graphviz: \fB:graphviz_dot:\fP option is renamed to \fB:layout:\fP .IP \(bu 2 #1464: html: emit a warning if \fBhtml_static_path\fP \%<#\:confval-html_static_path> and \fBhtml_extra_path\fP \%<#\:confval-html_extra_path> directories are inside output directory .IP \(bu 2 #6514: html: Add a label to search input for accessibility purposes .IP \(bu 2 #5602: apidoc: Add \fB\-\-templatedir\fP option .IP \(bu 2 #6475: Add \fBoverride\fP argument to \fBapp.add_autodocumenter()\fP .IP \(bu 2 #6310: imgmath: let \fBimgmath_use_preview\fP \%<#\:confval-imgmath_use_preview> work also with the SVG format for images rendering inline math .IP \(bu 2 #6533: LaTeX: refactor visit_enumerated_list() to use \fB\esphinxsetlistlabels\fP .IP \(bu 2 #6628: quickstart: Use \fBhttps://docs.python.org/3/\fP for default setting of \fBintersphinx_mapping\fP \%<#\:confval-intersphinx_mapping> .IP \(bu 2 #6419: sphinx\-build: give reasons why rebuilt .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 py domain: duplicated warning does not point the location of source code .IP \(bu 2 #6499: html: Sphinx never updates a copy of \fBhtml_logo\fP \%<#\:confval-html_logo> even if original file has changed .IP \(bu 2 #1125: html theme: scrollbar is hard to see on classic theme and macOS .IP \(bu 2 #5502: linkcheck: Consider HTTP 503 response as not an error .IP \(bu 2 #6439: Make generated download links reproducible .IP \(bu 2 #6486: UnboundLocalError is raised if broken extension installed .IP \(bu 2 #6567: autodoc: \fBautodoc_inherit_docstrings\fP \%<#\:confval-autodoc_inherit_docstrings> does not effect to \fB__init__()\fP and \fB__new__()\fP .IP \(bu 2 #6574: autodoc: \fBautodoc_member_order\fP \%<#\:confval-autodoc_member_order> does not refer order of imports when \fB\(aqbysource\(aq\fP order .IP \(bu 2 #6574: autodoc: missing type annotation for variadic and keyword parameters .IP \(bu 2 #6589: autodoc: Formatting issues with autodoc_typehints=\(aqnone\(aq .IP \(bu 2 #6605: autodoc: crashed when target code contains custom method\-like objects .IP \(bu 2 #6498: autosummary: crashed with wrong autosummary_generate setting .IP \(bu 2 #6507: autosummary: crashes without no autosummary_generate setting .IP \(bu 2 #6511: LaTeX: autonumbered list can not be customized in LaTeX since Sphinx 1.8.0 (refs: #6533) .IP \(bu 2 #6531: Failed to load last environment object when extension added .IP \(bu 2 #736: Invalid sort in pair index .IP \(bu 2 #6527: \fBlast_updated\fP \%<#\:last_updated> wrongly assumes timezone as UTC .IP \(bu 2 #5592: std domain: \fBoption\fP \%<#\:directive-option> directive registers an index entry for each comma separated option .IP \(bu 2 #6549: sphinx\-build: Escaped characters in error messages .IP \(bu 2 #6545: doctest comments not getting trimmed since Sphinx 1.8.0 .IP \(bu 2 #6561: glossary: Wrong hyperlinks are generated for non alphanumeric terms .IP \(bu 2 #6620: i18n: classifiers of definition list are not translated with Docutils 0.15 .IP \(bu 2 #6474: \fBDocFieldTransformer\fP raises AttributeError when given directive is not a subclass of ObjectDescription .UNINDENT .SS Sphinx 2.1 .SS Release 2.1.2 (released Jun 19, 2019) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #6497: custom lexers fails highlighting when syntax error .IP \(bu 2 #6478, #6488: info field lists are incorrectly recognized .UNINDENT .SS Release 2.1.1 (released Jun 10, 2019) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #6447: autodoc: Stop to generate document for undocumented module variables .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #6442: LaTeX: admonitions of \fBnote\fP \%<#\:directive-note> type can get separated from immediately preceding section title by pagebreak .IP \(bu 2 #6448: autodoc: crashed when autodocumenting classes with \fB__slots__ = None\fP .IP \(bu 2 #6451: autodoc: generates docs for \(dqoptional import\(dqed modules as variables .IP \(bu 2 #6452: autosummary: crashed when generating document of properties .IP \(bu 2 #6455: napoleon: docstrings for properties are not processed .IP \(bu 2 #6436: napoleon: \(dqUnknown target name\(dq error if variable name ends with underscore .IP \(bu 2 #6440: apidoc: missing blank lines between modules .UNINDENT .SS Release 2.1.0 (released Jun 02, 2019) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Ignore filenames without file extension given to \fBBuilder.build_specific()\fP API directly .IP \(bu 2 #6230: The anchor of term in glossary directive is changed if it is consisted by non\-ASCII characters .IP \(bu 2 #4550: html: Centering tables by default using CSS .IP \(bu 2 #6239: latex: xelatex and xeCJK are used for Chinese documents by default .IP \(bu 2 \fBSphinx.add_lexer()\fP now takes a Lexer class instead of instance. An instance of lexers are still supported until Sphinx 3.x. .UNINDENT .SS Deprecated .INDENT 0.0 .IP \(bu 2 \fBsphinx.builders.latex.LaTeXBuilder.apply_transforms()\fP .IP \(bu 2 \fBsphinx.builders._epub_base.EpubBuilder.esc()\fP .IP \(bu 2 \fBsphinx.directives.Acks\fP .IP \(bu 2 \fBsphinx.directives.Author\fP .IP \(bu 2 \fBsphinx.directives.Centered\fP .IP \(bu 2 \fBsphinx.directives.Class\fP .IP \(bu 2 \fBsphinx.directives.CodeBlock\fP .IP \(bu 2 \fBsphinx.directives.Figure\fP .IP \(bu 2 \fBsphinx.directives.HList\fP .IP \(bu 2 \fBsphinx.directives.Highlight\fP .IP \(bu 2 \fBsphinx.directives.Include\fP .IP \(bu 2 \fBsphinx.directives.Index\fP .IP \(bu 2 \fBsphinx.directives.LiteralInclude\fP .IP \(bu 2 \fBsphinx.directives.Meta\fP .IP \(bu 2 \fBsphinx.directives.Only\fP .IP \(bu 2 \fBsphinx.directives.SeeAlso\fP .IP \(bu 2 \fBsphinx.directives.TabularColumns\fP .IP \(bu 2 \fBsphinx.directives.TocTree\fP .IP \(bu 2 \fBsphinx.directives.VersionChange\fP .IP \(bu 2 \fBsphinx.domains.python.PyClassmember\fP .IP \(bu 2 \fBsphinx.domains.python.PyModulelevel\fP .IP \(bu 2 \fBsphinx.domains.std.StandardDomain._resolve_citation_xref()\fP .IP \(bu 2 \fBsphinx.domains.std.StandardDomain.note_citations()\fP .IP \(bu 2 \fBsphinx.domains.std.StandardDomain.note_citation_refs()\fP .IP \(bu 2 \fBsphinx.domains.std.StandardDomain.note_labels()\fP .IP \(bu 2 \fBsphinx.environment.NoUri\fP .IP \(bu 2 \fBsphinx.ext.apidoc.format_directive()\fP .IP \(bu 2 \fBsphinx.ext.apidoc.format_heading()\fP .IP \(bu 2 \fBsphinx.ext.apidoc.makename()\fP .IP \(bu 2 \fBsphinx.ext.autodoc.importer.MockFinder\fP .IP \(bu 2 \fBsphinx.ext.autodoc.importer.MockLoader\fP .IP \(bu 2 \fBsphinx.ext.autodoc.importer.mock()\fP .IP \(bu 2 \fBsphinx.ext.autosummary.autolink_role()\fP .IP \(bu 2 \fBsphinx.ext.imgmath.DOC_BODY\fP .IP \(bu 2 \fBsphinx.ext.imgmath.DOC_BODY_PREVIEW\fP .IP \(bu 2 \fBsphinx.ext.imgmath.DOC_HEAD\fP .IP \(bu 2 \fBsphinx.transforms.CitationReferences\fP .IP \(bu 2 \fBsphinx.transforms.SmartQuotesSkipper\fP .IP \(bu 2 \fBsphinx.util.docfields.DocFieldTransformer.preprocess_fieldtypes()\fP .IP \(bu 2 \fBsphinx.util.node.find_source_node()\fP .IP \(bu 2 \fBsphinx.util.i18n.find_catalog()\fP .IP \(bu 2 \fBsphinx.util.i18n.find_catalog_files()\fP .IP \(bu 2 \fBsphinx.util.i18n.find_catalog_source_files()\fP .UNINDENT .sp For more details, see deprecation APIs list \%<#\:dev-deprecated-apis>\&. .SS Features added .INDENT 0.0 .IP \(bu 2 Add a helper class \fBsphinx.transforms.post_transforms.SphinxPostTransform\fP .IP \(bu 2 Add helper methods .INDENT 2.0 .IP \(bu 2 \fBPythonDomain.note_module()\fP .IP \(bu 2 \fBPythonDomain.note_object()\fP .IP \(bu 2 \fBSphinxDirective.set_source_info()\fP .UNINDENT .IP \(bu 2 #6180: Support \fB\-\-keep\-going\fP with \fBBuildDoc\fP setup command .IP \(bu 2 \fBmath\fP directive now supports \fB:class:\fP option .IP \(bu 2 todo: \fBtodo\fP directive now supports \fB:name:\fP option .IP \(bu 2 Enable override via environment of \fBSPHINXOPTS\fP and \fBSPHINXBUILD\fP Makefile variables (refs: #6232, #6303) .IP \(bu 2 #6287: autodoc: Unable to document bound instance methods exported as module functions .IP \(bu 2 #6289: autodoc: \fBautodoc_default_options\fP \%<#\:confval-autodoc_default_options> now supports \fBimported\-members\fP option .IP \(bu 2 #4777: autodoc: Support coroutine .IP \(bu 2 #744: autodoc: Support abstractmethod .IP \(bu 2 #6325: autodoc: Support attributes in __slots__. For dict\-style __slots__, autodoc considers values as a docstring of the attribute .IP \(bu 2 #6361: autodoc: Add \fBautodoc_typehints\fP \%<#\:confval-autodoc_typehints> to suppress typehints from signature .IP \(bu 2 #1063: autodoc: \fBautomodule\fP directive now handles undocumented module level variables .IP \(bu 2 #6212: autosummary: Add \fBautosummary_imported_members\fP \%<#\:confval-autosummary_imported_members> to display imported members on autosummary .IP \(bu 2 #6271: \fBmake clean\fP is catastrophically broken if building into \(aq.\(aq .IP \(bu 2 #6363: Support \fB%O%\fP environment variable in make.bat .IP \(bu 2 #4777: py domain: Add \fB:async:\fP option to \fBpy:function\fP \%<#\:directive-py-function> directive .IP \(bu 2 py domain: Add new options to \fBpy:method\fP \%<#\:directive-py-method> directive .INDENT 2.0 .IP \(bu 2 \fB:abstractmethod:\fP .IP \(bu 2 \fB:async:\fP .IP \(bu 2 \fB:classmethod:\fP .IP \(bu 2 \fB:property:\fP .IP \(bu 2 \fB:staticmethod:\fP .UNINDENT .IP \(bu 2 rst domain: Add \fBrst:directive:option\fP \%<#\:directive-rst-directive-option> directive to describe the option for directive .IP \(bu 2 #6306: html: Add a label to search form for accessibility purposes .IP \(bu 2 #4390: html: Consistent and semantic CSS for signatures .IP \(bu 2 #6358: The \fBrawsource\fP property of \fBproduction\fP nodes now contains the full production rule .IP \(bu 2 #6373: autosectionlabel: Allow suppression of warnings .IP \(bu 2 coverage: Support a new \fBcoverage_ignore_pyobjects\fP option .IP \(bu 2 #6239: latex: Support to build Chinese documents .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #6230: Inappropriate node_id has been generated by glossary directive if term is consisted by non\-ASCII characters .IP \(bu 2 #6213: ifconfig: contents after headings are not shown .IP \(bu 2 commented term in glossary directive is wrongly recognized .IP \(bu 2 #6299: rst domain: rst:directive directive generates waste space .IP \(bu 2 #6379: py domain: Module index (py\-modindex.html) has duplicate titles .IP \(bu 2 #6331: man: invalid output when doctest follows rubric .IP \(bu 2 #6351: \(dqHyperlink target is not referenced\(dq message is shown even if referenced .IP \(bu 2 #6165: autodoc: \fBtab_width\fP setting of Docutils has been ignored .IP \(bu 2 #6347: autodoc: crashes with a plain Tuple on Python 3.6 and 3.5 .IP \(bu 2 #6311: autosummary: autosummary table gets confused by complex type hints .IP \(bu 2 #6350: autosummary: confused by an argument having some kind of default value .IP \(bu 2 Generated Makefiles lack a final EOL (refs: #6232) .IP \(bu 2 #6375: extlinks: Cannot escape angle brackets in link caption .IP \(bu 2 #6378: linkcheck: Send commonly used User\-Agent .IP \(bu 2 #6387: html search: failed to search document with haiku and scrolls themes .IP \(bu 2 #6408: html search: Fix the ranking of search results .IP \(bu 2 #6406: Wrong year is returned for \fBSOURCE_DATE_EPOCH\fP .IP \(bu 2 #6402: image directive crashes by unknown image format .IP \(bu 2 #6286: C++, allow 8 and 9 in hexadecimal integer literals. .IP \(bu 2 #6305: Fix the string in quickstart for \(aqpath\(aq argument of parser .IP \(bu 2 LaTeX: Figures in admonitions produced errors (refs: #6364) .UNINDENT .SS Sphinx 2.0 .SS Release 2.0.1 (released Apr 08, 2019) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 LaTeX: some system labels are not translated .IP \(bu 2 RemovedInSphinx30Warning is marked as pending .IP \(bu 2 deprecation warnings are not emitted .INDENT 2.0 .IP \(bu 2 \fBsphinx.application.CONFIG_FILENAME\fP .IP \(bu 2 \fBsphinx.builders.htmlhelp\fP .IP \(bu 2 \fBviewcode_import\fP .UNINDENT .IP \(bu 2 #6208: C++, properly parse full xrefs that happen to have a short xref as prefix .IP \(bu 2 #6220, #6225: napoleon: AttributeError is raised for raised section having references .IP \(bu 2 #6245: circular import error on importing SerializingHTMLBuilder .IP \(bu 2 #6243: LaTeX: \(aqreleasename\(aq setting for latex_elements is ignored .IP \(bu 2 #6244: html: Search function is broken with 3rd party themes .IP \(bu 2 #6263: html: HTML5Translator crashed with invalid field node .IP \(bu 2 #6262: html theme: The style of field lists has changed in bizstyle theme .UNINDENT .SS Release 2.0.0 (released Mar 29, 2019) .SS Dependencies .sp 2.0.0b1 .INDENT 0.0 .IP \(bu 2 LaTeX builder now depends on TeX Live 2015 or above. .IP \(bu 2 LaTeX builder (with \fB\(aqpdflatex\(aq\fP \fBlatex_engine\fP \%<#\:confval-latex_engine>) will process Unicode Greek letters in text (not in math mark\-up) via the text font and will not escape them to math mark\-up. See the discussion of the \fB\(aqfontenc\(aq\fP key of \fBlatex_elements\fP \%<#\:confval-latex_elements>; such (optional) support for Greek adds, for example on Ubuntu xenial, the \fBtexlive\-lang\-greek\fP and (if default font set\-up is not modified) \fBcm\-super(\-minimal)\fP as additional Sphinx LaTeX requirements. .IP \(bu 2 LaTeX builder with \fBlatex_engine\fP \%<#\:confval-latex_engine> set to \fB\(aqxelatex\(aq\fP or to \fB\(aqlualatex\(aq\fP requires (by default) the \fBFreeFont\fP fonts, which in Ubuntu xenial are provided by package \fBfonts\-freefont\-otf\fP, and e.g. in Fedora 29 via package \fBtexlive\-gnu\-freefont\fP\&. .IP \(bu 2 requests 2.5.0 or above .IP \(bu 2 The six package is no longer a dependency .IP \(bu 2 The sphinxcontrib\-websupport package is no longer a dependency .IP \(bu 2 Some packages are separated to sub packages: .INDENT 2.0 .IP \(bu 2 sphinxcontrib.applehelp .IP \(bu 2 sphinxcontrib.devhelp .IP \(bu 2 sphinxcontrib.htmlhelp .IP \(bu 2 sphinxcontrib.jsmath .IP \(bu 2 sphinxcontrib.serializinghtml .IP \(bu 2 sphinxcontrib.qthelp .UNINDENT .UNINDENT .SS Incompatible changes .sp 2.0.0b1 .INDENT 0.0 .IP \(bu 2 Drop python 2.7 and 3.4 support .IP \(bu 2 Drop Docutils 0.11 support .IP \(bu 2 Drop features and APIs deprecated in 1.7.x .IP \(bu 2 The default setting for \fBmaster_doc\fP \%<#\:confval-master_doc> is changed to \fB\(aqindex\(aq\fP which has been longly used as default of sphinx\-quickstart. .IP \(bu 2 LaTeX: Move message resources to \fBsphinxmessage.sty\fP .IP \(bu 2 LaTeX: Stop using \fB\ecaptions<lang>\fP macro for some labels .IP \(bu 2 LaTeX: for \fB\(aqxelatex\(aq\fP and \fB\(aqlualatex\(aq\fP, use the \fBFreeFont\fP OpenType fonts as default choice (refs: #5645) .IP \(bu 2 LaTeX: \fB\(aqxelatex\(aq\fP and \fB\(aqlualatex\(aq\fP now use \fB\esmall\fP in code\-blocks (due to \fBFreeMono\fP character width) like \fB\(aqpdflatex\(aq\fP already did (due to \fBCourier\fP character width). You may need to adjust this via \fBlatex_elements\fP \%<#\:confval-latex_elements> \fB\(aqfvset\(aq\fP key, in case of usage of some other OpenType fonts (refs: #5768) .IP \(bu 2 LaTeX: Greek letters in text are not escaped to math mode mark\-up, and they will use the text font not the math font. The \fBLGR\fP font encoding must be added to the \fB\(aqfontenc\(aq\fP key of \fBlatex_elements\fP \%<#\:confval-latex_elements> for this to work (only if it is needed by the document, of course). .IP \(bu 2 LaTeX: setting the \fBlanguage\fP \%<#\:confval-language> to \fB\(aqen\(aq\fP triggered \fBSonny\fP option of \fBfncychap\fP, now it is \fBBjarne\fP to match case of no language specified. (refs: #5772) .IP \(bu 2 #5770: doctest: Follow \fBhighlight_language\fP \%<#\:confval-highlight_language> on highlighting doctest block. As a result, they are highlighted as python3 by default. .IP \(bu 2 The order of argument for \fBHTMLTranslator\fP, \fBHTML5Translator\fP and \fBManualPageTranslator\fP are changed .IP \(bu 2 LaTeX: hard\-coded redefinitions of \fB\el@section\fP and \fB\el@subsection\fP formerly done during loading of \fB\(aqmanual\(aq\fP docclass get executed later, at time of \fB\esphinxtableofcontents\fP\&. This means that custom user definitions from LaTeX preamble now get overwritten. Use \fB\esphinxtableofcontentshook\fP to insert custom user definitions. See Macros \%<#\:latex-macros>\&. .IP \(bu 2 quickstart: Simplify generated \fBconf.py\fP .IP \(bu 2 #4148: quickstart: some questions are removed. They are still able to specify via command line options .IP \(bu 2 websupport: unbundled from Sphinx core. Please use sphinxcontrib\-websupport .IP \(bu 2 C++, the visibility of base classes is now always rendered as present in the input. That is, \fBprivate\fP is now shown, where it was ellided before. .IP \(bu 2 LaTeX: graphics inclusion of oversized images rescales to not exceed the text width and height, even if width and/or height option were used. (refs: #5956) .IP \(bu 2 epub: \fBepub_title\fP defaults to the \fBproject\fP \%<#\:confval-project> option .IP \(bu 2 #4550: All tables and figures without \fBalign\fP option are displayed to center .IP \(bu 2 #4587: html: Output HTML5 by default .UNINDENT .sp 2.0.0b2 .INDENT 0.0 .IP \(bu 2 texinfo: image files are copied into \fBname\-figure\fP directory .UNINDENT .SS Deprecated .sp 2.0.0b1 .INDENT 0.0 .IP \(bu 2 Support for evaluating Python 2 syntax is deprecated. This includes configuration files which should be converted to Python 3. .IP \(bu 2 The arguments of \fBEpubBuilder.build_mimetype()\fP, \fBEpubBuilder.build_container()\fP, \fBEpubBuilder.bulid_content()\fP, \fBEpubBuilder.build_toc()\fP and \fBEpubBuilder.build_epub()\fP .IP \(bu 2 The arguments of \fBEpub3Builder.build_navigation_doc()\fP .IP \(bu 2 The config variables .INDENT 2.0 .IP \(bu 2 \fBhtml_experimental_html5_writer\fP .UNINDENT .IP \(bu 2 The \fBencoding\fP argument of \fBautodoc.Documenter.get_doc()\fP, \fBautodoc.DocstringSignatureMixin.get_doc()\fP, \fBautodoc.DocstringSignatureMixin._find_signature()\fP, and \fBautodoc.ClassDocumenter.get_doc()\fP are deprecated. .IP \(bu 2 The \fBimporter\fP argument of \fBsphinx.ext.autodoc.importer._MockModule\fP .IP \(bu 2 The \fBnodetype\fP argument of \fBsphinx.search.WordCollector. is_meta_keywords()\fP .IP \(bu 2 The \fBsuffix\fP argument of \fBenv.doc2path()\fP is deprecated. .IP \(bu 2 The string style \fBbase\fP argument of \fBenv.doc2path()\fP is deprecated. .IP \(bu 2 The fallback to allow omitting the \fBfilename\fP argument from an overridden \fBIndexBuilder.feed()\fP method is deprecated. .IP \(bu 2 \fBsphinx.addnodes.abbreviation\fP .IP \(bu 2 \fBsphinx.application.Sphinx._setting_up_extension\fP .IP \(bu 2 \fBsphinx.builders.epub3.Epub3Builder.validate_config_value()\fP .IP \(bu 2 \fBsphinx.builders.html.SingleFileHTMLBuilder\fP .IP \(bu 2 \fBsphinx.builders.htmlhelp.HTMLHelpBuilder.open_file()\fP .IP \(bu 2 \fBsphinx.cmd.quickstart.term_decode()\fP .IP \(bu 2 \fBsphinx.cmd.quickstart.TERM_ENCODING\fP .IP \(bu 2 \fBsphinx.config.check_unicode()\fP .IP \(bu 2 \fBsphinx.config.string_classes\fP .IP \(bu 2 \fBsphinx.domains.cpp.DefinitionError.description\fP .IP \(bu 2 \fBsphinx.domains.cpp.NoOldIdError.description\fP .IP \(bu 2 \fBsphinx.domains.cpp.UnsupportedMultiCharacterCharLiteral.decoded\fP .IP \(bu 2 \fBsphinx.ext.autodoc.importer._MockImporter\fP .IP \(bu 2 \fBsphinx.ext.autosummary.Autosummary.warn()\fP .IP \(bu 2 \fBsphinx.ext.autosummary.Autosummary.genopt\fP .IP \(bu 2 \fBsphinx.ext.autosummary.Autosummary.warnings\fP .IP \(bu 2 \fBsphinx.ext.autosummary.Autosummary.result\fP .IP \(bu 2 \fBsphinx.ext.doctest.doctest_encode()\fP .IP \(bu 2 \fBsphinx.io.SphinxBaseFileInput\fP .IP \(bu 2 \fBsphinx.io.SphinxFileInput.supported\fP .IP \(bu 2 \fBsphinx.io.SphinxRSTFileInput\fP .IP \(bu 2 \fBsphinx.registry.SphinxComponentRegistry.add_source_input()\fP .IP \(bu 2 \fBsphinx.roles.abbr_role()\fP .IP \(bu 2 \fBsphinx.roles.emph_literal_role()\fP .IP \(bu 2 \fBsphinx.roles.menusel_role()\fP .IP \(bu 2 \fBsphinx.roles.index_role()\fP .IP \(bu 2 \fBsphinx.roles.indexmarkup_role()\fP .IP \(bu 2 \fBsphinx.testing.util.remove_unicode_literal()\fP .IP \(bu 2 \fBsphinx.util.attrdict\fP .IP \(bu 2 \fBsphinx.util.force_decode()\fP .IP \(bu 2 \fBsphinx.util.get_matching_docs()\fP .IP \(bu 2 \fBsphinx.util.inspect.Parameter\fP .IP \(bu 2 \fBsphinx.util.jsonimpl\fP .IP \(bu 2 \fBsphinx.util.osutil.EEXIST\fP .IP \(bu 2 \fBsphinx.util.osutil.EINVAL\fP .IP \(bu 2 \fBsphinx.util.osutil.ENOENT\fP .IP \(bu 2 \fBsphinx.util.osutil.EPIPE\fP .IP \(bu 2 \fBsphinx.util.osutil.walk()\fP .IP \(bu 2 \fBsphinx.util.PeekableIterator\fP .IP \(bu 2 \fBsphinx.util.pycompat.NoneType\fP .IP \(bu 2 \fBsphinx.util.pycompat.TextIOWrapper\fP .IP \(bu 2 \fBsphinx.util.pycompat.UnicodeMixin\fP .IP \(bu 2 \fBsphinx.util.pycompat.htmlescape\fP .IP \(bu 2 \fBsphinx.util.pycompat.indent\fP .IP \(bu 2 \fBsphinx.util.pycompat.sys_encoding\fP .IP \(bu 2 \fBsphinx.util.pycompat.terminal_safe()\fP .IP \(bu 2 \fBsphinx.util.pycompat.u\fP .IP \(bu 2 \fBsphinx.writers.latex.ExtBabel\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator._make_visit_admonition()\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.babel_defmacro()\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.collect_footnotes()\fP .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.generate_numfig_format()\fP .IP \(bu 2 \fBsphinx.writers.texinfo.TexinfoTranslator._make_visit_admonition()\fP .IP \(bu 2 \fBsphinx.writers.text.TextTranslator._make_depart_admonition()\fP .IP \(bu 2 template variables for LaTeX template .INDENT 2.0 .IP \(bu 2 \fBlogo\fP .IP \(bu 2 \fBnumfig_format\fP .IP \(bu 2 \fBpageautorefname\fP .IP \(bu 2 \fBtranslatablestrings\fP .UNINDENT .UNINDENT .sp For more details, see deprecation APIs list \%<#\:dev-deprecated-apis>\&. .SS Features added .sp 2.0.0b1 .INDENT 0.0 .IP \(bu 2 #1618: The search results preview of generated HTML documentation is reader\-friendlier: instead of showing the snippets as raw reStructuredText markup, Sphinx now renders the corresponding HTML. This means the Sphinx extension Sphinx: pretty search results \%<https://\:github\:.com/\:sphinx-contrib/\:sphinx-pretty-searchresults> is no longer necessary. Note that changes to the search function of your custom or 3rd\-party HTML template might overwrite this improvement. .IP \(bu 2 #4182: autodoc: Support \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings> .IP \(bu 2 #5533: autodoc: \fBautodoc_default_options\fP \%<#\:confval-autodoc_default_options> supports \fBmember\-order\fP .IP \(bu 2 #5394: autodoc: Display readable names in type annotations for mocked objects .IP \(bu 2 #5459: autodoc: \fBautodoc_default_options\fP \%<#\:confval-autodoc_default_options> accepts \fBTrue\fP as a value .IP \(bu 2 #1148: autodoc: Add \fBautodecorator\fP \%<#\:directive-autodecorator> directive for decorators .IP \(bu 2 #5635: autosummary: Add \fBautosummary_mock_imports\fP \%<#\:confval-autosummary_mock_imports> to mock external libraries on importing targets .IP \(bu 2 #4018: htmlhelp: Add \fBhtmlhelp_file_suffix\fP \%<#\:confval-htmlhelp_file_suffix> and \fBhtmlhelp_link_suffix\fP \%<#\:confval-htmlhelp_link_suffix> .IP \(bu 2 #5559: text: Support complex tables (colspan and rowspan) .IP \(bu 2 LaTeX: support rendering (not in math, yet) of Greek and Cyrillic Unicode letters in non\-Cyrillic document even with \fB\(aqpdflatex\(aq\fP as \fBlatex_engine\fP \%<#\:confval-latex_engine> (refs: #5645) .IP \(bu 2 #5660: The \fBversionadded\fP, \fBversionchanged\fP and \fBdeprecated\fP directives are now generated with their own specific CSS classes (\fBadded\fP, \fBchanged\fP and \fBdeprecated\fP, respectively) in addition to the generic \fBversionmodified\fP class. .IP \(bu 2 #5841: apidoc: Add \-\-extensions option to sphinx\-apidoc .IP \(bu 2 #4981: C++, added an alias directive for inserting lists of declarations, that references existing declarations (e.g., for making a synopsis). .IP \(bu 2 C++: add \fBcpp:struct\fP to complement \fBcpp:class\fP\&. .IP \(bu 2 #1341: the HTML search considers words that contain a search term of length three or longer a match. .IP \(bu 2 #4611: epub: Show warning for duplicated ToC entries .IP \(bu 2 #1851: Allow to omit an argument for \fBcode\-block\fP \%<#\:directive-code-block> directive. If omitted, it follows \fBhighlight\fP \%<#\:directive-highlight> or \fBhighlight_language\fP \%<#\:confval-highlight_language> .IP \(bu 2 #4587: html: Add \fBhtml4_writer\fP to use old HTML4 writer .IP \(bu 2 #6016: HTML search: A placeholder for the search summary prevents search result links from changing their position when the search terminates. This makes navigating search results easier. .IP \(bu 2 #5196: linkcheck also checks remote images exist .IP \(bu 2 #5924: githubpages: create CNAME file for custom domains when \fBhtml_baseurl\fP \%<#\:confval-html_baseurl> set .IP \(bu 2 #4261: autosectionlabel: restrict the labeled sections by new config value; \fBautosectionlabel_maxdepth\fP \%<#\:confval-autosectionlabel_maxdepth> .UNINDENT .SS Bugs fixed .sp 2.0.0b1 .INDENT 0.0 .IP \(bu 2 #1682: LaTeX: writer should not translate Greek unicode, but use textgreek package .IP \(bu 2 #5247: LaTeX: PDF does not build with default font config for Russian language and \fB\(aqxelatex\(aq\fP or \fB\(aqlualatex\(aq\fP as \fBlatex_engine\fP \%<#\:confval-latex_engine> (refs: #5251) .IP \(bu 2 #5248: LaTeX: Greek letters in section titles disappear from PDF bookmarks .IP \(bu 2 #5249: LaTeX: Unicode Greek letters in math directive break PDF build (fix requires extra set\-up, see \fBlatex_elements\fP \%<#\:confval-latex_elements> \fB\(aqtextgreek\(aq\fP key and/or \fBlatex_engine\fP \%<#\:confval-latex_engine> setting) .IP \(bu 2 #5772: LaTeX: should the Bjarne style of fncychap be used for English also if passed as language option? .IP \(bu 2 #5179: LaTeX: (lualatex only) escaping of \fB>\fP by \fB\etextgreater{}\fP is not enough as \fB\etextgreater{}\etextgreater{}\fP applies TeX\-ligature .IP \(bu 2 LaTeX: project name is not escaped if \fBlatex_documents\fP \%<#\:confval-latex_documents> omitted .IP \(bu 2 LaTeX: authors are not shown if \fBlatex_documents\fP \%<#\:confval-latex_documents> omitted .IP \(bu 2 HTML: Invalid HTML5 file is generated for a glossary having multiple terms for one description (refs: #4611) .IP \(bu 2 QtHelp: OS dependent path separator is used in .qhp file .IP \(bu 2 HTML search: search always returns nothing when multiple search terms are used and one term is shorter than three characters .UNINDENT .sp 2.0.0b2 .INDENT 0.0 .IP \(bu 2 #6096: html: Anchor links are not added to figures .IP \(bu 2 #3620: html: Defer searchindex.js rather than loading it via ajax .IP \(bu 2 #6113: html: Table cells and list items have large margins .IP \(bu 2 #5508: \fBlinenothreshold\fP option for \fBhighlight\fP directive was ignored .IP \(bu 2 texinfo: \fBmake install\-info\fP causes syntax error .IP \(bu 2 texinfo: \fBmake install\-info\fP fails on macOS .IP \(bu 2 #3079: texinfo: image files are not copied on \fBmake install\-info\fP .IP \(bu 2 #5391: A cross reference in heading is rendered as literal .IP \(bu 2 #5946: C++, fix \fBcpp:alias\fP problems in LaTeX (and singlehtml) .IP \(bu 2 #6147: classes attribute of \fBcitation_reference\fP node is lost .IP \(bu 2 AssertionError is raised when custom \fBcitation_reference\fP node having classes attribute refers missing citation (refs: #6147) .IP \(bu 2 #2155: Support \fBcode\fP directive .IP \(bu 2 C++, fix parsing of braced initializers. .IP \(bu 2 #6172: AttributeError is raised for old styled index nodes .IP \(bu 2 #4872: inheritance_diagram: correctly describe behavior of \fBparts\fP option in docs, allow negative values. .IP \(bu 2 #6178: i18n: Captions missing in translations for hidden TOCs .UNINDENT .sp 2.0.0 final .INDENT 0.0 .IP \(bu 2 #6196: py domain: unexpected prefix is generated .UNINDENT .SS Testing .sp 2.0.0b1 .INDENT 0.0 .IP \(bu 2 Stop to use \fBSPHINX_TEST_TEMPDIR\fP envvar .UNINDENT .sp 2.0.0b2 .INDENT 0.0 .IP \(bu 2 Add a helper function: \fBsphinx.testing.restructuredtext.parse()\fP .UNINDENT .SS Sphinx 1.8 .SS Release 1.8.6 (released Nov 18, 2021) .SS Dependencies .INDENT 0.0 .IP \(bu 2 #9807: Restrict Docutils to 0.17.x or older .UNINDENT .SS Release 1.8.5 (released Mar 10, 2019) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 LaTeX: Remove extraneous space after author names on PDF title page (refs: #6004) .IP \(bu 2 #6026: LaTeX: A cross reference to definition list does not work .IP \(bu 2 #6046: LaTeX: \fBTypeError\fP is raised when invalid latex_elements given .IP \(bu 2 #6067: LaTeX: images having a target are concatenated to next line .IP \(bu 2 #6067: LaTeX: images having a target are not aligned even if specified .IP \(bu 2 #6149: LaTeX: \fB:index:\fP role in titles causes \fBUse of \e@icentercr doesn\(aqt match its definition\fP error on latexpdf build .IP \(bu 2 #6019: imgconverter: Including multipage PDF fails .IP \(bu 2 #6047: autodoc: \fBautofunction\fP emits a warning for method objects .IP \(bu 2 #6028: graphviz: Ensure the graphviz filenames are reproducible .IP \(bu 2 #6068: doctest: \fBskipif\fP option may remove the code block from documentation .IP \(bu 2 #6136: \fB:name:\fP option for \fBmath\fP directive causes a crash .IP \(bu 2 #6139: intersphinx: ValueError on failure reporting .IP \(bu 2 #6135: changes: Fix UnboundLocalError when any module found .IP \(bu 2 #3859: manpage: code\-block captions are not displayed correctly .UNINDENT .SS Release 1.8.4 (released Feb 03, 2019) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #3707: latex: no bold checkmark (✔) available. .IP \(bu 2 #5605: with the documentation language set to Chinese, English words could not be searched. .IP \(bu 2 #5889: LaTeX: user \fBnumfig_format\fP is stripped of spaces and may cause build failure .IP \(bu 2 C++, fix hyperlinks for declarations involving east cv\-qualifiers. .IP \(bu 2 #5755: C++, fix duplicate declaration error on function templates with constraints in the return type. .IP \(bu 2 C++, parse unary right fold expressions and binary fold expressions. .IP \(bu 2 pycode could not handle egg files on windows .IP \(bu 2 #5928: KeyError: \(aqDOCUTILSCONFIG\(aq when running build .IP \(bu 2 #5936: LaTeX: PDF build broken by inclusion of image taller than page height in an admonition .IP \(bu 2 #5231: \(dqmake html\(dq does not read and build \(dqpo\(dq files in \(dqlocale\(dq dir .IP \(bu 2 #5954: \fB:scale:\fP image option may break PDF build if image in an admonition .IP \(bu 2 #5966: mathjax has not been loaded on incremental build .IP \(bu 2 #5960: LaTeX: modified PDF layout since September 2018 TeXLive update of \fBparskip.sty\fP .IP \(bu 2 #5948: LaTeX: duplicated labels are generated for sections .IP \(bu 2 #5958: versionadded directive causes crash with Python 3.5.0 .IP \(bu 2 #5995: autodoc: autodoc_mock_imports conflict with metaclass on Python 3.7 .IP \(bu 2 #5871: texinfo: a section title \fB\&.\fP is not allowed .UNINDENT .SS Release 1.8.3 (released Dec 26, 2018) .SS Features added .INDENT 0.0 .IP \(bu 2 LaTeX: it is possible to insert custom material to appear on back of title page, see discussion of \fB\(aqmaketitle\(aq\fP key of \fBlatex_elements\fP \%<#\:confval-latex_elements> (\fB\(aqmanual\(aq\fP docclass only) .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #5725: mathjax: Use CDN URL for \(dqlatest\(dq version by default .IP \(bu 2 #5460: html search does not work with some 3rd party themes .IP \(bu 2 #5520: LaTeX, caption package incompatibility since Sphinx 1.6 .IP \(bu 2 #5614: autodoc: incremental build is broken when builtin modules are imported .IP \(bu 2 #5627: qthelp: index.html missing in QtHelp .IP \(bu 2 #5659: linkcheck: crashes for a hyperlink containing multibyte character .IP \(bu 2 #5754: DOC: Fix some mistakes in LaTeX customization \%<> .IP \(bu 2 #5810: LaTeX: sphinxVerbatim requires explicit \(dqhllines\(dq set\-up since 1.6.6 (refs: #1238) .IP \(bu 2 #5636: C++, fix parsing of floating point literals. .IP \(bu 2 #5496 (again): C++, fix assertion in partial builds with duplicates. .IP \(bu 2 #5724: quickstart: sphinx\-quickstart fails when $LC_ALL is empty .IP \(bu 2 #1956: Default conf.py is not PEP8\-compliant .IP \(bu 2 #5849: LaTeX: document class \fB\emaketitle\fP is overwritten with no possibility to use original meaning in place of Sphinx custom one .IP \(bu 2 #5834: apidoc: wrong help for \fB\-\-tocfile\fP .IP \(bu 2 #5800: todo: crashed if todo is defined in TextElement .IP \(bu 2 #5846: htmlhelp: convert hex escaping to decimal escaping in .hhc/.hhk files .IP \(bu 2 htmlhelp: broken .hhk file generated when title contains a double quote .UNINDENT .SS Release 1.8.2 (released Nov 11, 2018) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #5497: Do not include MathJax.js and jsmath.js unless it is really needed .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #5471: Show appropriate deprecation warnings .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #5490: latex: enumerated list causes a crash with recommonmark .IP \(bu 2 #5492: sphinx\-build fails to build docs w/ Python < 3.5.2 .IP \(bu 2 #3704: latex: wrong \fB\elabel\fP positioning for figures with a legend .IP \(bu 2 #5496: C++, fix assertion when a symbol is declared more than twice. .IP \(bu 2 #5493: gettext: crashed with broken template .IP \(bu 2 #5495: csv\-table directive with file option in included file is broken (refs: #4821) .IP \(bu 2 #5498: autodoc: unable to find type hints for a \fBfunctools.partial\fP .IP \(bu 2 #5480: autodoc: unable to find type hints for unresolvable Forward references .IP \(bu 2 #5419: incompatible math_block node has been generated .IP \(bu 2 #5548: Fix ensuredir() in case of pre\-existing file .IP \(bu 2 #5549: graphviz Correctly deal with non\-existing static dir .IP \(bu 2 #3002: i18n: multiple footnote_references referring same footnote cause duplicated node_ids .IP \(bu 2 #5563: latex: footnote_references generated by extension causes a LaTeX builder crash .IP \(bu 2 #5561: make all\-pdf fails with old xindy version .IP \(bu 2 #5557: quickstart: \-\-no\-batchfile isn\(aqt honored .IP \(bu 2 #3080: texinfo: multiline rubrics are broken .IP \(bu 2 #3080: texinfo: multiline citations are broken .UNINDENT .SS Release 1.8.1 (released Sep 22, 2018) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 LaTeX \fB\epagestyle\fP commands have been moved to the LaTeX template. No changes in PDF, except possibly if \fB\esphinxtableofcontents\fP, which contained them, had been customized in \fBconf.py\fP\&. (refs: #5455) .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #5418: Incorrect default path for sphinx\-build \-d/doctrees files .IP \(bu 2 #5421: autodoc emits deprecation warning for \fBautodoc_default_flags\fP .IP \(bu 2 #5422: lambda object causes PicklingError on storing environment .IP \(bu 2 #5417: Sphinx fails to build with syntax error in Python 2.7.5 .IP \(bu 2 #4911: add latexpdf to make.bat for non make\-mode .IP \(bu 2 #5436: Autodoc does not work with enum subclasses with properties/methods .IP \(bu 2 #5437: autodoc: crashed on modules importing eggs .IP \(bu 2 #5433: latex: ImportError: cannot import name \(aqDEFAULT_SETTINGS\(aq .IP \(bu 2 #5431: autodoc: \fBautofunction\fP emits a warning for callable objects .IP \(bu 2 #5457: Fix TypeError in error message when override is prohibited .IP \(bu 2 #5453: PDF builds of \(aqhowto\(aq documents have no page numbers .IP \(bu 2 #5463: mathbase: math_role and MathDirective was disappeared in 1.8.0 .IP \(bu 2 #5454: latex: Index has disappeared from PDF for Japanese documents .IP \(bu 2 #5432: py domain: \fB:type:\fP field can\(aqt process \fB:term:\fP references .IP \(bu 2 #5426: py domain: TypeError has been raised for class attribute .UNINDENT .SS Release 1.8.0 (released Sep 13, 2018) .SS Dependencies .sp 1.8.0b1 .INDENT 0.0 .IP \(bu 2 LaTeX: \fBlatex_use_xindy\fP \%<#\:confval-latex_use_xindy>, if \fBTrue\fP (default for \fBxelatex/lualatex\fP), instructs \fBmake latexpdf\fP to use \fBxindy\fP for general index. Make sure your LaTeX distribution includes it. (refs: #5134) .IP \(bu 2 LaTeX: \fBlatexmk\fP is required for \fBmake latexpdf\fP on Windows .UNINDENT .SS Incompatible changes .sp 1.8.0b2 .INDENT 0.0 .IP \(bu 2 #5282: html theme: refer \fBpygments_style\fP settings of HTML themes preferentially .IP \(bu 2 The URL of download files are changed .IP \(bu 2 #5127: quickstart: \fBMakefile\fP and \fBmake.bat\fP are not overwritten if exists .UNINDENT .sp 1.8.0b1 .INDENT 0.0 .IP \(bu 2 #5156: the \fBsphinx.ext.graphviz\fP \%<#\:module-sphinx\:.ext\:.graphviz> extension runs \fBdot\fP in the directory of the document being built instead of in the root directory of the documentation. .IP \(bu 2 #4460: extensions which stores any data to environment should return the version of its env data structure as metadata. In detail, please see Extension metadata \%<#\:ext-metadata>\&. .IP \(bu 2 Sphinx expects source parser modules to have supported file formats as \fBParser.supported\fP attribute .IP \(bu 2 The default value of \fBepub_author\fP \%<#\:confval-epub_author> and \fBepub_publisher\fP \%<#\:confval-epub_publisher> are changed from \fB\(aqunknown\(aq\fP to the value of \fBauthor\fP \%<#\:confval-author>\&. This is same as a \fBconf.py\fP file sphinx\-build generates. .IP \(bu 2 The \fBgettext_compact\fP attribute is removed from \fBdocument.settings\fP object. Please use \fBconfig.gettext_compact\fP instead. .IP \(bu 2 The processing order on reading phase is changed. smart_quotes, sphinx domains, \fBdoctree\-read\fP \%<#\:event-doctree-read> event and versioning doctrees are invoked earlier than so far. For more details, please read a description of \fBSphinx.add_transform()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_transform> .IP \(bu 2 #4827: All \fBsubstitution_definition\fP nodes are removed from doctree on reading phase .IP \(bu 2 \fBdocutils.conf\fP in \fB$HOME\fP or \fB/etc\fP directories are ignored. Only \fBdocutils.conf\fP from confdir is obeyed. .IP \(bu 2 #789: \fB:samp:\fP role supports to escape curly braces with backslash .IP \(bu 2 #4811: The files under \fBhtml_static_path\fP \%<#\:confval-html_static_path> are excluded from source files. .IP \(bu 2 latex: Use \fB\esphinxcite\fP for citation references instead \fB\ehyperref\fP .IP \(bu 2 The config value \fBviewcode_import\fP is renamed to \fBviewcode_follow_imported_members\fP \%<#\:confval-viewcode_follow_imported_members> (refs: #4035) .IP \(bu 2 #1857: latex: \fBlatex_show_pagerefs\fP \%<#\:confval-latex_show_pagerefs> does not add pagerefs for citations .IP \(bu 2 #4648: latex: Now \(dqrubric\(dq elements are rendered as unnumbered section title .IP \(bu 2 #4983: html: The anchor for productionlist tokens has been changed .IP \(bu 2 Modifying a template variable \fBscript_files\fP in templates is allowed now. Please use \fBapp.add_js_file()\fP instead. .IP \(bu 2 #5072: Save environment object also with only new documents .IP \(bu 2 #5035: qthelp builder allows dashes in \fBqthelp_namespace\fP \%<#\:confval-qthelp_namespace> .IP \(bu 2 LaTeX: with lualatex or xelatex use by default \fBxindy\fP as UTF\-8 able replacement of \fBmakeindex\fP (refs: #5134). After upgrading Sphinx, please clean latex build repertory of existing project before new build. .IP \(bu 2 #5163: html: hlist items are now aligned to top .IP \(bu 2 \fBhighlightlang\fP directive is processed on resolving phase .IP \(bu 2 #4000: LaTeX: template changed. Following elements moved to it: .INDENT 2.0 .IP \(bu 2 \fB\ebegin{document}\fP .IP \(bu 2 \fBshorthandoff\fP variable .IP \(bu 2 \fBmaketitle\fP variable .IP \(bu 2 \fBtableofcontents\fP variable .UNINDENT .UNINDENT .SS Deprecated .sp 1.8.0b2 .INDENT 0.0 .IP \(bu 2 \fBsphinx.io.SphinxI18nReader.set_lineno_for_reporter()\fP is deprecated .IP \(bu 2 \fBsphinx.io.SphinxI18nReader.line\fP is deprecated .IP \(bu 2 \fBsphinx.util.i18n.find_catalog_source_file()\fP has changed; the \fIgettext_compact\fP argument has been deprecated .IP \(bu 2 #5403: \fBsphinx.util.images.guess_mimetype()\fP has changed; the \fIcontent\fP argument has been deprecated .UNINDENT .sp 1.8.0b1 .INDENT 0.0 .IP \(bu 2 \fBsource_parsers\fP is deprecated .IP \(bu 2 \fBautodoc_default_flags\fP is deprecated .IP \(bu 2 quickstart: \fB\-\-epub\fP option becomes default, so it is deprecated .IP \(bu 2 Drop function based directive support. For now, Sphinx only supports class based directives (see \fBDirective\fP \%<#\:docutils\:.parsers\:.rst\:.Directive>) .IP \(bu 2 \fBsphinx.util.docutils.directive_helper()\fP is deprecated .IP \(bu 2 \fBsphinx.cmdline\fP is deprecated .IP \(bu 2 \fBsphinx.make_mode\fP is deprecated .IP \(bu 2 \fBsphinx.locale.l_()\fP is deprecated .IP \(bu 2 #2157: helper function \fBwarn()\fP for HTML themes is deprecated .IP \(bu 2 \fBapp.override_domain()\fP is deprecated .IP \(bu 2 \fBapp.add_stylesheet()\fP is deprecated .IP \(bu 2 \fBapp.add_javascript()\fP is deprecated .IP \(bu 2 \fBapp.import_object()\fP is deprecated .IP \(bu 2 \fBapp.add_source_parser()\fP has changed; the \fIsuffix\fP argument has been deprecated .IP \(bu 2 \fBsphinx.versioning.prepare()\fP is deprecated .IP \(bu 2 \fBConfig.__init__()\fP has changed; the \fIdirname\fP, \fIfilename\fP and \fItags\fP argument has been deprecated .IP \(bu 2 \fBConfig.check_types()\fP is deprecated .IP \(bu 2 \fBConfig.check_unicode()\fP is deprecated .IP \(bu 2 \fBsphinx.application.CONFIG_FILENAME\fP is deprecated .IP \(bu 2 \fBhighlightlang\fP directive is deprecated .IP \(bu 2 \fBBuildEnvironment.load()\fP is deprecated .IP \(bu 2 \fBBuildEnvironment.loads()\fP is deprecated .IP \(bu 2 \fBBuildEnvironment.frompickle()\fP is deprecated .IP \(bu 2 \fBenv.read_doc()\fP is deprecated .IP \(bu 2 \fBenv.update()\fP is deprecated .IP \(bu 2 \fBenv._read_serial()\fP is deprecated .IP \(bu 2 \fBenv._read_parallel()\fP is deprecated .IP \(bu 2 \fBenv.write_doctree()\fP is deprecated .IP \(bu 2 \fBenv._nitpick_ignore\fP is deprecated .IP \(bu 2 \fBenv.versionchanges\fP is deprecated .IP \(bu 2 \fBenv.dump()\fP is deprecated .IP \(bu 2 \fBenv.dumps()\fP is deprecated .IP \(bu 2 \fBenv.topickle()\fP is deprecated .IP \(bu 2 \fBenv.note_versionchange()\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.Table.caption_footnotetexts\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.Table.header_footnotetexts\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.footnotestack\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.in_container_literal_block\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.next_section_ids\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.next_hyperlink_ids\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.restrict_footnote()\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.unrestrict_footnote()\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.push_hyperlink_ids()\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.pop_hyperlink_ids()\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.check_latex_elements()\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.bibitems\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.LaTeXTranslator.hlsettingstack\fP is deprecated .IP \(bu 2 \fBsphinx.writers.latex.ExtBabel.get_shorthandoff()\fP is deprecated .IP \(bu 2 \fBsphinx.writers.html.HTMLTranslator.highlightlang\fP is deprecated .IP \(bu 2 \fBsphinx.writers.html.HTMLTranslator.highlightlang_base\fP is deprecated .IP \(bu 2 \fBsphinx.writers.html.HTMLTranslator.highlightlangopts\fP is deprecated .IP \(bu 2 \fBsphinx.writers.html.HTMLTranslator.highlightlinenothreshold\fP is deprecated .IP \(bu 2 \fBsphinx.writers.html5.HTMLTranslator.highlightlang\fP is deprecated .IP \(bu 2 \fBsphinx.writers.html5.HTMLTranslator.highlightlang_base\fP is deprecated .IP \(bu 2 \fBsphinx.writers.html5.HTMLTranslator.highlightlangopts\fP is deprecated .IP \(bu 2 \fBsphinx.writers.html5.HTMLTranslator.highlightlinenothreshold\fP is deprecated .IP \(bu 2 \fBsphinx.ext.mathbase\fP extension is deprecated .IP \(bu 2 \fBsphinx.ext.mathbase.math\fP node is deprecated .IP \(bu 2 \fBsphinx.ext.mathbase.displaymath\fP node is deprecated .IP \(bu 2 \fBsphinx.ext.mathbase.eqref\fP node is deprecated .IP \(bu 2 \fBsphinx.ext.mathbase.is_in_section_title()\fP is deprecated .IP \(bu 2 \fBsphinx.ext.mathbase.MathDomain\fP is deprecated .IP \(bu 2 \fBsphinx.ext.mathbase.MathDirective\fP is deprecated .IP \(bu 2 \fBsphinx.ext.mathbase.math_role\fP is deprecated .IP \(bu 2 \fBsphinx.ext.mathbase.setup_math()\fP is deprecated .IP \(bu 2 \fBsphinx.directives.other.VersionChanges\fP is deprecated .IP \(bu 2 \fBsphinx.highlighting.PygmentsBridge.unhighlight()\fP is deprecated .IP \(bu 2 \fBsphinx.ext.mathbase.get_node_equation_number()\fP is deprecated .IP \(bu 2 \fBsphinx.ext.mathbase.wrap_displaymath()\fP is deprecated .IP \(bu 2 The \fBtrim_doctest_flags\fP argument of \fBsphinx.highlighting.PygmentsBridge\fP is deprecated .UNINDENT .sp For more details, see deprecation APIs list \%<#\:dev-deprecated-apis>\&. .SS Features added .sp 1.8.0b2 .INDENT 0.0 .IP \(bu 2 #5388: Ensure frozen object descriptions are reproducible .IP \(bu 2 #5362: apidoc: Add \fB\-\-tocfile\fP option to change the filename of ToC .UNINDENT .sp 1.8.0b1 .INDENT 0.0 .IP \(bu 2 Add \fBconfig\-inited\fP \%<#\:event-config-inited> event .IP \(bu 2 Add \fBsphinx.config.Any\fP to represent the config value accepts any type of value .IP \(bu 2 \fBsource_suffix\fP \%<#\:confval-source_suffix> allows a mapping fileext to file types .IP \(bu 2 Add \fBauthor\fP \%<#\:confval-author> as a configuration value .IP \(bu 2 #2852: imgconverter: Support to convert GIF to PNG .IP \(bu 2 \fBsphinx\-build\fP command supports i18n console output .IP \(bu 2 Add \fBapp.add_message_catalog()\fP and \fBsphinx.locale.get_translations()\fP to support translation for 3rd party extensions .IP \(bu 2 helper function \fBwarning()\fP for HTML themes is added .IP \(bu 2 Add \fBDomain.enumerable_nodes\fP to manage own enumerable nodes for domains (experimental) .IP \(bu 2 Add a new keyword argument \fBoverride\fP to Application APIs .IP \(bu 2 LaTeX: new key \fB\(aqfvset\(aq\fP for \fBlatex_elements\fP \%<#\:confval-latex_elements>\&. For XeLaTeX/LuaLaTeX its default sets \fBfanvyvrb\fP to use normal, not small, fontsize in code\-blocks (refs: #4793) .IP \(bu 2 Add \fBhtml_css_files\fP \%<#\:confval-html_css_files> and \fBepub_css_files\fP \%<#\:confval-epub_css_files> for adding CSS files from configuration .IP \(bu 2 Add \fBhtml_js_files\fP \%<#\:confval-html_js_files> for adding JS files from configuration .IP \(bu 2 #4834: Ensure set object descriptions are reproducible. .IP \(bu 2 #4828: Allow to override \fBnumfig_format\fP \%<#\:confval-numfig_format> partially. Full definition is not needed. .IP \(bu 2 Improve warning messages during including (refs: #4818) .IP \(bu 2 LaTeX: separate customizability of \fBguilabel\fP \%<#\:role-guilabel> and \fBmenuselection\fP \%<#\:role-menuselection> (refs: #4830) .IP \(bu 2 Add \fBConfig.read()\fP classmethod to create a new config object from configuration file .IP \(bu 2 #4866: Wrap graphviz diagrams in \fB<div>\fP tag .IP \(bu 2 viewcode: Add \fBviewcode\-find\-source\fP \%<#\:event-viewcode-find-source> and \fBviewcode\-follow\-imported\fP \%<#\:event-viewcode-follow-imported> to load source code without loading .IP \(bu 2 #4785: napoleon: Add strings to translation file for localisation .IP \(bu 2 #4927: Display a warning when invalid values are passed to linenothreshold option of highlight directive .IP \(bu 2 C++: .INDENT 2.0 .IP \(bu 2 Add a \fBcpp:texpr\fP role as a sibling to \fBcpp:expr\fP\&. .IP \(bu 2 Add support for unions. .IP \(bu 2 #3593, #2683: add support for anonymous entities using names staring with \fB@\fP\&. .IP \(bu 2 #5147: add support for (most) character literals. .IP \(bu 2 Cross\-referencing entities inside primary templates is supported, and now properly documented. .IP \(bu 2 #1552: add new cross\-referencing format for \fBcpp:any\fP and \fBcpp:func\fP roles, for referencing specific function overloads. .UNINDENT .IP \(bu 2 #3606: MathJax should be loaded with async attribute .IP \(bu 2 html: Output \fBcanonical_url\fP metadata if \fBhtml_baseurl\fP \%<#\:confval-html_baseurl> set (refs: #4193) .IP \(bu 2 #5029: autosummary: expose \fBinherited_members\fP to template .IP \(bu 2 #3784: mathjax: Add \fBmathjax_options\fP \%<#\:confval-mathjax_options> to give options to script tag for mathjax .IP \(bu 2 #726, #969: mathjax: Add \fBmathjax_config\fP \%<#\:confval-mathjax_config> to give in\-line configurations for mathjax .IP \(bu 2 #4362: latex: Don\(aqt overwrite .tex file if document not changed .IP \(bu 2 #1431: latex: Add alphanumeric enumerated list support .IP \(bu 2 Add \fBlatex_use_xindy\fP \%<#\:confval-latex_use_xindy> for UTF\-8 savvy indexing, defaults to \fBTrue\fP if \fBlatex_engine\fP \%<#\:confval-latex_engine> is \fB\(aqxelatex\(aq\fP or \fB\(aqlualatex\(aq\fP\&. (refs: #5134, #5192, #5212) .IP \(bu 2 #4976: \fBSphinxLoggerAdapter.info()\fP now supports \fBlocation\fP parameter .IP \(bu 2 #5122: setuptools: support nitpicky option .IP \(bu 2 #2820: autoclass directive supports nested class .IP \(bu 2 Add \fBapp.add_html_math_renderer()\fP to register a math renderer for HTML .IP \(bu 2 Apply \fBtrim_doctest_flags\fP \%<#\:confval-trim_doctest_flags> to all builders (cf. text, manpages) .IP \(bu 2 #5140: linkcheck: Add better Accept header to HTTP client .IP \(bu 2 #4614: sphinx\-build: Add \fB\-\-keep\-going\fP option to show all warnings .IP \(bu 2 Add \fBmath:numref\fP \%<#\:role-math-numref> role to refer equations (Same as \fBeq\fP \%<#\:role-eq>) .IP \(bu 2 quickstart: epub builder is enabled by default .IP \(bu 2 #5246: Add \fBsinglehtml_sidebars\fP \%<#\:confval-singlehtml_sidebars> to configure sidebars for singlehtml builder .IP \(bu 2 #5273: doctest: Skip doctest conditionally .IP \(bu 2 #5306: autodoc: emit a warning for invalid typehints .IP \(bu 2 #4075, #5215: autodoc: Add \fBautodoc_default_options\fP \%<#\:confval-autodoc_default_options> which accepts option values as dict .UNINDENT .SS Bugs fixed .sp 1.8.0b2 .INDENT 0.0 .IP \(bu 2 html: search box overrides to other elements if scrolled .IP \(bu 2 i18n: warnings for translation catalogs have wrong line numbers (refs: #5321) .IP \(bu 2 #5325: latex: cross references has been broken by multiply labeled objects .IP \(bu 2 C++, fixes for symbol addition and lookup. Lookup should no longer break in partial builds. See also #5337. .IP \(bu 2 #5348: download reference to remote file is not displayed .IP \(bu 2 #5282: html theme: \fBpygments_style\fP of theme was overridden by \fBconf.py\fP by default .IP \(bu 2 #4379: toctree shows confusing warning when document is excluded .IP \(bu 2 #2401: autodoc: \fB:members:\fP causes \fB:special\-members:\fP not to be shown .IP \(bu 2 autodoc: ImportError is replaced by AttributeError for deeper module .IP \(bu 2 #2720, #4034: Incorrect links with \fB:download:\fP, duplicate names, and parallel builds .IP \(bu 2 #5290: autodoc: failed to analyze source code in egg package .IP \(bu 2 #5399: Sphinx crashes if unknown po file exists .UNINDENT .sp 1.8.0b1 .INDENT 0.0 .IP \(bu 2 i18n: message catalogs were reset on each initialization .IP \(bu 2 #4850: latex: footnote inside footnote was not rendered .IP \(bu 2 #4945: i18n: fix lang_COUNTRY not fallback correctly for IndexBuilder. Thanks to Shengjing Zhu. .IP \(bu 2 #4983: productionlist directive generates invalid IDs for the tokens .IP \(bu 2 #5132: lualatex: PDF build fails if indexed word starts with Unicode character .IP \(bu 2 #5133: latex: index headings \(dqSymbols\(dq and \(dqNumbers\(dq not internationalized .IP \(bu 2 #5114: sphinx\-build: Handle errors on scanning documents .IP \(bu 2 epub: spine has been broken when \(dqself\(dq is listed on toctree (refs: #4611) .IP \(bu 2 #344: autosummary does not understand docstring of module level attributes .IP \(bu 2 #5191: C++, prevent nested declarations in functions to avoid lookup problems. .IP \(bu 2 #5126: C++, add missing isPack method for certain template parameter types. .IP \(bu 2 #5187: C++, parse attributes on declarators as well. .IP \(bu 2 C++, parse delete expressions and basic new expressions as well. .IP \(bu 2 #5002: graphviz: SVGs do not adapt to the column width .UNINDENT .SS Features removed .sp 1.8.0b1 .INDENT 0.0 .IP \(bu 2 \fBsphinx.ext.pngmath\fP extension .UNINDENT .SS Documentation .sp 1.8.0b1 .INDENT 0.0 .IP \(bu 2 #5083: Fix wrong make.bat option for internationalization. .IP \(bu 2 #5115: napoleon: add admonitions added by #4613 to the docs. .UNINDENT .SS Sphinx 1.7 .SS Release 1.7.9 (released Sep 05, 2018) .SS Features added .INDENT 0.0 .IP \(bu 2 #5359: Make generated texinfo files reproducible by sorting the anchors .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #5361: crashed on incremental build if document uses include directive .UNINDENT .SS Release 1.7.8 (released Aug 29, 2018) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 The type of \fBenv.included\fP has been changed to dict of set .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #5320: intersphinx: crashed if invalid url given .IP \(bu 2 #5326: manpage: crashed when invalid docname is specified as \fBman_pages\fP .IP \(bu 2 #5322: autodoc: \fBAny\fP typehint causes formatting error .IP \(bu 2 #5327: \(dqdocument isn\(aqt included in any toctree\(dq warning on rebuild with generated files .IP \(bu 2 #5335: quickstart: escape sequence has been displayed with MacPorts\(aq python .UNINDENT .SS Release 1.7.7 (released Aug 19, 2018) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #5198: document not in toctree warning when including files only for parallel builds .IP \(bu 2 LaTeX: reduce \(dqToken not allowed in a PDF string\(dq hyperref warnings in latex console output (refs: #5236) .IP \(bu 2 LaTeX: suppress \(dqremreset Warning: The remreset package is obsolete\(dq in latex console output with recent LaTeX (refs: #5237) .IP \(bu 2 #5234: PDF output: usage of PAPER environment variable is broken since Sphinx 1.5 .IP \(bu 2 LaTeX: fix the \fBlatex_engine\fP \%<#\:confval-latex_engine> documentation regarding Latin Modern font with XeLaTeX/LuaLateX (refs: #5251) .IP \(bu 2 #5280: autodoc: Fix wrong type annotations for complex typing .IP \(bu 2 autodoc: Optional types are wrongly rendered .IP \(bu 2 #5291: autodoc crashed by ForwardRef types .IP \(bu 2 #5211: autodoc: No docs generated for functools.partial functions .IP \(bu 2 #5306: autodoc: \fBgetargspec()\fP raises NameError for invalid typehints .IP \(bu 2 #5298: imgmath: math_number_all causes equations to have two numbers in html .IP \(bu 2 #5294: sphinx\-quickstart blank prompts in PowerShell .UNINDENT .SS Release 1.7.6 (released Jul 17, 2018) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #5037: LaTeX \fB\esphinxupquote{}\fP breaks in Russian .IP \(bu 2 sphinx.testing uses deprecated pytest API; \fBNode.get_marker(name)\fP .IP \(bu 2 #5016: crashed when recommonmark.AutoStrictify is enabled .IP \(bu 2 #5022: latex: crashed with Docutils package provided by Debian/Ubuntu .IP \(bu 2 #5009: latex: a label for table is vanished if table does not have a caption .IP \(bu 2 #5048: crashed with numbered toctree .IP \(bu 2 #2410: C, render empty argument lists for macros. .IP \(bu 2 C++, fix lookup of full template specializations with no template arguments. .IP \(bu 2 #4667: C++, fix assertion on missing references in global scope when using intersphinx. Thanks to Alan M. Carroll. .IP \(bu 2 #5019: autodoc: crashed by Form Feed Character .IP \(bu 2 #5032: autodoc: loses the first staticmethod parameter for old styled classes .IP \(bu 2 #5036: quickstart: Typing Ctrl\-U clears the whole of line .IP \(bu 2 #5066: html: \(dqrelations\(dq sidebar is not shown by default .IP \(bu 2 #5091: latex: curly braces in index entries are not handled correctly .IP \(bu 2 #5070: epub: Wrong internal href fragment links .IP \(bu 2 #5104: apidoc: Interface of \fBsphinx.apidoc:main()\fP has changed .IP \(bu 2 #4272: PDF builds of French projects have issues with XeTeX .IP \(bu 2 #5076: napoleon raises RuntimeError with python 3.7 .IP \(bu 2 #5125: sphinx\-build: Interface of \fBsphinx:main()\fP has changed .IP \(bu 2 sphinx\-build: \fBsphinx.cmd.build.main()\fP refers \fBsys.argv\fP instead of given argument .IP \(bu 2 #5146: autosummary: warning is emitted when the first line of docstring ends with literal notation .IP \(bu 2 autosummary: warnings of autosummary indicates wrong location (refs: #5146) .IP \(bu 2 #5143: autodoc: crashed on inspecting dict like object which does not support sorting .IP \(bu 2 #5139: autodoc: Enum argument missing if it shares value with another .IP \(bu 2 #4946: py domain: rtype field could not handle \(dq\fBNone\fP\(dq as a type .IP \(bu 2 #5176: LaTeX: indexing of terms containing \fB@\fP, \fB!\fP, or \fB\(dq\fP fails .IP \(bu 2 #5161: html: crashes if copying static files are failed .IP \(bu 2 #5167: autodoc: Fix formatting type annotations for tuples with more than two arguments .IP \(bu 2 #3329: i18n: crashed by auto\-symbol footnote references .IP \(bu 2 #5158: autosummary: module summary has been broken when it starts with heading .UNINDENT .SS Release 1.7.5 (released May 29, 2018) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #4924: html search: Upper characters problem in any other languages .IP \(bu 2 #4932: apidoc: some subpackage is ignored if sibling subpackage contains a module starting with underscore .IP \(bu 2 #4863, #4938, #4939: i18n doesn\(aqt handle correctly node.title as used for contents, topic, admonition, table and section. .IP \(bu 2 #4913: i18n: literal blocks in bullet list are not translated .IP \(bu 2 #4962: C++, raised TypeError on duplicate declaration. .IP \(bu 2 #4825: C++, properly parse expr roles and give better error messages when (escaped) line breaks are present. .IP \(bu 2 C++, properly use \fBdesc_addname\fP nodes for prefixes of names. .IP \(bu 2 C++, parse pack expansions in function calls. .IP \(bu 2 #4915, #4916: links on search page are broken when using dirhtml builder .IP \(bu 2 #4969: autodoc: constructor method should not have return annotation .IP \(bu 2 latex: deeply nested enumerated list which is beginning with non\-1 causes LaTeX engine crashed .IP \(bu 2 #4978: latex: shorthandoff is not set up for Brazil locale .IP \(bu 2 #4928: i18n: Ignore dot\-directories like .git/ in LC_MESSAGES/ .IP \(bu 2 #4946: py domain: type field could not handle \(dq\fBNone\fP\(dq as a type .IP \(bu 2 #4979: latex: Incorrect escaping of curly braces in index entries .IP \(bu 2 #4956: autodoc: Failed to extract document from a subclass of the class on mocked module .IP \(bu 2 #4973: latex: glossary directive adds whitespace to each item .IP \(bu 2 #4980: latex: Explicit labels on code blocks are duplicated .IP \(bu 2 #4919: node.asdom() crashes if toctree has :numbered: option .IP \(bu 2 #4914: autodoc: Parsing error when using dataclasses without default values .IP \(bu 2 #4931: autodoc: crashed when handler for autodoc\-skip\-member raises an error .IP \(bu 2 #4931: autodoc: crashed when subclass of mocked class are processed by napoleon module .IP \(bu 2 #5007: sphinx\-build crashes when error log contains a \(dq%\(dq character .UNINDENT .SS Release 1.7.4 (released Apr 25, 2018) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #4885, #4887: domains: Crashed with duplicated objects .IP \(bu 2 #4889: latex: sphinx.writers.latex causes recursive import .UNINDENT .SS Release 1.7.3 (released Apr 23, 2018) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #4769: autodoc loses the first staticmethod parameter .IP \(bu 2 #4790: autosummary: too wide two column tables in PDF builds .IP \(bu 2 #4795: Latex customization via \fB_templates/longtable.tex_t\fP is broken .IP \(bu 2 #4789: imgconverter: confused by convert.exe of Windows .IP \(bu 2 #4783: On windows, Sphinx crashed when drives of srcdir and outdir are different .IP \(bu 2 #4812: autodoc ignores type annotated variables .IP \(bu 2 #4817: wrong URLs on warning messages .IP \(bu 2 #4784: latex: \fBlatex_show_urls\fP \%<#\:confval-latex_show_urls> assigns incorrect footnote numbers if hyperlinks exists inside substitutions .IP \(bu 2 #4837: latex with class memoir Error: Font command \fB\esf\fP is not supported .IP \(bu 2 #4803: latex: too slow in proportion to number of auto numbered footnotes .IP \(bu 2 #4838: htmlhelp: The entries in .hhp file is not ordered .IP \(bu 2 toctree directive tries to glob for URL having query_string .IP \(bu 2 #4871: html search: Upper characters problem in German .IP \(bu 2 #4717: latex: Compilation for German docs failed with LuaLaTeX and XeLaTeX .IP \(bu 2 #4459: duplicated labels detector does not work well in parallel build .IP \(bu 2 #4878: Crashed with extension which returns invalid metadata .UNINDENT .SS Release 1.7.2 (released Mar 21, 2018) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #4520: apidoc: folders with an empty __init__.py are no longer excluded from TOC .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #4669: sphinx.build_main and sphinx.make_main throw NameError .IP \(bu 2 #4685: autosummary emits meaningless warnings .IP \(bu 2 autodoc: crashed when invalid options given .IP \(bu 2 pydomain: always strip parenthesis if empty (refs: #1042) .IP \(bu 2 #4689: autosummary: unexpectedly strips docstrings containing \(dqi.e.\(dq .IP \(bu 2 #4701: viewcode: Misplaced \fB<div>\fP in viewcode html output .IP \(bu 2 #4444: Don\(aqt require numfig to use :numref: on sections .IP \(bu 2 #4727: Option clash for package textcomp .IP \(bu 2 #4725: Sphinx does not work with python 3.5.0 and 3.5.1 .IP \(bu 2 #4716: Generation PDF file with TexLive on Windows, file not found error .IP \(bu 2 #4574: vertical space before equation in latex .IP \(bu 2 #4720: message when an image is mismatched for builder is not clear .IP \(bu 2 #4655, #4684: Incomplete localization strings in Polish and Chinese .IP \(bu 2 #2286: Sphinx crashes when error is happens in rendering HTML pages .IP \(bu 2 #4688: Error to download remote images having long URL .IP \(bu 2 #4754: sphinx/pycode/__init__.py raises AttributeError .IP \(bu 2 #1435: qthelp builder should htmlescape keywords .IP \(bu 2 epub: Fix docTitle elements of toc.ncx is not escaped .IP \(bu 2 #4520: apidoc: Subpackage not in toc (introduced in 1.6.6) now fixed .IP \(bu 2 #4767: html: search highlighting breaks mathjax equations .UNINDENT .SS Release 1.7.1 (released Feb 23, 2018) .SS Deprecated .INDENT 0.0 .IP \(bu 2 #4623: \fBsphinx.build_main()\fP is deprecated. .IP \(bu 2 autosummary: The interface of \fBsphinx.ext.autosummary.get_documenter()\fP has been changed (Since 1.7.0) .IP \(bu 2 #4664: \fBsphinx.ext.intersphinx.debug()\fP is deprecated. .UNINDENT .sp For more details, see deprecation APIs list \%<#\:dev-deprecated-apis>\&. .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #4608: epub: Invalid meta tag is generated .IP \(bu 2 #4260: autodoc: keyword only argument separator is not disappeared if it is appeared at top of the argument list .IP \(bu 2 #4622: epub: \fBepub_scheme\fP \%<#\:confval-epub_scheme> does not effect to content.opf .IP \(bu 2 #4627: graphviz: Fit graphviz images to page .IP \(bu 2 #4617: quickstart: PROJECT_DIR argument is required .IP \(bu 2 #4623: sphinx.build_main no longer exists in 1.7.0 .IP \(bu 2 #4615: The argument of \fBsphinx.build\fP has been changed in 1.7.0 .IP \(bu 2 autosummary: The interface of \fBsphinx.ext.autosummary.get_documenter()\fP has been changed .IP \(bu 2 #4630: Have order on msgids in sphinx.pot deterministic .IP \(bu 2 #4563: autosummary: Incorrect end of line punctuation detection .IP \(bu 2 #4577: Enumerated sublists with explicit start with wrong number .IP \(bu 2 #4641: A external link in TOC cannot contain \(dq?\(dq with \fB:glob:\fP option .IP \(bu 2 C++, add missing parsing of explicit casts and typeid in expression parsing. .IP \(bu 2 C++, add missing parsing of \fBthis\fP in expression parsing. .IP \(bu 2 #4655: Fix incomplete localization strings in Polish .IP \(bu 2 #4653: Fix error reporting for parameterless ImportErrors .IP \(bu 2 #4664: Reading objects.inv fails again .IP \(bu 2 #4662: \fBany\fP refs with \fBterm\fP targets crash when an ambiguity is encountered .UNINDENT .SS Release 1.7.0 (released Feb 12, 2018) .SS Dependencies .sp 1.7.0b1 .INDENT 0.0 .IP \(bu 2 Add \fBpackaging\fP package .UNINDENT .SS Incompatible changes .sp 1.7.0b1 .INDENT 0.0 .IP \(bu 2 #3668: The arguments has changed of main functions for each command .IP \(bu 2 #3893: Unknown html_theme_options throw warnings instead of errors .IP \(bu 2 #3927: Python parameter/variable types should match classes, not all objects .IP \(bu 2 #3962: sphinx\-apidoc now recognizes given directory as an implicit namespace package when \fB\-\-implicit\-namespaces\fP option given, not subdirectories of given directory. .IP \(bu 2 #3929: apidoc: Move sphinx.apidoc to sphinx.ext.apidoc .IP \(bu 2 #4226: apidoc: Generate new style makefile (make\-mode) .IP \(bu 2 #4274: sphinx\-build returns 2 as an exit code on argument error .IP \(bu 2 #4389: output directory will be created after loading extensions .IP \(bu 2 autodoc does not generate warnings messages to the generated document even if \fBkeep_warnings\fP \%<#\:confval-keep_warnings> is \fBTrue\fP\&. They are only emitted to stderr. .IP \(bu 2 shebang line is removed from generated conf.py .IP \(bu 2 #2557: autodoc: \fBautodoc_mock_imports\fP \%<#\:confval-autodoc_mock_imports> only mocks specified modules with their descendants. It does not mock their ancestors. If you want to mock them, please specify the name of ancestors explicitly. .IP \(bu 2 #3620: html theme: move DOCUMENTATION_OPTIONS to independent JavaScript file (refs: #4295) .IP \(bu 2 #4246: Limit width of text body for all themes. Configurable via theme options \fBbody_min_width\fP and \fBbody_max_width\fP\&. .IP \(bu 2 #4771: apidoc: The \fBexclude_patterns\fP arguments are ignored if they are placed just after command line options .UNINDENT .sp 1.7.0b2 .INDENT 0.0 .IP \(bu 2 #4467: html theme: Rename \fBcsss\fP block to \fBcss\fP .UNINDENT .SS Deprecated .sp 1.7.0b1 .INDENT 0.0 .IP \(bu 2 using a string value for \fBhtml_sidebars\fP \%<#\:confval-html_sidebars> is deprecated and only list values will be accepted at 2.0. .IP \(bu 2 \fBformat_annotation()\fP and \fBformatargspec()\fP is deprecated. Please use \fBsphinx.util.inspect.Signature\fP instead. .IP \(bu 2 \fBsphinx.ext.autodoc.AutodocReporter\fP is replaced by \fBsphinx.util.docutils. switch_source_input()\fP and now deprecated. It will be removed in Sphinx 2.0. .IP \(bu 2 \fBsphinx.ext.autodoc.add_documenter()\fP and \fBAutoDirective._register\fP is now deprecated. Please use \fBapp.add_autodocumenter()\fP instead. .IP \(bu 2 \fBAutoDirective._special_attrgetters\fP is now deprecated. Please use \fBapp.add_autodoc_attrgetter()\fP instead. .UNINDENT .SS Features added .sp 1.7.0b1 .INDENT 0.0 .IP \(bu 2 C++, handle \fBdecltype(auto)\fP\&. .IP \(bu 2 #2406: C++, add proper parsing of expressions, including linking of identifiers. .IP \(bu 2 C++, add a \fBcpp:expr\fP role for inserting inline C++ expressions or types. .IP \(bu 2 C++, support explicit member instantiations with shorthand \fBtemplate\fP prefix .IP \(bu 2 C++, make function parameters linkable, like template params. .IP \(bu 2 #3638: Allow to change a label of reference to equation using \fBmath_eqref_format\fP .IP \(bu 2 Now \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings> accepts following configurations: .INDENT 2.0 .IP \(bu 2 \fBref.python\fP (ref: #3866) .UNINDENT .IP \(bu 2 #3872: Add latex key to configure literal blocks caption position in PDF output (refs #3792, #1723) .IP \(bu 2 In case of missing docstring try to retrieve doc from base classes (ref: #3140) .IP \(bu 2 #4023: Clarify error message when any role has more than one target. .IP \(bu 2 #3973: epub: allow to override build date .IP \(bu 2 #3972: epub: Sort manifest entries by filename .IP \(bu 2 #4052: viewcode: Sort before highlighting module code .IP \(bu 2 #1448: qthelp: Add new config value; \fBqthelp_namespace\fP \%<#\:confval-qthelp_namespace> .IP \(bu 2 #4140: html themes: Make body tag inheritable .IP \(bu 2 #4168: improve zh search with jieba .IP \(bu 2 HTML themes can set up default sidebars through \fBtheme.conf\fP .IP \(bu 2 #3160: html: Use \fB<kdb>\fP to represent \fB:kbd:\fP role .IP \(bu 2 #4212: autosummary: catch all exceptions when importing modules .IP \(bu 2 #4166: Add \fBmath_numfig\fP \%<#\:confval-math_numfig> for equation numbering by section (refs: #3991, #4080). Thanks to Oliver Jahn. .IP \(bu 2 #4311: Let LaTeX obey \fBnumfig_secnum_depth\fP \%<#\:confval-numfig_secnum_depth> for figures, tables, and code\-blocks .IP \(bu 2 #947: autodoc now supports ignore\-module\-all to ignore a module\(aqs \fB__all__\fP .IP \(bu 2 #4332: Let LaTeX obey \fBmath_numfig\fP \%<#\:confval-math_numfig> for equation numbering .IP \(bu 2 #4093: sphinx\-build creates empty directories for unknown targets/builders .IP \(bu 2 Add \fBtop\-classes\fP option for the \fBsphinx.ext.inheritance_diagram\fP extension to limit the scope of inheritance graphs. .IP \(bu 2 #4183: doctest: \fB:pyversion:\fP option also follows PEP\-440 specification .IP \(bu 2 #4235: html: Add \fBmanpages_url\fP \%<#\:confval-manpages_url> to make manpage roles to hyperlinks .IP \(bu 2 #3570: autodoc: Do not display \(aqtyping.\(aq module for type hints .IP \(bu 2 #4354: sphinx\-build now emits finish message. Builders can modify it through \fBBuilder.epilog\fP attribute .IP \(bu 2 #4245: html themes: Add \fBlanguage\fP to javascript vars list .IP \(bu 2 #4079: html: Add \fBnotranslate\fP class to each code\-blocks, literals and maths to let Google Translate know they are not translatable .IP \(bu 2 #4137: doctest: doctest block is always highlighted as python console (pycon) .IP \(bu 2 #4137: doctest: testcode block is always highlighted as python .IP \(bu 2 #3998: text: Assign section numbers by default. You can control it using \fBtext_add_secnumbers\fP \%<#\:confval-text_add_secnumbers> and \fBtext_secnumber_suffix\fP \%<#\:confval-text_secnumber_suffix> .UNINDENT .sp 1.7.0b2 .INDENT 0.0 .IP \(bu 2 #4271: sphinx\-build supports an option called \fB\-j auto\fP to adjust numbers of processes automatically. .IP \(bu 2 Napoleon: added option to specify custom section tags. .UNINDENT .SS Features removed .sp 1.7.0b1 .INDENT 0.0 .IP \(bu 2 Configuration variables .INDENT 2.0 .IP \(bu 2 \fBhtml_use_smartypants\fP .IP \(bu 2 \fBlatex_keep_old_macro_names\fP .IP \(bu 2 latex_elements[\(aqfooter\(aq] .UNINDENT .IP \(bu 2 utility methods of \fBsphinx.application.Sphinx\fP class .INDENT 2.0 .IP \(bu 2 buildername (property) .IP \(bu 2 _display_chunk() .IP \(bu 2 old_status_iterator() .IP \(bu 2 status_iterator() .IP \(bu 2 _directive_helper() .UNINDENT .IP \(bu 2 utility methods of \fBsphinx.environment.BuildEnvironment\fP class .INDENT 2.0 .IP \(bu 2 currmodule (property) .IP \(bu 2 currclass (property) .UNINDENT .IP \(bu 2 epub2 builder .IP \(bu 2 prefix and colorfunc parameter for warn() .IP \(bu 2 \fBsphinx.util.compat\fP module .IP \(bu 2 \fBsphinx.util.nodes.process_only_nodes()\fP .IP \(bu 2 LaTeX environment \fBnotice\fP, use \fBsphinxadmonition\fP instead .IP \(bu 2 LaTeX \fB\esphinxstylethead\fP, use \fB\esphinxstyletheadfamily\fP .IP \(bu 2 C++, support of function concepts. Thanks to mickk\-on\-cpp. .IP \(bu 2 Not used and previously not documented LaTeX macros \fB\eshortversion\fP and \fB\esetshortversion\fP .UNINDENT .SS Bugs fixed .sp 1.7.0b1 .INDENT 0.0 .IP \(bu 2 #3882: Update the order of files for HTMLHelp and QTHelp .IP \(bu 2 #3962: sphinx\-apidoc does not recognize implicit namespace packages correctly .IP \(bu 2 #4094: C++, allow empty template argument lists. .IP \(bu 2 C++, also hyperlink types in the name of declarations with qualified names. .IP \(bu 2 C++, do not add index entries for declarations inside concepts. .IP \(bu 2 C++, support the template disambiguator for dependent names. .IP \(bu 2 #4314: For PDF \(aqhowto\(aq documents, numbering of code\-blocks differs from the one of figures and tables .IP \(bu 2 #4330: PDF \(aqhowto\(aq documents have an incoherent default LaTeX tocdepth counter setting .IP \(bu 2 #4198: autosummary emits multiple \(aqautodoc\-process\-docstring\(aq event. Thanks to Joel Nothman. .IP \(bu 2 #4081: Warnings and errors colored the same when building .IP \(bu 2 latex: Do not display \(aqRelease\(aq label if \fBrelease\fP \%<#\:confval-release> is not set .UNINDENT .sp 1.7.0b2 .INDENT 0.0 .IP \(bu 2 #4415: autodoc classifies inherited classmethods as regular methods .IP \(bu 2 #4415: autodoc classifies inherited staticmethods as regular methods .IP \(bu 2 #4472: DOCUMENTATION_OPTIONS is not defined .IP \(bu 2 #4491: autodoc: prefer _MockImporter over other importers in sys.meta_path .IP \(bu 2 #4490: autodoc: type annotation is broken with python 3.7.0a4+ .IP \(bu 2 utils package is no longer installed .IP \(bu 2 #3952: apidoc: module header is too escaped .IP \(bu 2 #4275: Formats accepted by sphinx.util.i18n.format_date are limited .IP \(bu 2 #4493: recommonmark raises AttributeError if AutoStructify enabled .IP \(bu 2 #4209: intersphinx: In link title, \(dqv\(dq should be optional if target has no version .IP \(bu 2 #4230: slowdown in writing pages with Sphinx 1.6 .IP \(bu 2 #4522: epub: document is not rebuilt even if config changed .UNINDENT .sp 1.7.0b3 .INDENT 0.0 .IP \(bu 2 #4019: inheritance_diagram AttributeError stopping make process .IP \(bu 2 #4531: autosummary: methods are not treated as attributes .IP \(bu 2 #4538: autodoc: \fBsphinx.ext.autodoc.Options\fP has been moved .IP \(bu 2 #4539: autodoc emits warnings for partialmethods .IP \(bu 2 #4223: doctest: failing tests reported in wrong file, at wrong line .IP \(bu 2 i18n: message catalogs are not compiled if specific filenames are given for \fBsphinx\-build\fP as arguments (refs: #4560) .IP \(bu 2 #4027: sphinx.ext.autosectionlabel now expects labels to be the same as they are in the raw source; no smart quotes, nothig fancy. .IP \(bu 2 #4581: apidoc: Excluded modules still included .UNINDENT .SS Testing .sp 1.7.0b1 .INDENT 0.0 .IP \(bu 2 Add support for Docutils 0.14 .IP \(bu 2 Add tests for the \fBsphinx.ext.inheritance_diagram\fP extension. .UNINDENT .SS Sphinx 1.6 .SS Release 1.6.7 (released Feb 04, 2018) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #1922: html search: Upper characters problem in French .IP \(bu 2 #4412: Updated jQuery version from 3.1.0 to 3.2.1 .IP \(bu 2 #4438: math: math with labels with whitespace cause html error .IP \(bu 2 #2437: make full reference for classes, aliased with \(dqalias of\(dq .IP \(bu 2 #4434: pure numbers as link targets produce warning .IP \(bu 2 #4477: Build fails after building specific files .IP \(bu 2 #4449: apidoc: include \(dqempty\(dq packages that contain modules .IP \(bu 2 #3917: citation labels are transformed to ellipsis .IP \(bu 2 #4501: graphviz: epub3 validation error caused if graph is not clickable .IP \(bu 2 #4514: graphviz: workaround for wrong map ID which graphviz generates .IP \(bu 2 #4525: autosectionlabel does not support parallel build .IP \(bu 2 #3953: Do not raise warning when there is a working intersphinx inventory .IP \(bu 2 #4487: math: ValueError is raised on parallel build. Thanks to jschueller. .IP \(bu 2 #2372: autosummary: invalid signatures are shown for type annotated functions .IP \(bu 2 #3942: html: table is not aligned to center even if \fB:align: center\fP .UNINDENT .SS Release 1.6.6 (released Jan 08, 2018) .SS Features added .INDENT 0.0 .IP \(bu 2 #4181: autodoc: Sort dictionary keys when possible .IP \(bu 2 \fBVerbatimHighlightColor\fP is a new LaTeX \(aqsphinxsetup\(aq \%<#\:latexsphinxsetup> key (refs: #4285) .IP \(bu 2 Easier customizability of LaTeX macros involved in rendering of code\-blocks .IP \(bu 2 Show traceback if conf.py raises an exception (refs: #4369) .IP \(bu 2 Add \fBsmartquotes\fP \%<#\:confval-smartquotes> to disable smart quotes through \fBconf.py\fP (refs: #3967) .IP \(bu 2 Add \fBsmartquotes_action\fP \%<#\:confval-smartquotes_action> and \fBsmartquotes_excludes\fP \%<#\:confval-smartquotes_excludes> (refs: #4142, #4357) .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #4334: sphinx\-apidoc: Don\(aqt generate references to non\-existing files in TOC .IP \(bu 2 #4206: latex: reST label between paragraphs loses paragraph break .IP \(bu 2 #4231: html: Apply fixFirefoxAnchorBug only under Firefox .IP \(bu 2 #4221: napoleon depends on autodoc, but users need to load it manually .IP \(bu 2 #2298: automodule fails to document a class attribute .IP \(bu 2 #4099: C++: properly link class reference to class from inside constructor .IP \(bu 2 #4267: PDF build broken by Unicode U+2116 NUMERO SIGN character .IP \(bu 2 #4249: PDF output: Pygments error highlighting increases line spacing in code blocks .IP \(bu 2 #1238: Support \fB:emphasize\-lines:\fP in PDF output .IP \(bu 2 #4279: Sphinx crashes with pickling error when run with multiple processes and remote image .IP \(bu 2 #1421: Respect the quiet flag in sphinx\-quickstart .IP \(bu 2 #4281: Race conditions when creating output directory .IP \(bu 2 #4315: For PDF \(aqhowto\(aq documents, \fBlatex_toplevel_sectioning=\(aqpart\(aq\fP generates \fB\echapter\fP commands .IP \(bu 2 #4214: Two todolist directives break Sphinx 1.6.5 .IP \(bu 2 Fix links to external option docs with intersphinx (refs: #3769) .IP \(bu 2 #4091: Private members not documented without :undoc\-members: .UNINDENT .SS Release 1.6.5 (released Oct 23, 2017) .SS Features added .INDENT 0.0 .IP \(bu 2 #4107: Make searchtools.js compatible with pre\-Sphinx1.5 templates .IP \(bu 2 #4112: Don\(aqt override the smart_quotes setting if it was already set .IP \(bu 2 #4125: Display reference texts of original and translated passages on i18n warning message .IP \(bu 2 #4147: Include the exception when logging PO/MO file read/write .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #4085: Failed PDF build from image in parsed\-literal using \fB:align:\fP option .IP \(bu 2 #4100: Remove debug print from autodoc extension .IP \(bu 2 #3987: Changing theme from \fBalabaster\fP causes HTML build to fail .IP \(bu 2 #4096: C++, don\(aqt crash when using the wrong role type. Thanks to mitya57. .IP \(bu 2 #4070, #4111: crashes when the warning message contains format strings (again) .IP \(bu 2 #4108: Search word highlighting breaks SVG images .IP \(bu 2 #3692: Unable to build HTML if writing .buildinfo failed .IP \(bu 2 #4152: HTML writer crashes if a field list is placed on top of the document .IP \(bu 2 #4063: Sphinx crashes when labeling directive \fB\&.. todolist::\fP .IP \(bu 2 #4134: [doc] \fBdocutils.conf\fP is not documented explicitly .IP \(bu 2 #4169: Chinese language doesn\(aqt trigger Chinese search automatically .IP \(bu 2 #1020: ext.todo todolist not linking to the page in pdflatex .IP \(bu 2 #3965: New quickstart generates wrong SPHINXBUILD in Makefile .IP \(bu 2 #3739: \fB:module:\fP option is ignored at content of pyobjects .IP \(bu 2 #4149: Documentation: Help choosing \fBlatex_engine\fP \%<#\:confval-latex_engine> .IP \(bu 2 #4090: [doc] \fBlatex_additional_files\fP \%<#\:confval-latex_additional_files> with extra LaTeX macros should not use \fB\&.tex\fP extension .IP \(bu 2 Failed to convert reST parser error to warning (refs: #4132) .UNINDENT .SS Release 1.6.4 (released Sep 26, 2017) .SS Features added .INDENT 0.0 .IP \(bu 2 #3926: Add \fBautodoc_warningiserror\fP to suppress the behavior of \fB\-W\fP option during importing target modules on autodoc .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #3924: docname lost after dynamically parsing RST in extension .IP \(bu 2 #3946: Typo in sphinx.sty (this was a bug with no effect in default context) .IP \(bu 2 .INDENT 2.0 .TP .B pep and :rfc: does not supports \fBdefault\-role\fP directive (refs: #3960) .UNINDENT .IP \(bu 2 #3960: default_role = \(aqguilabel\(aq not functioning .IP \(bu 2 Missing \fBtexinputs_win/Makefile\fP to be used in latexpdf builder on windows. .IP \(bu 2 #4026: nature: Fix macOS Safari scrollbar color .IP \(bu 2 #3877: Fix for C++ multiline signatures. .IP \(bu 2 #4006: Fix crash on parallel build .IP \(bu 2 #3969: private instance attributes causes AttributeError .IP \(bu 2 #4041: C++, remove extra name linking in function pointers. .IP \(bu 2 #4038: C, add missing documentation of \fBmember\fP role. .IP \(bu 2 #4044: An empty multicolumn cell causes extra row height in PDF output .IP \(bu 2 #4049: Fix typo in output of sphinx\-build \-h .IP \(bu 2 #4062: hashlib.sha1() must take bytes, not unicode on Python 3 .IP \(bu 2 Avoid indent after index entries in latex (refs: #4066) .IP \(bu 2 #4070: crashes when the warning message contains format strings .IP \(bu 2 #4067: Return non\-zero exit status when make subprocess fails .IP \(bu 2 #4055: graphviz: the :align: option does not work for SVG output .IP \(bu 2 #4055: graphviz: the :align: center option does not work for latex output .IP \(bu 2 #4051: \fBwarn()\fP function for HTML theme outputs \(aq\fBNone\fP\(aq string .UNINDENT .SS Release 1.6.3 (released Jul 02, 2017) .SS Features added .INDENT 0.0 .IP \(bu 2 latex: hint that code\-block continues on next page (refs: #3764, #3792) .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #3821: Failed to import sphinx.util.compat with Docutils 0.14rc1 .IP \(bu 2 #3829: sphinx\-quickstart template is incomplete regarding use of \fBalabaster\fP .IP \(bu 2 #3772: \(aqstr object\(aq has no attribute \(aqfilename\(aq .IP \(bu 2 Emit wrong warnings if citation label includes hyphens (refs: #3565) .IP \(bu 2 #3858: Some warnings are not colored when using \-\-color option .IP \(bu 2 #3775: Remove unwanted whitespace in default template .IP \(bu 2 #3835: sphinx.ext.imgmath fails to convert SVG images if project directory name contains spaces .IP \(bu 2 #3850: Fix color handling in make mode\(aqs help command .IP \(bu 2 #3865: use of self.env.warn in Sphinx extension fails .IP \(bu 2 #3824: production lists apply smart quotes transform since Sphinx 1.6.1 .IP \(bu 2 latex: fix \fB\esphinxbfcode\fP swallows initial space of argument .IP \(bu 2 #3878: Quotes in auto\-documented class attributes should be straight quotes in PDF output .IP \(bu 2 #3881: LaTeX figure floated to next page sometimes leaves extra vertical whitespace .IP \(bu 2 #3885: duplicated footnotes raises IndexError .IP \(bu 2 #3873: Failure of deprecation warning mechanism of \fBsphinx.util.compat.Directive\fP .IP \(bu 2 #3874: Bogus warnings for \(dqcitation not referenced\(dq for cross\-file citations .IP \(bu 2 #3860: Don\(aqt download images when builders not supported images .IP \(bu 2 #3860: Remote image URIs without filename break builders not supported remote images .IP \(bu 2 #3833: command line messages are translated unintentionally with \fBlanguage\fP setting. .IP \(bu 2 #3840: make checking \fBepub_uid\fP strict .IP \(bu 2 #3851, #3706: Fix about box drawing characters for PDF output .IP \(bu 2 #3900: autosummary could not find methods .IP \(bu 2 #3902: Emit error if \fBlatex_documents\fP contains non\-unicode string in py2 .UNINDENT .SS Release 1.6.2 (released May 28, 2017) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #3789: Do not require typing module for python>=3.5 .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #3754: HTML builder crashes if HTML theme appends own stylesheets .IP \(bu 2 #3756: epub: Entity \(aqmdash\(aq not defined .IP \(bu 2 #3758: Sphinx crashed if logs are emitted in conf.py .IP \(bu 2 #3755: incorrectly warns about dedent with literalinclude .IP \(bu 2 #3742: RTD \%<https://\:readthedocs\:.org/> PDF builds of Sphinx own docs are missing an index entry in the bookmarks and table of contents. This is rtfd/readthedocs.org#2857 \%<https://\:github\:.com/\:rtfd/\:readthedocs\:.org/\:issues/\:2857> issue, a workaround is obtained using some extra LaTeX code in Sphinx\(aqs own \fBconf.py\fP .IP \(bu 2 #3770: Build fails when a \(dqcode\-block\(dq has the option emphasize\-lines and the number indicated is higher than the number of lines .IP \(bu 2 #3774: Incremental HTML building broken when using citations .IP \(bu 2 #3763: got epubcheck validations error if epub_cover is set .IP \(bu 2 #3779: \(aqImportError\(aq in sphinx.ext.autodoc due to broken \(aqsys.meta_path\(aq. Thanks to Tatiana Tereshchenko. .IP \(bu 2 #3796: env.resolve_references() crashes when non\-document node given .IP \(bu 2 #3803: Sphinx crashes with invalid PO files .IP \(bu 2 #3791: PDF \(dqcontinued on next page\(dq for long tables isn\(aqt internationalized .IP \(bu 2 #3788: smartquotes emits warnings for unsupported languages .IP \(bu 2 #3807: latex Makefile for \fBmake latexpdf\fP is only for unixen .IP \(bu 2 #3781: double hyphens in option directive are compiled as endashes .IP \(bu 2 #3817: latex builder raises AttributeError .UNINDENT .SS Release 1.6.1 (released May 16, 2017) .SS Dependencies .sp 1.6b1 .INDENT 0.0 .IP \(bu 2 (updated) latex output is tested with Ubuntu trusty\(aqs texlive packages (Feb. 2014) and earlier tex installations may not be fully compliant, particularly regarding Unicode engines xelatex and lualatex .IP \(bu 2 (added) latexmk is required for \fBmake latexpdf\fP on GNU/Linux and Mac OS X (refs: #3082) .UNINDENT .SS Incompatible changes .sp 1.6b1 .INDENT 0.0 .IP \(bu 2 #1061, #2336, #3235: Now generation of autosummary doesn\(aqt contain imported members by default. Thanks to Luc Saffre. .IP \(bu 2 LaTeX \fB\eincludegraphics\fP command isn\(aqt overloaded: only \fB\esphinxincludegraphics\fP has the custom code to fit image to available width if oversized. .IP \(bu 2 The subclasses of \fBsphinx.domains.Index\fP should override \fBgenerate()\fP method. The default implementation raises NotImplementedError .IP \(bu 2 LaTeX positioned long tables horizontally centered, and short ones flushed left (no text flow around table.) The position now defaults to center in both cases, and it will obey Docutils 0.13 \fB:align:\fP option (refs #3415, #3377) .IP \(bu 2 option directive also allows all punctuations for the option name (refs: #3366) .IP \(bu 2 #3413: if \fBliteralinclude\fP \%<#\:directive-literalinclude>\(aqs \fB:start\-after:\fP is used, make \fB:lines:\fP relative (refs #3412) .IP \(bu 2 \fBliteralinclude\fP directive does not allow the combination of \fB:diff:\fP option and other options (refs: #3416) .IP \(bu 2 LuaLaTeX engine uses \fBfontspec\fP like XeLaTeX. It is advised \fBlatex_engine = \(aqlualatex\(aq\fP be used only on up\-to\-date TeX installs (refs #3070, #3466) .IP \(bu 2 \fBlatex_keep_old_macro_names\fP default value has been changed from \fBTrue\fP to \fBFalse\fP\&. This means that some LaTeX macros for styling are by default defined only with \fB\esphinx..\fP prefixed names. (refs: #3429) .IP \(bu 2 Footer \(dqContinued on next page\(dq of LaTeX longtable\(aqs now not framed (refs: #3497) .IP \(bu 2 #3529: The arguments of \fBBuildEnvironment.__init__\fP is changed .IP \(bu 2 #3082: Use latexmk for pdf (and dvi) targets (Unix\-like platforms only) .IP \(bu 2 #3558: Emit warnings if footnotes and citations are not referenced. The warnings can be suppressed by \fBsuppress_warnings\fP\&. .IP \(bu 2 latex made available (non documented) colour macros from a file distributed with pdftex engine for Plain TeX. This is removed in order to provide better support for multiple TeX engines. Only interface from \fBcolor\fP or \fBxcolor\fP packages should be used by extensions of Sphinx latex writer. (refs #3550) .IP \(bu 2 \fBBuilder.env\fP is not filled at instantiation .IP \(bu 2 #3594: LaTeX: single raw directive has been considered as block level element .IP \(bu 2 #3639: If \fBhtml_experimental_html5_writer\fP is available, epub builder use it by default. .IP \(bu 2 \fBSphinx.add_source_parser()\fP raises an error if duplicated .UNINDENT .sp 1.6b2 .INDENT 0.0 .IP \(bu 2 #3345: Replace the custom smartypants code with Docutils\(aq smart_quotes. Thanks to Dmitry Shachnev, and to Günter Milde at Docutils. .UNINDENT .sp 1.6b3 .INDENT 0.0 .IP \(bu 2 LaTeX package \fBeqparbox\fP is not used and not loaded by Sphinx anymore .IP \(bu 2 LaTeX package \fBmultirow\fP is not used and not loaded by Sphinx anymore .IP \(bu 2 Add line numbers to citation data in std domain .UNINDENT .sp 1.6 final .INDENT 0.0 .IP \(bu 2 LaTeX package \fBthreeparttable\fP is not used and not loaded by Sphinx anymore (refs #3686, #3532, #3377) .UNINDENT .SS Features removed .INDENT 0.0 .IP \(bu 2 Configuration variables .INDENT 2.0 .IP \(bu 2 epub3_contributor .IP \(bu 2 epub3_description .IP \(bu 2 epub3_page_progression_direction .IP \(bu 2 html_translator_class .IP \(bu 2 html_use_modindex .IP \(bu 2 latex_font_size .IP \(bu 2 latex_paper_size .IP \(bu 2 latex_preamble .IP \(bu 2 latex_use_modindex .IP \(bu 2 latex_use_parts .UNINDENT .IP \(bu 2 \fBtermsep\fP node .IP \(bu 2 defindex.html template .IP \(bu 2 LDML format support in \fBtoday\fP, \fBtoday_fmt\fP and \fBhtml_last_updated_fmt\fP .IP \(bu 2 \fB:inline:\fP option for the directives of sphinx.ext.graphviz extension .IP \(bu 2 sphinx.ext.pngmath extension .IP \(bu 2 \fBsphinx.util.compat.make_admonition()\fP .UNINDENT .SS Features added .sp 1.6b1 .INDENT 0.0 .IP \(bu 2 #3136: Add \fB:name:\fP option to the directives in \fBsphinx.ext.graphviz\fP .IP \(bu 2 #2336: Add \fBimported_members\fP option to \fBsphinx\-autogen\fP command to document imported members. .IP \(bu 2 C++, add \fB:tparam\-line\-spec:\fP option to templated declarations. When specified, each template parameter will be rendered on a separate line. .IP \(bu 2 #3359: Allow sphinx.js in a user locale dir to override sphinx.js from Sphinx .IP \(bu 2 #3303: Add \fB:pyversion:\fP option to the doctest directive. .IP \(bu 2 #3378: (latex) support for \fB:widths:\fP option of table directives (refs: #3379, #3381) .IP \(bu 2 #3402: Allow to suppress \(dqdownload file not readable\(dq warnings using \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings>\&. .IP \(bu 2 #3377: latex: Add support for Docutils 0.13 \fB:align:\fP option for tables (but does not implement text flow around table). .IP \(bu 2 latex: footnotes from inside tables are hyperlinked (except from captions or headers) (refs: #3422) .IP \(bu 2 Emit warning if over dedent has detected on \fBliteralinclude\fP directive (refs: #3416) .IP \(bu 2 Use for LuaLaTeX same default settings as for XeLaTeX (i.e. \fBfontspec\fP and \fBpolyglossia\fP). (refs: #3070, #3466) .IP \(bu 2 Make \fB\(aqextraclassoptions\(aq\fP key of \fBlatex_elements\fP public (refs #3480) .IP \(bu 2 #3463: Add warning messages for required EPUB3 metadata. Add default value to \fBepub_description\fP to avoid warning like other settings. .IP \(bu 2 #3476: setuptools: Support multiple builders .IP \(bu 2 latex: merged cells in LaTeX tables allow code\-blocks, lists, blockquotes... as do normal cells (refs: #3435) .IP \(bu 2 HTML builder uses experimental HTML5 writer if \fBhtml_experimental_html5_writer\fP is \fBTrue\fP and Docutils 0.13 or later is installed. .IP \(bu 2 LaTeX macros to customize space before and after tables in PDF output (refs #3504) .IP \(bu 2 #3348: Show decorators in literalinclude and viewcode directives .IP \(bu 2 #3108: Show warning if :start\-at: and other literalinclude options does not match to the text .IP \(bu 2 #3609: Allow to suppress \(dqduplicate citation\(dq warnings using \fBsuppress_warnings\fP .IP \(bu 2 #2803: Discovery of builders by entry point .IP \(bu 2 #1764, #1676: Allow setting \(aqrel\(aq and \(aqtitle\(aq attributes for stylesheets .IP \(bu 2 #3589: Support remote images on non\-HTML builders .IP \(bu 2 #3589: Support images in Data URI on non\-HTML builders .IP \(bu 2 #2961: improve \fBautodoc_mock_imports\fP \%<#\:confval-autodoc_mock_imports>\&. Now the config value only requires to declare the top\-level modules that should be mocked. Thanks to Robin Jarry. .IP \(bu 2 #3449: On py3, autodoc use inspect.signature for more accurate signature calculation. Thanks to Nathaniel J. Smith. .IP \(bu 2 #3641: Epub theme supports HTML structures that are generated by HTML5 writer. .IP \(bu 2 #3644: autodoc uses inspect instead of checking types. Thanks to Jeroen Demeyer. .IP \(bu 2 Add a new extension; \fBsphinx.ext.imgconverter\fP\&. It converts images in the document to appropriate format for builders .IP \(bu 2 latex: Use templates to render tables (refs #3389, 2a37b0e) .UNINDENT .sp 1.6b2 .INDENT 0.0 .IP \(bu 2 \fBLATEXMKOPTS\fP variable for the Makefile in \fB$BUILDDIR/latex\fP to pass options to \fBlatexmk\fP when executing \fBmake latexpdf\fP (refs #3695, #3720) .IP \(bu 2 Add a new event \fBenv\-check\-consistency\fP to check consistency to extensions .IP \(bu 2 Add \fBDomain.check_consistency()\fP to check consistency .UNINDENT .SS Bugs fixed .sp 1.6b1 .INDENT 0.0 .IP \(bu 2 \fBliteralinclude\fP directive expands tabs after dedent\-ing (refs: #3416) .IP \(bu 2 #1574: Paragraphs in table cell doesn\(aqt work in Latex output .IP \(bu 2 #3288: Table with merged headers not wrapping text .IP \(bu 2 #3491: Inconsistent vertical space around table and longtable in PDF .IP \(bu 2 #3506: Depart functions for all admonitions in HTML writer now properly pass \fBnode\fP to \fBdepart_admonition\fP\&. .IP \(bu 2 #2693: Sphinx latex style file wrongly inhibits colours for section headings for latex+dvi(ps,pdf,pdfmx) .IP \(bu 2 C++, properly look up \fBany\fP references. .IP \(bu 2 #3624: sphinx.ext.intersphinx couldn\(aqt load inventories compressed with gzip .IP \(bu 2 #3551: PDF information dictionary is lacking author and title data .IP \(bu 2 #3351: intersphinx does not refers context like \fBpy:module\fP, \fBpy:class\fP and so on. .IP \(bu 2 Fail to load template file if the parent template is archived .UNINDENT .sp 1.6b2 .INDENT 0.0 .IP \(bu 2 #3661: sphinx\-build crashes on parallel build .IP \(bu 2 #3669: gettext builder fails with \(dqValueError: substring not found\(dq .IP \(bu 2 #3660: Sphinx always depends on sphinxcontrib\-websupport and its dependencies .IP \(bu 2 #3472: smart quotes getting wrong in latex (at least with list of strings via autoattribute) (refs: #3345, #3666) .UNINDENT .sp 1.6b3 .INDENT 0.0 .IP \(bu 2 #3588: No compact (p tag) html output in the i18n document build even when \fBhtml_compact_lists\fP \%<#\:confval-html_compact_lists> is \fBTrue\fP\&. .IP \(bu 2 The \fBmake latexpdf\fP from 1.6b1 (for GNU/Linux and Mac OS, using \fBlatexmk\fP) aborted earlier in case of LaTeX errors than was the case with 1.5 series, due to hard\-coded usage of \fB\-\-halt\-on\-error\fP option (refs #3695) .IP \(bu 2 #3683: sphinx.websupport module is not provided by default .IP \(bu 2 #3683: Failed to build document if builder.css_file.insert() is called .IP \(bu 2 #3714: viewcode extension not taking \fBhighlight_code=\(aqnone\(aq\fP in account .IP \(bu 2 #3698: Moving :doc: to std domain broke backwards compatibility .IP \(bu 2 #3633: misdetect unreferenced citations .UNINDENT .sp 1.6 final .INDENT 0.0 .IP \(bu 2 LaTeX tables do not allow multiple paragraphs in a header cell .IP \(bu 2 LATEXOPTS is not passed over correctly to pdflatex since 1.6b3 .IP \(bu 2 #3532: Figure or literal block captions in cells of short tables cause havoc in PDF output .IP \(bu 2 Fix: in PDF captions of tables are rendered differently whether table is of longtable class or not (refs #3686) .IP \(bu 2 #3725: Todo looks different from note in LaTeX output .IP \(bu 2 #3479: stub\-columns have no effect in LaTeX output .IP \(bu 2 #3738: Nonsensical code in theming.py .IP \(bu 2 #3746: PDF builds fail with latexmk 4.48 or earlier due to undefined options \fB\-pdfxe\fP and \fB\-pdflua\fP .UNINDENT .SS Deprecated .sp 1.6b1 .INDENT 0.0 .IP \(bu 2 \fBsphinx.util.compat.Directive\fP class is now deprecated. Please use instead \fBdocutils.parsers.rst.Directive\fP .IP \(bu 2 \fBsphinx.util.compat.docutils_version\fP is now deprecated .IP \(bu 2 #2367: \fBSphinx.warn()\fP, \fBSphinx.info()\fP and other logging methods are now deprecated. Please use \fBsphinx.util.logging\fP (Logging API \%<#\:logging-api>) instead. .IP \(bu 2 #3318: \fBnotice\fP is now deprecated as LaTeX environment name and will be removed at Sphinx 1.7. Extension authors please use \fBsphinxadmonition\fP instead (as Sphinx does since 1.5.) .IP \(bu 2 \fBSphinx.status_iterator()\fP and \fBSphinx.old_status_iterator()\fP is now deprecated. Please use \fBsphinx.util:status_iterator()\fP instead. .IP \(bu 2 \fBSphinx._directive_helper()\fP is deprecated. Please use \fBsphinx.util.docutils.directive_helper()\fP instead. .IP \(bu 2 \fBBuildEnvironment.set_warnfunc()\fP is now deprecated .IP \(bu 2 Following methods of \fBBuildEnvironment\fP is now deprecated. .INDENT 2.0 .IP \(bu 2 \fBBuildEnvironment.note_toctree()\fP .IP \(bu 2 \fBBuildEnvironment.get_toc_for()\fP .IP \(bu 2 \fBBuildEnvironment.get_toctree_for()\fP .IP \(bu 2 \fBBuildEnvironment.create_index()\fP .UNINDENT .sp Please use \fBsphinx.environment.adapters\fP modules instead. .IP \(bu 2 latex package \fBfootnote\fP is not loaded anymore by its bundled replacement \fBfootnotehyper\-sphinx\fP\&. The redefined macros keep the same names as in the original package. .IP \(bu 2 #3429: deprecate config setting \fBlatex_keep_old_macro_names\fP\&. It will be removed at 1.7, and already its default value has changed from \fBTrue\fP to \fBFalse\fP\&. .IP \(bu 2 #3221: epub2 builder is deprecated .IP \(bu 2 #3254: \fBsphinx.websupport\fP is now separated into independent package; \fBsphinxcontrib\-websupport\fP\&. \fBsphinx.websupport\fP will be removed in Sphinx 2.0. .IP \(bu 2 #3628: \fBsphinx_themes\fP entry_point is deprecated. Please use \fBsphinx.html_themes\fP instead. .UNINDENT .sp 1.6b2 .INDENT 0.0 .IP \(bu 2 #3662: \fBbuilder.css_files\fP is deprecated. Please use \fBadd_stylesheet()\fP API instead. .UNINDENT .sp 1.6 final .INDENT 0.0 .IP \(bu 2 LaTeX \fB\esphinxstylethead\fP is deprecated at 1.6 and will be removed at 1.7. Please move customization into new macro \fB\esphinxstyletheadfamily\fP\&. .UNINDENT .SS Testing .sp 1.6 final .INDENT 0.0 .IP \(bu 2 #3458: Add \fBsphinx.testing\fP (experimental) .UNINDENT .SS Release 1.6 (unreleased) .INDENT 0.0 .IP \(bu 2 not released (because of package script error) .UNINDENT .SS Sphinx 1.5 .SS Release 1.5.6 (released May 15, 2017) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #3614: Sphinx crashes with requests\-2.5.0 .IP \(bu 2 #3618: autodoc crashes with tupled arguments .IP \(bu 2 #3664: No space after the bullet in items of a latex list produced by Sphinx .IP \(bu 2 #3657: EPUB builder crashes if a document starting with genindex exists .IP \(bu 2 #3588: No compact (p tag) html output in the i18n document build even when \fBhtml_compact_lists\fP \%<#\:confval-html_compact_lists> is \fBTrue\fP\&. .IP \(bu 2 #3685: AttributeError when using 3rd party domains .IP \(bu 2 #3702: LaTeX writer styles figure legends with a hard\-coded \fB\esmall\fP .IP \(bu 2 #3708: LaTeX writer allows irc scheme .IP \(bu 2 #3717: Stop enforcing that favicon\(aqs must be .ico .IP \(bu 2 #3731, #3732: Protect isenumclass predicate against non\-class arguments .IP \(bu 2 #3320: Warning about reference target not being found for container types .IP \(bu 2 Misspelled ARCHIVEPREFIX in Makefile for latex build repertory .UNINDENT .SS Release 1.5.5 (released Apr 03, 2017) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #3597: python domain raises UnboundLocalError if invalid name given .IP \(bu 2 #3599: Move to new MathJax CDN .UNINDENT .SS Release 1.5.4 (released Apr 02, 2017) .SS Features added .INDENT 0.0 .IP \(bu 2 #3470: Make genindex support all kinds of letters, not only Latin ones .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #3445: setting \fB\(aqinputenc\(aq\fP key to \fB\e\eusepackage[utf8x]{inputenc}\fP leads to failed PDF build .IP \(bu 2 EPUB file has duplicated \fBnav.xhtml\fP link in \fBcontent.opf\fP except first time build .IP \(bu 2 #3488: objects.inv has broken when \fBrelease\fP or \fBversion\fP contain return code .IP \(bu 2 #2073, #3443, #3490: gettext builder that writes pot files unless the content are same without creation date. Thanks to Yoshiki Shibukawa. .IP \(bu 2 #3487: intersphinx: failed to refer options .IP \(bu 2 #3496: latex longtable\(aqs last column may be much wider than its contents .IP \(bu 2 #3507: wrong quotes in latex output for productionlist directive .IP \(bu 2 #3533: Moving from Sphinx 1.3.1 to 1.5.3 breaks LaTeX compilation of links rendered as code .IP \(bu 2 #2665, #2607: Link names in C++ docfields, and make it possible for other domains. .IP \(bu 2 #3542: C++, fix parsing error of non\-type template argument with template. .IP \(bu 2 #3065, #3520: python domain fails to recognize nested class .IP \(bu 2 #3575: Problems with pdflatex in a Turkish document built with Sphinx has reappeared (refs #2997, #2397) .IP \(bu 2 #3577: Fix intersphinx debug tool .IP \(bu 2 A LaTeX command such as \fB\e\elarge\fP inserted in the title items of \fBlatex_documents\fP \%<#\:confval-latex_documents> causes failed PDF build (refs #3551, #3567) .UNINDENT .SS Release 1.5.3 (released Feb 26, 2017) .SS Features added .INDENT 0.0 .IP \(bu 2 Support requests\-2.0.0 (experimental) (refs: #3367) .IP \(bu 2 (latex) PDF page margin dimensions may be customized (refs: #3387) .IP \(bu 2 \fBliteralinclude\fP directive allows combination of \fB:pyobject:\fP and \fB:lines:\fP options (refs: #3416) .IP \(bu 2 #3400: make\-mode doesn\(aqt use subprocess on building docs .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #3370: the caption of code\-block is not picked up for translation .IP \(bu 2 LaTeX: \fBrelease\fP \%<#\:confval-release> is not escaped (refs: #3362) .IP \(bu 2 #3364: sphinx\-quickstart prompts overflow on Console with 80 chars width .IP \(bu 2 since 1.5, PDF\(aqs TOC and bookmarks lack an entry for general Index (refs: #3383) .IP \(bu 2 #3392: \fB\(aqreleasename\(aq\fP in \fBlatex_elements\fP \%<#\:confval-latex_elements> is not working .IP \(bu 2 #3356: Page layout for Japanese \fB\(aqmanual\(aq\fP docclass has a shorter text area .IP \(bu 2 #3394: When \fB\(aqpointsize\(aq\fP is not \fB10pt\fP, Japanese \fB\(aqmanual\(aq\fP document gets wrong PDF page dimensions .IP \(bu 2 #3399: quickstart: conf.py was not overwritten by template .IP \(bu 2 #3366: option directive does not allow punctuations .IP \(bu 2 #3410: return code in \fBrelease\fP \%<#\:confval-release> breaks html search .IP \(bu 2 #3427: autodoc: memory addresses are not stripped on Windows .IP \(bu 2 #3428: xetex build tests fail due to fontspec v2.6 defining \fB\estrong\fP .IP \(bu 2 #3349: Result of \fBIndexBuilder.load()\fP is broken .IP \(bu 2 #3450:   is appeared in EPUB docs .IP \(bu 2 #3418: Search button is misaligned in nature and pyramid theme .IP \(bu 2 #3421: Could not translate a caption of tables .IP \(bu 2 #3552: linkcheck raises UnboundLocalError .UNINDENT .SS Release 1.5.2 (released Jan 22, 2017) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Dependency requirement updates: requests 2.4.0 or above (refs: #3268, #3310) .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #3241: emit latex warning if buggy titlesec (ref #3210) .IP \(bu 2 #3194: Refer the $MAKE environment variable to determine \fBmake\fP command .IP \(bu 2 Emit warning for nested numbered toctrees (refs: #3142) .IP \(bu 2 #978: \fBintersphinx_mapping\fP also allows a list as a parameter .IP \(bu 2 #3340: (LaTeX) long lines in parsed\-literal \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:parsed-literal> are wrapped like in \fBcode\-block\fP \%<#\:directive-code-block>, inline math and footnotes are fully functional. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #3246: xapian search adapter crashes .IP \(bu 2 #3253: In Py2 environment, building another locale with a non\-captioned toctree produces \fBNone\fP captions .IP \(bu 2 #185: References to section title including raw node has broken .IP \(bu 2 #3255: In Py3.4 environment, autodoc doesn\(aqt support documentation for attributes of Enum class correctly. .IP \(bu 2 #3261: \fBlatex_use_parts\fP makes Sphinx crash .IP \(bu 2 The warning type \fBmisc.highlighting_failure\fP does not work .IP \(bu 2 #3294: \fBadd_latex_package()\fP make crashes non\-LaTeX builders .IP \(bu 2 The caption of table are rendered as invalid HTML (refs: #3287) .IP \(bu 2 #3268: Sphinx crashes with requests package from Debian jessie .IP \(bu 2 #3284: Sphinx crashes on parallel build with an extension which raises unserializable exception .IP \(bu 2 #3315: Bibliography crashes on latex build with docclass \(aqmemoir\(aq .IP \(bu 2 #3328: Could not refer rubric implicitly .IP \(bu 2 #3329: emit warnings if po file is invalid and can\(aqt read it. Also writing mo .IP \(bu 2 #3337: Ugly rendering of definition list term\(aqs classifier .IP \(bu 2 #3335: gettext does not extract field_name of a field in a field_list .IP \(bu 2 #2952: C++, fix refs to operator() functions. .IP \(bu 2 Fix Unicode super\- and subscript digits in \fBcode\-block\fP \%<#\:directive-code-block> and parsed\-literal LaTeX output (ref #3342) .IP \(bu 2 LaTeX writer: leave \fB\(dq\fP character inside parsed\-literal as is (ref #3341) .IP \(bu 2 #3234: intersphinx failed for encoded inventories .IP \(bu 2 #3158: too much space after captions in PDF output .IP \(bu 2 #3317: An URL in parsed\-literal contents gets wrongly rendered in PDF if with hyphen .IP \(bu 2 LaTeX crash if the filename of an image inserted in parsed\-literal via a substitution contains an hyphen (ref #3340) .IP \(bu 2 LaTeX rendering of inserted footnotes in parsed\-literal is wrong (ref #3340) .IP \(bu 2 Inline math in parsed\-literal is not rendered well by LaTeX (ref #3340) .IP \(bu 2 #3308: Parsed\-literals don\(aqt wrap very long lines with pdf builder (ref #3340) .IP \(bu 2 #3295: Could not import extension sphinx.builders.linkcheck .IP \(bu 2 #3285: autosummary: asterisks are escaped twice .IP \(bu 2 LaTeX, pass dvipdfm option to geometry package for Japanese documents (ref #3363) .IP \(bu 2 Fix parselinenos() could not parse left half open range (cf. \(dq\-4\(dq) .UNINDENT .SS Release 1.5.1 (released Dec 13, 2016) .SS Features added .INDENT 0.0 .IP \(bu 2 #3214: Allow to suppress \(dqunknown mimetype\(dq warnings from epub builder using \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings>\&. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #3195: Can not build in parallel .IP \(bu 2 #3198: AttributeError is raised when toctree has \(aqself\(aq .IP \(bu 2 #3211: Remove untranslated Sphinx locale catalogs (it was covered by untranslated it_IT) .IP \(bu 2 #3212: HTML Builders crashes with Docutils 0.13 .IP \(bu 2 #3207: more latex problems with references inside parsed\-literal directive (\fB\eDUrole\fP) .IP \(bu 2 #3205: sphinx.util.requests crashes with old pyOpenSSL (< 0.14) .IP \(bu 2 #3220: KeyError when having a duplicate citation .IP \(bu 2 #3200: LaTeX: xref inside desc_name not allowed .IP \(bu 2 #3228: \fBbuild_sphinx\fP command crashes when missing dependency .IP \(bu 2 #2469: Ignore updates of catalog files for gettext builder. Thanks to Hiroshi Ohkubo. .IP \(bu 2 #3183: Randomized jump box order in generated index page. .UNINDENT .SS Release 1.5 (released Dec 5, 2016) .SS Incompatible changes .sp 1.5a1 .INDENT 0.0 .IP \(bu 2 latex, package fancybox is not any longer a dependency of sphinx.sty .IP \(bu 2 Use \fB\(aqlocales\(aq\fP as a default value of \fBlocale_dirs\fP .IP \(bu 2 latex, package ifthen is not any longer a dependency of sphinx.sty .IP \(bu 2 latex, style file does not modify fancyvrb\(aqs Verbatim (also available as OriginalVerbatim) but uses sphinxVerbatim for name of custom wrapper. .IP \(bu 2 latex, package newfloat is not used (and not included) anymore (ref #2660; it was used since 1.3.4 and shipped with Sphinx since 1.4). .IP \(bu 2 latex, literal blocks in tables do not use OriginalVerbatim but sphinxVerbatimintable which handles captions and wraps lines (ref #2704). .IP \(bu 2 latex, replace \fBpt\fP by TeX equivalent \fBbp\fP if found in \fBwidth\fP or \fBheight\fP attribute of an image. .IP \(bu 2 latex, if \fBwidth\fP or \fBheight\fP attribute of an image is given with no unit, use \fBpx\fP rather than ignore it. .IP \(bu 2 latex: Separate stylesheets of pygments to independent .sty file .IP \(bu 2 #2454: The filename of sourcelink is now changed. The value of \fBhtml_sourcelink_suffix\fP will be appended to the original filename (like \fBindex.rst.txt\fP). .IP \(bu 2 \fBsphinx.util.copy_static_entry()\fP is now deprecated. Use \fBsphinx.util.fileutil.copy_asset()\fP instead. .IP \(bu 2 \fBsphinx.util.osutil.filecopy()\fP skips copying if the file has not been changed (ref: #2510, #2753) .IP \(bu 2 Internet Explorer 6\-8, Opera 12.1x or Safari 5.1+ support is dropped because jQuery version is updated from 1.11.0 to 3.1.0 (ref: #2634, #2773) .IP \(bu 2 QtHelpBuilder doesn\(aqt generate search page (ref: #2352) .IP \(bu 2 QtHelpBuilder uses \fBnonav\fP theme instead of default one to improve readability. .IP \(bu 2 latex: To provide good default settings to Japanese documents, Sphinx uses \fBjreport\fP and \fBjsbook\fP as docclass if \fBlanguage\fP \%<#\:confval-language> is \fBja\fP\&. .IP \(bu 2 \fBsphinx\-quickstart\fP now allows a project version is empty .IP \(bu 2 Fix :download: role on epub/qthelp builder. They ignore the role because they don\(aqt support it. .IP \(bu 2 \fBsphinx.ext.viewcode\fP doesn\(aqt work on epub building by default. \fBviewcode_enable_epub\fP option .IP \(bu 2 \fBsphinx.ext.viewcode\fP disabled on singlehtml builder. .IP \(bu 2 Use make\-mode of \fBsphinx\-quickstart\fP by default. To disable this, use \fB\-M\fP option .IP \(bu 2 Fix \fBgenindex.html\fP, Sphinx\(aqs document template, link address to itself to satisfy xhtml standard. .IP \(bu 2 Use epub3 builder by default. And the old epub builder is renamed to epub2. .IP \(bu 2 Fix \fBepub\fP and \fBepub3\fP builders that contained links to \fBgenindex\fP even if \fBepub_use_index = False\fP\&. .IP \(bu 2 \fBhtml_translator_class\fP is now deprecated. Use \fBset_translator()\fP \%<#\:sphinx\:.application\:.Sphinx\:.set_translator> API instead. .IP \(bu 2 Drop python 2.6 and 3.3 support .IP \(bu 2 Drop epub3 builder\(aqs \fBepub3_page_progression_direction\fP option (use \fBepub3_writing_mode\fP). .IP \(bu 2 #2877: Rename \fBlatex_elements[\(aqfooter\(aq]\fP to \fBlatex_elements[\(aqatendofbody\(aq]\fP .UNINDENT .sp 1.5a2 .INDENT 0.0 .IP \(bu 2 #2983: Rename \fBepub3_description\fP and \fBepub3_contributor\fP to \fBepub_description\fP and \fBepub_contributor\fP\&. .IP \(bu 2 Remove themes/basic/defindex.html; no longer used .IP \(bu 2 Sphinx does not ship anymore (but still uses) LaTeX style file \fBfncychap\fP .IP \(bu 2 #2435: Slim down quickstarted conf.py .IP \(bu 2 The \fBsphinx.sty\fP latex package does not load itself \(dqhyperref\(dq, as this is done later in the preamble of the latex output via \fB\(aqhyperref\(aq\fP key. .IP \(bu 2 Sphinx does not ship anymore a custom modified LaTeX style file \fBtabulary\fP\&. The non\-modified package is used. .IP \(bu 2 #3057: By default, footnote marks in latex PDF output are not preceded by a space anymore, \fB\esphinxBeforeFootnote\fP allows user customization if needed. .IP \(bu 2 LaTeX target requires that option \fBhyperfootnotes\fP of package \fBhyperref\fP be left unchanged to its default (i.e. \fBtrue\fP) (refs: #3022) .UNINDENT .sp 1.5 final .INDENT 0.0 .IP \(bu 2 #2986: \fBthemes/basic/defindex.html\fP is now deprecated .IP \(bu 2 Emit warnings that will be deprecated in Sphinx 1.6 by default. Users can change the behavior by setting the environment variable PYTHONWARNINGS. Please refer Deprecation Warnings \%<#\:when-deprecation-warnings-are-displayed>\&. .IP \(bu 2 #2454: new JavaScript variable \fBSOURCELINK_SUFFIX\fP is added .UNINDENT .SS Deprecated .sp These features are removed in Sphinx 1.6: .INDENT 0.0 .IP \(bu 2 LDML format support in i18n feature .IP \(bu 2 \fBsphinx.addnodes.termsep\fP .IP \(bu 2 Some functions and classes in \fBsphinx.util.pycompat\fP: \fBzip_longest\fP, \fBproduct\fP, \fBall\fP, \fBany\fP, \fBnext\fP, \fBopen\fP, \fBclass_types\fP, \fBbase_exception\fP, \fBrelpath\fP, \fBStringIO\fP, \fBBytesIO\fP\&. Please use the standard library version instead; .UNINDENT .sp If any deprecation warning like \fBRemovedInSphinxXXXWarning\fP are displayed, please refer Deprecation Warnings \%<#\:when-deprecation-warnings-are-displayed>\&. .SS Features added .sp 1.5a1 .INDENT 0.0 .IP \(bu 2 #2951: Add \fB\-\-implicit\-namespaces\fP PEP\-0420 support to apidoc. .IP \(bu 2 Add \fB:caption:\fP option for sphinx.ext.inheritance_diagram. .IP \(bu 2 #2471: Add config variable for default doctest flags. .IP \(bu 2 Convert linkcheck builder to requests for better encoding handling .IP \(bu 2 #2463, #2516: Add keywords of \(dqmeta\(dq directive to search index .IP \(bu 2 \fB:maxdepth:\fP option of toctree affects \fBsecnumdepth\fP (ref: #2547) .IP \(bu 2 #2575: Now \fBsphinx.ext.graphviz\fP allows \fB:align:\fP option .IP \(bu 2 Show warnings if unknown key is specified to \fBlatex_elements\fP .IP \(bu 2 Show warnings if no domains match with \fBprimary_domain\fP (ref: #2001) .IP \(bu 2 C++, show warnings when the kind of role is misleading for the kind of target it refers to (e.g., using the \fBclass\fP role for a function). .IP \(bu 2 latex, writer abstracts more of text styling into customizable macros, e.g. the \fBvisit_emphasis\fP will output \fB\esphinxstyleemphasis\fP rather than \fB\eemph\fP (which may be in use elsewhere or in an added LaTeX package). See list at end of \fBsphinx.sty\fP (ref: #2686) .IP \(bu 2 latex, public names for environments and parameters used by note, warning, and other admonition types, allowing full customizability from the \fB\(aqpreamble\(aq\fP key or an input file (ref: feature request #2674, #2685) .IP \(bu 2 latex, better computes column widths of some tables (as a result, there will be slight changes as tables now correctly fill the line width; ref: #2708) .IP \(bu 2 latex, sphinxVerbatim environment is more easily customizable (ref: #2704). In addition to already existing VerbatimColor and VerbatimBorderColor: .INDENT 2.0 .IP \(bu 2 two lengths \fB\esphinxverbatimsep\fP and \fB\esphinxverbatimborder\fP, .IP \(bu 2 booleans \fB\eifsphinxverbatimwithframe\fP and \fB\eifsphinxverbatimwrapslines\fP\&. .UNINDENT .IP \(bu 2 latex, captions for literal blocks inside tables are handled, and long code lines wrapped to fit table cell (ref: #2704) .IP \(bu 2 #2597: Show warning messages as darkred .IP \(bu 2 latex, allow image dimensions using px unit (default is 96px=1in) .IP \(bu 2 Show warnings if invalid dimension units found .IP \(bu 2 #2650: Add \fB\-\-pdb\fP option to setup.py command .IP \(bu 2 latex, make the use of \fB\esmall\fP for code listings customizable (ref #2721) .IP \(bu 2 #2663: Add \fB\-\-warning\-is\-error\fP option to setup.py command .IP \(bu 2 Show warnings if deprecated latex options are used .IP \(bu 2 Add sphinx.config.ENUM to check the config values is in candidates .IP \(bu 2 math: Add hyperlink marker to each equations in HTML output .IP \(bu 2 Add new theme \fBnonav\fP that doesn\(aqt include any navigation links. This is for any help generator like qthelp. .IP \(bu 2 #2680: \fBsphinx.ext.todo\fP now emits warnings if \fBtodo_emit_warnings\fP enabled. Also, it emits an additional event named \fBtodo\-defined\fP to handle the TODO entries in 3rd party extensions. .IP \(bu 2 Python domain signature parser now uses the xref mixin for \(aqexceptions\(aq, allowing exception classes to be autolinked. .IP \(bu 2 #2513: Add \fBlatex_engine\fP to switch the LaTeX engine by conf.py .IP \(bu 2 #2682: C++, basic support for attributes (C++11 style and GNU style). The new configuration variables \(aqcpp_id_attributes\(aq and \(aqcpp_paren_attributes\(aq can be used to introduce custom attributes. .IP \(bu 2 #1958: C++, add configuration variable \(aqcpp_index_common_prefix\(aq for removing prefixes from the index text of C++ objects. .IP \(bu 2 C++, added concept directive. Thanks to mickk\-on\-cpp. .IP \(bu 2 C++, added support for template introduction syntax. Thanks to mickk\-on\-cpp. .IP \(bu 2 #2725: latex builder: allow to use user\-defined template file (experimental) .IP \(bu 2 apidoc now avoids invalidating cached files by not writing to files whose content doesn\(aqt change. This can lead to significant performance wins if apidoc is run frequently. .IP \(bu 2 #2851: \fBsphinx.ext.math\fP emits missing\-reference event if equation not found .IP \(bu 2 #1210: \fBeqref\fP role now supports cross reference .IP \(bu 2 #2892: Added \fB\-a\fP (\fB\-\-append\-syspath\fP) option to \fBsphinx\-apidoc\fP .IP \(bu 2 #1604: epub3 builder: Obey font\-related CSS when viewing in iBooks. .IP \(bu 2 #646: \fBoption\fP directive support \(aq.\(aq character as a part of options .IP \(bu 2 Add document about kindlegen and fix document structure for it. .IP \(bu 2 #2474: Add \fBintersphinx_timeout\fP option to \fBsphinx.ext.intersphinx\fP .IP \(bu 2 #2926: EPUB3 builder supports vertical mode (\fBepub3_writing_mode\fP option) .IP \(bu 2 #2695: \fBbuild_sphinx\fP subcommand for setuptools handles exceptions as same as \fBsphinx\-build\fP does .IP \(bu 2 #326: \fBnumref\fP role can also refer sections .IP \(bu 2 #2916: \fBnumref\fP role can also refer caption as an its linktext .UNINDENT .sp 1.5a2 .INDENT 0.0 .IP \(bu 2 #3008: \fBlinkcheck\fP builder ignores self\-signed certificate URL .IP \(bu 2 #3020: new \fB\(aqgeometry\(aq\fP key to \fBlatex_elements\fP whose default uses LaTeX style file \fBgeometry.sty\fP to set page layout .IP \(bu 2 #2843: Add :start\-at: and :end\-at: options to literalinclude directive .IP \(bu 2 #2527: Add \fB:reversed:\fP option to toctree directive .IP \(bu 2 Add \fB\-t\fP and \fB\-d\fP option to \fBsphinx\-quickstart\fP to support templating generated Sphinx project. .IP \(bu 2 #3028: Add \fB{path}\fP and \fB{basename}\fP to the format of \fBfigure_language_filename\fP .IP \(bu 2 new \fB\(aqhyperref\(aq\fP key in the \fBlatex_elements\fP dictionary (ref #3030) .IP \(bu 2 #3022: Allow code\-blocks in footnotes for LaTeX PDF output .UNINDENT .sp 1.5b1 .INDENT 0.0 .IP \(bu 2 #2513: A better default settings for XeLaTeX .IP \(bu 2 #3096: \fB\(aqmaxlistdepth\(aq\fP key to work around LaTeX list limitations .IP \(bu 2 #3060: autodoc supports documentation for attributes of Enum class. Now autodoc render just the value of Enum attributes instead of Enum attribute representation. .IP \(bu 2 Add \fB\-\-extensions\fP to \fBsphinx\-quickstart\fP to support enable arbitrary extensions from command line (ref: #2904) .IP \(bu 2 #3104, #3122: \fB\(aqsphinxsetup\(aq\fP for key=value styling of Sphinx LaTeX .IP \(bu 2 #3071: Autodoc: Allow mocked module decorators to pass\-through functions unchanged .IP \(bu 2 #2495: linkcheck: Allow skipping anchor checking using \fBlinkcheck_anchors_ignore\fP \%<#\:confval-linkcheck_anchors_ignore> .IP \(bu 2 #3083: let Unicode no\-break space act like LaTeX \fB~\fP (fixed #3019) .IP \(bu 2 #3116: allow word wrap in PDF output for inline literals (ref #3110) .IP \(bu 2 #930: sphinx\-apidoc allow wildcards for excluding paths. Thanks to Nick Coghlan. .IP \(bu 2 #3121: add \fBinlineliteralwraps\fP option to control if inline literal word\-wraps in latex .UNINDENT .sp 1.5 final .INDENT 0.0 .IP \(bu 2 #3095: Add \fBtls_verify\fP \%<#\:confval-tls_verify> and \fBtls_cacerts\fP \%<#\:confval-tls_cacerts> to support self\-signed HTTPS servers in linkcheck and intersphinx .IP \(bu 2 #2215: make.bat generated by sphinx\-quickstart can be called from another dir. Thanks to Timotheus Kampik. .IP \(bu 2 #3185: Add new warning type \fBmisc.highlighting_failure\fP .UNINDENT .SS Bugs fixed .sp 1.5a1 .INDENT 0.0 .IP \(bu 2 #2707: (latex) the column width is badly computed for tabular .IP \(bu 2 #2799: Sphinx installs roles and directives automatically on importing sphinx module. Now Sphinx installs them on running application. .IP \(bu 2 \fBsphinx.ext.autodoc\fP crashes if target code imports * from mock modules by \fBautodoc_mock_imports\fP\&. .IP \(bu 2 #1953: \fBSphinx.add_node\fP does not add handlers the translator installed by \fBhtml_translator_class\fP .IP \(bu 2 #1797: text builder inserts blank line on top .IP \(bu 2 #2894: quickstart main() doesn\(aqt use argv argument .IP \(bu 2 #2874: gettext builder could not extract all text under the \fBonly\fP directives .IP \(bu 2 #2485: autosummary crashes with multiple source_suffix values .IP \(bu 2 #1734: Could not translate the caption of toctree directive .IP \(bu 2 Could not translate the content of meta directive (ref: #1734) .IP \(bu 2 #2550: external links are opened in help viewer .IP \(bu 2 #2687: Running Sphinx multiple times produces \(aqalready registered\(aq warnings .UNINDENT .sp 1.5a2 .INDENT 0.0 .IP \(bu 2 #2810: Problems with pdflatex in an Italian document .IP \(bu 2 Use \fBlatex_elements.papersize\fP to specify papersize of LaTeX in Makefile .IP \(bu 2 #2988: linkcheck: retry with GET request if denied HEAD request .IP \(bu 2 #2990: linkcheck raises \(dqCan\(aqt convert \(aqbytes\(aq object to str implicitly\(dq error if linkcheck_anchors enabled .IP \(bu 2 #3004: Invalid link types \(dqtop\(dq and \(dqup\(dq are used .IP \(bu 2 #3009: Bad rendering of parsed\-literals in LaTeX since Sphinx 1.4.4 .IP \(bu 2 #3000: \fBoption\fP directive generates invalid HTML anchors .IP \(bu 2 #2984: Invalid HTML has been generated if \fBhtml_split_index\fP enabled .IP \(bu 2 #2986: themes/basic/defindex.html should be changed for html5 friendly .IP \(bu 2 #2987: Invalid HTML has been generated if multiple IDs are assigned to a list .IP \(bu 2 #2891: HTML search does not provide all the results .IP \(bu 2 #1986: Title in PDF Output .IP \(bu 2 #147: Problem with latex chapter style .IP \(bu 2 #3018: LaTeX problem with page layout dimensions and chapter titles .IP \(bu 2 Fix an issue with \fB\epysigline\fP in LaTeX style file (ref #3023) .IP \(bu 2 #3038: \fBsphinx.ext.math*\fP raises TypeError if labels are duplicated .IP \(bu 2 #3031: incompatibility with LaTeX package \fBtocloft\fP .IP \(bu 2 #3003: literal blocks in footnotes are not supported by Latex .IP \(bu 2 #3047: spacing before footnote in pdf output is not coherent and allows breaks .IP \(bu 2 #3045: HTML search index creator should ignore \(dqraw\(dq content if now html .IP \(bu 2 #3039: English stemmer returns wrong word if the word is capitalized .IP \(bu 2 Fix make\-mode Makefile template (ref #3056, #2936) .UNINDENT .sp 1.5b1 .INDENT 0.0 .IP \(bu 2 #2432: Fix unwanted * between varargs and keyword only args. Thanks to Alex Grönholm. .IP \(bu 2 #3062: Failed to build PDF using 1.5a2 (undefined \fB\ehypersetup\fP for Japanese documents since PR#3030) .IP \(bu 2 Better rendering of multiline signatures in html. .IP \(bu 2 #777: LaTeX output \(dqtoo deeply nested\(dq (ref #3096) .IP \(bu 2 Let LaTeX image inclusion obey \fBscale\fP before textwidth fit (ref #2865, #3059) .IP \(bu 2 #3019: LaTeX fails on description of C function with arguments (ref #3083) .IP \(bu 2 fix latex inline literals where \fB< > \-\fP gobbled a space .UNINDENT .sp 1.5 final .INDENT 0.0 .IP \(bu 2 #3069: Even if \fB\(aqbabel\(aq\fP key is set to empty string, LaTeX output contains one \fB\eaddto\ecaptions...\fP .IP \(bu 2 #3123: user \fB\(aqbabel\(aq\fP key setting is not obeyed anymore .IP \(bu 2 #3155: Fix JavaScript for \fBhtml_sourcelink_suffix\fP fails with IE and Opera .IP \(bu 2 #3085: keep current directory after breaking build documentation. Thanks to Timotheus Kampik. .IP \(bu 2 #3181: pLaTeX crashes with a section contains endash .IP \(bu 2 #3180: latex: add stretch/shrink between successive singleline or multipleline cpp signatures (ref #3072) .IP \(bu 2 #3128: globing images does not support .svgz file .IP \(bu 2 #3015: fix a broken test on Windows. .IP \(bu 2 #1843: Fix documentation of descriptor classes that have a custom metaclass. Thanks to Erik Bray. .IP \(bu 2 #3190: util.split_docinfo fails to parse multi\-line field bodies .IP \(bu 2 #3024, #3037: In Python3, application.Sphinx._log crushed when the log message cannot be encoded into console encoding. .UNINDENT .SS Testing .INDENT 0.0 .IP \(bu 2 To simplify, Sphinx uses external mock package even if \fBunittest.mock\fP exists. .UNINDENT .SS Sphinx 1.4 .SS Release 1.4.9 (released Nov 23, 2016) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #2936: Fix doc/Makefile that can\(aqt build man because doc/man exists .IP \(bu 2 #3058: Using the same \(aqcaption\(aq attribute in multiple \(aqtoctree\(aq directives results in warning / error .IP \(bu 2 #3068: Allow the \(aq=\(aq character in the \-D option of sphinx\-build.py .IP \(bu 2 #3074: \fBadd_source_parser()\fP crashes in debug mode .IP \(bu 2 #3135: \fBsphinx.ext.autodoc\fP crashes with plain Callable .IP \(bu 2 #3150: Fix query word splitter in JavaScript. It behaves as same as Python\(aqs regular expression. .IP \(bu 2 #3093: gettext build broken on substituted images. .IP \(bu 2 #3093: gettext build broken on image node under \fBnote\fP directive. .IP \(bu 2 imgmath: crashes on showing error messages if image generation failed .IP \(bu 2 #3117: LaTeX writer crashes if admonition is placed before first section title .IP \(bu 2 #3164: Change search order of \fBsphinx.ext.inheritance_diagram\fP .UNINDENT .SS Release 1.4.8 (released Oct 1, 2016) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #2996: The wheel package of Sphinx got crash with ImportError .UNINDENT .SS Release 1.4.7 (released Oct 1, 2016) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #2890: Quickstart should return an error consistently on all error conditions .IP \(bu 2 #2870: flatten genindex columns\(aq heights. .IP \(bu 2 #2856: Search on generated HTML site doesn\(aqt find some symbols .IP \(bu 2 #2882: Fall back to a GET request on 403 status in linkcheck .IP \(bu 2 #2902: jsdump.loads fails to load search index if keywords starts with underscore .IP \(bu 2 #2900: Fix epub content.opf: add auto generated orphan files to spine. .IP \(bu 2 #2899: Fix \fBhasdoc()\fP function in Jinja2 template. It will detect \fBgenindex\fP, \fBsearch\fP also. .IP \(bu 2 #2901: Fix epub result: skip creating links from image tags to original image files. .IP \(bu 2 #2917: inline code is hyphenated on HTML .IP \(bu 2 #1462: autosummary warns for namedtuple with attribute with trailing underscore .IP \(bu 2 Could not reference equations if \fB:nowrap:\fP option specified .IP \(bu 2 #2873: code\-block overflow in latex (due to commas) .IP \(bu 2 #1060, #2056: sphinx.ext.intersphinx: broken links are generated if relative paths are used in \fBintersphinx_mapping\fP .IP \(bu 2 #2931: code\-block directive with same :caption: causes warning of duplicate target. Now \fBcode\-block\fP and \fBliteralinclude\fP does not define hyperlink target using its caption automatically. .IP \(bu 2 #2962: latex: missing label of longtable .IP \(bu 2 #2968: autodoc: show\-inheritance option breaks docstrings .UNINDENT .SS Release 1.4.6 (released Aug 20, 2016) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 #2867: linkcheck builder crashes with six\-1.4. Now Sphinx depends on six\-1.5 or later .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 applehelp: Sphinx crashes if \fBhiutil\fP or \fBcodesign\fP commands not found .IP \(bu 2 Fix \fBmake clean\fP abort issue when build dir contains regular files like \fBDS_Store\fP\&. .IP \(bu 2 Reduce epubcheck warnings/errors: .INDENT 2.0 .IP \(bu 2 Fix DOCTYPE to html5 .IP \(bu 2 Change extension from .html to .xhtml. .IP \(bu 2 Disable search page on epub results .UNINDENT .IP \(bu 2 #2778: Fix autodoc crashes if obj.__dict__ is a property method and raises exception .IP \(bu 2 Fix duplicated toc in epub3 output. .IP \(bu 2 #2775: Fix failing linkcheck with servers not supporting identity encoding .IP \(bu 2 #2833: Fix formatting instance annotations in ext.autodoc. .IP \(bu 2 #1911: \fB\-D\fP option of \fBsphinx\-build\fP does not override the \fBextensions\fP variable .IP \(bu 2 #2789: \fBsphinx.ext.intersphinx\fP generates wrong hyperlinks if the inventory is given .IP \(bu 2 parsing errors for caption of code\-blocks are displayed in document (ref: #2845) .IP \(bu 2 #2846: \fBsinglehtml\fP builder does not include figure numbers .IP \(bu 2 #2816: Fix data from builds cluttering the \fBDomain.initial_data\fP class attributes .UNINDENT .SS Release 1.4.5 (released Jul 13, 2016) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 latex, inclusion of non\-inline images from image directive resulted in non\-coherent whitespaces depending on original image width; new behaviour by necessity differs from earlier one in some cases. (ref: #2672) .IP \(bu 2 latex, use of \fB\eincludegraphics\fP to refer to Sphinx custom variant is deprecated; in future it will revert to original LaTeX macro, custom one already has alternative name \fB\esphinxincludegraphics\fP\&. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 new config option \fBlatex_keep_old_macro_names\fP, defaults to \fBTrue\fP\&. If \fBFalse\fP, lets macros (for text styling) be defined only with \fB\esphinx\fP\-prefixed names .IP \(bu 2 latex writer allows user customization of \(dqshadowed\(dq boxes (topics), via three length variables. .IP \(bu 2 woff\-format web font files now supported by the epub builder. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 jsdump fix for python 3: fixes the HTML search on python > 3 .IP \(bu 2 #2676: (latex) Error with verbatim text in captions since Sphinx 1.4.4 .IP \(bu 2 #2629: memoir class crashes LaTeX. Fixed by \fBlatex_keep_old_macro_names=False\fP (ref 2675) .IP \(bu 2 #2684: \fBsphinx.ext.intersphinx\fP crashes with six\-1.4.1 .IP \(bu 2 #2679: \fBfloat\fP package needed for \fB\(aqfigure_align\(aq: \(aqH\(aq\fP latex option .IP \(bu 2 #2671: image directive may lead to inconsistent spacing in pdf .IP \(bu 2 #2705: \fBtoctree\fP generates empty bullet_list if \fB:titlesonly:\fP specified .IP \(bu 2 #2479: \fBsphinx.ext.viewcode\fP uses python2 highlighter by default .IP \(bu 2 #2700: HtmlHelp builder has hard coded index.html .IP \(bu 2 latex, since 1.4.4 inline literal text is followed by spurious space .IP \(bu 2 #2722: C++, fix id generation for var/member declarations to include namespaces. .IP \(bu 2 latex, images (from image directive) in lists or quoted blocks did not obey indentation (fixed together with #2671) .IP \(bu 2 #2733: since Sphinx 1.4.4 \fBmake latexpdf\fP generates lots of hyperref warnings .IP \(bu 2 #2731: \fBsphinx.ext.autodoc\fP does not access propertymethods which raises any exceptions .IP \(bu 2 #2666: C++, properly look up nested names involving constructors. .IP \(bu 2 #2579: Could not refer a label including both spaces and colons via \fBsphinx.ext.intersphinx\fP .IP \(bu 2 #2718: Sphinx crashes if the document file is not readable .IP \(bu 2 #2699: hyperlinks in help HTMLs are broken if \fBhtml_file_suffix\fP is set .IP \(bu 2 #2723: extra spaces in latex pdf output from multirow cell .IP \(bu 2 #2735: latexpdf \fBUnderfull \ehbox (badness 10000)\fP warnings from title page .IP \(bu 2 #2667: latex crashes if resized images appeared in section title .IP \(bu 2 #2763: (html) Provide default value for required \fBalt\fP attribute for image tags of SVG source, required to validate and now consistent w/ other formats. .UNINDENT .SS Release 1.4.4 (released Jun 12, 2016) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #2630: latex: sphinx.sty notice environment formatting problem .IP \(bu 2 #2632: Warning directives fail in quote environment latex build .IP \(bu 2 #2633: Sphinx crashes with old styled indices .IP \(bu 2 Fix a \fB\ebegin{\eminipage}\fP typo in sphinx.sty from 1.4.2 (ref: 68becb1) .IP \(bu 2 #2622: Latex produces empty pages after title and table of contents .IP \(bu 2 #2640: 1.4.2 LaTeX crashes if code\-block inside warning directive .IP \(bu 2 Let LaTeX use straight quotes also in inline code (ref #2627) .IP \(bu 2 #2351: latex crashes if enumerated lists are placed on footnotes .IP \(bu 2 #2646: latex crashes if math contains twice empty lines .IP \(bu 2 #2480: \fBsphinx.ext.autodoc\fP: memory addresses were shown .IP \(bu 2 latex: allow code\-blocks appearing inside lists and quotes at maximal nesting depth (ref #777, #2624, #2651) .IP \(bu 2 #2635: Latex code directives produce inconsistent frames based on viewing resolution .IP \(bu 2 #2639: Sphinx now bundles iftex.sty .IP \(bu 2 Failed to build PDF with framed.sty 0.95 .IP \(bu 2 Sphinx now bundles needspace.sty .UNINDENT .SS Release 1.4.3 (released Jun 5, 2016) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #2530: got \(dqCounter too large\(dq error on building PDF if large numbered footnotes existed in admonitions .IP \(bu 2 \fBwidth\fP option of figure directive does not work if \fBalign\fP option specified at same time (ref: #2595) .IP \(bu 2 #2590: The \fBinputenc\fP package breaks compiling under lualatex and xelatex .IP \(bu 2 #2540: date on latex front page use different font .IP \(bu 2 Suppress \(dqdocument isn\(aqt included in any toctree\(dq warning if the document is included (ref: #2603) .IP \(bu 2 #2614: Some tables in PDF output will end up shifted if user sets non zero parindent in preamble .IP \(bu 2 #2602: URL redirection breaks the hyperlinks generated by \fBsphinx.ext.intersphinx\fP .IP \(bu 2 #2613: Show warnings if merged extensions are loaded .IP \(bu 2 #2619: make sure amstext LaTeX package always loaded (ref: d657225, 488ee52, 9d82cad and #2615) .IP \(bu 2 #2593: latex crashes if any figures in the table .UNINDENT .SS Release 1.4.2 (released May 29, 2016) .SS Features added .INDENT 0.0 .IP \(bu 2 Now \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings> accepts following configurations (ref: #2451, #2466): .INDENT 2.0 .IP \(bu 2 \fBapp.add_node\fP .IP \(bu 2 \fBapp.add_directive\fP .IP \(bu 2 \fBapp.add_role\fP .IP \(bu 2 \fBapp.add_generic_role\fP .IP \(bu 2 \fBapp.add_source_parser\fP .IP \(bu 2 \fBimage.data_uri\fP .IP \(bu 2 \fBimage.nonlocal_uri\fP .UNINDENT .IP \(bu 2 #2453: LaTeX writer allows page breaks in topic contents; and their horizontal extent now fits in the line width (with shadow in margin). Also warning\-type admonitions allow page breaks and their vertical spacing has been made more coherent with the one for hint\-type notices (ref #2446). .IP \(bu 2 #2459: the framing of literal code\-blocks in LaTeX output (and not only the code lines themselves) obey the indentation in lists or quoted blocks. .IP \(bu 2 #2343: the long source lines in code\-blocks are wrapped (without modifying the line numbering) in LaTeX output (ref #1534, #2304). .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #2370: the equations are slightly misaligned in LaTeX writer .IP \(bu 2 #1817, #2077: suppress pep8 warnings on conf.py generated by sphinx\-quickstart .IP \(bu 2 #2407: building docs crash if document includes large data image URIs .IP \(bu 2 #2436: Sphinx does not check version by \fBneeds_sphinx\fP \%<#\:confval-needs_sphinx> if loading extensions failed .IP \(bu 2 #2397: Setup shorthandoff for Turkish documents .IP \(bu 2 #2447: VerbatimBorderColor wrongly used also for captions of PDF .IP \(bu 2 #2456: C++, fix crash related to document merging (e.g., singlehtml and Latex builders). .IP \(bu 2 #2446: latex(pdf) sets local tables of contents (or more generally topic nodes) in unbreakable boxes, causes overflow at bottom .IP \(bu 2 #2476: Omit MathJax markers if :nowrap: is given .IP \(bu 2 #2465: latex builder fails in case no caption option is provided to toctree directive .IP \(bu 2 Sphinx crashes if self referenced toctree found .IP \(bu 2 #2481: spelling mistake for mecab search splitter. Thanks to Naoki Sato. .IP \(bu 2 #2309: Fix could not refer \(dqindirect hyperlink targets\(dq by ref\-role .IP \(bu 2 intersphinx fails if mapping URL contains any port .IP \(bu 2 #2088: intersphinx crashes if the mapping URL requires basic auth .IP \(bu 2 #2304: auto line breaks in latexpdf codeblocks .IP \(bu 2 #1534: Word wrap long lines in Latex verbatim blocks .IP \(bu 2 #2460: too much white space on top of captioned literal blocks in PDF output .IP \(bu 2 Show error reason when multiple math extensions are loaded (ref: #2499) .IP \(bu 2 #2483: any figure number was not assigned if figure title contains only non text objects .IP \(bu 2 #2501: Unicode subscript numbers are normalized in LaTeX .IP \(bu 2 #2492: Figure directive with :figwidth: generates incorrect Latex\-code .IP \(bu 2 The caption of figure is always put on center even if \fB:align:\fP was specified .IP \(bu 2 #2526: LaTeX writer crashes if the section having only images .IP \(bu 2 #2522: Sphinx touches mo files under installed directory that caused permission error. .IP \(bu 2 #2536: C++, fix crash when an immediately nested scope has the same name as the current scope. .IP \(bu 2 #2555: Fix crash on any\-references with unicode. .IP \(bu 2 #2517: wrong bookmark encoding in PDF if using LuaLaTeX .IP \(bu 2 #2521: generated Makefile causes BSD make crashed if sphinx\-build not found .IP \(bu 2 #2470: \fBtyping\fP backport package causes autodoc errors with python 2.7 .IP \(bu 2 \fBsphinx.ext.intersphinx\fP crashes if non\-string value is used for key of \fBintersphinx_mapping\fP .IP \(bu 2 #2518: \fBintersphinx_mapping\fP disallows non alphanumeric keys .IP \(bu 2 #2558: unpack error on devhelp builder .IP \(bu 2 #2561: Info builder crashes when a footnote contains a link .IP \(bu 2 #2565: The descriptions of objects generated by \fBsphinx.ext.autosummary\fP overflow lines at LaTeX writer .IP \(bu 2 Extend pdflatex config in sphinx.sty to subparagraphs (ref: #2551) .IP \(bu 2 #2445: \fBrst_prolog\fP and \fBrst_epilog\fP affect to non reST sources .IP \(bu 2 #2576: \fBsphinx.ext.imgmath\fP crashes if subprocess raises error .IP \(bu 2 #2577: \fBsphinx.ext.imgmath\fP: Invalid argument are passed to dvisvgm .IP \(bu 2 #2556: Xapian search does not work with Python 3 .IP \(bu 2 #2581: The search doesn\(aqt work if language=\(dqes\(dq (Spanish) .IP \(bu 2 #2382: Adjust spacing after abbreviations on figure numbers in LaTeX writer .IP \(bu 2 #2383: The generated footnote by \fBlatex_show_urls\fP overflows lines .IP \(bu 2 #2497, #2552: The label of search button does not fit for the button itself .UNINDENT .SS Release 1.4.1 (released Apr 12, 2016) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 The default format of \fBtoday_fmt\fP and \fBhtml_last_updated_fmt\fP is back to strftime format again. Locale Date Markup Language is also supported for backward compatibility until Sphinx 1.5. .UNINDENT .SS Translations .INDENT 0.0 .IP \(bu 2 Added Welsh translation, thanks to Geraint Palmer. .IP \(bu 2 Added Greek translation, thanks to Stelios Vitalis. .IP \(bu 2 Added Esperanto translation, thanks to Dinu Gherman. .IP \(bu 2 Added Hindi translation, thanks to Purnank H. Ghumalia. .IP \(bu 2 Added Romanian translation, thanks to Razvan Stefanescu. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 C++, added support for \fBextern\fP and \fBthread_local\fP\&. .IP \(bu 2 C++, type declarations are now using the prefixes \fBtypedef\fP, \fBusing\fP, and \fBtype\fP, depending on the style of declaration. .IP \(bu 2 #2413: C++, fix crash on duplicate declarations .IP \(bu 2 #2394: Sphinx crashes when html_last_updated_fmt is invalid .IP \(bu 2 #2408: dummy builder not available in Makefile and make.bat .IP \(bu 2 #2412: hyperlink targets are broken in LaTeX builder .IP \(bu 2 figure directive crashes if non paragraph item is given as caption .IP \(bu 2 #2418: time formats no longer allowed in today_fmt .IP \(bu 2 #2395: Sphinx crashes if unicode character in image filename .IP \(bu 2 #2396: \(dqtoo many values to unpack\(dq in genindex\-single .IP \(bu 2 #2405: numref link in PDF jumps to the wrong location .IP \(bu 2 #2414: missing number in PDF hyperlinks to code listings .IP \(bu 2 #2440: wrong import for gmtime. Thanks to Uwe L. Korn. .UNINDENT .SS Release 1.4 (released Mar 28, 2016) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Drop \fBPorterStemmer\fP package support. Use \fBPyStemmer\fP instead of \fBPorterStemmer\fP to accelerate stemming. .IP \(bu 2 \fBsphinx_rtd_theme\fP has become optional. Please install it manually. Refs #2087, #2086, #1845 and #2097. Thanks to Victor Zverovich. .IP \(bu 2 #2231: Use DUrole instead of DUspan for custom roles in LaTeX writer. It enables to take title of roles as an argument of custom macros. .IP \(bu 2 #2022: \(aqThumbs.db\(aq and \(aq.DS_Store\(aq are added to \fBexclude_patterns\fP default values in conf.py that will be provided on sphinx\-quickstart. .IP \(bu 2 #2027, #2208: The \fBhtml_title\fP accepts string values only. And the \fBNone\fP value cannot be accepted. .IP \(bu 2 \fBsphinx.ext.graphviz\fP: show graph image in inline by default .IP \(bu 2 #2060, #2224: The \fBmanpage\fP role now generate \fBsphinx.addnodes.manpage\fP node instead of \fBsphinx.addnodes.literal_emphasis\fP node. .IP \(bu 2 #2022: \fBhtml_extra_path\fP \%<#\:confval-html_extra_path> also copies dotfiles in the extra directory, and refers to \fBexclude_patterns\fP \%<#\:confval-exclude_patterns> to exclude extra files and directories. .IP \(bu 2 #2300: enhance autoclass:: to use the docstring of __new__ if __init__ method\(aqs is missing of empty .IP \(bu 2 #2251: Previously, under glossary directives, multiple terms for one definition are converted into single \fBterm\fP node and the each terms in the term node are separated by \fBtermsep\fP node. In new implementation, each terms are converted into individual \fBterm\fP nodes and \fBtermsep\fP node is removed. By this change, output layout of every builders are changed a bit. .IP \(bu 2 The default highlight language is now Python 3. This means that source code is highlighted as Python 3 (which is mostly a superset of Python 2), and no parsing is attempted to distinguish valid code. To get the old behavior back, add \fBhighlight_language = \(dqpython\(dq\fP to conf.py. .IP \(bu 2 Locale Date Markup Language \%<https://\:unicode\:.org/\:reports/\:tr35/\:tr35-dates\:.html#\:Date_Format_Patterns> like \fB\(dqMMMM dd, YYYY\(dq\fP is default format for \fBtoday_fmt\fP and \fBhtml_last_updated_fmt\fP\&. However strftime format like \fB\(dq%B %d, %Y\(dq\fP is also supported for backward compatibility until Sphinx 1.5. Later format will be disabled from Sphinx 1.5. .IP \(bu 2 #2327: \fBlatex_use_parts\fP is deprecated now. Use \fBlatex_toplevel_sectioning\fP instead. .IP \(bu 2 #2337: Use \fB\eurl{URL}\fP macro instead of \fB\ehref{URL}{URL}\fP in LaTeX writer. .IP \(bu 2 #1498: manpage writer: don\(aqt make whole of item in definition list bold if it includes strong node. .IP \(bu 2 #582: Remove hint message from quick search box for html output. .IP \(bu 2 #2378: Sphinx now bundles newfloat.sty .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #2092: add todo directive support in napoleon package. .IP \(bu 2 #1962: when adding directives, roles or nodes from an extension, warn if such an element is already present (built\-in or added by another extension). .IP \(bu 2 #1909: Add \(dqdoc\(dq references to Intersphinx inventories. .IP \(bu 2 C++ type alias support (e.g., \fB\&.. type:: T = int\fP). .IP \(bu 2 C++ template support for classes, functions, type aliases, and variables (#1729, #1314). .IP \(bu 2 C++, added new scope management directives \fBnamespace\-push\fP and \fBnamespace\-pop\fP\&. .IP \(bu 2 #1970: Keyboard shortcuts to navigate Next and Previous topics .IP \(bu 2 Intersphinx: Added support for fetching Intersphinx inventories with URLs using HTTP basic auth. .IP \(bu 2 C++, added support for template parameter in function info field lists. .IP \(bu 2 C++, added support for pointers to member (function). .IP \(bu 2 #2113: Allow \fB:class:\fP option to code\-block directive. .IP \(bu 2 #2192: Imgmath (pngmath with svg support). .IP \(bu 2 #2200: Support XeTeX and LuaTeX for the LaTeX builder. .IP \(bu 2 #1906: Use xcolor over color for fcolorbox where available for LaTeX output. .IP \(bu 2 #2216: Texinputs makefile improvements. .IP \(bu 2 #2170: Support for Chinese language search index. .IP \(bu 2 #2214: Add sphinx.ext.githubpages to publish the docs on GitHub Pages .IP \(bu 2 #1030: Make page reference names for latex_show_pagerefs translatable .IP \(bu 2 #2162: Add Sphinx.add_source_parser() to add source_suffix and source_parsers from extension .IP \(bu 2 #2207: Add sphinx.parsers.Parser class; a base class for new parsers .IP \(bu 2 #656: Add \fBgraphviz_dot\fP option to graphviz directives to switch the \fBdot\fP command .IP \(bu 2 #1939: Added the \fBdummy\fP builder: syntax check without output. .IP \(bu 2 #2230: Add \fBmath_number_all\fP option to number all displayed math in math extensions .IP \(bu 2 #2235: \fBneeds_sphinx\fP supports micro version comparison .IP \(bu 2 #2282: Add \(dqlanguage\(dq attribute to html tag in the \(dqbasic\(dq theme .IP \(bu 2 #1779: Add EPUB 3 builder .IP \(bu 2 #1751: Add \fBtodo_link_only\fP \%<#\:confval-todo_link_only> to avoid file path and line indication on \fBtodolist\fP \%<#\:directive-todolist>\&. Thanks to Francesco Montesano. .IP \(bu 2 #2199: Use \fBimagesize\fP package to obtain size of images. .IP \(bu 2 #1099: Add configurable retries to the linkcheck builder. Thanks to Alex Gaynor. Also don\(aqt check anchors starting with \fB!\fP\&. .IP \(bu 2 #2300: enhance autoclass:: to use the docstring of __new__ if __init__ method\(aqs is missing of empty .IP \(bu 2 #1858: Add Sphinx.add_enumerable_node() to add enumerable nodes for numfig feature .IP \(bu 2 #1286, #2099: Add \fBsphinx.ext.autosectionlabel\fP extension to allow reference sections using its title. Thanks to Tadhg O\(aqHiggins. .IP \(bu 2 #1854: Allow to choose Janome for Japanese splitter. .IP \(bu 2 #1853: support custom text splitter on html search with \fBlanguage=\(aqja\(aq\fP\&. .IP \(bu 2 #2320: classifier of glossary terms can be used for index entries grouping key The classifier also be used for translation. See also Glossary \%<#\:glossary-directive>\&. .IP \(bu 2 #2308: Define \fB\etablecontinued\fP macro to redefine the style of continued label for longtables. .IP \(bu 2 Select an image by similarity if multiple images are globbed by \fB\&.. image:: filename.*\fP .IP \(bu 2 #1921: Support figure substitutions by \fBlanguage\fP \%<#\:confval-language> and \fBfigure_language_filename\fP \%<#\:confval-figure_language_filename> .IP \(bu 2 #2245: Add \fBlatex_elements[\(dqpassoptionstopackages\(dq]\fP option to call PassOptionsToPackages in early stage of preambles. .IP \(bu 2 #2340: Math extension: support alignment of multiple equations for MathJax. .IP \(bu 2 #2338: Define \fB\etitleref\fP macro to redefine the style of \fBtitle\-reference\fP roles. .IP \(bu 2 Define \fB\emenuselection\fP and \fB\eaccelerator\fP macros to redefine the style of \fBmenuselection\fP roles. .IP \(bu 2 Define \fB\ecrossref\fP macro to redefine the style of references .IP \(bu 2 #2301: Texts in the classic html theme should be hyphenated. .IP \(bu 2 #2355: Define \fB\etermref\fP macro to redefine the style of \fBterm\fP roles. .IP \(bu 2 Add \fBsuppress_warnings\fP \%<#\:confval-suppress_warnings> to suppress arbitrary warning message (experimental) .IP \(bu 2 #2229: Fix no warning is given for unknown options .IP \(bu 2 #2327: Add \fBlatex_toplevel_sectioning\fP to switch the top level sectioning of LaTeX document. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #1913: C++, fix assert bug for enumerators in next\-to\-global and global scope. .IP \(bu 2 C++, fix parsing of \(aqsigned char\(aq and \(aqunsigned char\(aq as types. .IP \(bu 2 C++, add missing support for \(aqfriend\(aq functions. .IP \(bu 2 C++, add missing support for virtual base classes (thanks to Rapptz). .IP \(bu 2 C++, add support for final classes. .IP \(bu 2 C++, fix parsing of types prefixed with \(aqenum\(aq. .IP \(bu 2 #2023: Dutch search support uses Danish stemming info. .IP \(bu 2 C++, add support for user\-defined literals. .IP \(bu 2 #1804: Now html output wraps overflowed long\-line\-text in the sidebar. Thanks to Hassen ben tanfous. .IP \(bu 2 #2183: Fix porterstemmer causes \fBmake json\fP to fail. .IP \(bu 2 #1899: Ensure list is sent to OptParse. .IP \(bu 2 #2164: Fix wrong check for pdftex inside sphinx.sty (for graphicx package option). .IP \(bu 2 #2165, #2218: Remove faulty and non\-need conditional from sphinx.sty. .IP \(bu 2 Fix broken LaTeX code is generated if unknown language is given .IP \(bu 2 #1944: Fix rst_prolog breaks file\-wide metadata .IP \(bu 2 #2074: make gettext should use canonical relative paths for .pot. Thanks to anatoly techtonik. .IP \(bu 2 #2311: Fix sphinx.ext.inheritance_diagram raises AttributeError .IP \(bu 2 #2251: Line breaks in .rst files are transferred to .pot files in a wrong way. .IP \(bu 2 #794: Fix date formatting in latex output is not localized .IP \(bu 2 Remove \fBimage/gif\fP from supported_image_types of LaTeX writer (#2272) .IP \(bu 2 Fix ValueError is raised if LANGUAGE is empty string .IP \(bu 2 Fix unpack warning is shown when the directives generated from \fBSphinx.add_crossref_type\fP is used .IP \(bu 2 The default highlight language is now \fBdefault\fP\&. This means that source code is highlighted as Python 3 (which is mostly a superset of Python 2) if possible. To get the old behavior back, add \fBhighlight_language = \(dqpython\(dq\fP to conf.py. .IP \(bu 2 #2329: Refresh environment forcedly if source directory has changed. .IP \(bu 2 #2331: Fix code\-blocks are filled by block in dvi; remove \fBxcdraw\fP option from xcolor package .IP \(bu 2 Fix the confval type checker emits warnings if unicode is given to confvals which expects string value .IP \(bu 2 #2360: Fix numref in LaTeX output is broken .IP \(bu 2 #2361: Fix additional paragraphs inside the \(dqcompound\(dq directive are indented .IP \(bu 2 #2364: Fix KeyError \(aqrootSymbol\(aq on Sphinx upgrade from older version. .IP \(bu 2 #2348: Move amsmath and amssymb to before fontpkg on LaTeX writer. .IP \(bu 2 #2368: Ignore emacs lock files like \fB\&.#foo.rst\fP by default. .IP \(bu 2 #2262: literal_block and its caption has been separated by pagebreak in LaTeX output. .IP \(bu 2 #2319: Fix table counter is overridden by code\-block\(aqs in LaTeX. Thanks to jfbu. .IP \(bu 2 Fix unpack warning if combined with 3rd party domain extensions. .IP \(bu 2 #1153: Fix figures in sidebar causes latex build error. .IP \(bu 2 #2358: Fix user\-preamble could not override the tocdepth definition. .IP \(bu 2 #2358: Reduce tocdepth if \fBpart\fP or \fBchapter\fP is used for top_sectionlevel .IP \(bu 2 #2351: Fix footnote spacing .IP \(bu 2 #2363: Fix \fBtoctree()\fP in templates generates broken links in SingleHTMLBuilder. .IP \(bu 2 #2366: Fix empty hyperref is generated on toctree in HTML builder. .UNINDENT .SS Documentation .INDENT 0.0 .IP \(bu 2 #1757: Fix for usage of \fBhtml_last_updated_fmt\fP \%<#\:confval-html_last_updated_fmt>\&. Thanks to Ralf Hemmecke. .UNINDENT .SS Sphinx 1.3 .SS Release 1.3.6 (released Feb 29, 2016) .SS Features added .INDENT 0.0 .IP \(bu 2 #1873, #1876, #2278: Add \fBpage_source_suffix\fP html context variable. This should be introduced with \fBsource_parsers\fP feature. Thanks for Eric Holscher. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #2265: Fix babel is used in spite of disabling it on \fBlatex_elements\fP .IP \(bu 2 #2295: Avoid mutating dictionary errors while enumerating members in autodoc with Python 3 .IP \(bu 2 #2291: Fix pdflatex \(dqCounter too large\(dq error from footnotes inside tables of contents .IP \(bu 2 #2292: Fix some footnotes disappear from LaTeX output .IP \(bu 2 #2287: \fBsphinx.transforms.Locale\fP always uses rst parser. Sphinx i18n feature should support parsers that specified source_parsers. .IP \(bu 2 #2290: Fix \fBsphinx.ext.mathbase\fP use of amsfonts may break user choice of math fonts .IP \(bu 2 #2324: Print a hint how to increase the recursion limit when it is hit. .IP \(bu 2 #1565, #2229: Revert new warning; the new warning will be triggered from version 1.4 on. .IP \(bu 2 #2329: Refresh environment forcedly if source directory has changed. .IP \(bu 2 #2019: Fix the domain objects in search result are not escaped .UNINDENT .SS Release 1.3.5 (released Jan 24, 2016) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Fix line numbers was not shown on warnings in LaTeX and texinfo builders .IP \(bu 2 Fix filenames were not shown on warnings of citations .IP \(bu 2 Fix line numbers was not shown on warnings in LaTeX and texinfo builders .IP \(bu 2 Fix line numbers was not shown on warnings of indices .IP \(bu 2 #2026: Fix LaTeX builder raises error if parsed\-literal includes links .IP \(bu 2 #2243: Ignore strange docstring types for classes, do not crash .IP \(bu 2 #2247: Fix #2205 breaks make html for definition list with classifiers that contains regular\-expression like string .IP \(bu 2 #1565: Sphinx will now emit a warning that highlighting was skipped if the syntax is incorrect for \fBcode\-block\fP, \fBliteralinclude\fP and so on. .IP \(bu 2 #2211: Fix paragraphs in table cell doesn\(aqt work in Latex output .IP \(bu 2 #2253: \fB:pyobject:\fP option of \fBliteralinclude\fP directive can\(aqt detect indented body block when the block starts with blank or comment lines. .IP \(bu 2 Fix TOC is not shown when no \fB:maxdepth:\fP for toctrees (ref: #771) .IP \(bu 2 Fix warning message for \fB:numref:\fP if target is in orphaned doc (ref: #2244) .UNINDENT .SS Release 1.3.4 (released Jan 12, 2016) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #2134: Fix figure caption with reference causes latex build error .IP \(bu 2 #2094: Fix rubric with reference not working in Latex .IP \(bu 2 #2147: Fix literalinclude code in latex does not break in pages .IP \(bu 2 #1833: Fix email addresses is showed again if latex_show_urls is not \fBNone\fP .IP \(bu 2 #2176: sphinx.ext.graphviz: use <object> instead of <img> to embed svg .IP \(bu 2 #967: Fix SVG inheritance diagram is not hyperlinked (clickable) .IP \(bu 2 #1237: Fix footnotes not working in definition list in LaTeX .IP \(bu 2 #2168: Fix raw directive does not work for text writer .IP \(bu 2 #2171: Fix cannot linkcheck url with unicode .IP \(bu 2 #2182: LaTeX: support image file names with more than 1 dots .IP \(bu 2 #2189: Fix previous sibling link for first file in subdirectory uses last file, not intended previous from root toctree .IP \(bu 2 #2003: Fix decode error under python2 (only) when \fBmake linkcheck\fP is run .IP \(bu 2 #2186: Fix LaTeX output of mathbb in math .IP \(bu 2 #1480, #2188: LaTeX: Support math in section titles .IP \(bu 2 #2071: Fix same footnote in more than two section titles => LaTeX/PDF Bug .IP \(bu 2 #2040: Fix UnicodeDecodeError in sphinx\-apidoc when author contains non\-ASCII characters .IP \(bu 2 #2193: Fix shutil.SameFileError if source directory and destination directory are same .IP \(bu 2 #2178: Fix unparsable C++ cross\-reference when referencing a function with \fB:cpp:any:\fP .IP \(bu 2 #2206: Fix Sphinx latex doc build failed due to a footnotes .IP \(bu 2 #2201: Fix wrong table caption for tables with over 30 rows .IP \(bu 2 #2213: Set <blockquote> in the classic theme to fit with <p> .IP \(bu 2 #1815: Fix linkcheck does not raise an exception if warniserror set to true and link is broken .IP \(bu 2 #2197: Fix slightly cryptic error message for missing index.rst file .IP \(bu 2 #1894: Unlisted phony targets in quickstart Makefile .IP \(bu 2 #2125: Fix unifies behavior of collapsed fields (\fBGroupedField\fP and \fBTypedField\fP) .IP \(bu 2 #1408: Check latex_logo validity before copying .IP \(bu 2 #771: Fix latex output doesn\(aqt set tocdepth .IP \(bu 2 #1820: On Windows, console coloring is broken with colorama version 0.3.3. Now Sphinx use colorama>=0.3.5 to avoid this problem. .IP \(bu 2 #2072: Fix footnotes in chapter\-titles do not appear in PDF output .IP \(bu 2 #1580: Fix paragraphs in longtable don\(aqt work in Latex output .IP \(bu 2 #1366: Fix centered image not centered in latex .IP \(bu 2 #1860: Fix man page using \fB:samp:\fP with braces \- font doesn\(aqt reset .IP \(bu 2 #1610: Sphinx crashes in Japanese indexing in some systems .IP \(bu 2 Fix Sphinx crashes if mecab initialization failed .IP \(bu 2 #2160: Fix broken TOC of PDFs if section includes an image .IP \(bu 2 #2172: Fix dysfunctional admonition \fB\epy@lightbox\fP in sphinx.sty. Thanks to jfbu. .IP \(bu 2 #2198,#2205: \fBmake gettext\fP generate broken msgid for definition lists. .IP \(bu 2 #2062: Escape characters in doctests are treated incorrectly with Python 2. .IP \(bu 2 #2225: Fix if the option does not begin with dash, linking is not performed .IP \(bu 2 #2226: Fix math is not HTML\-encoded when :nowrap: is given (jsmath, mathjax) .IP \(bu 2 #1601, #2220: \(aqany\(aq role breaks extended domains behavior. Affected extensions doesn\(aqt support resolve_any_xref and resolve_xref returns problematic node instead of \fBNone\fP\&. sphinxcontrib\-httpdomain is one of them. .IP \(bu 2 #2229: Fix no warning is given for unknown options .UNINDENT .SS Release 1.3.3 (released Dec 2, 2015) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #2177: Fix parallel hangs .IP \(bu 2 #2012: Fix exception occurred if \fBnumfig_format\fP is invalid .IP \(bu 2 #2142: Provide non\-minified JS code in \fBsphinx/search/non\-minified\-js/*.js\fP for source distribution on PyPI. .IP \(bu 2 #2148: Error while building devhelp target with non\-ASCII document. .UNINDENT .SS Release 1.3.2 (released Nov 29, 2015) .SS Features added .INDENT 0.0 .IP \(bu 2 #1935: Make \(dqnumfig_format\(dq overridable in latex_elements. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #1976: Avoid \(dq2.0\(dq version of Babel because it doesn\(aqt work with Windows environment. .IP \(bu 2 Add a \(dqdefault.css\(dq stylesheet (which imports \(dqclassic.css\(dq) for compatibility .IP \(bu 2 #1788: graphviz extension raises exception when caption option is present. .IP \(bu 2 #1789: \fB:pyobject:\fP option of \fBliteralinclude\fP directive includes following lines after class definitions .IP \(bu 2 #1790: \fBliteralinclude\fP strips empty lines at the head and tail .IP \(bu 2 #1802: load plugin themes automatically when theme.conf use it as \(aqinherit\(aq. Thanks to Takayuki Hirai. .IP \(bu 2 #1794: custom theme extended from \fBalabaster\fP or \fBsphinx_rtd_theme\fP can\(aqt find base theme. .IP \(bu 2 #1834: compatibility for Docutils 0.13: handle_io_errors keyword argument for docutils.io.FileInput cause TypeError. .IP \(bu 2 #1823: \(aq.\(aq as <module_path> for sphinx\-apidoc cause an unfriendly error. Now \(aq.\(aq is converted to absolute path automatically. .IP \(bu 2 Fix a crash when setting up extensions which do not support metadata. .IP \(bu 2 #1784: Provide non\-minified JS code in \fBsphinx/search/non\-minified\-js/*.js\fP .IP \(bu 2 #1822, #1892: Fix regression for #1061. autosummary can\(aqt generate doc for imported members since Sphinx 1.3b3. Thanks to Eric Larson. .IP \(bu 2 #1793, #1819: \(dqsee also\(dq misses a linebreak in text output. Thanks to Takayuki Hirai. .IP \(bu 2 #1780, #1866: \(dqmake text\(dq shows \(dqclass\(dq keyword twice. Thanks to Takayuki Hirai. .IP \(bu 2 #1871: Fix for LaTeX output of tables with one column and multirows. .IP \(bu 2 Work around the lack of the HTMLParserError exception in Python 3.5. .IP \(bu 2 #1949: Use \fBsafe_getattr\fP in the coverage builder to avoid aborting with descriptors that have custom behavior. .IP \(bu 2 #1915: Do not generate smart quotes in doc field type annotations. .IP \(bu 2 #1796: On py3, automated .mo building caused UnicodeDecodeError. .IP \(bu 2 #1923: Use babel features only if the babel latex element is nonempty. .IP \(bu 2 #1942: Fix a KeyError in websupport. .IP \(bu 2 #1903: Fix strange id generation for glossary terms. .IP \(bu 2 \fBmake text\fP will crush if a definition list item has more than 1 classifiers as: \fBterm : classifier1 : classifier2\fP\&. .IP \(bu 2 #1855: make gettext generates broken po file for definition lists with classifier. .IP \(bu 2 #1869: Fix problems when dealing with files containing non\-ASCII characters. Thanks to Marvin Schmidt. .IP \(bu 2 #1798: Fix building LaTeX with references in titles. .IP \(bu 2 #1725: On py2 environment, doctest with using non\-ASCII characters causes \fB\(aqascii\(aq codec can\(aqt decode byte\fP exception. .IP \(bu 2 #1540: Fix RuntimeError with circular referenced toctree .IP \(bu 2 #1983: i18n translation feature breaks references which uses section name. .IP \(bu 2 #1990: Use caption of toctree to title of tableofcontents in LaTeX .IP \(bu 2 #1987: Fix ampersand is ignored in \fB:menuselection:\fP and \fB:guilabel:\fP on LaTeX builder .IP \(bu 2 #1994: More supporting non\-standard parser (like recommonmark parser) for Translation and WebSupport feature. Now node.rawsource is fall backed to node.astext() during Docutils transforming. .IP \(bu 2 #1989: \(dqmake blahblah\(dq on Windows indicate help messages for sphinx\-build every time. It was caused by wrong make.bat that generated by Sphinx 1.3.0/1.3.1. .IP \(bu 2 On Py2 environment, conf.py that is generated by sphinx\-quickstart should have u prefixed config value for \(aqversion\(aq and \(aqrelease\(aq. .IP \(bu 2 #2102: On Windows + Py3, using \fB|today|\fP and non\-ASCII date format will raise UnicodeEncodeError. .IP \(bu 2 #1974: UnboundLocalError: local variable \(aqdomain\(aq referenced before assignment when using \fBany\fP role and \fBsphinx.ext.intersphinx\fP in same time. .IP \(bu 2 #2121: multiple words search doesn\(aqt find pages when words across on the page title and the page content. .IP \(bu 2 #1884, #1885: plug\-in html themes cannot inherit another plug\-in theme. Thanks to Suzumizaki. .IP \(bu 2 #1818: \fBsphinx.ext.todo\fP directive generates broken html class attribute as \(aqadmonition\-\(aq when \fBlanguage\fP \%<#\:confval-language> is specified with non\-ASCII linguistic area like \(aqru\(aq or \(aqja\(aq. To fix this, now \fBtodo\fP directive can use \fB:class:\fP option. .IP \(bu 2 #2140: Fix footnotes in table has broken in LaTeX .IP \(bu 2 #2127: MecabBinder for html searching feature doesn\(aqt work with Python 3. Thanks to Tomoko Uchida. .UNINDENT .SS Release 1.3.1 (released Mar 17, 2015) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #1769: allows generating quickstart files/dirs for destination dir that doesn\(aqt overwrite existent files/dirs. Thanks to WAKAYAMA shirou. .IP \(bu 2 #1773: sphinx\-quickstart doesn\(aqt accept non\-ASCII character as a option argument. .IP \(bu 2 #1766: the message \(dqleast Python 2.6 to run\(dq is at best misleading. .IP \(bu 2 #1772: cross reference in docstrings like \fB:param .write:\fP breaks building. .IP \(bu 2 #1770, #1774: \fBliteralinclude\fP with empty file occurs exception. Thanks to Takayuki Hirai. .IP \(bu 2 #1777: Sphinx 1.3 can\(aqt load extra theme. Thanks to tell\-k. .IP \(bu 2 #1776: \fBsource_suffix = [\(aq.rst\(aq]\fP cause unfriendly error on prior version. .IP \(bu 2 #1771: automated .mo building doesn\(aqt work properly. .IP \(bu 2 #1783: Autodoc: Python2 Allow unicode string in \fB__all__\fP\&. Thanks to Jens Hedegaard Nielsen. .IP \(bu 2 #1781: Setting \fBhtml_domain_indices\fP to a list raises a type check warnings. .UNINDENT .SS Release 1.3 (released Mar 10, 2015) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Roles \fBref\fP, \fBterm\fP and \fBmenusel\fP now don\(aqt generate emphasis \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:roles\:.html#\:emphasis> nodes anymore. If you want to keep italic style, adapt your stylesheet. .IP \(bu 2 Role \fBnumref\fP uses \fB%s\fP as special character to indicate position of figure numbers instead \fB#\fP symbol. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 Add convenience directives and roles to the C++ domain: directive \fBcpp:var\fP as alias for \fBcpp:member\fP, role \fB:cpp:var\fP as alias for \fB:cpp:member\fP, and role \fBany\fP for cross\-reference to any C++ declaraction. #1577, #1744 .IP \(bu 2 The \fBsource_suffix\fP \%<#\:confval-source_suffix> config value can now be a list of multiple suffixes. .IP \(bu 2 Add the ability to specify source parsers by source suffix with the \fBsource_parsers\fP config value. .IP \(bu 2 #1675: A new builder, AppleHelpBuilder, has been added that builds Apple Help Books. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 1.3b3 change breaks a previous gettext output that contains duplicated msgid such as \(dqfoo bar\(dq and \(dqversion changes in 1.3: foo bar\(dq. .IP \(bu 2 #1745: latex builder cause maximum recursion depth exceeded when a footnote has a footnote mark itself. .IP \(bu 2 #1748: SyntaxError in sphinx/ext/ifconfig.py with Python 2.6. .IP \(bu 2 #1658, #1750: No link created (and warning given) if option does not begin with \-, / or +. Thanks to Takayuki Hirai. .IP \(bu 2 #1753: C++, added missing support for more complex declarations. .IP \(bu 2 #1700: Add \fB:caption:\fP option for \fBtoctree\fP \%<#\:directive-toctree>\&. .IP \(bu 2 #1742: \fB:name:\fP option is provided for \fBtoctree\fP \%<#\:directive-toctree>, \fBcode\-block\fP \%<#\:directive-code-block> and \fBliteralinclude\fP \%<#\:directive-literalinclude> directives. .IP \(bu 2 #1756: Incorrect section titles in search that was introduced from 1.3b3. .IP \(bu 2 #1746: C++, fixed name lookup procedure, and added missing lookups in declarations. .IP \(bu 2 #1765: C++, fix old id generation to use fully qualified names. .UNINDENT .SS Documentation .INDENT 0.0 .IP \(bu 2 #1651: Add \fBvartype\fP field description for python domain. .UNINDENT .SS Release 1.3b3 (released Feb 24, 2015) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Dependency requirement updates: Docutils 0.11, Pygments 2.0 .IP \(bu 2 The \fBgettext_enables\fP config value has been renamed to \fBgettext_additional_targets\fP\&. .IP \(bu 2 #1735: Use \%<https://\:docs\:.python\:.org/> instead of \fBhttp\fP protocol. It was used for \fBsphinx.ext.intersphinx\fP and some documentation. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #1346: Add new default theme; .INDENT 2.0 .IP \(bu 2 Add \(aq\fBalabaster\fP\(aq theme. .IP \(bu 2 Add \(aq\fBsphinx_rtd_theme\fP\(aq theme. .IP \(bu 2 The \(aqdefault\(aq html theme has been renamed to \(aqclassic\(aq. \(aqdefault\(aq is still available, however it will emit notice a recommendation that using new \(aq\fBalabaster\fP\(aq theme. .UNINDENT .IP \(bu 2 Added \fBhighlight_options\fP configuration value. .IP \(bu 2 The \fBlanguage\fP config value is now available in the HTML templates. .IP \(bu 2 The \fBenv\-updated\fP event can now return a value, which is interpreted as an iterable of additional docnames that need to be rewritten. .IP \(bu 2 #772: Support for scoped and unscoped enums in C++. Enumerators in unscoped enums are injected into the parent scope in addition to the enum scope. .IP \(bu 2 Add \fBtodo_include_todos\fP config option to quickstart conf file, handled as described in documentation. .IP \(bu 2 HTML breadcrumb items tag has class \(dqnav\-item\(dq and \(dqnav\-item\-N\(dq (like nav\-item\-0, 1, 2...). .IP \(bu 2 New option \fBsphinx\-quickstart \-\-use\-make\-mode\fP for generating Makefile that use sphinx\-build make\-mode. .IP \(bu 2 #1235: i18n: several node can be translated if it is set to \fBgettext_additional_targets\fP in conf.py. Supported nodes are: .INDENT 2.0 .IP \(bu 2 \(aqliteral\-block\(aq .IP \(bu 2 \(aqdoctest\-block\(aq .IP \(bu 2 \(aqraw\(aq .IP \(bu 2 \(aqimage\(aq .UNINDENT .IP \(bu 2 #1227: Add \fBhtml_scaled_image_link\fP config option to conf.py, to control scaled image link. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 LaTeX writer now generates correct markup for cells spanning multiple rows. .IP \(bu 2 #1674: Do not crash if a module\(aqs \fB__all__\fP is not a list of strings. .IP \(bu 2 #1629: Use VerbatimBorderColor to add frame to code\-block in LaTeX .IP \(bu 2 On windows, make\-mode didn\(aqt work on Win32 platform if Sphinx was invoked as \fBpython sphinx\-build.py\fP\&. .IP \(bu 2 #1687: linkcheck now treats 401 Unauthorized responses as \(dqworking\(dq. .IP \(bu 2 #1690: toctrees with \fBglob\fP option now can also contain entries for single documents with explicit title. .IP \(bu 2 #1591: html search results for C++ elements now has correct interpage links. .IP \(bu 2 bizstyle theme: nested long title pages make long breadcrumb that breaks page layout. .IP \(bu 2 bizstyle theme: all breadcrumb items become \(aqTop\(aq on some mobile browser (iPhone5s safari). .IP \(bu 2 #1722: restore \fBtoctree()\fP template function behavior that was changed at 1.3b1. .IP \(bu 2 #1732: i18n: localized table caption raises exception. .IP \(bu 2 #1718: \fB:numref:\fP does not work with capital letters in the label .IP \(bu 2 #1630: resolve CSS conflicts, \fBdiv.container\fP css target for literal block wrapper now renamed to \fBdiv.literal\-block\-wrapper\fP\&. .IP \(bu 2 \fBsphinx.util.pycompat\fP has been restored in its backwards\-compatibility; slated for removal in Sphinx 1.4. .IP \(bu 2 #1719: LaTeX writer does not respect \fBnumref_format\fP option in captions .UNINDENT .SS Release 1.3b2 (released Dec 5, 2014) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 update bundled ez_setup.py for setuptools\-7.0 that requires Python 2.6 or later. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 #1597: Added possibility to return a new template name from \fBhtml\-page\-context\fP\&. .IP \(bu 2 PR#314, #1150: Configuration values are now checked for their type. A warning is raised if the configured and the default value do not have the same type and do not share a common non\-trivial base class. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 PR#311: sphinx\-quickstart does not work on python 3.4. .IP \(bu 2 Fix \fBautodoc_docstring_signature\fP \%<#\:confval-autodoc_docstring_signature> not working with signatures in class docstrings. .IP \(bu 2 Rebuilding cause crash unexpectedly when source files were added. .IP \(bu 2 #1607: Fix a crash when building latexpdf with \(dqhowto\(dq class .IP \(bu 2 #1251: Fix again. Sections which depth are lower than :tocdepth: should not be shown on localtoc sidebar. .IP \(bu 2 make\-mode didn\(aqt work on Win32 platform if Sphinx was installed by wheel package. .UNINDENT .SS Release 1.3b1 (released Oct 10, 2014) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Dropped support for Python 2.5, 3.1 and 3.2. .IP \(bu 2 Dropped support for Docutils versions up to 0.9. .IP \(bu 2 Removed the \fBsphinx.ext.oldcmarkup\fP extension. .IP \(bu 2 The deprecated config values \fBexclude_trees\fP, \fBexclude_dirnames\fP and \fBunused_docs\fP have been removed. .IP \(bu 2 A new node, \fBsphinx.addnodes.literal_strong\fP, has been added, for text that should appear literally (i.e. no smart quotes) in strong font. Custom writers will have to be adapted to handle this node. .IP \(bu 2 PR#269, #1476: replace \fB<tt>\fP tag by \fB<code>\fP\&. User customized stylesheets should be updated If the css contain some styles for \fBtt>\fP tag. Thanks to Takeshi Komiya. .IP \(bu 2 #1543: \fBtemplates_path\fP is automatically added to \fBexclude_patterns\fP to avoid reading autosummary rst templates in the templates directory. .IP \(bu 2 Custom domains should implement the new \fBDomain.resolve_any_xref\fP method to make the \fBany\fP role work properly. .IP \(bu 2 gettext builder: gettext doesn\(aqt emit uuid information to generated pot files by default. Please set \fBTrue\fP to \fBgettext_uuid\fP to emit uuid information. Additionally, if the \fBpython\-levenshtein\fP 3rd\-party package is installed, it will improve the calculation time. .IP \(bu 2 gettext builder: disable extracting/apply \(aqindex\(aq node by default. Please set \(aqindex\(aq to \fBgettext_enables\fP to enable extracting index entries. .IP \(bu 2 PR#307: Add frame to code\-block in LaTeX. Thanks to Takeshi Komiya. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 Add support for Python 3.4. .IP \(bu 2 Add support for Docutils 0.12 .IP \(bu 2 Added \fBsphinx.ext.napoleon\fP extension for NumPy and Google style docstring support. .IP \(bu 2 Added support for parallel reading (parsing) of source files with the \fBsphinx\-build \-j\fP option. Third\-party extensions will need to be checked for compatibility and may need to be adapted if they store information in the build environment object. See \fBenv\-merge\-info\fP\&. .IP \(bu 2 Added the \fBany\fP role that can be used to find a cross\-reference of \fIany\fP type in \fIany\fP domain. Custom domains should implement the new \fBDomain.resolve_any_xref\fP method to make this work properly. .IP \(bu 2 Exception logs now contain the last 10 messages emitted by Sphinx. .IP \(bu 2 Added support for extension versions (a string returned by \fBsetup()\fP, these can be shown in the traceback log files). Version requirements for extensions can be specified in projects using the new \fBneeds_extensions\fP config value. .IP \(bu 2 Changing the default role within a document with the default\-role \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:default-role> directive is now supported. .IP \(bu 2 PR#214: Added stemming support for 14 languages, so that the built\-in document search can now handle these. Thanks to Shibukawa Yoshiki. .IP \(bu 2 PR#296, PR#303, #76: numfig feature: Assign numbers to figures, tables and code\-blocks. This feature is configured with \fBnumfig\fP, \fBnumfig_secnum_depth\fP and \fBnumfig_format\fP\&. Also \fBnumref\fP role is available. Thanks to Takeshi Komiya. .IP \(bu 2 PR#202: Allow \(dq.\(dq and \(dq~\(dq prefixed references in \fB:param:\fP doc fields for Python. .IP \(bu 2 PR#184: Add \fBautodoc_mock_imports\fP, allowing to mock imports of external modules that need not be present when autodocumenting. .IP \(bu 2 #925: Allow list\-typed config values to be provided on the command line, like \fB\-D key=val1,val2\fP\&. .IP \(bu 2 #668: Allow line numbering of \fBcode\-block\fP and \fBliteralinclude\fP directives to start at an arbitrary line number, with a new \fBlineno\-start\fP option. .IP \(bu 2 PR#172, PR#266: The \fBcode\-block\fP and \fBliteralinclude\fP directives now can have a \fBcaption\fP option that shows a filename before the code in the output. Thanks to Nasimul Haque, Takeshi Komiya. .IP \(bu 2 Prompt for the document language in sphinx\-quickstart. .IP \(bu 2 PR#217: Added config values to suppress UUID and location information in generated gettext catalogs. .IP \(bu 2 PR#236, #1456: apidoc: Add a \-M option to put module documentation before submodule documentation. Thanks to Wes Turner and Luc Saffre. .IP \(bu 2 #1434: Provide non\-minified JS files for jquery.js and underscore.js to clarify the source of the minified files. .IP \(bu 2 PR#252, #1291: Windows color console support. Thanks to meu31. .IP \(bu 2 PR#255: When generating latex references, also insert latex target/anchor for the ids defined on the node. Thanks to Olivier Heurtier. .IP \(bu 2 PR#229: Allow registration of other translators. Thanks to Russell Sim. .IP \(bu 2 Add app.set_translator() API to register or override a Docutils translator class like \fBhtml_translator_class\fP\&. .IP \(bu 2 PR#267, #1134: add \(aqdiff\(aq parameter to literalinclude. Thanks to Richard Wall and WAKAYAMA shirou. .IP \(bu 2 PR#272: Added \(aqbizstyle\(aq theme. Thanks to Shoji KUMAGAI. .IP \(bu 2 Automatically compile \fB*.mo\fP files from \fB*.po\fP files when \fBgettext_auto_build\fP is \fBTrue\fP (default) and \fB*.po\fP is newer than \fB*.mo\fP file. .IP \(bu 2 #623: \fBsphinx.ext.viewcode\fP supports imported function/class aliases. .IP \(bu 2 PR#275: \fBsphinx.ext.intersphinx\fP supports multiple target for the inventory. Thanks to Brigitta Sipocz. .IP \(bu 2 PR#261: Added the \fBenv\-before\-read\-docs\fP event that can be connected to modify the order of documents before they are read by the environment. .IP \(bu 2 #1284: Program options documented with \fBoption\fP \%<#\:directive-option> can now start with \fB+\fP\&. .IP \(bu 2 PR#291: The caption of \fBcode\-block\fP \%<#\:directive-code-block> is recognized as a title of ref target. Thanks to Takeshi Komiya. .IP \(bu 2 PR#298: Add new API: \fBadd_latex_package()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_latex_package>\&. Thanks to Takeshi Komiya. .IP \(bu 2 #1344: add \fBgettext_enables\fP to enable extracting \(aqindex\(aq to gettext catalog output / applying translation catalog to generated documentation. .IP \(bu 2 PR#301, #1583: Allow the line numbering of the directive \fBliteralinclude\fP to match that of the included file, using a new \fBlineno\-match\fP option. Thanks to Jeppe Pihl. .IP \(bu 2 PR#299: add various options to sphinx\-quickstart. Quiet mode option \fB\-\-quiet\fP will skips wizard mode. Thanks to WAKAYAMA shirou. .IP \(bu 2 #1623: Return types specified with \fB:rtype:\fP are now turned into links if possible. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #1438: Updated jQuery version from 1.8.3 to 1.11.1. .IP \(bu 2 #1568: Fix a crash when a \(dqcentered\(dq directive contains a reference. .IP \(bu 2 Now sphinx.ext.autodoc works with python\-2.5 again. .IP \(bu 2 #1563: \fBadd_search_language()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_search_language> raises AssertionError for correct type of argument. Thanks to rikoman. .IP \(bu 2 #1174: Fix smart quotes being applied inside roles like \fBprogram\fP \%<#\:role-program> or \fBmakevar\fP\&. .IP \(bu 2 PR#235: comment db schema of websupport lacked a length of the node_id field. Thanks to solos. .IP \(bu 2 #1466,PR#241: Fix failure of the cpp domain parser to parse C+11 \(dqvariadic templates\(dq declarations. Thanks to Victor Zverovich. .IP \(bu 2 #1459,PR#244: Fix default mathjax js path point to \fBhttp://\fP that cause mixed\-content error on HTTPS server. Thanks to sbrandtb and robo9k. .IP \(bu 2 PR#157: autodoc remove spurious signatures from @property decorated attributes. Thanks to David Ham. .IP \(bu 2 PR#159: Add coverage targets to quickstart generated Makefile and make.bat. Thanks to Matthias Troffaes. .IP \(bu 2 #1251: When specifying toctree :numbered: option and :tocdepth: metadata, sub section number that is larger depth than \fB:tocdepth:\fP is shrunk. .IP \(bu 2 PR#260: Encode underscore in citation labels for latex export. Thanks to Lennart Fricke. .IP \(bu 2 PR#264: Fix could not resolve xref for figure node with :name: option. Thanks to Takeshi Komiya. .IP \(bu 2 PR#265: Fix could not capture caption of graphviz node by xref. Thanks to Takeshi Komiya. .IP \(bu 2 PR#263, #1013, #1103: Rewrite of C++ domain. Thanks to Jakob Lykke Andersen. .INDENT 2.0 .IP \(bu 2 Hyperlinks to all found nested names and template arguments (#1103). .IP \(bu 2 Support for function types everywhere, e.g., in std::function<bool(int, int)> (#1013). .IP \(bu 2 Support for virtual functions. .IP \(bu 2 Changed interpretation of function arguments to following standard prototype declarations, i.e., void f(arg) means that arg is the type of the argument, instead of it being the name. .IP \(bu 2 Updated tests. .IP \(bu 2 Updated documentation with elaborate description of what declarations are supported and how the namespace declarations influence declaration and cross\-reference lookup. .IP \(bu 2 Index names may be different now. Elements are indexed by their fully qualified name. It should be rather easy to change this behaviour and potentially index by namespaces/classes as well. .UNINDENT .IP \(bu 2 PR#258, #939: Add dedent option for \fBcode\-block\fP and \fBliteralinclude\fP\&. Thanks to Zafar Siddiqui. .IP \(bu 2 PR#268: Fix numbering section does not work at singlehtml mode. It still ad\-hoc fix because there is a issue that section IDs are conflicted. Thanks to Takeshi Komiya. .IP \(bu 2 PR#273, #1536: Fix RuntimeError with numbered circular toctree. Thanks to Takeshi Komiya. .IP \(bu 2 PR#274: Set its URL as a default title value if URL appears in toctree. Thanks to Takeshi Komiya. .IP \(bu 2 PR#276, #1381: \fBrfc\fP and \fBpep\fP roles support custom link text. Thanks to Takeshi Komiya. .IP \(bu 2 PR#277, #1513: highlights for function pointers in argument list of \fBc:function\fP\&. Thanks to Takeshi Komiya. .IP \(bu 2 PR#278: Fix section entries were shown twice if toctree has been put under only directive. Thanks to Takeshi Komiya. .IP \(bu 2 #1547: pgen2 tokenizer doesn\(aqt recognize \fB\&...\fP literal (Ellipsis for py3). .IP \(bu 2 PR#294: On LaTeX builder, wrap float environment on writing literal_block to avoid separation of caption and body. Thanks to Takeshi Komiya. .IP \(bu 2 PR#295, #1520: \fBmake.bat latexpdf\fP mechanism to \fBcd\fP back to the current directory. Thanks to Peter Suter. .IP \(bu 2 PR#297, #1571: Add imgpath property to all builders. It make easier to develop builder extensions. Thanks to Takeshi Komiya. .IP \(bu 2 #1584: Point to master doc in HTML \(dqtop\(dq link. .IP \(bu 2 #1585: Autosummary of modules broken in Sphinx 1.2.3. .IP \(bu 2 #1610: Sphinx cause AttributeError when MeCab search option is enabled and python\-mecab is not installed. .IP \(bu 2 #1674: Do not crash if a module\(aqs \fB__all__\fP is not a list of strings. .IP \(bu 2 #1673: Fix crashes with \fBnitpick_ignore\fP \%<#\:confval-nitpick_ignore> and \fB:doc:\fP references. .IP \(bu 2 #1686: ifconfig directive doesn\(aqt care about default config values. .IP \(bu 2 #1642: Fix only one search result appearing in Chrome. .UNINDENT .SS Documentation .INDENT 0.0 .IP \(bu 2 Add clarification about the syntax of tags. (\fBdoc/markup/misc.rst\fP) .UNINDENT .SS Sphinx 1.2 .SS Release 1.2.3 (released Sep 1, 2014) .SS Features added .INDENT 0.0 .IP \(bu 2 #1518: \fBsphinx\-apidoc\fP command now has a \fB\-\-version\fP option to show version information and exit .IP \(bu 2 New locales: Hebrew, European Portuguese, Vietnamese. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #636: Keep straight single quotes in literal blocks in the LaTeX build. .IP \(bu 2 #1419: Generated i18n sphinx.js files are missing message catalog entries from \(aq.js_t\(aq and \(aq.html\(aq. The issue was introduced from Sphinx 1.1 .IP \(bu 2 #1363: Fix i18n: missing python domain\(aqs cross\-references with currentmodule directive or currentclass directive. .IP \(bu 2 #1444: autosummary does not create the description from attributes docstring. .IP \(bu 2 #1457: In python3 environment, make linkcheck cause \(dqCan\(aqt convert \(aqbytes\(aq object to str implicitly\(dq error when link target url has a hash part. Thanks to Jorge_C. .IP \(bu 2 #1467: Exception on Python3 if nonexistent method is specified by automethod .IP \(bu 2 #1441: autosummary can\(aqt handle nested classes correctly. .IP \(bu 2 #1499: With non\-callable \fBsetup\fP in a conf.py, now sphinx\-build emits a user\-friendly error message. .IP \(bu 2 #1502: In autodoc, fix display of parameter defaults containing backslashes. .IP \(bu 2 #1226: autodoc, autosummary: importing setup.py by automodule will invoke setup process and execute \fBsys.exit()\fP\&. Now Sphinx avoids SystemExit exception and emits warnings without unexpected termination. .IP \(bu 2 #1503: py:function directive generate incorrectly signature when specifying a default parameter with an empty list \fB[]\fP\&. Thanks to Geert Jansen. .IP \(bu 2 #1508: Non\-ASCII filename raise exception on make singlehtml, latex, man, texinfo and changes. .IP \(bu 2 #1531: On Python3 environment, docutils.conf with \(aqsource_link=true\(aq in the general section cause type error. .IP \(bu 2 PR#270, #1533: Non\-ASCII docstring cause UnicodeDecodeError when uses with inheritance\-diagram directive. Thanks to WAKAYAMA shirou. .IP \(bu 2 PR#281, PR#282, #1509: TODO extension not compatible with websupport. Thanks to Takeshi Komiya. .IP \(bu 2 #1477: gettext does not extract nodes.line in a table or list. .IP \(bu 2 #1544: \fBmake text\fP generates wrong table when it has empty table cells. .IP \(bu 2 #1522: Footnotes from table get displayed twice in LaTeX. This problem has been appeared from Sphinx 1.2.1 by #949. .IP \(bu 2 #508: Sphinx every time exit with zero when is invoked from setup.py command. ex. \fBpython setup.py build_sphinx \-b doctest\fP return zero even if doctest failed. .UNINDENT .SS Release 1.2.2 (released Mar 2, 2014) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 PR#211: When checking for existence of the \fBhtml_logo\fP file, check the full relative path and not the basename. .IP \(bu 2 PR#212: Fix traceback with autodoc and \fB__init__\fP methods without docstring. .IP \(bu 2 PR#213: Fix a missing import in the setup command. .IP \(bu 2 #1357: Option names documented by \fBoption\fP \%<#\:directive-option> are now again allowed to not start with a dash or slash, and referencing them will work correctly. .IP \(bu 2 #1358: Fix handling of image paths outside of the source directory when using the \(dqwildcard\(dq style reference. .IP \(bu 2 #1374: Fix for autosummary generating overly\-long summaries if first line doesn\(aqt end with a period. .IP \(bu 2 #1383: Fix Python 2.5 compatibility of sphinx\-apidoc. .IP \(bu 2 #1391: Actually prevent using \(dqpngmath\(dq and \(dqmathjax\(dq extensions at the same time in sphinx\-quickstart. .IP \(bu 2 #1386: Fix bug preventing more than one theme being added by the entry point mechanism. .IP \(bu 2 #1370: Ignore \(dqtoctree\(dq nodes in text writer, instead of raising. .IP \(bu 2 #1364: Fix \(aqmake gettext\(aq fails when the \(aq.. todolist::\(aq directive is present. .IP \(bu 2 #1367: Fix a change of PR#96 that break sphinx.util.docfields.Field.make_field interface/behavior for \fBitem\fP argument usage. .UNINDENT .SS Documentation .INDENT 0.0 .IP \(bu 2 Extended the documentation about building extensions \%<#\:dev-extensions>\&. .UNINDENT .SS Release 1.2.1 (released Jan 19, 2014) .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #1335: Fix autosummary template overloading with exclamation prefix like \fB{% extends \(dq!autosummary/class.rst\(dq %}\fP cause infinite recursive function call. This was caused by PR#181. .IP \(bu 2 #1337: Fix autodoc with \fBautoclass_content=\(dqboth\(dq\fP uses useless \fBobject.__init__\fP docstring when class does not have \fB__init__\fP\&. This was caused by a change for #1138. .IP \(bu 2 #1340: Can\(aqt search alphabetical words on the HTML quick search generated with language=\(aqja\(aq. .IP \(bu 2 #1319: Do not crash if the \fBhtml_logo\fP file does not exist. .IP \(bu 2 #603: Do not use the HTML\-ized title for building the search index (that resulted in \(dqliteral\(dq being found on every page with a literal in the title). .IP \(bu 2 #751: Allow production lists longer than a page in LaTeX by using longtable. .IP \(bu 2 #764: Always look for stopwords lowercased in JS search. .IP \(bu 2 #814: autodoc: Guard against strange type objects that don\(aqt have \fB__bases__\fP\&. .IP \(bu 2 #932: autodoc: Do not crash if \fB__doc__\fP is not a string. .IP \(bu 2 #933: Do not crash if an \fBoption\fP \%<#\:role-option> value is malformed (contains spaces but no option name). .IP \(bu 2 #908: On Python 3, handle error messages from LaTeX correctly in the pngmath extension. .IP \(bu 2 #943: In autosummary, recognize \(dqfirst sentences\(dq to pull from the docstring if they contain uppercase letters. .IP \(bu 2 #923: Take the entire LaTeX document into account when caching pngmath\-generated images. This rebuilds them correctly when \fBpngmath_latex_preamble\fP changes. .IP \(bu 2 #901: Emit a warning when using Docutils\(aq new \(dqmath\(dq markup without a Sphinx math extension active. .IP \(bu 2 #845: In code blocks, when the selected lexer fails, display line numbers nevertheless if configured. .IP \(bu 2 #929: Support parsed\-literal blocks in LaTeX output correctly. .IP \(bu 2 #949: Update the tabulary.sty packed with Sphinx. .IP \(bu 2 #1050: Add anonymous labels into \fBobjects.inv\fP to be referenced via \fBintersphinx\fP \%<#\:module-sphinx\:.ext\:.intersphinx>\&. .IP \(bu 2 #1095: Fix print\-media stylesheet being included always in the \(dqscrolls\(dq theme. .IP \(bu 2 #1085: Fix current classname not getting set if class description has \fB:noindex:\fP set. .IP \(bu 2 #1181: Report option errors in autodoc directives more gracefully. .IP \(bu 2 #1155: Fix autodocumenting C\-defined methods as attributes in Python 3. .IP \(bu 2 #1233: Allow finding both Python classes and exceptions with the \(dqclass\(dq and \(dqexc\(dq roles in intersphinx. .IP \(bu 2 #1198: Allow \(dqimage\(dq for the \(dqfigwidth\(dq option of the figure \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:figure> directive as documented by docutils. .IP \(bu 2 #1152: Fix pycode parsing errors of Python 3 code by including two grammar versions for Python 2 and 3, and loading the appropriate version for the running Python version. .IP \(bu 2 #1017: Be helpful and tell the user when the argument to \fBoption\fP \%<#\:directive-option> does not match the required format. .IP \(bu 2 #1345: Fix two bugs with \fBnitpick_ignore\fP; now you don\(aqt have to remove the store environment for changes to have effect. .IP \(bu 2 #1072: In the JS search, fix issues searching for upper\-cased words by lowercasing words before stemming. .IP \(bu 2 #1299: Make behavior of the \fBmath\fP \%<#\:directive-math> directive more consistent and avoid producing empty environments in LaTeX output. .IP \(bu 2 #1308: Strip HTML tags from the content of \(dqraw\(dq nodes before feeding it to the search indexer. .IP \(bu 2 #1249: Fix duplicate LaTeX page numbering for manual documents. .IP \(bu 2 #1292: In the linkchecker, retry HEAD requests when denied by HTTP 405. Also make the redirect code apparent and tweak the output a bit to be more obvious. .IP \(bu 2 #1285: Avoid name clashes between C domain objects and section titles. .IP \(bu 2 #848: Always take the newest code in incremental rebuilds with the \fBsphinx.ext.viewcode\fP \%<#\:module-sphinx\:.ext\:.viewcode> extension. .IP \(bu 2 #979, #1266: Fix exclude handling in \fBsphinx\-apidoc\fP\&. .IP \(bu 2 #1302: Fix regression in \fBsphinx.ext.inheritance_diagram\fP \%<#\:module-sphinx\:.ext\:.inheritance_diagram> when documenting classes that can\(aqt be pickled. .IP \(bu 2 #1316: Remove hard\-coded \fBfont\-face\fP resources from epub theme. .IP \(bu 2 #1329: Fix traceback with empty translation msgstr in .po files. .IP \(bu 2 #1300: Fix references not working in translated documents in some instances. .IP \(bu 2 #1283: Fix a bug in the detection of changed files that would try to access doctrees of deleted documents. .IP \(bu 2 #1330: Fix \fBexclude_patterns\fP behavior with subdirectories in the \fBhtml_static_path\fP\&. .IP \(bu 2 #1323: Fix emitting empty \fB<ul>\fP tags in the HTML writer, which is not valid HTML. .IP \(bu 2 #1147: Don\(aqt emit a sidebar search box in the \(dqsinglehtml\(dq builder. .UNINDENT .SS Documentation .INDENT 0.0 .IP \(bu 2 #1325: Added a \(dqIntersphinx\(dq tutorial section. (\fBdoc/tutorial.rst\fP) .UNINDENT .SS Release 1.2 (released Dec 10, 2013) .SS Features added .INDENT 0.0 .IP \(bu 2 Added \fBsphinx.version_info\fP tuple for programmatic checking of the Sphinx version. .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Removed the \fBsphinx.ext.refcounting\fP extension \-\- it is very specific to CPython and has no place in the main distribution. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Restore \fBversionmodified\fP CSS class for versionadded/changed and deprecated directives. .IP \(bu 2 PR#181: Fix \fBhtml_theme_path = [\(aq.\(aq]\fP is a trigger of rebuild all documents always (This change keeps the current \(dqtheme changes cause a rebuild\(dq feature). .IP \(bu 2 #1296: Fix invalid charset in HTML help generated HTML files for default locale. .IP \(bu 2 PR#190: Fix gettext does not extract figure caption and rubric title inside other blocks. Thanks to Michael Schlenker. .IP \(bu 2 PR#176: Make sure setup_command test can always import Sphinx. Thanks to Dmitry Shachnev. .IP \(bu 2 #1311: Fix test_linkcode.test_html fails with C locale and Python 3. .IP \(bu 2 #1269: Fix ResourceWarnings with Python 3.2 or later. .IP \(bu 2 #1138: Fix: When \fBautodoc_docstring_signature = True\fP and \fBautoclass_content = \(aqinit\(aq\fP or \fB\(aqboth\(aq\fP, __init__ line should be removed from class documentation. .UNINDENT .SS Release 1.2 beta3 (released Oct 3, 2013) .SS Features added .INDENT 0.0 .IP \(bu 2 The Sphinx error log files will now include a list of the loaded extensions for help in debugging. .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 PR#154: Remove \(dqsphinx\(dq prefix from LaTeX class name except \(aqsphinxmanual\(aq and \(aqsphinxhowto\(aq. Now you can use your custom document class without \(aqsphinx\(aq prefix. Thanks to Erik B. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #1265: Fix i18n: crash when translating a section name that is pointed to from a named target. .IP \(bu 2 A wrong condition broke the search feature on first page that is usually index.rst. This issue was introduced in 1.2b1. .IP \(bu 2 #703: When Sphinx can\(aqt decode filenames with non\-ASCII characters, Sphinx now catches UnicodeError and will continue if possible instead of raising the exception. .UNINDENT .SS Release 1.2 beta2 (released Sep 17, 2013) .SS Features added .INDENT 0.0 .IP \(bu 2 \fBapidoc\fP now ignores \(dq_private\(dq modules by default, and has an option \fB\-P\fP to include them. .IP \(bu 2 \fBapidoc\fP now has an option to not generate headings for packages and modules, for the case that the module docstring already includes a reST heading. .IP \(bu 2 PR#161: \fBapidoc\fP can now write each module to a standalone page instead of combining all modules in a package on one page. .IP \(bu 2 Builders: rebuild i18n target document when catalog updated. .IP \(bu 2 Support docutils.conf \(aqwriters\(aq and \(aqhtml4css1 writer\(aq section in the HTML writer. The latex, manpage and texinfo writers also support their respective \(aqwriters\(aq sections. .IP \(bu 2 The new \fBhtml_extra_path\fP config value allows to specify directories with files that should be copied directly to the HTML output directory. .IP \(bu 2 Autodoc directives for module data and attributes now support an \fBannotation\fP option, so that the default display of the data/attribute value can be overridden. .IP \(bu 2 PR#136: Autodoc directives now support an \fBimported\-members\fP option to include members imported from different modules. .IP \(bu 2 New locales: Macedonian, Sinhala, Indonesian. .IP \(bu 2 Theme package collection by using setuptools plugin mechanism. .UNINDENT .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 PR#144, #1182: Force timezone offset to LocalTimeZone on POT\-Creation\-Date that was generated by gettext builder. Thanks to masklinn and Jakub Wilk. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 PR#132: Updated jQuery version to 1.8.3. .IP \(bu 2 PR#141, #982: Avoid crash when writing PNG file using Python 3. Thanks to Marcin Wojdyr. .IP \(bu 2 PR#145: In parallel builds, Sphinx drops second document file to write. Thanks to tychoish. .IP \(bu 2 PR#151: Some styling updates to tables in LaTeX. .IP \(bu 2 PR#153: The \(dqextensions\(dq config value can now be overridden. .IP \(bu 2 PR#155: Added support for some C++11 function qualifiers. .IP \(bu 2 Fix: \(aqmake gettext\(aq caused UnicodeDecodeError when templates contain utf\-8 encoded strings. .IP \(bu 2 #828: use inspect.getfullargspec() to be able to document functions with keyword\-only arguments on Python 3. .IP \(bu 2 #1090: Fix i18n: multiple cross references (term, ref, doc) in the same line return the same link. .IP \(bu 2 #1157: Combination of \(aqglobaltoc.html\(aq and hidden toctree caused exception. .IP \(bu 2 #1159: fix wrong generation of objects inventory for Python modules, and add a workaround in intersphinx to fix handling of affected inventories. .IP \(bu 2 #1160: Citation target missing caused an AssertionError. .IP \(bu 2 #1162, PR#139: singlehtml builder didn\(aqt copy images to _images/. .IP \(bu 2 #1173: Adjust setup.py dependencies because Jinja2 2.7 discontinued compatibility with Python < 3.3 and Python < 2.6. Thanks to Alexander Dupuy. .IP \(bu 2 #1185: Don\(aqt crash when a Python module has a wrong or no encoding declared, and non\-ASCII characters are included. .IP \(bu 2 #1188: sphinx\-quickstart raises UnicodeEncodeError if \(dqProject version\(dq includes non\-ASCII characters. .IP \(bu 2 #1189: \(dqTitle underline is too short\(dq WARNING is given when using fullwidth characters to \(dqProject name\(dq on quickstart. .IP \(bu 2 #1190: Output TeX/texinfo/man filename has no basename (only extension) when using non\-ASCII characters in the \(dqProject name\(dq on quickstart. .IP \(bu 2 #1192: Fix escaping problem for hyperlinks in the manpage writer. .IP \(bu 2 #1193: Fix i18n: multiple link references in the same line return the same link. .IP \(bu 2 #1176: Fix i18n: footnote reference number missing for auto numbered named footnote and auto symbol footnote. .IP \(bu 2 PR#146,#1172: Fix ZeroDivisionError in parallel builds. Thanks to tychoish. .IP \(bu 2 #1204: Fix wrong generation of links to local intersphinx targets. .IP \(bu 2 #1206: Fix i18n: gettext did not translate admonition directive\(aqs title. .IP \(bu 2 #1232: Sphinx generated broken ePub files on Windows. .IP \(bu 2 #1259: Guard the debug output call when emitting events; to prevent the repr() implementation of arbitrary objects causing build failures. .IP \(bu 2 #1142: Fix NFC/NFD normalizing problem of rst filename on Mac OS X. .IP \(bu 2 #1234: Ignoring the string consists only of white\-space characters. .UNINDENT .SS Release 1.2 beta1 (released Mar 31, 2013) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Removed \fBsphinx.util.compat.directive_dwim()\fP and \fBsphinx.roles.xfileref_role()\fP which were deprecated since version 1.0. .IP \(bu 2 PR#122: the files given in \fBlatex_additional_files\fP now override TeX files included by Sphinx, such as \fBsphinx.sty\fP\&. .IP \(bu 2 PR#124: the node generated by \fBversionadded\fP, \fBversionchanged\fP and \fBdeprecated\fP directives now includes all added markup (such as \(dqNew in version X\(dq) as child nodes, and no additional text must be generated by writers. .IP \(bu 2 PR#99: the \fBseealso\fP \%<#\:directive-seealso> directive now generates admonition nodes instead of the custom \fBseealso\fP node. .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 Markup .INDENT 2.0 .IP \(bu 2 The \fBtoctree\fP \%<#\:directive-toctree> directive and the \fBtoctree()\fP template function now have an \fBincludehidden\fP option that includes hidden toctree entries (bugs #790 and #1047). A bug in the \fBmaxdepth\fP option for the \fBtoctree()\fP template function has been fixed (bug #1046). .IP \(bu 2 PR#99: Strip down seealso directives to normal admonitions. This removes their unusual CSS classes (admonition\-see\-also), inconsistent LaTeX admonition title (\(dqSee Also\(dq instead of \(dqSee also\(dq), and spurious indentation in the text builder. .UNINDENT .IP \(bu 2 HTML builder .INDENT 2.0 .IP \(bu 2 #783: Create a link to full size image if it is scaled with width or height. .IP \(bu 2 #1067: Improve the ordering of the JavaScript search results: matches in titles come before matches in full text, and object results are better categorized. Also implement a pluggable search scorer. .IP \(bu 2 #1053: The \(dqrightsidebar\(dq and \(dqcollapsiblesidebar\(dq HTML theme options now work together. .IP \(bu 2 Update to jQuery 1.7.1 and Underscore.js 1.3.1. .UNINDENT .IP \(bu 2 Texinfo builder .INDENT 2.0 .IP \(bu 2 An \(dqIndex\(dq node is no longer added when there are no entries. .IP \(bu 2 \(dqdeffn\(dq categories are no longer capitalized if they contain capital letters. .IP \(bu 2 \fBdesc_annotation\fP nodes are now rendered. .IP \(bu 2 \fBstrong\fP and \fBemphasis\fP nodes are now formatted like \fBliteral\fPs. The reason for this is because the standard Texinfo markup (\fB*strong*\fP and \fB_emphasis_\fP) resulted in confusing output due to the common usage of using these constructs for documenting parameter names. .IP \(bu 2 Field lists formatting has been tweaked to better display \(dqInfo field lists\(dq. .IP \(bu 2 \fBsystem_message\fP and \fBproblematic\fP nodes are now formatted in a similar fashion as done by the text builder. .IP \(bu 2 \(dqen\-dash\(dq and \(dqem\-dash\(dq conversion of hyphens is no longer performed in option directive signatures. .IP \(bu 2 \fB@ref\fP is now used instead of \fB@pxref\fP for cross\-references which prevents the word \(dqsee\(dq from being added before the link (does not affect the Info output). .IP \(bu 2 The \fB@finalout\fP command has been added for better TeX output. .IP \(bu 2 \fBtransition\fP nodes are now formatted using underscores (\(dq_\(dq) instead of asterisks (\(dq*\(dq). .IP \(bu 2 The default value for the \fBparagraphindent\fP has been changed from 2 to 0 meaning that paragraphs are no longer indented by default. .IP \(bu 2 #1110: A new configuration value \fBtexinfo_no_detailmenu\fP has been added for controlling whether a \fB@detailmenu\fP is added in the \(dqTop\(dq node\(aqs menu. .IP \(bu 2 Detailed menus are no longer created except for the \(dqTop\(dq node. .IP \(bu 2 Fixed an issue where duplicate domain indices would result in invalid output. .UNINDENT .IP \(bu 2 LaTeX builder: .INDENT 2.0 .IP \(bu 2 PR#115: Add \fB\(aqtransition\(aq\fP item in \fBlatex_elements\fP for customizing how transitions are displayed. Thanks to Jeff Klukas. .IP \(bu 2 PR#114: The LaTeX writer now includes the \(dqcmap\(dq package by default. The \fB\(aqcmappkg\(aq\fP item in \fBlatex_elements\fP can be used to control this. Thanks to Dmitry Shachnev. .IP \(bu 2 The \fB\(aqfontpkg\(aq\fP item in \fBlatex_elements\fP now defaults to \fB\(aq\(aq\fP when the \fBlanguage\fP \%<#\:confval-language> uses the Cyrillic script. Suggested by Dmitry Shachnev. .IP \(bu 2 The \fBlatex_documents\fP, \fBtexinfo_documents\fP, and \fBman_pages\fP configuration values will be set to default values based on the \fBmaster_doc\fP \%<#\:confval-master_doc> if not explicitly set in \fBconf.py\fP\&. Previously, if these values were not set, no output would be generated by their respective builders. .UNINDENT .IP \(bu 2 Internationalization: .INDENT 2.0 .IP \(bu 2 Add i18n capabilities for custom templates. For example: The Sphinx reference documentation in doc directory provides a \fBsphinx.pot\fP file with message strings from \fBdoc/_templates/*.html\fP when using \fBmake gettext\fP\&. .IP \(bu 2 PR#61,#703: Add support for non\-ASCII filename handling. .UNINDENT .IP \(bu 2 Other builders: .INDENT 2.0 .IP \(bu 2 Added the Docutils\-native XML and pseudo\-XML builders. See \fBXMLBuilder\fP \%<#\:sphinx\:.builders\:.xml\:.XMLBuilder> and \fBPseudoXMLBuilder\fP \%<#\:sphinx\:.builders\:.xml\:.PseudoXMLBuilder>\&. .IP \(bu 2 PR#45: The linkcheck builder now checks \fB#anchor\fPs for existence. .IP \(bu 2 PR#123, #1106: Add \fBepub_use_index\fP configuration value. If provided, it will be used instead of \fBhtml_use_index\fP for epub builder. .IP \(bu 2 PR#126: Add \fBepub_tocscope\fP configuration value. The setting controls the generation of the epub toc. The user can now also include hidden toc entries. .IP \(bu 2 PR#112: Add \fBepub_show_urls\fP configuration value. .UNINDENT .IP \(bu 2 Extensions: .INDENT 2.0 .IP \(bu 2 PR#52: \fBspecial_members\fP flag to autodoc now behaves like \fBmembers\fP\&. .IP \(bu 2 PR#47: Added \fBsphinx.ext.linkcode\fP \%<#\:module-sphinx\:.ext\:.linkcode> extension. .IP \(bu 2 PR#25: In inheritance diagrams, the first line of the class docstring is now the tooltip for the class. .UNINDENT .IP \(bu 2 Command\-line interfaces: .INDENT 2.0 .IP \(bu 2 PR#75: Added \fB\-\-follow\-links\fP option to sphinx\-apidoc. .IP \(bu 2 #869: sphinx\-build now has the option \fB\-T\fP for printing the full traceback after an unhandled exception. .IP \(bu 2 sphinx\-build now supports the standard \fB\-\-help\fP and \fB\-\-version\fP options. .IP \(bu 2 sphinx\-build now provides more specific error messages when called with invalid options or arguments. .IP \(bu 2 sphinx\-build now has a verbose option \fB\-v\fP which can be repeated for greater effect. A single occurrence provides a slightly more verbose output than normal. Two or more occurrences of this option provides more detailed output which may be useful for debugging. .UNINDENT .IP \(bu 2 Locales: .INDENT 2.0 .IP \(bu 2 PR#74: Fix some Russian translation. .IP \(bu 2 PR#54: Added Norwegian bokmaal translation. .IP \(bu 2 PR#35: Added Slovak translation. .IP \(bu 2 PR#28: Added Hungarian translation. .IP \(bu 2 #1113: Add Hebrew locale. .IP \(bu 2 #1097: Add Basque locale. .IP \(bu 2 #1037: Fix typos in Polish translation. Thanks to Jakub Wilk. .IP \(bu 2 #1012: Update Estonian translation. .UNINDENT .IP \(bu 2 Optimizations: .INDENT 2.0 .IP \(bu 2 Speed up building the search index by caching the results of the word stemming routines. Saves about 20 seconds when building the Python documentation. .IP \(bu 2 PR#108: Add experimental support for parallel building with a new \fBsphinx\-build \-j\fP \%<#\:cmdoption-sphinx-build-j> option. .UNINDENT .UNINDENT .SS Documentation .INDENT 0.0 .IP \(bu 2 PR#88: Added the \(dqSphinx Developer\(aqs Guide\(dq (\fBdoc/devguide.rst\fP) which outlines the basic development process of the Sphinx project. .IP \(bu 2 Added a detailed \(dqInstalling Sphinx\(dq document (\fBdoc/install.rst\fP). .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 PR#124: Fix paragraphs in versionmodified are ignored when it has no dangling paragraphs. Fix wrong html output (nested \fB<p>\fP tag). Fix versionmodified is not translatable. Thanks to Nozomu Kaneko. .IP \(bu 2 PR#111: Respect add_autodoc_attrgetter() even when inherited\-members is set. Thanks to A. Jesse Jiryu Davis. .IP \(bu 2 PR#97: Fix footnote handling in translated documents. .IP \(bu 2 Fix text writer not handling visit_legend for figure directive contents. .IP \(bu 2 Fix text builder not respecting wide/fullwidth characters: title underline width, table layout width and text wrap width. .IP \(bu 2 Fix leading space in LaTeX table header cells. .IP \(bu 2 #1132: Fix LaTeX table output for multi\-row cells in the first column. .IP \(bu 2 #1128: Fix Unicode errors when trying to format time strings with a non\-standard locale. .IP \(bu 2 #1127: Fix traceback when autodoc tries to tokenize a non\-Python file. .IP \(bu 2 #1126: Fix double\-hyphen to en\-dash conversion in wrong places such as command\-line option names in LaTeX. .IP \(bu 2 #1123: Allow whitespaces in filenames given to \fBliteralinclude\fP\&. .IP \(bu 2 #1120: Added improvements about i18n for themes \(dqbasic\(dq, \(dqhaiku\(dq and \(dqscrolls\(dq that Sphinx built\-in. Thanks to Leonardo J. Caballero G. .IP \(bu 2 #1118: Updated Spanish translation. Thanks to Leonardo J. Caballero G. .IP \(bu 2 #1117: Handle .pyx files in sphinx\-apidoc. .IP \(bu 2 #1112: Avoid duplicate download files when referenced from documents in different ways (absolute/relative). .IP \(bu 2 #1111: Fix failure to find uppercase words in search when \fBhtml_search_language\fP is \(aqja\(aq. Thanks to Tomo Saito. .IP \(bu 2 #1108: The text writer now correctly numbers enumerated lists with non\-default start values (based on patch by Ewan Edwards). .IP \(bu 2 #1102: Support multi\-context \(dqwith\(dq statements in autodoc. .IP \(bu 2 #1090: Fix gettext not extracting glossary terms. .IP \(bu 2 #1074: Add environment version info to the generated search index to avoid compatibility issues with old builds. .IP \(bu 2 #1070: Avoid un\-pickling issues when running Python 3 and the saved environment was created under Python 2. .IP \(bu 2 #1069: Fixed error caused when autodoc would try to format signatures of \(dqpartial\(dq functions without keyword arguments (patch by Artur Gaspar). .IP \(bu 2 #1062: sphinx.ext.autodoc use __init__ method signature for class signature. .IP \(bu 2 #1055: Fix web support with relative path to source directory. .IP \(bu 2 #1043: Fix sphinx\-quickstart asking again for yes/no questions because \fBinput()\fP returns values with an extra \(aqr\(aq on Python 3.2.0 + Windows. Thanks to Régis Décamps. .IP \(bu 2 #1041: Fix failure of the cpp domain parser to parse a const type with a modifier. .IP \(bu 2 #1038: Fix failure of the cpp domain parser to parse C+11 \(dqstatic constexpr\(dq declarations. Thanks to Jakub Wilk. .IP \(bu 2 #1029: Fix intersphinx_mapping values not being stable if the mapping has plural key/value set with Python 3.3. .IP \(bu 2 #1028: Fix line block output in the text builder. .IP \(bu 2 #1024: Improve Makefile/make.bat error message if Sphinx is not found. Thanks to Anatoly Techtonik. .IP \(bu 2 #1018: Fix \(dqcontainer\(dq directive handling in the text builder. .IP \(bu 2 #1015: Stop overriding jQuery contains() in the JavaScript. .IP \(bu 2 #1010: Make pngmath images transparent by default; IE7+ should handle it. .IP \(bu 2 #1008: Fix test failures with Python 3.3. .IP \(bu 2 #995: Fix table\-of\-contents and page numbering for the LaTeX \(dqhowto\(dq class. .IP \(bu 2 #976: Fix gettext does not extract index entries. .IP \(bu 2 PR#72: #975: Fix gettext not extracting definition terms before Docutils 0.10. .IP \(bu 2 #961: Fix LaTeX output for triple quotes in code snippets. .IP \(bu 2 #958: Do not preserve \fBenvironment.pickle\fP after a failed build. .IP \(bu 2 #955: Fix i18n transformation. .IP \(bu 2 #940: Fix gettext does not extract figure caption. .IP \(bu 2 #920: Fix PIL packaging issue that allowed to import \fBImage\fP without PIL namespace. Thanks to Marc Schlaich. .IP \(bu 2 #723: Fix the search function on local files in WebKit based browsers. .IP \(bu 2 #440: Fix coarse timestamp resolution in some filesystem generating a wrong list of outdated files. .UNINDENT .SS Sphinx 1.1 .SS Release 1.1.3 (Mar 10, 2012) .INDENT 0.0 .IP \(bu 2 PR#40: Fix \fBsafe_repr\fP function to decode bytestrings with non\-ASCII characters correctly. .IP \(bu 2 PR#37: Allow configuring sphinx\-apidoc via \fBSPHINX_APIDOC_OPTIONS\fP\&. .IP \(bu 2 PR#34: Restore Python 2.4 compatibility. .IP \(bu 2 PR#36: Make the \(dqbibliography to TOC\(dq fix in LaTeX output specific to the document class. .IP \(bu 2 #695: When the highlight language \(dqpython\(dq is specified explicitly, do not try to parse the code to recognize non\-Python snippets. .IP \(bu 2 #859: Fix exception under certain circumstances when not finding appropriate objects to link to. .IP \(bu 2 #860: Do not crash when encountering invalid doctest examples, just emit a warning. .IP \(bu 2 #864: Fix crash with some settings of \fBmodindex_common_prefix\fP \%<#\:confval-modindex_common_prefix>\&. .IP \(bu 2 #862: Fix handling of \fB\-D\fP and \fB\-A\fP options on Python 3. .IP \(bu 2 #851: Recognize and warn about circular toctrees, instead of running into recursion errors. .IP \(bu 2 #853: Restore compatibility with Docutils trunk. .IP \(bu 2 #852: Fix HtmlHelp index entry links again. .IP \(bu 2 #854: Fix inheritance_diagram raising attribute errors on builtins. .IP \(bu 2 #832: Fix crashes when putting comments or lone terms in a glossary. .IP \(bu 2 #834, #818: Fix HTML help language/encoding mapping for all Sphinx supported languages. .IP \(bu 2 #844: Fix crashes when dealing with Unicode output in doctest extension. .IP \(bu 2 #831: Provide \fB\-\-project\fP flag in setup_command as advertised. .IP \(bu 2 #875: Fix reading config files under Python 3. .IP \(bu 2 #876: Fix quickstart test under Python 3. .IP \(bu 2 #870: Fix spurious KeyErrors when removing documents. .IP \(bu 2 #892: Fix single\-HTML builder misbehaving with the master document in a subdirectory. .IP \(bu 2 #873: Fix assertion errors with empty \fBonly\fP directives. .IP \(bu 2 #816: Fix encoding issues in the Qt help builder. .UNINDENT .SS Release 1.1.2 (Nov 1, 2011) \-\- 1.1.1 is a silly version number anyway! .INDENT 0.0 .IP \(bu 2 #809: Include custom fixers in the source distribution. .UNINDENT .SS Release 1.1.1 (Nov 1, 2011) .INDENT 0.0 .IP \(bu 2 #791: Fix QtHelp, DevHelp and HtmlHelp index entry links. .IP \(bu 2 #792: Include \(dqsphinx\-apidoc\(dq in the source distribution. .IP \(bu 2 #797: Don\(aqt crash on a misformatted glossary. .IP \(bu 2 #801: Make intersphinx work properly without SSL support. .IP \(bu 2 #805: Make the \fBSphinx.add_index_to_domain\fP method work correctly. .IP \(bu 2 #780: Fix Python 2.5 compatibility. .UNINDENT .SS Release 1.1 (Oct 9, 2011) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 The \fBpy:module\fP directive doesn\(aqt output its \fBplatform\fP option value anymore. (It was the only thing that the directive did output, and therefore quite inconsistent.) .IP \(bu 2 Removed support for old dependency versions; requirements are now: .INDENT 2.0 .IP \(bu 2 Pygments >= 1.2 .IP \(bu 2 Docutils >= 0.7 .IP \(bu 2 Jinja2 >= 2.3 .UNINDENT .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 Added Python 3.x support. .IP \(bu 2 New builders and subsystems: .INDENT 2.0 .IP \(bu 2 Added a Texinfo builder. .IP \(bu 2 Added i18n support for content, a \fBgettext\fP builder and related utilities. .IP \(bu 2 Added the \fBwebsupport\fP library and builder. .IP \(bu 2 #98: Added a \fBsphinx\-apidoc\fP script that autogenerates a hierarchy of source files containing autodoc directives to document modules and packages. .IP \(bu 2 #273: Add an API for adding full\-text search support for languages other than English. Add support for Japanese. .UNINDENT .IP \(bu 2 Markup: .INDENT 2.0 .IP \(bu 2 #138: Added an \fBindex\fP \%<#\:role-index> role, to make inline index entries. .IP \(bu 2 #454: Added more index markup capabilities: marking see/seealso entries, and main entries for a given key. .IP \(bu 2 #460: Allowed limiting the depth of section numbers for HTML using the \fBtoctree\fP \%<#\:directive-toctree>\(aqs \fBnumbered\fP option. .IP \(bu 2 #586: Implemented improved \fBglossary\fP \%<#\:directive-glossary> markup which allows multiple terms per definition. .IP \(bu 2 #478: Added \fBpy:decorator\fP directive to describe decorators. .IP \(bu 2 C++ domain now supports array definitions. .IP \(bu 2 C++ domain now supports doc fields (\fB:param x:\fP inside directives). .IP \(bu 2 Section headings in \fBonly\fP \%<#\:directive-only> directives are now correctly handled. .IP \(bu 2 Added \fBemphasize\-lines\fP option to source code directives. .IP \(bu 2 #678: C++ domain now supports superclasses. .UNINDENT .IP \(bu 2 HTML builder: .INDENT 2.0 .IP \(bu 2 Added \fBpyramid\fP theme. .IP \(bu 2 #559: \fBhtml_add_permalinks\fP is now a string giving the text to display in permalinks. .IP \(bu 2 #259: HTML table rows now have even/odd CSS classes to enable \(dqZebra styling\(dq. .IP \(bu 2 #554: Add theme option \fBsidebarwidth\fP to the basic theme. .UNINDENT .IP \(bu 2 Other builders: .INDENT 2.0 .IP \(bu 2 #516: Added new value of the \fBlatex_show_urls\fP \%<#\:confval-latex_show_urls> option to show the URLs in footnotes. .IP \(bu 2 #209: Added \fBtext_newlines\fP \%<#\:confval-text_newlines> and \fBtext_sectionchars\fP \%<#\:confval-text_sectionchars> config values. .IP \(bu 2 Added \fBman_show_urls\fP \%<#\:confval-man_show_urls> config value. .IP \(bu 2 #472: linkcheck builder: Check links in parallel, use HTTP HEAD requests and allow configuring the timeout. New config values: \fBlinkcheck_timeout\fP \%<#\:confval-linkcheck_timeout> and \fBlinkcheck_workers\fP \%<#\:confval-linkcheck_workers>\&. .IP \(bu 2 #521: Added \fBlinkcheck_ignore\fP \%<#\:confval-linkcheck_ignore> config value. .IP \(bu 2 #28: Support row/colspans in tables in the LaTeX builder. .UNINDENT .IP \(bu 2 Configuration and extensibility: .INDENT 2.0 .IP \(bu 2 #537: Added \fBnitpick_ignore\fP \%<#\:confval-nitpick_ignore>\&. .IP \(bu 2 #306: Added \fBenv\-get\-outdated\fP \%<#\:event-env-get-outdated> event. .IP \(bu 2 \fBApplication.add_stylesheet()\fP now accepts full URIs. .UNINDENT .IP \(bu 2 Autodoc: .INDENT 2.0 .IP \(bu 2 #564: Add \fBautodoc_docstring_signature\fP \%<#\:confval-autodoc_docstring_signature>\&. When enabled (the default), autodoc retrieves the signature from the first line of the docstring, if it is found there. .IP \(bu 2 #176: Provide \fBprivate\-members\fP option for autodoc directives. .IP \(bu 2 #520: Provide \fBspecial\-members\fP option for autodoc directives. .IP \(bu 2 #431: Doc comments for attributes can now be given on the same line as the assignment. .IP \(bu 2 #437: autodoc now shows values of class data attributes. .IP \(bu 2 autodoc now supports documenting the signatures of \fBfunctools.partial\fP objects. .UNINDENT .IP \(bu 2 Other extensions: .INDENT 2.0 .IP \(bu 2 Added the \fBsphinx.ext.mathjax\fP \%<#\:module-sphinx\:.ext\:.mathjax> extension. .IP \(bu 2 #443: Allow referencing external graphviz files. .IP \(bu 2 Added \fBinline\fP option to graphviz directives, and fixed the default (block\-style) in LaTeX output. .IP \(bu 2 #590: Added \fBcaption\fP option to graphviz directives. .IP \(bu 2 #553: Added \fBtestcleanup\fP blocks in the doctest extension. .IP \(bu 2 #594: \fBtrim_doctest_flags\fP now also removes \fB<BLANKLINE>\fP indicators. .IP \(bu 2 #367: Added automatic exclusion of hidden members in inheritance diagrams, and an option to selectively enable it. .IP \(bu 2 Added \fBpngmath_add_tooltips\fP\&. .IP \(bu 2 The math extension displaymath directives now support \fBname\fP in addition to \fBlabel\fP for giving the equation label, for compatibility with Docutils. .UNINDENT .IP \(bu 2 New locales: .INDENT 2.0 .IP \(bu 2 #221: Added Swedish locale. .IP \(bu 2 #526: Added Iranian locale. .IP \(bu 2 #694: Added Latvian locale. .IP \(bu 2 Added Nepali locale. .IP \(bu 2 #714: Added Korean locale. .IP \(bu 2 #766: Added Estonian locale. .UNINDENT .IP \(bu 2 Bugs fixed: .INDENT 2.0 .IP \(bu 2 #778: Fix \(dqhide search matches\(dq link on pages linked by search. .IP \(bu 2 Fix the source positions referenced by the \(dqviewcode\(dq extension. .UNINDENT .UNINDENT .SS Sphinx 1.0 .SS Release 1.0.8 (Sep 23, 2011) .INDENT 0.0 .IP \(bu 2 #627: Fix tracebacks for AttributeErrors in autosummary generation. .IP \(bu 2 Fix the \fBabbr\fP role when the abbreviation has newlines in it. .IP \(bu 2 #727: Fix the links to search results with custom object types. .IP \(bu 2 #648: Fix line numbers reported in warnings about undefined references. .IP \(bu 2 #696, #666: Fix C++ array definitions and template arguments that are not type names. .IP \(bu 2 #633: Allow footnotes in section headers in LaTeX output. .IP \(bu 2 #616: Allow keywords to be linked via intersphinx. .IP \(bu 2 #613: Allow Unicode characters in production list token names. .IP \(bu 2 #720: Add dummy visitors for graphviz nodes for text and man. .IP \(bu 2 #704: Fix image file duplication bug. .IP \(bu 2 #677: Fix parsing of multiple signatures in C++ domain. .IP \(bu 2 #637: Ignore Emacs lock files when looking for source files. .IP \(bu 2 #544: Allow .pyw extension for importable modules in autodoc. .IP \(bu 2 #700: Use \fB$(MAKE)\fP in quickstart\-generated Makefiles. .IP \(bu 2 #734: Make sidebar search box width consistent in browsers. .IP \(bu 2 #644: Fix spacing of centered figures in HTML output. .IP \(bu 2 #767: Safely encode SphinxError messages when printing them to sys.stderr. .IP \(bu 2 #611: Fix LaTeX output error with a document with no sections but a link target. .IP \(bu 2 Correctly treat built\-in method descriptors as methods in autodoc. .IP \(bu 2 #706: Stop monkeypatching the Python textwrap module. .IP \(bu 2 #657: viewcode now works correctly with source files that have non\-ASCII encoding. .IP \(bu 2 #669: Respect the \fBnoindex\fP flag option in py:module directives. .IP \(bu 2 #675: Fix IndexErrors when including nonexisting lines with \fBliteralinclude\fP\&. .IP \(bu 2 #676: Respect custom function/method parameter separator strings. .IP \(bu 2 #682: Fix JS incompatibility with jQuery >= 1.5. .IP \(bu 2 #693: Fix double encoding done when writing HTMLHelp .hhk files. .IP \(bu 2 #647: Do not apply SmartyPants in parsed\-literal blocks. .IP \(bu 2 C++ domain now supports array definitions. .UNINDENT .SS Release 1.0.7 (Jan 15, 2011) .INDENT 0.0 .IP \(bu 2 #347: Fix wrong generation of directives of static methods in autosummary. .IP \(bu 2 #599: Import PIL as \fBfrom PIL import Image\fP\&. .IP \(bu 2 #558: Fix longtables with captions in LaTeX output. .IP \(bu 2 Make token references work as hyperlinks again in LaTeX output. .IP \(bu 2 #572: Show warnings by default when reference labels cannot be found. .IP \(bu 2 #536: Include line number when complaining about missing reference targets in nitpicky mode. .IP \(bu 2 #590: Fix inline display of graphviz diagrams in LaTeX output. .IP \(bu 2 #589: Build using app.build() in setup command. .IP \(bu 2 Fix a bug in the inheritance diagram exception that caused base classes to be skipped if one of them is a builtin. .IP \(bu 2 Fix general index links for C++ domain objects. .IP \(bu 2 #332: Make admonition boundaries in LaTeX output visible. .IP \(bu 2 #573: Fix KeyErrors occurring on rebuild after removing a file. .IP \(bu 2 Fix a traceback when removing files with globbed toctrees. .IP \(bu 2 If an autodoc object cannot be imported, always re\-read the document containing the directive on next build. .IP \(bu 2 If an autodoc object cannot be imported, show the full traceback of the import error. .IP \(bu 2 Fix a bug where the removal of download files and images wasn\(aqt noticed. .IP \(bu 2 #571: Implement \fB~\fP cross\-reference prefix for the C domain. .IP \(bu 2 Fix regression of LaTeX output with the fix of #556. .IP \(bu 2 #568: Fix lookup of class attribute documentation on descriptors so that comment documentation now works. .IP \(bu 2 Fix traceback with \fBonly\fP directives preceded by targets. .IP \(bu 2 Fix tracebacks occurring for duplicate C++ domain objects. .IP \(bu 2 Fix JavaScript domain links to objects with \fB$\fP in their name. .UNINDENT .SS Release 1.0.6 (Jan 04, 2011) .INDENT 0.0 .IP \(bu 2 #581: Fix traceback in Python domain for empty cross\-reference targets. .IP \(bu 2 #283: Fix literal block display issues on Chrome browsers. .IP \(bu 2 #383, #148: Support sorting a limited range of accented characters in the general index and the glossary. .IP \(bu 2 #570: Try decoding \fB\-D\fP and \fB\-A\fP command\-line arguments with the locale\(aqs preferred encoding. .IP \(bu 2 #528: Observe \fBlocale_dirs\fP when looking for the JS translations file. .IP \(bu 2 #574: Add special code for better support of Japanese documents in the LaTeX builder. .IP \(bu 2 Regression of #77: If there is only one parameter given with \fB:param:\fP markup, the bullet list is now suppressed again. .IP \(bu 2 #556: Fix missing paragraph breaks in LaTeX output in certain situations. .IP \(bu 2 #567: Emit the \fBautodoc\-process\-docstring\fP event even for objects without a docstring so that it can add content. .IP \(bu 2 #565: In the LaTeX builder, not only literal blocks require different table handling, but also quite a few other list\-like block elements. .IP \(bu 2 #515: Fix tracebacks in the viewcode extension for Python objects that do not have a valid signature. .IP \(bu 2 Fix strange reports of line numbers for warnings generated from autodoc\-included docstrings, due to different behavior depending on Docutils version. .IP \(bu 2 Several fixes to the C++ domain. .UNINDENT .SS Release 1.0.5 (Nov 12, 2010) .INDENT 0.0 .IP \(bu 2 #557: Add CSS styles required by Docutils 0.7 for aligned images and figures. .IP \(bu 2 In the Makefile generated by LaTeX output, do not delete pdf files on clean; they might be required images. .IP \(bu 2 #535: Fix LaTeX output generated for line blocks. .IP \(bu 2 #544: Allow \fB\&.pyw\fP as a source file extension. .UNINDENT .SS Release 1.0.4 (Sep 17, 2010) .INDENT 0.0 .IP \(bu 2 #524: Open intersphinx inventories in binary mode on Windows, since version 2 contains zlib\-compressed data. .IP \(bu 2 #513: Allow giving non\-local URIs for JavaScript files, e.g. in the JSMath extension. .IP \(bu 2 #512: Fix traceback when \fBintersphinx_mapping\fP is empty. .UNINDENT .SS Release 1.0.3 (Aug 23, 2010) .INDENT 0.0 .IP \(bu 2 #495: Fix internal vs. external link distinction for links coming from a Docutils table\-of\-contents. .IP \(bu 2 #494: Fix the \fBmaxdepth\fP option for the \fBtoctree()\fP template callable when used with \fBcollapse=True\fP\&. .IP \(bu 2 #507: Fix crash parsing Python argument lists containing brackets in string literals. .IP \(bu 2 #501: Fix regression when building LaTeX docs with figures that don\(aqt have captions. .IP \(bu 2 #510: Fix inheritance diagrams for classes that are not picklable. .IP \(bu 2 #497: Introduce separate background color for the sidebar collapse button, making it easier to see. .IP \(bu 2 #502, #503, #496: Fix small layout bugs in several builtin themes. .UNINDENT .SS Release 1.0.2 (Aug 14, 2010) .INDENT 0.0 .IP \(bu 2 #490: Fix cross\-references to objects of types added by the \fBadd_object_type()\fP \%<#\:sphinx\:.application\:.Sphinx\:.add_object_type> API function. .IP \(bu 2 Fix handling of doc field types for different directive types. .IP \(bu 2 Allow breaking long signatures, continuing with backlash\-escaped newlines. .IP \(bu 2 Fix unwanted styling of C domain references (because of a namespace clash with Pygments styles). .IP \(bu 2 Allow references to PEPs and RFCs with explicit anchors. .IP \(bu 2 #471: Fix LaTeX references to figures. .IP \(bu 2 #482: When doing a non\-exact search, match only the given type of object. .IP \(bu 2 #481: Apply non\-exact search for Python reference targets with \fB\&.name\fP for modules too. .IP \(bu 2 #484: Fix crash when duplicating a parameter in an info field list. .IP \(bu 2 #487: Fix setting the default role to one provided by the \fBoldcmarkup\fP extension. .IP \(bu 2 #488: Fix crash when json\-py is installed, which provides a \fBjson\fP module but is incompatible to simplejson. .IP \(bu 2 #480: Fix handling of target naming in intersphinx. .IP \(bu 2 #486: Fix removal of \fB!\fP for all cross\-reference roles. .UNINDENT .SS Release 1.0.1 (Jul 27, 2010) .INDENT 0.0 .IP \(bu 2 #470: Fix generated target names for reST domain objects; they are not in the same namespace. .IP \(bu 2 #266: Add Bengali language. .IP \(bu 2 #473: Fix a bug in parsing JavaScript object names. .IP \(bu 2 #474: Fix building with SingleHTMLBuilder when there is no toctree. .IP \(bu 2 Fix display names for objects linked to by intersphinx with explicit targets. .IP \(bu 2 Fix building with the JSON builder. .IP \(bu 2 Fix hyperrefs in object descriptions for LaTeX. .UNINDENT .SS Release 1.0 (Jul 23, 2010) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Support for domains has been added. A domain is a collection of directives and roles that all describe objects belonging together, e.g. elements of a programming language. A few builtin domains are provided: .INDENT 2.0 .IP \(bu 2 Python .IP \(bu 2 C .IP \(bu 2 C++ .IP \(bu 2 JavaScript .IP \(bu 2 reStructuredText .UNINDENT .IP \(bu 2 The old markup for defining and linking to C directives is now deprecated. It will not work anymore in future versions without activating the \fBoldcmarkup\fP extension; in Sphinx 1.0, it is activated by default. .IP \(bu 2 Removed support for old dependency versions; requirements are now: .INDENT 2.0 .IP \(bu 2 Docutils >= 0.5 .IP \(bu 2 Jinja2 >= 2.2 .UNINDENT .IP \(bu 2 Removed deprecated elements: .INDENT 2.0 .IP \(bu 2 \fBexclude_dirs\fP config value .IP \(bu 2 \fBsphinx.builder\fP module .UNINDENT .UNINDENT .SS Features added .INDENT 0.0 .IP \(bu 2 General: .INDENT 2.0 .IP \(bu 2 Added a \(dqnitpicky\(dq mode that emits warnings for all missing references. It is activated by the \fBsphinx\-build \-n\fP \%<#\:cmdoption-sphinx-build-n> command\-line switch or the \fBnitpicky\fP \%<#\:confval-nitpicky> config value. .IP \(bu 2 Added \fBlatexpdf\fP target in quickstart Makefile. .UNINDENT .IP \(bu 2 Markup: .INDENT 2.0 .IP \(bu 2 The \fBmenuselection\fP and \fBguilabel\fP roles now support ampersand accelerators. .IP \(bu 2 New more compact doc field syntax is now recognized: \fB:param type name: description\fP\&. .IP \(bu 2 Added \fBtab\-width\fP option to \fBliteralinclude\fP directive. .IP \(bu 2 Added \fBtitlesonly\fP option to \fBtoctree\fP \%<#\:directive-toctree> directive. .IP \(bu 2 Added the \fBprepend\fP and \fBappend\fP options to the \fBliteralinclude\fP directive. .IP \(bu 2 #284: All docinfo metadata is now put into the document metadata, not just the author. .IP \(bu 2 The \fBref\fP role can now also reference tables by caption. .IP \(bu 2 The include \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:include> directive now supports absolute paths, which are interpreted as relative to the source directory. .IP \(bu 2 In the Python domain, references like \fB:func:\(ga.name\(ga\fP now look for matching names with any prefix if no direct match is found. .UNINDENT .IP \(bu 2 Configuration: .INDENT 2.0 .IP \(bu 2 Added \fBrst_prolog\fP config value. .IP \(bu 2 Added \fBhtml_secnumber_suffix\fP config value to control section numbering format. .IP \(bu 2 Added \fBhtml_compact_lists\fP config value to control Docutils\(aq compact lists feature. .IP \(bu 2 The \fBhtml_sidebars\fP config value can now contain patterns as keys, and the values can be lists that explicitly select which sidebar templates should be rendered. That means that the builtin sidebar contents can be included only selectively. .IP \(bu 2 \fBhtml_static_path\fP can now contain single file entries. .IP \(bu 2 The new universal config value \fBexclude_patterns\fP makes the old \fBunused_docs\fP, \fBexclude_trees\fP and \fBexclude_dirnames\fP obsolete. .IP \(bu 2 Added \fBhtml_output_encoding\fP config value. .IP \(bu 2 Added the \fBlatex_docclass\fP config value and made the \(dqtwoside\(dq documentclass option overridable by \(dqoneside\(dq. .IP \(bu 2 Added the \fBtrim_doctest_flags\fP config value, which is true by default. .IP \(bu 2 Added \fBhtml_show_copyright\fP config value. .IP \(bu 2 Added \fBlatex_show_pagerefs\(ga\fP and \fBlatex_show_urls\fP config values. .IP \(bu 2 The behavior of \fBhtml_file_suffix\(ga\fP changed slightly: the empty string now means \(dqno suffix\(dq instead of \(dqdefault suffix\(dq, use \fBNone\fP for \(dqdefault suffix\(dq. .UNINDENT .IP \(bu 2 New builders: .INDENT 2.0 .IP \(bu 2 Added a builder for the Epub format. .IP \(bu 2 Added a builder for manual pages. .IP \(bu 2 Added a single\-file HTML builder. .UNINDENT .IP \(bu 2 HTML output: .INDENT 2.0 .IP \(bu 2 Inline roles now get a CSS class with their name, allowing styles to customize their appearance. Domain\-specific roles get two classes, \fBdomain\fP and \fBdomain\-rolename\fP\&. .IP \(bu 2 References now get the class \fBinternal\fP if they are internal to the whole project, as opposed to internal to the current page. .IP \(bu 2 External references can be styled differently with the new \fBexternalrefs\fP theme option for the default theme. .IP \(bu 2 In the default theme, the sidebar can experimentally now be made collapsible using the new \fBcollapsiblesidebar\fP theme option. .IP \(bu 2 #129: Toctrees are now wrapped in a \fBdiv\fP tag with class \fBtoctree\-wrapper\fP in HTML output. .IP \(bu 2 The \fBtoctree\fP \%<#\:toctree> callable in templates now has a \fBmaxdepth\fP keyword argument to control the depth of the generated tree. .IP \(bu 2 The \fBtoctree\fP \%<#\:toctree> callable in templates now accepts a \fBtitles_only\fP keyword argument. .IP \(bu 2 Added \fBhtmltitle\fP block in layout template. .IP \(bu 2 In the JavaScript search, allow searching for object names including the module name, like \fBsys.argv\fP\&. .IP \(bu 2 Added new theme \fBhaiku\fP, inspired by the Haiku OS user guide. .IP \(bu 2 Added new theme \fBnature\fP\&. .IP \(bu 2 Added new theme \fBagogo\fP, created by Andi Albrecht. .IP \(bu 2 Added new theme \fBscrolls\fP, created by Armin Ronacher. .IP \(bu 2 #193: Added a \fBvisitedlinkcolor\fP theme option to the default theme. .IP \(bu 2 #322: Improved responsiveness of the search page by loading the search index asynchronously. .UNINDENT .IP \(bu 2 Extension API: .INDENT 2.0 .IP \(bu 2 Added \fBhtml\-collect\-pages\fP \%<#\:event-html-collect-pages>\&. .IP \(bu 2 Added \fBneeds_sphinx\fP config value and \fBrequire_sphinx()\fP \%<#\:sphinx\:.application\:.Sphinx\:.require_sphinx> application API method. .IP \(bu 2 #200: Added \fBadd_stylesheet()\fP application API method. .UNINDENT .IP \(bu 2 Extensions: .INDENT 2.0 .IP \(bu 2 Added the \fBviewcode\fP \%<#\:module-sphinx\:.ext\:.viewcode> extension. .IP \(bu 2 Added the \fBextlinks\fP \%<#\:module-sphinx\:.ext\:.extlinks> extension. .IP \(bu 2 Added support for source ordering of members in autodoc, with \fBautodoc_member_order = \(aqbysource\(aq\fP\&. .IP \(bu 2 Added \fBautodoc_default_flags\fP config value, which can be used to select default flags for all autodoc directives. .IP \(bu 2 Added a way for intersphinx to refer to named labels in other projects, and to specify the project you want to link to. .IP \(bu 2 #280: Autodoc can now document instance attributes assigned in \fB__init__\fP methods. .IP \(bu 2 Many improvements and fixes to the \fBautosummary\fP \%<#\:module-sphinx\:.ext\:.autosummary> extension, thanks to Pauli Virtanen. .IP \(bu 2 #309: The \fBgraphviz\fP \%<#\:module-sphinx\:.ext\:.graphviz> extension can now output SVG instead of PNG images, controlled by the \fBgraphviz_output_format\fP config value. .IP \(bu 2 Added \fBalt\fP option to \fBgraphviz\fP \%<#\:directive-graphviz> extension directives. .IP \(bu 2 Added \fBexclude\fP argument to \fBautodoc.between()\fP \%<#\:sphinx\:.ext\:.autodoc\:.between>\&. .UNINDENT .IP \(bu 2 Translations: .INDENT 2.0 .IP \(bu 2 Added Croatian translation, thanks to Bojan Mihelač. .IP \(bu 2 Added Turkish translation, thanks to Firat Ozgul. .IP \(bu 2 Added Catalan translation, thanks to Pau Fernández. .IP \(bu 2 Added simplified Chinese translation. .IP \(bu 2 Added Danish translation, thanks to Hjorth Larsen. .IP \(bu 2 Added Lithuanian translation, thanks to Dalius Dobravolskas. .UNINDENT .IP \(bu 2 Bugs fixed: .INDENT 2.0 .IP \(bu 2 #445: Fix links to result pages when using the search function of HTML built with the \fBdirhtml\fP builder. .IP \(bu 2 #444: In templates, properly re\-escape values treated with the \(dqstriptags\(dq Jinja filter. .UNINDENT .UNINDENT .SS Sphinx 0.6 .SS Release 0.6.7 (Jun 05, 2010) .INDENT 0.0 .IP \(bu 2 #440: Remove usage of a Python >= 2.5 API in the \fBliteralinclude\fP directive. .IP \(bu 2 Fix a bug that prevented some references being generated in the LaTeX builder. .IP \(bu 2 #428: Add some missing CSS styles for standard Docutils classes. .IP \(bu 2 #432: Fix UnicodeErrors while building LaTeX in translated locale. .UNINDENT .SS Release 0.6.6 (May 25, 2010) .INDENT 0.0 .IP \(bu 2 Handle raw nodes in the \fBtext\fP writer. .IP \(bu 2 Fix a problem the Qt help project generated by the \fBqthelp\fP builder that would lead to no content being displayed in the Qt Assistant. .IP \(bu 2 #393: Fix the usage of Unicode characters in mathematic formulas when using the \fBpngmath\fP extension. .IP \(bu 2 #404: Make \fB\eand\fP work properly in the author field of the \fBlatex_documents\fP setting. .IP \(bu 2 #409: Make the \fBhighlight_language\fP config value work properly in the LaTeX builder. .IP \(bu 2 #418: Allow relocation of the translation JavaScript files to the system directory on Unix systems. .IP \(bu 2 #414: Fix handling of Windows newlines in files included with the \fBliteralinclude\fP directive. .IP \(bu 2 #377: Fix crash in linkcheck builder. .IP \(bu 2 #387: Fix the display of search results in \fBdirhtml\fP output. .IP \(bu 2 #376: In autodoc, fix display of parameter defaults containing backslashes. .IP \(bu 2 #370: Fix handling of complex list item labels in LaTeX output. .IP \(bu 2 #374: Make the \fBdoctest_path\fP config value of the doctest extension actually work. .IP \(bu 2 Fix the handling of multiple toctrees when creating the global TOC for the \fBtoctree()\fP template function. .IP \(bu 2 Fix the handling of hidden toctrees when creating the global TOC for the \fBtoctree()\fP template function. .IP \(bu 2 Fix the handling of nested lists in the text writer. .IP \(bu 2 #362: In autodoc, check for the existence of \fB__self__\fP on function objects before accessing it. .IP \(bu 2 #353: Strip leading and trailing whitespace when extracting search words in the search function. .UNINDENT .SS Release 0.6.5 (Mar 01, 2010) .INDENT 0.0 .IP \(bu 2 In autodoc, fix the omission of some module members explicitly documented using documentation comments. .IP \(bu 2 #345: Fix cropping of sidebar scroll bar with \fBstickysidebar\fP option of the default theme. .IP \(bu 2 #341: Always generate UNIX newlines in the quickstart Makefile. .IP \(bu 2 #338: Fix running with \fB\-C\fP under Windows. .IP \(bu 2 In autodoc, allow customizing the signature of an object where the built\-in mechanism fails. .IP \(bu 2 #331: Fix output for enumerated lists with start values in LaTeX. .IP \(bu 2 Make the \fBstart\-after\fP and \fBend\-before\fP options to the \fBliteralinclude\fP directive work correctly if not used together. .IP \(bu 2 #321: Fix link generation in the LaTeX builder. .UNINDENT .SS Release 0.6.4 (Jan 12, 2010) .INDENT 0.0 .IP \(bu 2 Improve the handling of non\-Unicode strings in the configuration. .IP \(bu 2 #316: Catch OSErrors occurring when calling graphviz with arguments it doesn\(aqt understand. .IP \(bu 2 Restore compatibility with Pygments >= 1.2. .IP \(bu 2 #295: Fix escaping of hyperref targets in LaTeX output. .IP \(bu 2 #302: Fix links generated by the \fB:doc:\fP role for LaTeX output. .IP \(bu 2 #286: collect todo nodes after the whole document has been read; this allows placing substitution references in todo items. .IP \(bu 2 #294: do not ignore an explicit \fBtoday\fP config value in a LaTeX build. .IP \(bu 2 The \fBalt\fP text of inheritance diagrams is now much cleaner. .IP \(bu 2 Ignore images in section titles when generating link captions. .IP \(bu 2 #310: support exception messages in the \fBtestoutput\fP blocks of the \fBdoctest\fP extension. .IP \(bu 2 #293: line blocks are styled properly in HTML output. .IP \(bu 2 #285: make the \fBlocale_dirs\fP config value work again. .IP \(bu 2 #303: \fBhtml_context\fP values given on the command line via \fB\-A\fP should not override other values given in conf.py. .IP \(bu 2 Fix a bug preventing incremental rebuilds for the \fBdirhtml\fP builder. .IP \(bu 2 #299: Fix the mangling of quotes in some literal blocks. .IP \(bu 2 #292: Fix path to the search index for the \fBdirhtml\fP builder. .IP \(bu 2 Fix a Jython compatibility issue: make the dependence on the \fBparser\fP module optional. .IP \(bu 2 #238: In autodoc, catch all errors that occur on module import, not just \fBImportError\fP\&. .IP \(bu 2 Fix the handling of non\-data, but non\-method descriptors in autodoc. .IP \(bu 2 When copying file times, ignore OSErrors raised by \fBos.utime()\fP\&. .UNINDENT .SS Release 0.6.3 (Sep 03, 2009) .INDENT 0.0 .IP \(bu 2 Properly add C module filenames as dependencies in autodoc. .IP \(bu 2 #253: Ignore graphviz directives without content instead of raising an unhandled exception. .IP \(bu 2 #241: Fix a crash building LaTeX output for documents that contain a todolist directive. .IP \(bu 2 #252: Make it easier to change the build dir in the Makefiles generated by quickstart. .IP \(bu 2 #220: Fix CSS so that displaymath really is centered. .IP \(bu 2 #222: Allow the \(dqFootnotes\(dq header to be translated. .IP \(bu 2 #225: Don\(aqt add whitespace in generated HTML after inline tags. .IP \(bu 2 #227: Make \fBliteralinclude\fP work when the document\(aqs path name contains non\-ASCII characters. .IP \(bu 2 #229: Fix autodoc failures with members that raise errors on \fBgetattr()\fP\&. .IP \(bu 2 #205: When copying files, don\(aqt copy full stat info, only modification times. .IP \(bu 2 #232: Support non\-ASCII metadata in Qt help builder. .IP \(bu 2 Properly format bullet lists nested in definition lists for LaTeX. .IP \(bu 2 Section titles are now allowed inside \fBonly\fP directives. .IP \(bu 2 #201: Make \fBcentered\fP directive work in LaTeX output. .IP \(bu 2 #206: Refuse to overwrite an existing master document in sphinx\-quickstart. .IP \(bu 2 #208: Use MS\-sanctioned locale settings, determined by the \fBlanguage\fP config option, in the HTML help builder. .IP \(bu 2 #210: Fix nesting of HTML tags for displayed math from pngmath extension. .IP \(bu 2 #213: Fix centering of images in LaTeX output. .IP \(bu 2 #211: Fix compatibility with Docutils 0.5. .UNINDENT .SS Release 0.6.2 (Jun 16, 2009) .INDENT 0.0 .IP \(bu 2 #130: Fix obscure IndexError in doctest extension. .IP \(bu 2 #167: Make glossary sorting case\-independent. .IP \(bu 2 #196: Add a warning if an extension module doesn\(aqt have a \fBsetup()\fP function. .IP \(bu 2 #158: Allow \(aq..\(aq in template names, and absolute template paths; Jinja 2 by default disables both. .IP \(bu 2 When highlighting Python code, ignore extra indentation before trying to parse it as Python. .IP \(bu 2 #191: Don\(aqt escape the tilde in URIs in LaTeX. .IP \(bu 2 Don\(aqt consider contents of source comments for the search index. .IP \(bu 2 Set the default encoding to \fButf\-8\-sig\fP to handle files with a UTF\-8 BOM correctly. .IP \(bu 2 #178: apply \fBadd_function_parentheses\fP config value to C functions as promised. .IP \(bu 2 #173: Respect the Docutils \fBtitle\fP directive. .IP \(bu 2 #172: The \fBobj\fP role now links to modules as promised. .IP \(bu 2 #19: Tables now can have a \(dqlongtable\(dq class, in order to get correctly broken into pages in LaTeX output. .IP \(bu 2 Look for Sphinx message catalogs in the system default path before trying \fBsphinx/locale\fP\&. .IP \(bu 2 Fix the search for methods via \(dqclassname.methodname\(dq. .IP \(bu 2 #155: Fix Python 2.4 compatibility: exceptions are old\-style classes there. .IP \(bu 2 #150: Fix display of the \(dqsphinxdoc\(dq theme on Internet Explorer versions 6 and 7. .IP \(bu 2 #146: Don\(aqt fail to generate LaTeX when the user has an active \fB\&.docutils\fP configuration. .IP \(bu 2 #29: Don\(aqt generate visible \(dq\-{\-}\(dq in option lists in LaTeX. .IP \(bu 2 Fix cross\-reference roles when put into substitutions. .IP \(bu 2 Don\(aqt put image \(dqalt\(dq text into table\-of\-contents entries. .IP \(bu 2 In the LaTeX writer, do not raise an exception on too many section levels, just use the \(dqsubparagraph\(dq level for all of them. .IP \(bu 2 #145: Fix autodoc problem with automatic members that refuse to be getattr()\(aqd from their parent. .IP \(bu 2 If specific filenames to build are given on the command line, check that they are within the source directory. .IP \(bu 2 Fix autodoc crash for objects without a \fB__name__\fP\&. .IP \(bu 2 Fix intersphinx for installations without urllib2.HTTPSHandler. .IP \(bu 2 #134: Fix pending_xref leftover nodes when using the todolist directive from the todo extension. .UNINDENT .SS Release 0.6.1 (Mar 26, 2009) .INDENT 0.0 .IP \(bu 2 #135: Fix problems with LaTeX output and the graphviz extension. .IP \(bu 2 #132: Include the autosummary \(dqmodule\(dq template in the distribution. .UNINDENT .SS Release 0.6 (Mar 24, 2009) .SS New features added .INDENT 0.0 .IP \(bu 2 Incompatible changes: .INDENT 2.0 .IP \(bu 2 Templating now requires the Jinja2 library, which is an enhanced version of the old Jinja1 engine. Since the syntax and semantic is largely the same, very few fixes should be necessary in custom templates. .IP \(bu 2 The \(dqdocument\(dq div tag has been moved out of the \fBlayout.html\fP template\(aqs \(dqdocument\(dq block, because the closing tag was already outside. If you overwrite this block, you need to remove your \(dqdocument\(dq div tag as well. .IP \(bu 2 The \fBautodoc_skip_member\fP event now also gets to decide whether to skip members whose name starts with underscores. Previously, these members were always automatically skipped. Therefore, if you handle this event, add something like this to your event handler to restore the old behavior: .INDENT 2.0 .INDENT 3.5 .sp .EX if name.startswith(\(aq_\(aq): return True .EE .UNINDENT .UNINDENT .UNINDENT .IP \(bu 2 Theming support, see the new section in the documentation. .IP \(bu 2 Markup: .INDENT 2.0 .IP \(bu 2 Due to popular demand, added a \fB:doc:\fP role which directly links to another document without the need of creating a label to which a \fB:ref:\fP could link to. .IP \(bu 2 #4: Added a \fB:download:\fP role that marks a non\-document file for inclusion into the HTML output and links to it. .IP \(bu 2 Added an \fBonly\fP directive that can selectively include text based on enabled \(dqtags\(dq. Tags can be given on the command line. Also, the current builder output format (e.g. \(dqhtml\(dq or \(dqlatex\(dq) is always a defined tag. .IP \(bu 2 #10: Added HTML section numbers, enabled by giving a \fB:numbered:\fP flag to the \fBtoctree\fP directive. .IP \(bu 2 #114: Added an \fBabbr\fP role to markup abbreviations and acronyms. .IP \(bu 2 The \fBliteralinclude\fP directive now supports several more options, to include only parts of a file. .IP \(bu 2 The \fBtoctree\fP directive now supports a \fB:hidden:\fP flag, which will prevent links from being generated in place of the directive \-\- this allows you to define your document structure, but place the links yourself. .IP \(bu 2 #123: The \fBglossary\fP directive now supports a \fB:sorted:\fP flag that sorts glossary entries alphabetically. .IP \(bu 2 Paths to images, literal include files and download files can now be absolute (like \fB/images/foo.png\fP). They are treated as relative to the top source directory. .IP \(bu 2 #52: There is now a \fBhlist\fP directive, creating a compact list by placing distributing items into multiple columns. .IP \(bu 2 #77: If a description environment with info field list only contains one \fB:param:\fP entry, no bullet list is generated. .IP \(bu 2 #6: Don\(aqt generate redundant \fB<ul>\fP for top\-level TOC tree items, which leads to a visual separation of TOC entries. .IP \(bu 2 #23: Added a \fBclassmethod\fP directive along with \fBmethod\fP and \fBstaticmethod\fP\&. .IP \(bu 2 Scaled images now get a link to the unscaled version. .IP \(bu 2 SVG images are now supported in HTML (via \fB<object>\fP and \fB<embed>\fP tags). .IP \(bu 2 Added a \fBtoctree\fP callable to the templates, and the ability to include external links in toctrees. The \(aqcollapse\(aq keyword argument indicates whether or not to only display subitems of the current page. (Defaults to \fBTrue\fP\&.) .UNINDENT .IP \(bu 2 Configuration: .INDENT 2.0 .IP \(bu 2 The new config value \fBrst_epilog\fP can contain reST that is appended to each source file that is read. This is the right place for global substitutions. .IP \(bu 2 The new \fBhtml_add_permalinks\fP config value can be used to switch off the generated \(dqparagraph sign\(dq permalinks for each heading and definition environment. .IP \(bu 2 The new \fBhtml_show_sourcelink\fP config value can be used to switch off the links to the reST sources in the sidebar. .IP \(bu 2 The default value for \fBhtmlhelp_basename\fP is now the project title, cleaned up as a filename. .IP \(bu 2 The new \fBmodindex_common_prefix\fP config value can be used to ignore certain package names for module index sorting. .IP \(bu 2 The new \fBtrim_footnote_reference_space\fP config value mirrors the Docutils config value of the same name and removes the space before a footnote reference that is necessary for reST to recognize the reference. .IP \(bu 2 The new \fBlatex_additional_files\fP config value can be used to copy files (that Sphinx doesn\(aqt copy automatically, e.g. if they are referenced in custom LaTeX added in \fBlatex_elements\fP) to the build directory. .UNINDENT .IP \(bu 2 Builders: .INDENT 2.0 .IP \(bu 2 The HTML builder now stores a small file named \fB\&.buildinfo\fP in its output directory. It stores a hash of config values that can be used to determine if a full rebuild needs to be done (e.g. after changing \fBhtml_theme\fP). .IP \(bu 2 New builder for Qt help collections, by Antonio Valentino. .IP \(bu 2 The new \fBDirectoryHTMLBuilder\fP (short name \fBdirhtml\fP) creates a separate directory for every page, and places the page there in a file called \fBindex.html\fP\&. Therefore, page URLs and links don\(aqt need to contain \fB\&.html\fP\&. .IP \(bu 2 The new \fBhtml_link_suffix\fP config value can be used to select the suffix of generated links between HTML files. .IP \(bu 2 #96: The LaTeX builder now supports figures wrapped by text, when using the \fBfigwidth\fP option and right/left alignment. .UNINDENT .IP \(bu 2 New translations: .INDENT 2.0 .IP \(bu 2 Italian by Sandro Dentella. .IP \(bu 2 Ukrainian by Petro Sasnyk. .IP \(bu 2 Finnish by Jukka Inkeri. .IP \(bu 2 Russian by Alexander Smishlajev. .UNINDENT .IP \(bu 2 Extensions and API: .INDENT 2.0 .IP \(bu 2 New \fBgraphviz\fP extension to embed graphviz graphs. .IP \(bu 2 New \fBinheritance_diagram\fP extension to embed... inheritance diagrams! .IP \(bu 2 New \fBautosummary\fP extension that generates summaries of modules and automatic documentation of modules. .IP \(bu 2 Autodoc now has a reusable Python API, which can be used to create custom types of objects to auto\-document (e.g. Zope interfaces). See also \fBSphinx.add_autodocumenter()\fP\&. .IP \(bu 2 Autodoc now handles documented attributes. .IP \(bu 2 Autodoc now handles inner classes and their methods. .IP \(bu 2 Autodoc can document classes as functions now if explicitly marked with \fBautofunction\fP\&. .IP \(bu 2 Autodoc can now exclude single members from documentation via the \fBexclude\-members\fP option. .IP \(bu 2 Autodoc can now order members either alphabetically (like previously) or by member type; configurable either with the config value \fBautodoc_member_order\fP or a \fBmember\-order\fP option per directive. .IP \(bu 2 The function \fBSphinx.add_directive()\fP now also supports Docutils 0.5\-style directive classes. If they inherit from \fBsphinx.util.compat.Directive\fP, they also work with Docutils 0.4. .IP \(bu 2 There is now a \fBSphinx.add_lexer()\fP method to be able to use custom Pygments lexers easily. .IP \(bu 2 There is now \fBSphinx.add_generic_role()\fP to mirror the Docutils\(aq own function. .UNINDENT .IP \(bu 2 Other changes: .INDENT 2.0 .IP \(bu 2 Config overrides for single dict keys can now be given on the command line. .IP \(bu 2 There is now a \fBdoctest_global_setup\fP config value that can be used to give setup code for all doctests in the documentation. .IP \(bu 2 Source links in HTML are now generated with \fBrel=\(dqnofollow\(dq\fP\&. .IP \(bu 2 Quickstart can now generate a Windows \fBmake.bat\fP file. .IP \(bu 2 #62: There is now a \fB\-w\fP option for sphinx\-build that writes warnings to a file, in addition to stderr. .IP \(bu 2 There is now a \fB\-W\fP option for sphinx\-build that turns warnings into errors. .UNINDENT .UNINDENT .SS Sphinx 0.5 .SS Release 0.5.2 (Mar 24, 2009) .INDENT 0.0 .IP \(bu 2 Properly escape \fB|\fP in LaTeX output. .IP \(bu 2 #71: If a decoding error occurs in source files, print a warning and replace the characters by \(dq?\(dq. .IP \(bu 2 Fix a problem in the HTML search if the index takes too long to load. .IP \(bu 2 Don\(aqt output system messages while resolving, because they would stay in the doctrees even if keep_warnings is false. .IP \(bu 2 #82: Determine the correct path for dependencies noted by docutils. This fixes behavior where a source with dependent files was always reported as changed. .IP \(bu 2 Recognize toctree directives that are not on section toplevel, but within block items, such as tables. .IP \(bu 2 Use a new RFC base URL, since rfc.org seems down. .IP \(bu 2 Fix a crash in the todolist directive when no todo items are defined. .IP \(bu 2 Don\(aqt call LaTeX or dvipng over and over again if it was not found once, and use text\-only latex as a substitute in that case. .IP \(bu 2 Fix problems with footnotes in the LaTeX output. .IP \(bu 2 Prevent double hyphens becoming en\-dashes in literal code in the LaTeX output. .IP \(bu 2 Open literalinclude files in universal newline mode to allow arbitrary newline conventions. .IP \(bu 2 Actually make the \fB\-Q\fP option work. .IP \(bu 2 #86: Fix explicit document titles in toctrees. .IP \(bu 2 #81: Write environment and search index in a manner that is safe from exceptions that occur during dumping. .IP \(bu 2 #80: Fix UnicodeErrors when a locale is set with setlocale(). .UNINDENT .SS Release 0.5.1 (Dec 15, 2008) .INDENT 0.0 .IP \(bu 2 #67: Output warnings about failed doctests in the doctest extension even when running in quiet mode. .IP \(bu 2 #72: In pngmath, make it possible to give a full path to LaTeX and dvipng on Windows. For that to work, the \fBpngmath_latex\fP and \fBpngmath_dvipng\fP options are no longer split into command and additional arguments; use \fBpngmath_latex_args\fP and \fBpngmath_dvipng_args\fP to give additional arguments. .IP \(bu 2 Don\(aqt crash on failing doctests with non\-ASCII characters. .IP \(bu 2 Don\(aqt crash on writing status messages and warnings containing unencodable characters. .IP \(bu 2 Warn if a doctest extension block doesn\(aqt contain any code. .IP \(bu 2 Fix the handling of \fB:param:\fP and \fB:type:\fP doc fields when they contain markup (especially cross\-referencing roles). .IP \(bu 2 #65: Fix storage of depth information for PNGs generated by the pngmath extension. .IP \(bu 2 Fix autodoc crash when automethod is used outside a class context. .IP \(bu 2 #68: Fix LaTeX writer output for images with specified height. .IP \(bu 2 #60: Fix wrong generated image path when including images in sources in subdirectories. .IP \(bu 2 Fix the JavaScript search when html_copy_source is off. .IP \(bu 2 Fix an indentation problem in autodoc when documenting classes with the option \fBautoclass_content = \(dqboth\(dq\fP set. .IP \(bu 2 Don\(aqt crash on empty index entries, only emit a warning. .IP \(bu 2 Fix a typo in the search JavaScript code, leading to unusable search function in some setups. .UNINDENT .SS Release 0.5 (Nov 23, 2008) \-\- Birthday release! .SS New features added .INDENT 0.0 .IP \(bu 2 Markup features: .INDENT 2.0 .IP \(bu 2 Citations are now global: all citation defined in any file can be referenced from any file. Citations are collected in a bibliography for LaTeX output. .IP \(bu 2 Footnotes are now properly handled in the LaTeX builder: they appear at the location of the footnote reference in text, not at the end of a section. Thanks to Andrew McNamara for the initial patch. .IP \(bu 2 \(dqSystem Message\(dq warnings are now automatically removed from the built documentation, and only written to stderr. If you want the old behavior, set the new config value \fBkeep_warnings\fP to \fBTrue\fP\&. .IP \(bu 2 Glossary entries are now automatically added to the index. .IP \(bu 2 Figures with captions can now be referred to like section titles, using the \fB:ref:\fP role without an explicit link text. .IP \(bu 2 Added \fBcmember\fP role for consistency. .IP \(bu 2 Lists enumerated by letters or roman numerals are now handled like in standard reST. .IP \(bu 2 The \fBseealso\fP directive can now also be given arguments, as a short form. .IP \(bu 2 You can now document several programs and their options with the new \fBprogram\fP directive. .UNINDENT .IP \(bu 2 HTML output and templates: .INDENT 2.0 .IP \(bu 2 Incompatible change: The \(dqroot\(dq relation link (top left in the relbar) now points to the \fBmaster_doc\fP by default, no longer to a document called \(dqindex\(dq. The old behavior, while useful in some situations, was somewhat unexpected. Override the \(dqrootrellink\(dq block in the template to customize where it refers to. .IP \(bu 2 The JavaScript search now searches for objects before searching in the full text. .IP \(bu 2 TOC tree entries now have CSS classes that make it possible to style them depending on their depth. .IP \(bu 2 Highlighted code blocks now have CSS classes that make it possible to style them depending on their language. .IP \(bu 2 HTML \fB<meta>\fP tags via the Docutils meta \%<https://\:docutils\:.sourceforge\:.io/\:docs/\:ref/\:rst/\:directives\:.html#\:meta> directive are now supported. .IP \(bu 2 \fBSerializingHTMLBuilder\fP was added as new abstract builder that can be subclassed to serialize build HTML in a specific format. The \fBPickleHTMLBuilder\fP is a concrete subclass of it that uses pickle as serialization implementation. .IP \(bu 2 \fBJSONHTMLBuilder\fP was added as another \fBSerializingHTMLBuilder\fP subclass that dumps the generated HTML into JSON files for further processing. .IP \(bu 2 The \fBrellinks\fP block in the layout template is now called \fBlinktags\fP to avoid confusion with the relbar links. .IP \(bu 2 The HTML builders have two additional attributes now that can be used to disable the anchor\-link creation after headlines and definition links. .IP \(bu 2 Only generate a module index if there are some modules in the documentation. .UNINDENT .IP \(bu 2 New and changed config values: .INDENT 2.0 .IP \(bu 2 Added support for internationalization in generated text with the \fBlanguage\fP and \fBlocale_dirs\fP config values. Many thanks to language contributors: .INDENT 2.0 .IP \(bu 2 Horst Gutmann \-\- German .IP \(bu 2 Pavel Kosina \-\- Czech .IP \(bu 2 David Larlet \-\- French .IP \(bu 2 Michał Kandulski \-\- Polish .IP \(bu 2 Yasushi Masuda \-\- Japanese .IP \(bu 2 Guillem Borrell \-\- Spanish .IP \(bu 2 Luc Saffre and Peter Bertels \-\- Dutch .IP \(bu 2 Fred Lin \-\- Traditional Chinese .IP \(bu 2 Roger Demetrescu \-\- Brazilian Portuguese .IP \(bu 2 Rok Garbas \-\- Slovenian .UNINDENT .IP \(bu 2 The new config value \fBhighlight_language\fP set a global default for highlighting. When \fB\(aqpython3\(aq\fP is selected, console output blocks are recognized like for \fB\(aqpython\(aq\fP\&. .IP \(bu 2 Exposed Pygments\(aq lexer guessing as a highlight \(dqlanguage\(dq \fBguess\fP\&. .IP \(bu 2 The new config value \fBlatex_elements\fP allows to override all LaTeX snippets that Sphinx puts into the generated .tex file by default. .IP \(bu 2 Added \fBexclude_dirnames\fP config value that can be used to exclude e.g. CVS directories from source file search. .IP \(bu 2 Added \fBsource_encoding\fP config value to select input encoding. .UNINDENT .IP \(bu 2 Extensions: .INDENT 2.0 .IP \(bu 2 The new extensions \fBsphinx.ext.jsmath\fP and \fBsphinx.ext.pngmath\fP provide math support for both HTML and LaTeX builders. .IP \(bu 2 The new extension \fBsphinx.ext.intersphinx\fP half\-automatically creates links to Sphinx documentation of Python objects in other projects. .IP \(bu 2 The new extension \fBsphinx.ext.todo\fP allows the insertion of \(dqTo do\(dq directives whose visibility in the output can be toggled. It also adds a directive to compile a list of all todo items. .IP \(bu 2 sphinx.ext.autodoc has a new event \fBautodoc\-process\-signature\fP that allows tuning function signature introspection. .IP \(bu 2 sphinx.ext.autodoc has a new event \fBautodoc\-skip\-member\fP that allows tuning which members are included in the generated content. .IP \(bu 2 Respect \fB__all__\fP when autodocumenting module members. .IP \(bu 2 The \fBautomodule\fP directive now supports the \fBsynopsis\fP, \fBdeprecated\fP and \fBplatform\fP options. .UNINDENT .IP \(bu 2 Extension API: .INDENT 2.0 .IP \(bu 2 \fBSphinx.add_node()\fP now takes optional visitor methods for the HTML, LaTeX and text translators; this prevents having to manually patch the classes. .IP \(bu 2 Added \fBSphinx.add_javascript()\fP that adds scripts to load in the default HTML template. .IP \(bu 2 Added new events: \fBsource\-read\fP, \fBenv\-updated\fP, \fBenv\-purge\-doc\fP, \fBmissing\-reference\fP, \fBbuild\-finished\fP\&. .UNINDENT .IP \(bu 2 Other changes: .INDENT 2.0 .IP \(bu 2 Added a command\-line switch \fB\-Q\fP: it will suppress warnings. .IP \(bu 2 Added a command\-line switch \fB\-A\fP: it can be used to supply additional values into the HTML templates. .IP \(bu 2 Added a command\-line switch \fB\-C\fP: if it is given, no configuration file \fBconf.py\fP is required. .IP \(bu 2 Added a distutils command \fBbuild_sphinx\fP: When Sphinx is installed, you can call \fBpython setup.py build_sphinx\fP for projects that have Sphinx documentation, which will build the docs and place them in the standard distutils build directory. .IP \(bu 2 In quickstart, if the selected root path already contains a Sphinx project, complain and abort. .UNINDENT .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 #51: Escape configuration values placed in HTML templates. .IP \(bu 2 #44: Fix small problems in HTML help index generation. .IP \(bu 2 Fix LaTeX output for line blocks in tables. .IP \(bu 2 #38: Fix \(dqillegal unit\(dq error when using pixel image widths/heights. .IP \(bu 2 Support table captions in LaTeX output. .IP \(bu 2 #39: Work around a bug in Jinja that caused \(dq<generator ...>\(dq to be emitted in HTML output. .IP \(bu 2 Fix a problem with module links not being generated in LaTeX output. .IP \(bu 2 Fix the handling of images in different directories. .IP \(bu 2 #29: Support option lists in the text writer. Make sure that dashes introducing long option names are not contracted to en\-dashes. .IP \(bu 2 Support the \(dqscale\(dq option for images in HTML output. .IP \(bu 2 #25: Properly escape quotes in HTML help attribute values. .IP \(bu 2 Fix LaTeX build for some description environments with \fB:noindex:\fP\&. .IP \(bu 2 #24: Don\(aqt crash on uncommon casing of role names (like \fB:Class:\fP). .IP \(bu 2 Only output ANSI colors on color terminals. .IP \(bu 2 Update to newest fncychap.sty, to fix problems with non\-ASCII characters at the start of chapter titles. .IP \(bu 2 Fix a problem with index generation in LaTeX output, caused by hyperref not being included last. .IP \(bu 2 Don\(aqt disregard return annotations for functions without any parameters. .IP \(bu 2 Don\(aqt throw away labels for code blocks. .UNINDENT .SS Sphinx 0.4 .SS Release 0.4.3 (Oct 8, 2008) .INDENT 0.0 .IP \(bu 2 Fix a bug in autodoc with directly given autodoc members. .IP \(bu 2 Fix a bug in autodoc that would import a module twice, once as \(dqmodule\(dq, once as \(dqmodule.\(dq. .IP \(bu 2 Fix a bug in the HTML writer that created duplicate \fBid\fP attributes for section titles with Docutils 0.5. .IP \(bu 2 Properly call \fBsuper()\fP in overridden blocks in templates. .IP \(bu 2 Add a fix when using XeTeX. .IP \(bu 2 Unify handling of LaTeX escaping. .IP \(bu 2 Rebuild everything when the \fBextensions\fP config value changes. .IP \(bu 2 Don\(aqt try to remove a nonexisting static directory. .IP \(bu 2 Fix an indentation problem in production lists. .IP \(bu 2 Fix encoding handling for literal include files: \fBliteralinclude\fP now has an \fBencoding\fP option that defaults to UTF\-8. .IP \(bu 2 Fix the handling of non\-ASCII characters entered in quickstart. .IP \(bu 2 Fix a crash with nonexisting image URIs. .UNINDENT .SS Release 0.4.2 (Jul 29, 2008) .INDENT 0.0 .IP \(bu 2 Fix rendering of the \fBsamp\fP role in HTML. .IP \(bu 2 Fix a bug with LaTeX links to headings leading to a wrong page. .IP \(bu 2 Reread documents with globbed toctrees when source files are added or removed. .IP \(bu 2 Add a missing parameter to PickleHTMLBuilder.handle_page(). .IP \(bu 2 Put inheritance info always on its own line. .IP \(bu 2 Don\(aqt automatically enclose code with whitespace in it in quotes; only do this for the \fBsamp\fP role. .IP \(bu 2 autodoc now emits a more precise error message when a module can\(aqt be imported or an attribute can\(aqt be found. .IP \(bu 2 The JavaScript search now uses the correct file name suffix when referring to found items. .IP \(bu 2 The automodule directive now accepts the \fBinherited\-members\fP and \fBshow\-inheritance\fP options again. .IP \(bu 2 You can now rebuild the docs normally after relocating the source and/or doctree directory. .UNINDENT .SS Release 0.4.1 (Jul 5, 2008) .INDENT 0.0 .IP \(bu 2 Added sub\-/superscript node handling to TextBuilder. .IP \(bu 2 Label names in references are now case\-insensitive, since reST label names are always lowercased. .IP \(bu 2 Fix linkcheck builder crash for malformed URLs. .IP \(bu 2 Add compatibility for admonitions and Docutils 0.5. .IP \(bu 2 Remove the silly restriction on \(dqrubric\(dq in the LaTeX writer: you can now write arbitrary \(dqrubric\(dq directives, and only those with a title of \(dqFootnotes\(dq will be ignored. .IP \(bu 2 Copy the HTML logo to the output \fB_static\fP directory. .IP \(bu 2 Fix LaTeX code for modules with underscores in names and platforms. .IP \(bu 2 Fix a crash with nonlocal image URIs. .IP \(bu 2 Allow the usage of :noindex: in \fBautomodule\fP directives, as documented. .IP \(bu 2 Fix the \fBdelete()\fP docstring processor function in autodoc. .IP \(bu 2 Fix warning message for nonexisting images. .IP \(bu 2 Fix JavaScript search in Internet Explorer. .UNINDENT .SS Release 0.4 (Jun 23, 2008) .SS New features added .INDENT 0.0 .IP \(bu 2 \fBtocdepth\fP can be given as a file\-wide metadata entry, and specifies the maximum depth of a TOC of this file. .IP \(bu 2 The new config value \fBdefault_role\fP can be used to select the default role for all documents. .IP \(bu 2 Sphinx now interprets field lists with fields like \fB:param foo:\fP in description units. .IP \(bu 2 The new \fBstaticmethod\fP directive can be used to mark methods as static methods. .IP \(bu 2 HTML output: .INDENT 2.0 .IP \(bu 2 The \(dqprevious\(dq and \(dqnext\(dq links have a more logical structure, so that by following \(dqnext\(dq links you can traverse the entire TOC tree. .IP \(bu 2 The new event \fBhtml\-page\-context\fP can be used to include custom values into the context used when rendering an HTML template. .IP \(bu 2 Document metadata is now in the default template context, under the name \fBmetadata\fP\&. .IP \(bu 2 The new config value \fBhtml_favicon\fP can be used to set a favicon for the HTML output. Thanks to Sebastian Wiesner. .IP \(bu 2 The new config value \fBhtml_use_index\fP can be used to switch index generation in HTML documents off. .IP \(bu 2 The new config value \fBhtml_split_index\fP can be used to create separate index pages for each letter, to be used when the complete index is too large for one page. .IP \(bu 2 The new config value \fBhtml_short_title\fP can be used to set a shorter title for the documentation which is then used in the navigation bar. .IP \(bu 2 The new config value \fBhtml_show_sphinx\fP can be used to control whether a link to Sphinx is added to the HTML footer. .IP \(bu 2 The new config value \fBhtml_file_suffix\fP can be used to set the HTML file suffix to e.g. \fB\&.xhtml\fP\&. .IP \(bu 2 The directories in the \fBhtml_static_path\fP can now contain subdirectories. .IP \(bu 2 The module index now isn\(aqt collapsed if the number of submodules is larger than the number of toplevel modules. .UNINDENT .IP \(bu 2 The image directive now supports specifying the extension as \fB\&.*\fP, which makes the builder select the one that matches best. Thanks to Sebastian Wiesner. .IP \(bu 2 The new config value \fBexclude_trees\fP can be used to exclude whole subtrees from the search for source files. .IP \(bu 2 Defaults for configuration values can now be callables, which allows dynamic defaults. .IP \(bu 2 The new TextBuilder creates plain\-text output. .IP \(bu 2 Python 3\-style signatures, giving a return annotation via \fB\->\fP, are now supported. .IP \(bu 2 Extensions: .INDENT 2.0 .IP \(bu 2 The autodoc extension now offers a much more flexible way to manipulate docstrings before including them into the output, via the new \fBautodoc\-process\-docstring\fP event. .IP \(bu 2 The \fBautodoc\fP extension accepts signatures for functions, methods and classes now that override the signature got via introspection from Python code. .IP \(bu 2 The \fBautodoc\fP extension now offers a \fBshow\-inheritance\fP option for autoclass that inserts a list of bases after the signature. .IP \(bu 2 The autodoc directives now support the \fBnoindex\fP flag option. .UNINDENT .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 Correctly report the source location for docstrings included with autodoc. .IP \(bu 2 Fix the LaTeX output of description units with multiple signatures. .IP \(bu 2 Handle the figure directive in LaTeX output. .IP \(bu 2 Handle raw admonitions in LaTeX output. .IP \(bu 2 Fix determination of the title in HTML help output. .IP \(bu 2 Handle project names containing spaces. .IP \(bu 2 Don\(aqt write SSI\-like comments in HTML output. .IP \(bu 2 Rename the \(dqsidebar\(dq class to \(dqsphinxsidebar\(dq in order to stay different from reST sidebars. .IP \(bu 2 Use a binary TOC in HTML help generation to fix issues links without explicit anchors. .IP \(bu 2 Fix behavior of references to functions/methods with an explicit title. .IP \(bu 2 Support citation, subscript and superscript nodes in LaTeX writer. .IP \(bu 2 Provide the standard \(dqclass\(dq directive as \(dqcssclass\(dq; else it is shadowed by the Sphinx\-defined directive. .IP \(bu 2 Fix the handling of explicit module names given to autoclass directives. They now show up with the correct module name in the generated docs. .IP \(bu 2 Enable autodoc to process Unicode docstrings. .IP \(bu 2 The LaTeX writer now translates line blocks with \fB\eraggedright\fP, which plays nicer with tables. .IP \(bu 2 Fix bug with directories in the HTML builder static path. .UNINDENT .SS Sphinx 0.3 .SS Release 0.3 (May 6, 2008) .SS New features added .INDENT 0.0 .IP \(bu 2 The \fBtoctree\fP directive now supports a \fBglob\fP option that allows glob\-style entries in the content. .IP \(bu 2 If the \fBpygments_style\fP config value contains a dot it\(aqs treated as the import path of a custom Pygments style class. .IP \(bu 2 A new config value, \fBexclude_dirs\fP, can be used to exclude whole directories from the search for source files. .IP \(bu 2 The configuration directory (containing \fBconf.py\fP) can now be set independently from the source directory. For that, a new command\-line option \fB\-c\fP has been added. .IP \(bu 2 A new directive \fBtabularcolumns\fP can be used to give a tabular column specification for LaTeX output. Tables now use the \fBtabulary\fP package. Literal blocks can now be placed in tables, with several caveats. .IP \(bu 2 A new config value, \fBlatex_use_parts\fP, can be used to enable parts in LaTeX documents. .IP \(bu 2 Autodoc now skips inherited members for classes, unless you give the new \fBinherited\-members\fP option. .IP \(bu 2 A new config value, \fBautoclass_content\fP, selects if the docstring of the class\(aq \fB__init__\fP method is added to the directive\(aqs body. .IP \(bu 2 Support for C++ class names (in the style \fBClass::Function\fP) in C function descriptions. .IP \(bu 2 Support for a \fBtoctree_only\fP item in items for the \fBlatex_documents\fP config value. This only includes the documents referenced by TOC trees in the output, not the rest of the file containing the directive. .UNINDENT .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 sphinx.htmlwriter: Correctly write the TOC file for any structure of the master document. Also encode non\-ASCII characters as entities in TOC and index file. Remove two remaining instances of hard\-coded \(dqdocumentation\(dq. .IP \(bu 2 sphinx.ext.autodoc: descriptors are detected properly now. .IP \(bu 2 sphinx.latexwriter: implement all reST admonitions, not just \fBnote\fP and \fBwarning\fP\&. .IP \(bu 2 Lots of little fixes to the LaTeX output and style. .IP \(bu 2 Fix OpenSearch template and make template URL absolute. The \fBhtml_use_opensearch\fP config value now must give the base URL. .IP \(bu 2 Some unused files are now stripped from the HTML help file build. .UNINDENT .SS Sphinx 0.2 .SS Release 0.2 (Apr 27, 2008) .SS Incompatible changes .INDENT 0.0 .IP \(bu 2 Jinja, the template engine used for the default HTML templates, is now no longer shipped with Sphinx. If it is not installed automatically for you (it is now listed as a dependency in \fBsetup.py\fP), install it manually from PyPI. This will also be needed if you\(aqre using Sphinx from a SVN checkout; in that case please also remove the \fBsphinx/jinja\fP directory that may be left over from old revisions. .IP \(bu 2 The clumsy handling of the \fBindex.html\fP template was removed. The config value \fBhtml_index\fP is gone, and \fBhtml_additional_pages\fP should be used instead. If you need it, the old \fBindex.html\fP template is still there, called \fBdefindex.html\fP, and you can port your html_index template, using Jinja inheritance, by changing your template: .INDENT 2.0 .INDENT 3.5 .sp .EX {% extends \(dqdefindex.html\(dq %} {% block tables %} \&... old html_index template content ... {% endblock %} .EE .UNINDENT .UNINDENT .sp and putting \fB\(aqindex\(aq: name of your template\fP in \fBhtml_additional_pages\fP\&. .IP \(bu 2 In the layout template, redundant \fBblock\fPs were removed; you should use Jinja\(aqs standard \fB{{ super() }}\fP mechanism instead, as explained in the (newly written) templating docs. .UNINDENT .SS New features added .INDENT 0.0 .IP \(bu 2 Extension API (Application object): .INDENT 2.0 .IP \(bu 2 Support a new method, \fBadd_crossref_type\fP\&. It works like \fBadd_description_unit\fP but the directive will only create a target and no output. .IP \(bu 2 Support a new method, \fBadd_transform\fP\&. It takes a standard Docutils \fBTransform\fP subclass which is then applied by Sphinx\(aqs reader on parsing reST document trees. .IP \(bu 2 Add support for other template engines than Jinja, by adding an abstraction called a \(dqtemplate bridge\(dq. This class handles rendering of templates and can be changed using the new configuration value \(dqtemplate_bridge\(dq. .IP \(bu 2 The config file itself can be an extension (if it provides a \fBsetup()\fP function). .UNINDENT .IP \(bu 2 Markup: .INDENT 2.0 .IP \(bu 2 New directive, \fBcurrentmodule\fP\&. It can be used to indicate the module name of the following documented things without creating index entries. .IP \(bu 2 Allow giving a different title to documents in the toctree. .IP \(bu 2 Allow giving multiple options in a \fBcmdoption\fP directive. .IP \(bu 2 Fix display of class members without explicit class name given. .UNINDENT .IP \(bu 2 Templates (HTML output): .INDENT 2.0 .IP \(bu 2 \fBindex.html\fP renamed to \fBdefindex.html\fP, see above. .IP \(bu 2 There\(aqs a new config value, \fBhtml_title\fP, that controls the overall \(dqtitle\(dq of the set of Sphinx docs. It is used instead everywhere instead of \(dqProjectname vX.Y documentation\(dq now. .IP \(bu 2 All references to \(dqdocumentation\(dq in the templates have been removed, so that it is now easier to use Sphinx for non\-documentation documents with the default templates. .IP \(bu 2 Templates now have an XHTML doctype, to be consistent with Docutils\(aq HTML output. .IP \(bu 2 You can now create an OpenSearch description file with the \fBhtml_use_opensearch\fP config value. .IP \(bu 2 You can now quickly include a logo in the sidebar, using the \fBhtml_logo\fP config value. .IP \(bu 2 There are new blocks in the sidebar, so that you can easily insert content into the sidebar. .UNINDENT .IP \(bu 2 LaTeX output: .INDENT 2.0 .IP \(bu 2 The \fBsphinx.sty\fP package was cleaned of unused stuff. .IP \(bu 2 You can include a logo in the title page with the \fBlatex_logo\fP config value. .IP \(bu 2 You can define the link colors and a border and background color for verbatim environments. .UNINDENT .UNINDENT .sp Thanks to Jacob Kaplan\-Moss, Talin, Jeroen Ruigrok van der Werven and Sebastian Wiesner for suggestions. .SS Bugs fixed .INDENT 0.0 .IP \(bu 2 sphinx.ext.autodoc: Don\(aqt check \fB__module__\fP for explicitly given members. Remove \(dqself\(dq in class constructor argument list. .IP \(bu 2 sphinx.htmlwriter: Don\(aqt use os.path for joining image HREFs. .IP \(bu 2 sphinx.htmlwriter: Don\(aqt use SmartyPants for HTML attribute values. .IP \(bu 2 sphinx.latexwriter: Implement option lists. Also, some other changes were made to \fBsphinx.sty\fP in order to enhance compatibility and remove old unused stuff. Thanks to Gael Varoquaux for that! .IP \(bu 2 sphinx.roles: Fix referencing glossary terms with explicit targets. .IP \(bu 2 sphinx.environment: Don\(aqt swallow TOC entries when resolving subtrees. .IP \(bu 2 sphinx.quickstart: Create a sensible default latex_documents setting. .IP \(bu 2 sphinx.builder, sphinx.environment: Gracefully handle some user error cases. .IP \(bu 2 sphinx.util: Follow symbolic links when searching for documents. .UNINDENT .SS Sphinx 0.1 .SS Release 0.1.61950 (Mar 26, 2008) .INDENT 0.0 .IP \(bu 2 sphinx.quickstart: Fix format string for Makefile. .UNINDENT .SS Release 0.1.61945 (Mar 26, 2008) .INDENT 0.0 .IP \(bu 2 sphinx.htmlwriter, sphinx.latexwriter: Support the \fB\&.. image::\fP directive by copying image files to the output directory. .IP \(bu 2 sphinx.builder: Consistently name \(dqspecial\(dq HTML output directories with a leading underscore; this means \fB_sources\fP and \fB_static\fP\&. .IP \(bu 2 sphinx.environment: Take dependent files into account when collecting the set of outdated sources. .IP \(bu 2 sphinx.directives: Record files included with \fB\&.. literalinclude::\fP as dependencies. .IP \(bu 2 sphinx.ext.autodoc: Record files from which docstrings are included as dependencies. .IP \(bu 2 sphinx.builder: Rebuild all HTML files in case of a template change. .IP \(bu 2 sphinx.builder: Handle unavailability of TOC relations (previous/ next chapter) more gracefully in the HTML builder. .IP \(bu 2 sphinx.latexwriter: Include fncychap.sty which doesn\(aqt seem to be very common in TeX distributions. Add a \fBclean\fP target in the latex Makefile. Really pass the correct paper and size options to the LaTeX document class. .IP \(bu 2 setup: On Python 2.4, don\(aqt egg\-depend on Docutils if a Docutils is already installed \-\- else it will be overwritten. .UNINDENT .SS Release 0.1.61843 (Mar 24, 2008) .INDENT 0.0 .IP \(bu 2 sphinx.quickstart: Really don\(aqt create a makefile if the user doesn\(aqt want one. .IP \(bu 2 setup: Don\(aqt install scripts twice, via setuptools entry points and distutils scripts. Only install via entry points. .IP \(bu 2 sphinx.builder: Don\(aqt recognize the HTML builder\(aqs copied source files (under \fB_sources\fP) as input files if the source suffix is \fB\&.txt\fP\&. .IP \(bu 2 sphinx.highlighting: Generate correct markup for LaTeX Verbatim environment escapes even if Pygments is not installed. .IP \(bu 2 sphinx.builder: The WebHTMLBuilder is now called PickleHTMLBuilder. .IP \(bu 2 sphinx.htmlwriter: Make parsed\-literal blocks work as expected, not highlighting them via Pygments. .IP \(bu 2 sphinx.environment: Don\(aqt error out on reading an empty source file. .UNINDENT .SS Release 0.1.61798 (Mar 23, 2008) .INDENT 0.0 .IP \(bu 2 sphinx: Work with Docutils SVN snapshots as well as 0.4. .IP \(bu 2 sphinx.ext.doctest: Make the group in which doctest blocks are placed selectable, and default to \fB\(aqdefault\(aq\fP\&. .IP \(bu 2 sphinx.ext.doctest: Replace \fB<BLANKLINE>\fP in doctest blocks by real blank lines for presentation output, and remove doctest options given inline. .IP \(bu 2 sphinx.environment: Move doctest_blocks out of block_quotes to support indented doctest blocks. .IP \(bu 2 sphinx.ext.autodoc: Render \fB\&.. automodule::\fP docstrings in a section node, so that module docstrings can contain proper sectioning. .IP \(bu 2 sphinx.ext.autodoc: Use the module\(aqs encoding for decoding docstrings, rather than requiring ASCII. .UNINDENT .SS Release 0.1.61611 (Mar 21, 2008) .INDENT 0.0 .IP \(bu 2 First public release. .UNINDENT .SS Projects using Sphinx .sp This is an incomplete list of projects that use Sphinx for their documentation. If you would like to add a project, please create an issue or pull request on GitHub \%<https://\:github\:.com/\:sphinx-doc/\:sphinx/>\&. .sp I\(aqve grouped the list into sections to make it easier to find interesting examples. .SS Documentation using the alabaster theme .INDENT 0.0 .IP \(bu 2 Alabaster \%<https://\:alabaster\:.readthedocs\:.io/> .IP \(bu 2 Blinker \%<https://\:blinker\:.readthedocs\:.io/> .IP \(bu 2 Calibre \%<https://\:manual\:.calibre-ebook\:.com/> .IP \(bu 2 CherryPy \%<https://\:cherrypy\:.readthedocs\:.io/> .IP \(bu 2 Click \%<https://\:click\:.palletsprojects\:.com/> (customized) .IP \(bu 2 coala \%<https://\:docs\:.coala\:.io/> (customized) .IP \(bu 2 CodePy \%<https://\:documen\:.tician\:.de/\:codepy/> .IP \(bu 2 Django Q \%<https://\:django-q\:.readthedocs\:.io/> .IP \(bu 2 Eve \%<https://\:docs\:.python-eve\:.org/> (Python REST API framework) .IP \(bu 2 Fabric \%<https://\:docs\:.fabfile\:.org/> .IP \(bu 2 Fityk \%<https://\:fityk\:.nieto\:.pl/> .IP \(bu 2 Flask \%<https://\:flask\:.palletsprojects\:.com/> .IP \(bu 2 Flask\-OpenID \%<https://\:pythonhosted\:.org/\:Flask-OpenID/> .IP \(bu 2 Invoke \%<https://\:docs\:.pyinvoke\:.org/> .IP \(bu 2 Jinja \%<https://\:jinja\:.palletsprojects\:.com/> .IP \(bu 2 Lino \%<https://\:www\:.lino-framework\:.org/> (customized) .IP \(bu 2 Linux kernel \%<https://\:www\:.kernel\:.org/\:doc/\:html/\:latest/\:index\:.html> (customized) .IP \(bu 2 marbl \%<https://\:getmarbl\:.readthedocs\:.io/> .IP \(bu 2 MeshPy \%<https://\:documen\:.tician\:.de/\:meshpy/> .IP \(bu 2 Molecule \%<https://\:molecule\:.readthedocs\:.io/> .IP \(bu 2 Momotor LTI \%<https://\:momotor\:.org/\:doc/\:lti/\:canvas/> .IP \(bu 2 Podman \%<https://\:docs\:.podman\:.io/> .IP \(bu 2 PyCUDA \%<https://\:documen\:.tician\:.de/\:pycuda/> .IP \(bu 2 PyOpenCL \%<https://\:documen\:.tician\:.de/\:pyopencl/> .IP \(bu 2 PyLangAcq \%<https://\:pylangacq\:.org/> .IP \(bu 2 python\-apt \%<https://\:apt-team\:.pages\:.debian\:.net/\:python-apt/> .IP \(bu 2 PyVisfile \%<https://\:documen\:.tician\:.de/\:pyvisfile/> .IP \(bu 2 Requests \%<https://\:requests\:.readthedocs\:.io/> .IP \(bu 2 searx \%<https://\:asciimoo\:.github\:.io/\:searx/> .IP \(bu 2 Spyder \%<https://\:docs\:.spyder-ide\:.org/> (customized) .IP \(bu 2 Tablib \%<http://\:docs\:.python-tablib\:.org/> .IP \(bu 2 urllib3 \%<https://\:urllib3\:.readthedocs\:.io/> (customized) .IP \(bu 2 Werkzeug \%<https://\:werkzeug\:.palletsprojects\:.com/> .IP \(bu 2 Write the Docs \%<https://\:www\:.writethedocs\:.org/> .UNINDENT .SS Documentation using the classic theme .INDENT 0.0 .IP \(bu 2 Advanced Generic Widgets \%<https://\:xoomer\:.virgilio\:.it/\:infinity77/\:AGW_Docs/> (customized) .IP \(bu 2 Apache CouchDB \%<https://\:docs\:.couchdb\:.org/> (customized) .IP \(bu 2 APSW \%<https://\:rogerbinns\:.github\:.io/\:apsw/> .IP \(bu 2 Arb \%<https://\:arblib\:.org/> .IP \(bu 2 Beautiful Soup \%<https://\:www\:.crummy\:.com/\:software/\:BeautifulSoup/\:bs4/\:doc/> .IP \(bu 2 Blender API \%<https://\:docs\:.blender\:.org/\:api/\:current/> .IP \(bu 2 Bugzilla \%<https://\:bugzilla\:.readthedocs\:.io/> .IP \(bu 2 Buildbot \%<https://\:docs\:.buildbot\:.net/\:latest/> .IP \(bu 2 CMake \%<https://\:cmake\:.org/\:documentation/> (customized) .IP \(bu 2 Chaco \%<https://\:docs\:.enthought\:.com/\:chaco/> (customized) .IP \(bu 2 DEAP \%<https://\:deap\:.readthedocs\:.io/> (customized) .IP \(bu 2 Director \%<https://\:pythonhosted\:.org/\:director/> .IP \(bu 2 EZ\-Draw \%<https://\:pageperso\:.lis-lab\:.fr/\:~edouard\:.thiel/\:ez-draw/\:doc/\:en/\:html/\:ez-manual\:.html> (customized) .IP \(bu 2 Generic Mapping Tools (GMT) \%<https://\:docs\:.generic-mapping-tools\:.org/\:latest/> (customized) .IP \(bu 2 Genomedata \%<https://\:noble\:.gs\:.washington\:.edu/\:proj/\:genomedata/\:doc/\:1\:.3\:.3/> .IP \(bu 2 GetFEM \%<https://\:getfem\:.org/> (customized) .IP \(bu 2 Glasgow Haskell Compiler \%<https://\:downloads\:.haskell\:.org/\:~ghc/\:latest/\:docs/\:html/\:users_guide/> (customized) .IP \(bu 2 Grok \%<https://\:web\:.archive\:.org/\:web/\:20230708190705/\:http://\:grok\:.zope\:.org/\:doc/\:current/> (customized) .IP \(bu 2 GROMACS \%<https://\:manual\:.gromacs\:.org/\:documentation/> .IP \(bu 2 GSL Shell \%<https://\:www\:.nongnu\:.org/\:gsl-shell/> .IP \(bu 2 Hands\-on Python Tutorial \%<http://\:anh\:.cs\:.luc\:.edu:80/\:python/\:hands-on/\:3\:.1/\:handsonHtml/> .IP \(bu 2 Kaa \%<https://\:freevo\:.github\:.io/\:kaa-base/> (customized) .IP \(bu 2 Leo \%<https://\:leo-editor\:.github\:.io/\:leo-editor/> (customized) .IP \(bu 2 Mayavi \%<https://\:docs\:.enthought\:.com/\:mayavi/\:mayavi/> (customized) .IP \(bu 2 MediaGoblin \%<https://\:mediagoblin\:.readthedocs\:.io/> (customized) .IP \(bu 2 mpmath \%<https://\:mpmath\:.org/\:doc/\:current/> .IP \(bu 2 OpenCV \%<https://\:docs\:.opencv\:.org/> (customized) .IP \(bu 2 OpenEXR \%<https://\:excamera\:.com/\:articles/\:26/\:doc/\:index\:.html> .IP \(bu 2 OpenGDA \%<https://\:alfred\:.diamond\:.ac\:.uk/\:documentation/> .IP \(bu 2 phpDocumentor \%<https://\:docs\:.phpdoc\:.org/> (customized) .IP \(bu 2 Plone \%<https://\:docs\:.plone\:.org/> (customized) .IP \(bu 2 PyEMD \%<https://\:pyemd\:.readthedocs\:.io/> .IP \(bu 2 Pyevolve \%<https://\:pyevolve\:.sourceforge\:.net/> .IP \(bu 2 Pygame \%<https://\:www\:.pygame\:.org/\:docs/> (customized) .IP \(bu 2 PyMQI \%<https://\:dsuch\:.github\:.io/\:pymqi/> .IP \(bu 2 PyQt4 \%<https://\:pyqt\:.sourceforge\:.net/\:Docs/\:PyQt4/> (customized) .IP \(bu 2 PyQt5 \%<https://\:pyqt\:.sourceforge\:.net/\:Docs/\:PyQt5/> (customized) .IP \(bu 2 Python 2 \%<https://\:docs\:.python\:.org/2/> .IP \(bu 2 Python 3 \%<https://\:docs\:.python\:.org/3/> (customized) .IP \(bu 2 Python Packaging Authority \%<https://\:www\:.pypa\:.io/> (customized) .IP \(bu 2 Ring programming language \%<https://\:ring-lang\:.github\:.io/\:doc1\:.20/> (customized) .IP \(bu 2 SageMath \%<https://\:doc\:.sagemath\:.org/> (customized) .IP \(bu 2 Segway \%<https://\:noble\:.gs\:.washington\:.edu/\:proj/\:segway/\:doc/\:1\:.1\:.0/\:segway\:.html> .IP \(bu 2 simuPOP \%<https://\:bopeng\:.github\:.io/\:simuPOP/> (customized) .IP \(bu 2 SymPy \%<https://\:docs\:.sympy\:.org/> .IP \(bu 2 TurboGears \%<https://\:turbogears\:.readthedocs\:.io/> (customized) .IP \(bu 2 tvtk \%<https://\:docs\:.enthought\:.com/\:mayavi/\:tvtk/> .IP \(bu 2 Varnish \%<https://\:www\:.varnish-cache\:.org/\:docs/> (customized, alabaster for index) .IP \(bu 2 Waf \%<https://\:waf\:.io/\:apidocs/> .IP \(bu 2 wxPython Phoenix \%<https://\:wxpython\:.org/\:Phoenix/\:docs/\:html/\:main\:.html> (customized) .IP \(bu 2 z3c \%<https://\:www\:.ibiblio\:.org/\:paulcarduner/\:z3ctutorial/> .IP \(bu 2 zc.async \%<https://\:pythonhosted\:.org/\:zc\:.async/> (customized) .IP \(bu 2 Zope \%<https://\:www\:.zope\:.dev/> (customized) .UNINDENT .SS Documentation using the sphinxdoc theme .INDENT 0.0 .IP \(bu 2 ABRT \%<https://\:abrt\:.readthedocs\:.io/> .IP \(bu 2 cartopy \%<https://\:scitools\:.org\:.uk/\:cartopy/\:docs/\:latest/> .IP \(bu 2 Jython \%<https://\:jython\:.readthedocs\:.io/> .IP \(bu 2 LLVM \%<https://\:llvm\:.org/\:docs/> .IP \(bu 2 PyCantonese \%<https://\:pycantonese\:.org/> .IP \(bu 2 Pyre \%<https://\:pyre\:.readthedocs\:.io/> .IP \(bu 2 pySPACE \%<https://\:pyspace\:.github\:.io/\:pyspace/> .IP \(bu 2 Pysparse \%<https://\:pysparse\:.sourceforge\:.net/> .IP \(bu 2 PyTango \%<https://\:pytango\:.readthedocs\:.io> .IP \(bu 2 Python Wild Magic \%<https://\:vmlaker\:.github\:.io/\:pythonwildmagic/> (customized) .IP \(bu 2 RDKit \%<https://\:www\:.rdkit\:.org/\:docs/> .IP \(bu 2 Reteisi \%<https://\:www\:.reteisi\:.org/\:contents\:.html> (customized) .IP \(bu 2 Turbulenz \%<http://\:docs\:.turbulenz\:.com/> .UNINDENT .SS Documentation using the nature theme .INDENT 0.0 .IP \(bu 2 Alembic \%<https://\:alembic\:.sqlalchemy\:.org/> .IP \(bu 2 Cython \%<https://\:docs\:.cython\:.org/> .IP \(bu 2 easybuild \%<https://\:easybuild\:.readthedocs\:.io/> .IP \(bu 2 libLAS \%<https://\:liblas\:.org/> (customized) .IP \(bu 2 Lmod \%<https://\:lmod\:.readthedocs\:.io/> .IP \(bu 2 MapServer \%<https://\:mapserver\:.org/> (customized) .IP \(bu 2 PyWavelets \%<https://\:pywavelets\:.readthedocs\:.io/> .IP \(bu 2 Setuptools \%<https://\:setuptools\:.readthedocs\:.io/> .IP \(bu 2 Spring Python \%<https://\:docs\:.spring\:.io/\:spring-python/\:1\:.2\:.x/\:sphinx/\:html/> .IP \(bu 2 StatsModels \%<https://\:www\:.statsmodels\:.org/> (customized) .IP \(bu 2 Sylli \%<https://\:sylli\:.sourceforge\:.net/> .UNINDENT .SS Documentation using another builtin theme .INDENT 0.0 .IP \(bu 2 Breathe \%<https://\:breathe\:.readthedocs\:.io/> (haiku) .IP \(bu 2 Breezy (fork of Bazaar) \%<https://\:www\:.breezy-vcs\:.org/\:doc/\:en/> (agogo) .IP \(bu 2 MPipe \%<https://\:vmlaker\:.github\:.io/\:mpipe/> (sphinx13) .IP \(bu 2 NLTK \%<https://\:www\:.nltk\:.org/> (agogo) .IP \(bu 2 PyPubSub \%<https://\:pypubsub\:.readthedocs\:.io/> (bizstyle) .IP \(bu 2 Pylons \%<https://\:docs\:.pylonsproject\:.org/\:projects/\:pylons-webframework/> (pyramid) .IP \(bu 2 Pyramid web framework \%<https://\:docs\:.pylonsproject\:.org/\:projects/\:pyramid/> (pyramid) .IP \(bu 2 RxDock \%<https://\:rxdock\:.gitlab\:.io/\:documentation/\:devel/\:html/> (bizstyle) .IP \(bu 2 Sphinx \%<https://\:www\:.sphinx-doc\:.org/> (sphinx13) :\-) .IP \(bu 2 Valence \%<https://\:docs\:.valence\:.desire2learn\:.com/> (haiku, customized) .UNINDENT .SS Documentation using Read the Docs Sphinx Theme .sp Read the Docs Sphinx Theme documentation \%<https://\:sphinx-rtd-theme\:.readthedocs\:.io/> .INDENT 0.0 .IP \(bu 2 Aesara (fork of Theano) \%<https://\:aesara\:.readthedocs\:.io/> .IP \(bu 2 Annotator \%<https://\:docs\:.annotatorjs\:.org/> .IP \(bu 2 Ansible \%<https://\:docs\:.ansible\:.com/> (customized) .IP \(bu 2 Arcade \%<https://\:arcade\:.academy/> .IP \(bu 2 aria2 \%<https://\:aria2\:.github\:.io/\:manual/\:en/\:html/> .IP \(bu 2 ASE \%<https://\:wiki\:.fysik\:.dtu\:.dk/\:ase/> .IP \(bu 2 asvin \%<https://\:asvin\:.readthedocs\:.io/> .IP \(bu 2 Autofac \%<https://\:docs\:.autofac\:.org/> .IP \(bu 2 BigchainDB \%<https://\:docs\:.bigchaindb\:.com/> .IP \(bu 2 Blender Reference Manual \%<https://\:docs\:.blender\:.org/\:manual/> .IP \(bu 2 Blocks \%<https://\:blocks\:.readthedocs\:.io/> .IP \(bu 2 bootstrap\-datepicker \%<https://\:bootstrap-datepicker\:.readthedocs\:.io/> .IP \(bu 2 Certbot \%<https://\:certbot\:.eff\:.org/\:docs/> .IP \(bu 2 CKAN \%<https://\:docs\:.ckan\:.org/> .IP \(bu 2 Copr Buildsystem \%<https://\:docs\:.pagure\:.org/\:copr\:.copr/> (customized) .IP \(bu 2 Coreboot \%<https://\:doc\:.coreboot\:.org/> .IP \(bu 2 Chainer \%<https://\:docs\:.chainer\:.org/> (customized) .IP \(bu 2 citeproc\-js \%<https://\:citeproc-js\:.readthedocs\:.io/> .IP \(bu 2 cloud\-init \%<https://\:cloudinit\:.readthedocs\:.io/> .IP \(bu 2 CodeIgniter \%<https://\:www\:.codeigniter\:.com/\:user_guide/> .IP \(bu 2 Conda \%<https://\:conda\:.io/\:docs/> .IP \(bu 2 Corda \%<https://\:docs\:.corda\:.net/> .IP \(bu 2 Dask \%<https://\:dask\:.pydata\:.org/> .IP \(bu 2 Databricks \%<https://\:docs\:.databricks\:.com/> (customized) .IP \(bu 2 Dataiku DSS \%<https://\:doc\:.dataiku\:.com/> .IP \(bu 2 DNF \%<https://\:dnf\:.readthedocs\:.io/> .IP \(bu 2 Distro Tracker \%<https://\:qa\:.pages\:.debian\:.net/\:distro-tracker/> .IP \(bu 2 Django\-cas\-ng \%<https://\:djangocas\:.dev/\:docs/> .IP \(bu 2 dj\-stripe \%<https://\:dj-stripe\:.github\:.io/\:dj-stripe/> .IP \(bu 2 edX \%<https://\:docs\:.edx\:.org/> .IP \(bu 2 Electrum \%<https://\:docs\:.electrum\:.org/> .IP \(bu 2 ESWP3 \%<https://\:eswp3\:.readthedocs\:.io/> .IP \(bu 2 Ethereum Homestead \%<https://\:www\:.ethdocs\:.org/> .IP \(bu 2 Exhale \%<https://\:exhale\:.readthedocs\:.io/> .IP \(bu 2 Faker \%<https://\:faker\:.readthedocs\:.io/> .IP \(bu 2 Fidimag \%<https://\:fidimag\:.readthedocs\:.io/> .IP \(bu 2 Flake8 \%<https://\:flake8\:.pycqa\:.org/> .IP \(bu 2 Flatpak \%<https://\:docs\:.flatpak\:.org/> .IP \(bu 2 FluidDyn \%<https://\:fluiddyn\:.readthedocs\:.io/> .IP \(bu 2 Fluidsim \%<https://\:fluidsim\:.readthedocs\:.io/> .IP \(bu 2 Gallium \%<https://\:gallium\:.readthedocs\:.io/> .IP \(bu 2 GeoNode \%<https://\:docs\:.geonode\:.org/> .IP \(bu 2 Glances \%<https://\:glances\:.readthedocs\:.io/> .IP \(bu 2 Godot \%<https://\:godot\:.readthedocs\:.io/> .IP \(bu 2 Graylog \%<https://\:docs\:.graylog\:.org/> .IP \(bu 2 GPAW \%<https://\:wiki\:.fysik\:.dtu\:.dk/\:gpaw/> (customized) .IP \(bu 2 HDF5 for Python (h5py) \%<https://\:docs\:.h5py\:.org/> .IP \(bu 2 HyperKitty \%<https://\:hyperkitty\:.readthedocs\:.io/> .IP \(bu 2 Hyperledger Fabric \%<https://\:hyperledger-fabric\:.readthedocs\:.io/> .IP \(bu 2 IdentityServer \%<https://\:docs\:.identityserver\:.io/> .IP \(bu 2 Idris \%<https://\:docs\:.idris-lang\:.org/> .IP \(bu 2 Inkscape \%<https://\:inkscape-manuals\:.readthedocs\:.io/> (customized) .IP \(bu 2 javasphinx \%<https://\:bronto-javasphinx\:.readthedocs\:.io/> .IP \(bu 2 Jupyter Notebook \%<https://\:jupyter-notebook\:.readthedocs\:.io/> .IP \(bu 2 Kanboard \%<https://\:docs\:.kanboard\:.org/> .IP \(bu 2 Lasagne \%<https://\:lasagne\:.readthedocs\:.io/> .IP \(bu 2 latexindent.pl \%<https://\:latexindentpl\:.readthedocs\:.io/> .IP \(bu 2 Learning Apache Spark with Python \%<https://\:runawayhorse001\:.github\:.io/\:LearningApacheSpark> .IP \(bu 2 LibCEED \%<https://\:libceed\:.readthedocs\:.io/> .IP \(bu 2 Linguistica \%<https://\:linguistica-uchicago\:.github\:.io/\:lxa5/> .IP \(bu 2 Mailman \%<https://\:docs\:.list\:.org/> .IP \(bu 2 MathJax \%<https://\:docs\:.mathjax\:.org/> .IP \(bu 2 MDTraj \%<https://\:mdtraj\:.org/> (customized) .IP \(bu 2 Mesa 3D \%<https://\:docs\:.mesa3d\:.org/> .IP \(bu 2 micca \- MICrobial Community Analysis \%<https://\:micca\:.readthedocs\:.io/> .IP \(bu 2 MicroPython \%<https://\:docs\:.micropython\:.org/> .IP \(bu 2 Mink \%<https://\:mink\:.behat\:.org/> .IP \(bu 2 Mockery \%<https://\:docs\:.mockery\:.io/> .IP \(bu 2 mod_wsgi \%<https://\:modwsgi\:.readthedocs\:.io/> .IP \(bu 2 MoinMoin \%<https://\:moin-20\:.readthedocs\:.io/> .IP \(bu 2 Mopidy \%<https://\:docs\:.mopidy\:.com/> .IP \(bu 2 mpi4py \%<https://\:mpi4py\:.readthedocs\:.io/> .IP \(bu 2 MyHDL \%<https://\:docs\:.myhdl\:.org/> .IP \(bu 2 Mypy \%<https://\:mypy\:.readthedocs\:.io/> .IP \(bu 2 Netgate Docs \%<https://\:docs\:.netgate\:.com/> .IP \(bu 2 Nextcloud Server \%<https://\:docs\:.nextcloud\:.com/#\:server> .IP \(bu 2 Nextflow \%<https://\:www\:.nextflow\:.io/\:docs/\:latest/\:index\:.html> .IP \(bu 2 nghttp2 \%<https://\:nghttp2\:.org/\:documentation/> .IP \(bu 2 NICOS \%<https://\:forge\:.frm2\:.tum\:.de/\:nicos/\:doc/\:nicos-master/> (customized) .IP \(bu 2 OpenFAST \%<https://\:openfast\:.readthedocs\:.io/> .IP \(bu 2 Panda3D \%<https://\:docs\:.panda3d\:.org/> (customized) .IP \(bu 2 Pelican \%<https://\:docs\:.getpelican\:.com/> .IP \(bu 2 picamera \%<https://\:picamera\:.readthedocs\:.io/> .IP \(bu 2 Pillow \%<https://\:pillow\:.readthedocs\:.io/> .IP \(bu 2 pip \%<https://\:pip\:.pypa\:.io/> .IP \(bu 2 Paver \%<https://\:paver\:.readthedocs\:.io/> .IP \(bu 2 peewee \%<https://\:docs\:.peewee-orm\:.com/> .IP \(bu 2 Phinx \%<https://\:docs\:.phinx\:.org/> .IP \(bu 2 phpMyAdmin \%<https://\:docs\:.phpmyadmin\:.net/> .IP \(bu 2 PHPUnit \%<https://\:phpunit\:.readthedocs\:.io/> .IP \(bu 2 PHPWord \%<https://\:phpword\:.readthedocs\:.io/> .IP \(bu 2 PROS \%<https://\:pros\:.cs\:.purdue\:.edu/\:v5/> (customized) .IP \(bu 2 Pweave \%<https://\:mpastell\:.com/\:pweave/> .IP \(bu 2 pyca/cryptograhpy \%<https://\:cryptography\:.io/> .IP \(bu 2 pyglet \%<https://\:pyglet\:.readthedocs\:.io/> .IP \(bu 2 PyNaCl \%<https://\:pynacl\:.readthedocs\:.io/> .IP \(bu 2 pyOpenSSL \%<https://\:www\:.pyopenssl\:.org/> .IP \(bu 2 PyPy \%<https://\:doc\:.pypy\:.org/> .IP \(bu 2 python\-sqlparse \%<https://\:sqlparse\:.readthedocs\:.io/> .IP \(bu 2 PyVISA \%<https://\:pyvisa\:.readthedocs\:.io/> .IP \(bu 2 Read The Docs \%<https://\:docs\:.readthedocs\:.io/> .IP \(bu 2 RenderDoc \%<https://\:renderdoc\:.org/\:docs/> .IP \(bu 2 ROCm Platform \%<https://\:rocmdocs\:.amd\:.com/> .IP \(bu 2 Free your information from their silos (French) \%<https://\:redaction-technique\:.org/> (customized) .IP \(bu 2 Releases Sphinx extension \%<https://\:releases\:.readthedocs\:.io/> .IP \(bu 2 Qtile \%<https://\:docs\:.qtile\:.org/> .IP \(bu 2 Quex \%<https://\:quex\:.sourceforge\:.net/\:doc/\:html/\:main\:.html> .IP \(bu 2 QuTiP \%<https://\:qutip\:.readthedocs\:.io/\:en/\:latest/> .IP \(bu 2 Sawtooth \%<https://\:sawtooth\:.splinter\:.dev/\:docs> .IP \(bu 2 Scapy \%<https://\:scapy\:.readthedocs\:.io/> .IP \(bu 2 SimGrid \%<https://\:simgrid\:.org/\:doc/\:latest/> .IP \(bu 2 SimPy \%<https://\:simpy\:.readthedocs\:.io/> .IP \(bu 2 six \%<https://\:six\:.readthedocs\:.io/> .IP \(bu 2 Solidity \%<https://\:solidity\:.readthedocs\:.io/> .IP \(bu 2 Sonos Controller (SoCo) \%<https://\:docs\:.python-soco\:.com/> .IP \(bu 2 Sphinx AutoAPI \%<https://\:sphinx-autoapi\:.readthedocs\:.io/> .IP \(bu 2 sphinx\-argparse \%<https://\:sphinx-argparse\:.readthedocs\:.io/> .IP \(bu 2 sphinx\-tabs \%<https://\:sphinx-tabs\:.readthedocs\:.io/> .IP \(bu 2 Sphinx\-Gallery \%<https://\:sphinx-gallery\:.readthedocs\:.io/> (customized) .IP \(bu 2 Sphinx with Github Webpages \%<https://\:runawayhorse001\:.github\:.io/\:SphinxGithub> .IP \(bu 2 SpotBugs \%<https://\:spotbugs\:.readthedocs\:.io/> .IP \(bu 2 StarUML \%<https://\:docs\:.staruml\:.io/> .IP \(bu 2 Sublime Text Unofficial Documentation \%<https://\:docs\:.sublimetext\:.info/> .IP \(bu 2 SunPy \%<https://\:docs\:.sunpy\:.org/> .IP \(bu 2 Sylius \%<https://\:docs\:.sylius\:.com/> .IP \(bu 2 Syncthing \%<https://\:docs\:.syncthing\:.net/> .IP \(bu 2 Tango Controls \%<https://\:tango-controls\:.readthedocs\:.io/> (customized) .IP \(bu 2 ThreatConnect \%<https://\:docs\:.threatconnect\:.com/> .IP \(bu 2 TrueNAS \%<https://\:www\:.ixsystems\:.com/\:documentation/\:truenas/> (customized) .IP \(bu 2 Tuleap \%<https://\:tuleap\:.net/\:doc/\:en/> .IP \(bu 2 TYPO3 \%<https://\:docs\:.typo3\:.org/> (customized) .IP \(bu 2 Veyon \%<https://\:docs\:.veyon\:.io/> .IP \(bu 2 Ubiquity \%<https://\:micro-framework\:.readthedocs\:.io/> .IP \(bu 2 uWSGI \%<https://\:uwsgi-docs\:.readthedocs\:.io/> .IP \(bu 2 virtualenv \%<https://\:virtualenv\:.readthedocs\:.io/> .IP \(bu 2 Wagtail \%<https://\:docs\:.wagtail\:.io/> .IP \(bu 2 Web Application Attack and Audit Framework (w3af) \%<https://\:docs\:.w3af\:.org/> .IP \(bu 2 Weblate \%<https://\:docs\:.weblate\:.org/> .IP \(bu 2 x265 \%<https://\:x265\:.readthedocs\:.io/> .IP \(bu 2 Zeek \%<https://\:docs\:.zeek\:.org/> .IP \(bu 2 Zulip \%<https://\:zulip\:.readthedocs\:.io/> .UNINDENT .SS Documentation using Sphinx Bootstrap Theme .sp Sphinx Bootstrap Theme documentation \%<https://\:ryan-roemer\:.github\:.io/\:sphinx-bootstrap-theme/> .INDENT 0.0 .IP \(bu 2 Bootstrap Theme \%<https://\:ryan-roemer\:.github\:.io/\:sphinx-bootstrap-theme/> .IP \(bu 2 C/C++ Software Development with Eclipse \%<https://\:eclipsebook\:.in/> .IP \(bu 2 Dataverse \%<https://\:guides\:.dataverse\:.org/> .IP \(bu 2 e\-cidadania \%<https://\:e-cidadania\:.readthedocs\:.io/> .IP \(bu 2 Hangfire \%<https://\:docs\:.hangfire\:.io/> .IP \(bu 2 Hedge \%<https://\:documen\:.tician\:.de/\:hedge/> .IP \(bu 2 ObsPy \%<https://\:docs\:.obspy\:.org/> .IP \(bu 2 OPNFV \%<https://\:docs\:.opnfv\:.org/> .IP \(bu 2 Pootle \%<https://\:docs\:.translatehouse\:.org/\:projects/\:pootle/> .IP \(bu 2 PyUblas \%<https://\:documen\:.tician\:.de/\:pyublas/> .IP \(bu 2 seaborn \%<https://\:seaborn\:.pydata\:.org/> .UNINDENT .SS Documentation using PyData Sphinx Theme .sp Pydata Sphinx Theme documentation \%<https://\:pydata-sphinx-theme\:.readthedocs\:.io/> .INDENT 0.0 .IP \(bu 2 Arviz \%<https://\:python\:.arviz\:.org/\:en/\:stable/> .IP \(bu 2 Astropy \%<https://\:docs\:.astropy\:.org/> .IP \(bu 2 Binder \%<https://\:mybinder\:.readthedocs\:.io/\:en/\:latest/> .IP \(bu 2 Bokeh \%<https://\:docs\:.bokeh\:.org/\:en/\:latest/> .IP \(bu 2 CuPy \%<https://\:docs\:.cupy\:.dev/\:en/\:stable/> .IP \(bu 2 DAMASK \%<https://\:damask-multiphysics\:.org/> .IP \(bu 2 EnOSlib \%<https://\:discovery\:.gitlabpages\:.inria\:.fr/\:enoslib/> .IP \(bu 2 Fairlearn \%<https://\:fairlearn\:.org/\:main/> .IP \(bu 2 Feature\-engine \%<https://\:feature-engine\:.readthedocs\:.io/\:en/\:latest/> .IP \(bu 2 Jupyter \%<https://\:docs\:.jupyter\:.org/\:en/\:latest/> .IP \(bu 2 Jupyter Book \%<https://\:jupyterbook\:.org/\:en/\:stable/\:intro\:.html> .IP \(bu 2 Matplotlib \%<https://\:matplotlib\:.org/\:stable/\:index\:.html> .IP \(bu 2 MegEngine \%<https://\:megengine\:.org\:.cn/\:doc/\:stable/\:en/> .IP \(bu 2 MNE\-Python \%<https://\:mne\:.tools/\:stable/> .IP \(bu 2 NetworkX \%<https://\:networkx\:.org/\:documentation/\:stable/> .IP \(bu 2 Numpy \%<https://\:numpy\:.org/\:doc/\:stable/> .IP \(bu 2 Pandas \%<https://\:pandas\:.pydata\:.org/\:docs/> .IP \(bu 2 PhaseFieldX \%<https://\:phasefieldx\:.readthedocs\:.io/> .IP \(bu 2 Pystra (continuation of PyRe) \%<https://\:pystra\:.github\:.io/\:pystra/> .IP \(bu 2 PyVista \%<https://\:docs\:.pyvista\:.org/> .IP \(bu 2 SciPy \%<https://\:docs\:.scipy\:.org/\:doc/\:scipy/> .IP \(bu 2 Seaborn \%<https://\:seaborn\:.pydata\:.org/> .IP \(bu 2 SEPAL \%<https://\:docs\:.sepal\:.io/\:en/\:latest/\:index\:.html> .UNINDENT .SS Documentation using Furo theme .sp Furo theme documentation \%<https://\:pradyunsg\:.me/\:furo/> .INDENT 0.0 .IP \(bu 2 Furo theme \%<https://\:pradyunsg\:.me/\:furo/> .IP \(bu 2 pytest \%<https://\:docs\:.pytest\:.org/> .IP \(bu 2 Python Packaging User Guide \%<https://\:packaging\:.python\:.org/> .IP \(bu 2 Python Developer\(aqs Guide \%<https://\:devguide\:.python\:.org/> .UNINDENT .SS Documentation using a custom theme or integrated in a website .INDENT 0.0 .IP \(bu 2 AIOHTTP \%<https://\:docs\:.aiohttp\:.org/> .IP \(bu 2 Apache Cassandra \%<https://\:cassandra\:.apache\:.org/\:doc/> .IP \(bu 2 Boto 3 \%<https://\:boto3\:.readthedocs\:.io/> .IP \(bu 2 CakePHP \%<https://\:book\:.cakephp\:.org/> .IP \(bu 2 Ceph \%<https://\:docs\:.ceph\:.com/\:docs/\:master/> .IP \(bu 2 Chef \%<https://\:docs\:.chef\:.io/> .IP \(bu 2 CKAN \%<https://\:docs\:.ckan\:.org/> .IP \(bu 2 Confluent Platform \%<https://\:docs\:.confluent\:.io/> .IP \(bu 2 Django \%<https://\:docs\:.djangoproject\:.com/> .IP \(bu 2 django CMS \%<https://\:docs\:.django-cms\:.org/> .IP \(bu 2 Doctrine \%<https://\:www\:.doctrine-project\:.org/> .IP \(bu 2 Enterprise Toolkit for Acrobat products \%<https://\:www\:.adobe\:.com/\:devnet-docs/\:acrobatetk/> .IP \(bu 2 FreeFEM \%<https://\:doc\:.freefem\:.org/\:introduction/> .IP \(bu 2 fmt \%<https://\:fmt\:.dev/> .IP \(bu 2 Gameduino \%<https://\:excamera\:.com/\:sphinx/\:gameduino/> .IP \(bu 2 gensim \%<https://\:radimrehurek\:.com/\:gensim/> .IP \(bu 2 GeoServer \%<https://\:docs\:.geoserver\:.org/> .IP \(bu 2 gevent \%<https://\:www\:.gevent\:.org/> .IP \(bu 2 GHC \- Glasgow Haskell Compiler \%<https://\:downloads\:.haskell\:.org/\:~ghc/\:master/\:users-guide/> .IP \(bu 2 Guzzle \%<https://\:docs\:.guzzlephp\:.org/> .IP \(bu 2 H2O.ai \%<https://\:docs\:.h2o\:.ai/> .IP \(bu 2 Heka \%<https://\:hekad\:.readthedocs\:.io/> .IP \(bu 2 Istihza (Turkish Python documentation project) \%<https://\:python-istihza\:.yazbel\:.com/> .IP \(bu 2 JupyterHub \%<https://\:jupyterhub\:.readthedocs\:.io/> .IP \(bu 2 Kombu \%<https://\:kombu\:.readthedocs\:.io/> .IP \(bu 2 Lasso \%<http://\:www\:.lassoguide\:.com/> .IP \(bu 2 Mako \%<https://\:docs\:.makotemplates\:.org/> .IP \(bu 2 MirrorBrain \%<https://\:mirrorbrain-docs\:.readthedocs\:.io/> .IP \(bu 2 Mitiq \%<https://\:mitiq\:.readthedocs\:.io/> .IP \(bu 2 MongoDB \%<https://\:docs\:.mongodb\:.com/> .IP \(bu 2 Music21 \%<https://\:web\:.mit\:.edu/\:music21/\:doc/> .IP \(bu 2 MyHDL \%<https://\:docs\:.myhdl\:.org/> .IP \(bu 2 ndnSIM \%<https://\:ndnsim\:.net/\:current/> .IP \(bu 2 nose \%<https://\:nose\:.readthedocs\:.io/> .IP \(bu 2 ns\-3 \%<https://\:www\:.nsnam\:.org/\:documentation/> .IP \(bu 2 ObjectListView \%<https://\:objectlistview\:.sourceforge\:.net/\:python/> .IP \(bu 2 OpenERP \%<https://\:doc\:.odoo\:.com/> .IP \(bu 2 OpenCV \%<https://\:docs\:.opencv\:.org/> .IP \(bu 2 Open Dylan \%<https://\:opendylan\:.org/> .IP \(bu 2 OpenTURNS \%<https://\:openturns\:.github\:.io/\:openturns/\:latest/> .IP \(bu 2 Open vSwitch \%<https://\:docs\:.openvswitch\:.org/> .IP \(bu 2 PlatformIO \%<https://\:docs\:.platformio\:.org/> .IP \(bu 2 Psycopg \%<https://\:www\:.psycopg\:.org/\:docs/> .IP \(bu 2 PyEphem \%<https://\:rhodesmill\:.org/\:pyephem/> .IP \(bu 2 Pygments \%<https://\:pygments\:.org/\:docs/> .IP \(bu 2 Plone User Manual (German) \%<https://\:www\:.hasecke\:.com/\:plone-benutzerhandbuch/\:4\:.0/> .IP \(bu 2 PSI4 \%<https://\:www\:.psicode\:.org/\:psi4manual/\:master/\:index\:.html> .IP \(bu 2 PyMOTW \%<https://\:pymotw\:.com/2/> .IP \(bu 2 python\-aspectlib \%<https://\:python-aspectlib\:.readthedocs\:.io/> (sphinx_py3doc_enhanced_theme \%<https://\:pypi\:.org/\:project/\:sphinx_py3doc_enhanced_theme/>) .IP \(bu 2 QGIS \%<https://\:qgis\:.org/\:en/\:docs/\:index\:.html> .IP \(bu 2 Roundup \%<https://\:www\:.roundup-tracker\:.org/> .IP \(bu 2 SaltStack \%<https://\:docs\:.saltstack\:.com/> .IP \(bu 2 scikit\-learn \%<https://\:scikit-learn\:.org/\:stable/> .IP \(bu 2 Scrapy \%<https://\:doc\:.scrapy\:.org/> .IP \(bu 2 Selenium \%<https://\:docs\:.seleniumhq\:.org/\:docs/> .IP \(bu 2 Self \%<https://\:www\:.selflanguage\:.org/> .IP \(bu 2 Substance D \%<https://\:docs\:.pylonsproject\:.org/\:projects/\:substanced/> .IP \(bu 2 Sulu \%<https://\:docs\:.sulu\:.io/> .IP \(bu 2 SQLAlchemy \%<https://\:docs\:.sqlalchemy\:.org/> .IP \(bu 2 tinyTiM \%<https://\:tinytim\:.sourceforge\:.net/\:docs/\:2\:.0/> .IP \(bu 2 Twisted \%<https://\:twistedmatrix\:.com/\:documents/\:current/> .IP \(bu 2 Ubuntu Packaging Guide \%<https://\:packaging\:.ubuntu\:.com/\:html/> .IP \(bu 2 WTForms \%<https://\:wtforms\:.readthedocs\:.io/> .UNINDENT .SS Homepages and other non\-documentation sites .INDENT 0.0 .IP \(bu 2 Alan Crosswell\(aqs Using the Django REST Framework and DRF\-JSONAPI \%<https://\:www\:.columbia\:.edu/\:~alan/\:django-jsonapi-training/> .IP \(bu 2 Arizona State University PHY494/PHY598/CHM598 Simulation approaches to Bio\-and Nanophysics \%<https://\:becksteinlab\:.physics\:.asu\:.edu/\:pages/\:courses/\:2013/\:SimBioNano/> (classic) .IP \(bu 2 Benoit Boissinot \%<https://\:bboissin\:.appspot\:.com/> (classic, customized) .IP \(bu 2 EBI Cloud Consultancy Team \%<https://\:tsi-ccdoc\:.readthedocs\:.io/> (sphinx_rtd_theme) .IP \(bu 2 Eric Holscher \%<https://\:ericholscher\:.com/> (alabaster) .IP \(bu 2 Florian Diesch \%<https://\:www\:.florian-diesch\:.de/> .IP \(bu 2 Institute for the Design of Advanced Energy Systems (IDAES) \%<https://\:idaes-pse\:.readthedocs\:.io/> (sphinx_rtd_theme) .IP \(bu 2 IDAES Examples \%<https://\:idaes\:.github\:.io/\:examples-pse/> (sphinx_rtd_theme) .IP \(bu 2 Lei Ma\(aqs Statistical Mechanics lecture notes \%<https://\:statisticalphysics\:.leima\:.is/> (sphinx_bootstrap_theme) .IP \(bu 2 PyXLL \%<https://\:www\:.pyxll\:.com/> (sphinx_bootstrap_theme, customized) .IP \(bu 2 SciPy Cookbook \%<https://\:scipy-cookbook\:.readthedocs\:.io/> (sphinx_rtd_theme) .IP \(bu 2 Tech writer at work blog \%<https://\:documatt\:.com/\:blog/> (custom theme) .IP \(bu 2 UC Berkeley ME233 Advanced Control Systems II course \%<https://\:berkeley-me233\:.github\:.io/> (sphinxdoc) .IP \(bu 2 Željko Svedružić\(aqs Biomolecular Structure and Function Laboratory (BioSFLab) \%<https://\:svedruziclab\:.github\:.io/> (sphinx_bootstrap_theme) .UNINDENT .SS Books produced using Sphinx .INDENT 0.0 .IP \(bu 2 \(dqThe Art of Community\(dq (Japanese translation) \%<https://\:www\:.oreilly\:.co\:.jp/\:books/\:9784873114958/> .IP \(bu 2 \(dqDie Wahrheit des Sehens. Der DEKALOG von Krzysztof Kieślowski\(dq \%<https://\:literatur\:.hasecke\:.com/\:post/\:die-wahrheit-des-sehens-dekalog-kieslowski/> .IP \(bu 2 \(dqExpert Python Programming\(dq \%<https://\:www\:.packtpub\:.com/\:application-development/\:expert-python-programming> .IP \(bu 2 \(dqExpert Python Programming\(dq (Japanese translation) \%<https://\:www\:.amazon\:.co\:.jp/\:dp/\:4048686291/> .IP \(bu 2 \(dqExpert Python Programming 2nd Edition\(dq (Japanese translation) \%<https://\:www\:.amazon\:.co\:.jp/\:dp/\:4048930613/> .IP \(bu 2 \(dqThe Hitchhiker\(aqs Guide to Python\(dq \%<https://\:docs\:.python-guide\:.org/> .IP \(bu 2 \(dqLassoGuide\(dq \%<http://\:www\:.lassoguide\:.com/> .IP \(bu 2 \(dqLearning Sphinx\(dq (in Japanese) \%<https://\:www\:.oreilly\:.co\:.jp/\:books/\:9784873116488/> .IP \(bu 2 \(dqLearning System Programming with Go (Japanese)\(dq \%<https://\:www\:.lambdanote\:.com/\:products/go> .IP \(bu 2 \(dqMercurial: the definitive guide (Second edition)\(dq \%<https://\:book\:.mercurial-scm\:.org/> .IP \(bu 2 \(dqMithril \-\- The fastest clientside MVC (Japanese)\(dq \%<https://\:www\:.oreilly\:.co\:.jp/\:books/\:9784873117447/> .IP \(bu 2 \(dqPioneers and Prominent Men of Utah\(dq .IP \(bu 2 \(dqPomodoro Technique Illustrated\(dq (Japanese translation) \%<https://\:www\:.amazon\:.co\:.jp/\:dp/\:4048689525/> .IP \(bu 2 \(dqProfessional Software Development\(dq \%<https://\:mixmastamyk\:.bitbucket\:.io/\:pro_soft_dev/> .IP \(bu 2 \(dqPython Professional Programming\(dq (in Japanese) \%<https://\:www\:.amazon\:.co\:.jp/\:dp/\:4798032948/> .IP \(bu 2 \(dqPython Professional Programming 2nd Edition\(dq (in Japanese) \%<https://\:www\:.amazon\:.co\:.jp/\:dp/\:479804315X/> .IP \(bu 2 \(dqPython Professional Programming 3rd Edition\(dq (in Japanese) \%<https://\:www\:.amazon\:.co\:.jp/\:dp/\:4798053821/> .IP \(bu 2 Python Course by Yuri Petrov (Russian) \%<https://\:www\:.yuripetrov\:.ru/\:edu/\:python> .IP \(bu 2 \(dqReal World HTTP \-\- Learning The Internet and Web Technology via its history and code (Japanese)\(dq \%<https://\:www\:.oreilly\:.co\:.jp/\:books/\:9784873118048/> .IP \(bu 2 \(dqRedmine Primer 5th Edition (in Japanese)\(dq \%<https://\:www\:.shuwasystem\:.co\:.jp/\:products/\:7980html/\:4825\:.html> .IP \(bu 2 \(dqThe repoze.bfg Web Application Framework\(dq \%<https://\:www\:.amazon\:.com/\:repoze-bfg-Web-Application-Framework-Version/\:dp/\:0615345379> .IP \(bu 2 \(dqThe Self\-Taught Programmer\(dq (Japanese translation) \%<https://\:www\:.amazon\:.co\:.jp/\:dp/\:4822292274/> .IP \(bu 2 \(dqSimple and Steady Way of Learning for Software Engineering\(dq (in Japanese) \%<https://\:www\:.amazon\:.co\:.jp/\:dp/\:477414259X/> .IP \(bu 2 \(dqSoftware\-Dokumentation mit Sphinx\(dq \%<https://\:www\:.amazon\:.de/\:dp/\:1497448689/> .IP \(bu 2 \(dqTheoretical Physics Reference\(dq \%<https://\:www\:.theoretical-physics\:.net/> .IP \(bu 2 \(dqThe Varnish Book\(dq \%<https://\:info\:.varnish-software\:.com/\:the-varnish-book> .UNINDENT .SS Theses produced using Sphinx .INDENT 0.0 .IP \(bu 2 \(dqContent Conditioning and Distribution for Dynamic Virtual Worlds\(dq \%<https://\:www\:.cs\:.princeton\:.edu/\:research/\:techreps/\:TR-941-12> .IP \(bu 2 \(dqThe Sphinx Thesis Resource\(dq \%<https://\:jterrace\:.github\:.io/\:sphinxtr/> .UNINDENT .SS Projects integrating Sphinx functionality .INDENT 0.0 .IP \(bu 2 Read the Docs \%<https://\:readthedocs\:.org/>, a software\-as\-a\-service documentation hosting platform, uses Sphinx to automatically build documentation updates that are pushed to GitHub. .IP \(bu 2 Spyder \%<https://\:docs\:.spyder-ide\:.org/\:current/\:panes/\:help\:.html>, the Scientific Python Development Environment, uses Sphinx in its help pane to render rich documentation for functions, classes and methods automatically or on\-demand. .UNINDENT .SH Author the Sphinx developers .SH Copyright 2007-2026, the Sphinx developers .\" End of generated man page.