2008-03-09 16:32:24 -05:00
|
|
|
.. _builders:
|
|
|
|
|
2018-02-06 05:25:43 -06:00
|
|
|
========
|
|
|
|
Builders
|
|
|
|
========
|
2008-03-09 16:32:24 -05:00
|
|
|
|
2008-11-29 13:04:11 -06:00
|
|
|
.. module:: sphinx.builders
|
2008-03-09 16:32:24 -05:00
|
|
|
:synopsis: Available built-in builder classes.
|
|
|
|
|
2008-03-16 06:19:26 -05:00
|
|
|
These are the built-in Sphinx builders. More builders can be added by
|
2017-11-03 15:58:21 -05:00
|
|
|
:doc:`extensions </usage/extensions/index>`.
|
2008-03-16 06:19:26 -05:00
|
|
|
|
2023-09-21 03:39:39 -05:00
|
|
|
The builder's "name" must be given to the **-M** or **-b** command-line options of
|
2008-03-23 12:43:22 -05:00
|
|
|
:program:`sphinx-build` to select a builder.
|
2008-03-09 16:32:24 -05:00
|
|
|
|
2023-09-21 03:39:39 -05:00
|
|
|
The most common builders are:
|
|
|
|
|
|
|
|
**html**
|
|
|
|
Build HTML pages. This is the default builder.
|
|
|
|
|
|
|
|
**dirhtml**
|
|
|
|
Build HTML pages, but with a single directory per document. Makes for
|
|
|
|
prettier URLs (no ``.html``) if served from a webserver.
|
|
|
|
|
|
|
|
**singlehtml**
|
|
|
|
Build a single HTML with the whole content.
|
|
|
|
|
|
|
|
**htmlhelp**, **qthelp**, **devhelp**, **epub**
|
|
|
|
Build HTML files with additional information for building a documentation
|
|
|
|
collection in one of these formats.
|
|
|
|
|
|
|
|
**applehelp**
|
|
|
|
Build an Apple Help Book. Requires :program:`hiutil` and
|
|
|
|
:program:`codesign`, which are not Open Source and presently only
|
|
|
|
available on Mac OS X 10.6 and higher.
|
|
|
|
|
|
|
|
**latex**
|
|
|
|
Build LaTeX sources that can be compiled to a PDF document using
|
|
|
|
:program:`pdflatex`.
|
|
|
|
|
|
|
|
**man**
|
|
|
|
Build manual pages in groff format for UNIX systems.
|
|
|
|
|
|
|
|
**texinfo**
|
|
|
|
Build Texinfo files that can be processed into Info files using
|
|
|
|
:program:`makeinfo`.
|
|
|
|
|
|
|
|
**text**
|
|
|
|
Build plain text files.
|
|
|
|
|
|
|
|
**gettext**
|
|
|
|
Build gettext-style message catalogs (``.pot`` files).
|
|
|
|
|
|
|
|
**doctest**
|
|
|
|
Run all doctests in the documentation, if the :mod:`~sphinx.ext.doctest`
|
|
|
|
extension is enabled.
|
|
|
|
|
|
|
|
**linkcheck**
|
|
|
|
Check the integrity of all external links.
|
|
|
|
|
|
|
|
**xml**
|
|
|
|
Build Docutils-native XML files.
|
|
|
|
|
|
|
|
**pseudoxml**
|
|
|
|
Build compact pretty-printed "pseudo-XML" files displaying the
|
|
|
|
internal structure of the intermediate document trees.
|
|
|
|
|
|
|
|
--------------
|
2008-03-12 16:37:22 -05:00
|
|
|
|
2008-11-29 13:04:11 -06:00
|
|
|
.. module:: sphinx.builders.html
|
2008-03-12 16:37:22 -05:00
|
|
|
.. class:: StandaloneHTMLBuilder
|
|
|
|
|
2008-03-16 06:19:26 -05:00
|
|
|
This is the standard HTML builder. Its output is a directory with HTML
|
2024-07-14 00:00:08 -05:00
|
|
|
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 :ref:`html-options` for details.
|
2008-03-16 06:19:26 -05:00
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2008-03-12 16:37:22 -05:00
|
|
|
|
2019-02-10 22:46:32 -06:00
|
|
|
.. module:: sphinx.builders.dirhtml
|
2009-02-18 17:07:47 -06:00
|
|
|
.. class:: DirectoryHTMLBuilder
|
|
|
|
|
|
|
|
This is a subclass of the standard HTML builder. Its output is a directory
|
|
|
|
with HTML files, where each file is called ``index.html`` and placed in a
|
|
|
|
subdirectory named like its page name. For example, the document
|
|
|
|
``markup/rest.rst`` will not result in an output file ``markup/rest.html``,
|
|
|
|
but ``markup/rest/index.html``. When generating links between pages, the
|
|
|
|
``index.html`` is omitted, so that the URL would look like ``markup/rest/``.
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2009-02-18 17:07:47 -06:00
|
|
|
|
|
|
|
.. versionadded:: 0.6
|
|
|
|
|
2019-02-10 22:46:32 -06:00
|
|
|
.. module:: sphinx.builders.singlehtml
|
2010-01-17 09:48:02 -06:00
|
|
|
.. class:: 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
|
2021-06-22 08:26:59 -05:00
|
|
|
the root document. No indices will be generated.
|
2010-01-17 09:48:02 -06:00
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2010-01-17 09:48:02 -06:00
|
|
|
|
|
|
|
.. versionadded:: 1.0
|
|
|
|
|
2019-05-14 10:08:26 -05:00
|
|
|
.. module:: sphinxcontrib.htmlhelp
|
2008-03-12 16:37:22 -05:00
|
|
|
.. class:: HTMLHelpBuilder
|
|
|
|
|
2008-03-16 06:19:26 -05:00
|
|
|
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.
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2008-03-16 06:19:26 -05:00
|
|
|
|
2019-01-19 01:34:06 -06:00
|
|
|
.. module:: sphinxcontrib.qthelp
|
2009-06-27 11:49:51 -05:00
|
|
|
.. class:: QtHelpBuilder
|
|
|
|
|
|
|
|
This builder produces the same output as the standalone HTML builder, but
|
2018-02-06 05:25:43 -06:00
|
|
|
also generates `Qt help`_ collection support files that allow the Qt
|
|
|
|
collection generator to compile them.
|
2009-06-27 11:49:51 -05:00
|
|
|
|
2019-01-19 01:34:06 -06:00
|
|
|
.. versionchanged:: 2.0
|
|
|
|
|
|
|
|
Moved to sphinxcontrib.qthelp from sphinx.builders package.
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2009-06-27 11:49:51 -05:00
|
|
|
|
2017-05-31 09:07:01 -05:00
|
|
|
.. _Qt help: https://doc.qt.io/qt-4.8/qthelp-framework.html
|
2010-02-20 12:57:13 -06:00
|
|
|
|
2019-01-25 22:38:42 -06:00
|
|
|
.. module:: sphinxcontrib.applehelp
|
2015-01-14 06:45:04 -06:00
|
|
|
.. class:: AppleHelpBuilder
|
|
|
|
|
|
|
|
This builder produces an Apple Help Book based on the same output as the
|
|
|
|
standalone HTML builder.
|
|
|
|
|
2015-01-15 07:11:58 -06:00
|
|
|
If the source directory contains any ``.lproj`` 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.
|
|
|
|
|
|
|
|
In order to generate a valid help book, this builder requires the command
|
|
|
|
line tool :program:`hiutil`, which is only available on Mac OS X 10.6 and
|
|
|
|
above. You can disable the indexing step by setting
|
|
|
|
:confval:`applehelp_disable_external_tools` to ``True``, in which case the
|
|
|
|
output will not be valid until :program:`hiutil` has been run on all of the
|
|
|
|
``.lproj`` folders within the bundle.
|
2015-01-14 06:45:04 -06:00
|
|
|
|
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2015-01-14 06:45:04 -06:00
|
|
|
.. autoattribute:: supported_image_types
|
|
|
|
|
|
|
|
.. versionadded:: 1.3
|
|
|
|
|
2019-01-25 22:38:42 -06:00
|
|
|
.. versionchanged:: 2.0
|
|
|
|
|
|
|
|
Moved to sphinxcontrib.applehelp from sphinx.builders package.
|
|
|
|
|
2019-01-19 09:36:59 -06:00
|
|
|
.. module:: sphinxcontrib.devhelp
|
2009-06-27 11:49:51 -05:00
|
|
|
.. class:: DevhelpBuilder
|
|
|
|
|
|
|
|
This builder produces the same output as the standalone HTML builder, but
|
2014-01-12 17:05:22 -06:00
|
|
|
also generates `GNOME Devhelp <https://wiki.gnome.org/Apps/Devhelp>`__
|
2009-06-27 11:49:51 -05:00
|
|
|
support file that allows the GNOME Devhelp reader to view them.
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2009-06-27 11:49:51 -05:00
|
|
|
|
2019-01-19 09:36:59 -06:00
|
|
|
.. versionchanged:: 2.0
|
|
|
|
|
|
|
|
Moved to sphinxcontrib.devhelp from sphinx.builders package.
|
|
|
|
|
2016-01-17 07:59:59 -06:00
|
|
|
.. module:: sphinx.builders.epub3
|
|
|
|
.. class:: Epub3Builder
|
|
|
|
|
|
|
|
This builder produces the same output as the standalone HTML builder, but
|
|
|
|
also generates an *epub* file for ebook readers. See :ref:`epub-faq` for
|
|
|
|
details about it. For definition of the epub format, have a look at
|
2024-01-13 22:18:57 -06:00
|
|
|
`<https://idpf.org/epub>`_ or `<https://en.wikipedia.org/wiki/EPUB>`_.
|
2016-01-17 07:59:59 -06:00
|
|
|
The builder creates *EPUB 3* files.
|
|
|
|
|
|
|
|
.. autoattribute:: name
|
|
|
|
|
|
|
|
.. autoattribute:: format
|
|
|
|
|
|
|
|
.. autoattribute:: supported_image_types
|
|
|
|
|
|
|
|
.. versionadded:: 1.4
|
|
|
|
|
2016-08-15 02:32:38 -05:00
|
|
|
.. versionchanged:: 1.5
|
|
|
|
|
2023-01-08 13:28:40 -06:00
|
|
|
Since Sphinx 1.5, the epub3 builder is used as the default epub builder.
|
2016-08-15 02:32:38 -05:00
|
|
|
|
2008-11-29 13:04:11 -06:00
|
|
|
.. module:: sphinx.builders.latex
|
2008-03-12 16:37:22 -05:00
|
|
|
.. class:: LaTeXBuilder
|
|
|
|
|
2022-10-17 03:54:31 -05:00
|
|
|
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
|
|
|
|
:program:`make all-pdf` there.
|
|
|
|
To combine the two steps into only one, use :option:`sphinx-build -M`
|
|
|
|
(i.e. ``-M latexpdf`` not ``-b latexpdf``) or :program:`make latexpdf`
|
|
|
|
at the project root.
|
2008-03-16 06:19:26 -05:00
|
|
|
|
2022-10-17 03:54:31 -05:00
|
|
|
See :confval:`latex_documents` and the chapter :ref:`latex-options` for
|
|
|
|
available options.
|
2018-11-21 11:58:58 -06:00
|
|
|
|
2022-10-17 03:54:31 -05:00
|
|
|
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.
|
|
|
|
|
|
|
|
At any rate, on Ubuntu for example, following packages must all be present:
|
2018-04-02 12:21:48 -05:00
|
|
|
|
2018-02-06 05:25:43 -06:00
|
|
|
* ``texlive-latex-recommended``
|
|
|
|
* ``texlive-fonts-recommended``
|
2024-07-13 11:33:22 -05:00
|
|
|
* ``texlive-fonts-extra`` (needed for ``fontawesome5``, see the 7.4.0
|
|
|
|
change notice below)
|
2022-10-17 03:54:31 -05:00
|
|
|
* ``tex-gyre`` (if :confval:`latex_engine` left to default)
|
2018-02-06 05:25:43 -06:00
|
|
|
* ``texlive-latex-extra``
|
2022-10-17 03:54:31 -05:00
|
|
|
* ``latexmk``
|
|
|
|
|
|
|
|
.. versionchanged:: 4.0.0
|
|
|
|
TeX Gyre fonts now required for ``'pdflatex'`` engine (default).
|
2018-11-21 11:58:58 -06:00
|
|
|
|
2024-07-13 11:33:22 -05:00
|
|
|
.. versionchanged:: 7.4.0
|
|
|
|
LaTeX package ``xcolor`` is now required (it is part of Ubuntu
|
|
|
|
``texlive-latex-recommended`` anyhow). The LaTeX package
|
|
|
|
``fontawesome5`` is recommended. See the :ref:`'sphinxsetup'
|
|
|
|
<latexsphinxsetup>` ``iconpackage`` key for more.
|
|
|
|
|
2022-10-17 03:54:31 -05:00
|
|
|
Additional packages are needed in some circumstances:
|
2018-11-21 11:58:58 -06:00
|
|
|
|
2022-10-17 03:54:31 -05:00
|
|
|
* ``texlive-lang-cyrillic`` for Cyrillic (and also then
|
|
|
|
``cm-super`` if using the default fonts),
|
|
|
|
* ``texlive-lang-greek`` for Greek (and also then
|
|
|
|
``cm-super`` if using the default fonts),
|
2021-01-20 09:48:35 -06:00
|
|
|
* ``texlive-xetex`` if :confval:`latex_engine` is ``'xelatex'``,
|
|
|
|
* ``texlive-luatex`` if :confval:`latex_engine` is ``'lualatex'``,
|
2022-10-17 03:54:31 -05:00
|
|
|
* ``fonts-freefont-otf`` if :confval:`latex_engine` is either
|
|
|
|
``'xelatex'`` or ``'lualatex'``.
|
2021-01-20 09:48:35 -06:00
|
|
|
|
2008-11-22 06:32:32 -06:00
|
|
|
.. note::
|
|
|
|
|
2022-10-17 03:54:31 -05:00
|
|
|
Since 1.6, ``make latexpdf`` uses on GNU/Linux and macOS
|
|
|
|
:program:`latexmk`, 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 ``makeindex``, then two more).
|
2018-02-06 05:25:43 -06:00
|
|
|
|
2017-05-28 09:24:21 -05:00
|
|
|
One can pass to ``latexmk`` options via the ``LATEXMKOPTS``
|
2017-05-07 08:45:55 -05:00
|
|
|
Makefile variable. For example:
|
2017-05-03 03:45:53 -05:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
2017-05-07 08:45:55 -05:00
|
|
|
make latexpdf LATEXMKOPTS="-silent"
|
2017-05-03 03:45:53 -05:00
|
|
|
|
2018-04-02 12:21:48 -05:00
|
|
|
reduces console output to a minimum.
|
|
|
|
|
2018-11-21 11:58:58 -06:00
|
|
|
Also, if ``latexmk`` is at version 4.52b or higher (January 2017)
|
|
|
|
``LATEXMKOPTS="-xelatex"`` speeds up PDF builds via XeLateX in case
|
2018-04-02 12:21:48 -05:00
|
|
|
of numerous graphics inclusions.
|
|
|
|
|
2018-11-21 11:58:58 -06:00
|
|
|
To pass options directly to the ``(pdf|xe|lua)latex`` binary, use
|
|
|
|
variable ``LATEXOPTS``, for example:
|
2018-04-02 12:21:48 -05:00
|
|
|
|
|
|
|
.. code-block:: console
|
2017-05-13 05:24:01 -05:00
|
|
|
|
2018-11-21 11:58:58 -06:00
|
|
|
make latexpdf LATEXOPTS="--halt-on-error"
|
2017-05-03 00:52:32 -05:00
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2008-03-16 06:19:26 -05:00
|
|
|
|
2017-06-05 07:51:35 -05:00
|
|
|
Note that a direct PDF builder is being provided by `rinohtype`_. The builder's
|
2018-01-20 06:33:09 -06:00
|
|
|
name is ``rinoh``. Refer to the `rinohtype manual`_ for details.
|
2017-06-05 07:51:35 -05:00
|
|
|
|
|
|
|
.. _rinohtype: https://github.com/brechtm/rinohtype
|
2022-06-22 13:35:42 -05:00
|
|
|
.. _rinohtype manual: https://www.mos6581.org/rinohtype/master/quickstart.html#sphinx-builder
|
2009-11-08 09:54:06 -06:00
|
|
|
|
2008-11-29 13:04:11 -06:00
|
|
|
.. module:: sphinx.builders.text
|
2008-06-01 10:27:16 -05:00
|
|
|
.. class:: TextBuilder
|
|
|
|
|
2024-07-14 00:00:08 -05:00
|
|
|
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.
|
2008-06-01 10:27:16 -05:00
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2008-06-01 10:27:16 -05:00
|
|
|
|
|
|
|
.. versionadded:: 0.4
|
2008-06-26 04:40:42 -05:00
|
|
|
|
2010-02-21 04:50:08 -06:00
|
|
|
.. module:: sphinx.builders.manpage
|
|
|
|
.. class:: 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
|
|
|
|
:confval:`man_pages` configuration value.
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2010-02-21 04:50:08 -06:00
|
|
|
|
|
|
|
.. versionadded:: 1.0
|
|
|
|
|
2010-09-16 02:16:27 -05:00
|
|
|
|
|
|
|
.. module:: sphinx.builders.texinfo
|
|
|
|
.. class:: TexinfoBuilder
|
|
|
|
|
2010-10-22 03:17:35 -05:00
|
|
|
This builder produces Texinfo files that can be processed into Info files by
|
|
|
|
the :program:`makeinfo` program. You have to specify which documents are to
|
|
|
|
be included in which Texinfo files via the :confval:`texinfo_documents`
|
|
|
|
configuration value.
|
|
|
|
|
|
|
|
The Info format is the basis of the on-line help system used by GNU Emacs and
|
|
|
|
the terminal-based program :program:`info`. See :ref:`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
|
2017-05-31 09:07:01 -05:00
|
|
|
`<https://www.gnu.org/software/texinfo/>`_.
|
2010-09-16 02:16:27 -05:00
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2010-09-16 02:16:27 -05:00
|
|
|
|
|
|
|
.. versionadded:: 1.1
|
|
|
|
|
|
|
|
|
2019-02-17 06:55:28 -06:00
|
|
|
.. currentmodule:: sphinxcontrib.serializinghtml
|
2008-06-26 04:40:42 -05:00
|
|
|
.. class:: SerializingHTMLBuilder
|
|
|
|
|
|
|
|
This builder uses a module that implements the Python serialization API
|
2024-03-17 08:45:56 -05:00
|
|
|
(``pickle``, ``simplejson``, ``phpserialize``, and others) to dump the
|
|
|
|
generated HTML documentation. The pickle builder is a subclass of it.
|
2008-06-26 04:40:42 -05:00
|
|
|
|
2010-01-14 13:42:10 -06:00
|
|
|
A concrete subclass of this builder serializing to the `PHP serialization`_
|
2008-06-26 06:11:20 -05:00
|
|
|
format could look like this::
|
|
|
|
|
|
|
|
import phpserialize
|
2008-06-26 04:40:42 -05:00
|
|
|
|
2008-06-26 06:13:44 -05:00
|
|
|
class PHPSerializedBuilder(SerializingHTMLBuilder):
|
2008-06-26 06:11:20 -05:00
|
|
|
name = 'phpserialized'
|
|
|
|
implementation = phpserialize
|
|
|
|
out_suffix = '.file.phpdump'
|
|
|
|
globalcontext_filename = 'globalcontext.phpdump'
|
|
|
|
searchindex_filename = 'searchindex.phpdump'
|
2008-06-26 04:40:42 -05:00
|
|
|
|
2018-04-18 21:51:48 -05:00
|
|
|
.. _PHP serialization: https://pypi.org/project/phpserialize/
|
2008-06-26 04:40:42 -05:00
|
|
|
|
|
|
|
.. attribute:: implementation
|
2009-01-10 15:18:18 -06:00
|
|
|
|
2024-03-17 08:45:56 -05:00
|
|
|
A module that implements ``dump()``, ``load()``, ``dumps()`` and ``loads()``
|
2008-06-26 04:40:42 -05:00
|
|
|
functions that conform to the functions with the same names from the
|
|
|
|
pickle module. Known modules implementing this interface are
|
2024-03-17 08:45:56 -05:00
|
|
|
``simplejson``, ``phpserialize``, ``plistlib``, and others.
|
2008-06-26 04:40:42 -05:00
|
|
|
|
|
|
|
.. attribute:: out_suffix
|
|
|
|
|
|
|
|
The suffix for all regular files.
|
|
|
|
|
|
|
|
.. attribute:: globalcontext_filename
|
|
|
|
|
|
|
|
The filename for the file that contains the "global context". This
|
|
|
|
is a dict with some general configuration values such as the name
|
|
|
|
of the project.
|
|
|
|
|
|
|
|
.. attribute:: searchindex_filename
|
|
|
|
|
|
|
|
The filename for the search index Sphinx generates.
|
|
|
|
|
|
|
|
See :ref:`serialization-details` for details about the output format.
|
|
|
|
|
|
|
|
.. versionadded:: 0.5
|
2008-11-22 06:34:51 -06:00
|
|
|
|
|
|
|
.. class:: 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't use the standard HTML templates.
|
|
|
|
|
|
|
|
See :ref:`serialization-details` for details about the output format.
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
|
|
|
The old name ``web`` still works as well.
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2008-11-22 06:34:51 -06:00
|
|
|
|
|
|
|
The file suffix is ``.fpickle``. The global context is called
|
|
|
|
``globalcontext.pickle``, the search index ``searchindex.pickle``.
|
|
|
|
|
|
|
|
.. class:: 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't use the standard HTML templates.
|
|
|
|
|
|
|
|
See :ref:`serialization-details` for details about the output format.
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2008-11-22 06:34:51 -06:00
|
|
|
|
|
|
|
The file suffix is ``.fjson``. The global context is called
|
|
|
|
``globalcontext.json``, the search index ``searchindex.json``.
|
|
|
|
|
|
|
|
.. versionadded:: 0.5
|
|
|
|
|
2011-01-08 10:32:32 -06:00
|
|
|
.. module:: sphinx.builders.gettext
|
2010-06-26 05:38:06 -05:00
|
|
|
.. class:: MessageCatalogBuilder
|
|
|
|
|
2011-01-15 08:13:57 -06:00
|
|
|
This builder produces gettext-style message catalogs. Each top-level file or
|
2010-08-26 18:02:49 -05:00
|
|
|
subdirectory grows a single ``.pot`` catalog template.
|
2010-06-26 05:38:06 -05:00
|
|
|
|
2010-08-26 18:02:49 -05:00
|
|
|
See the documentation on :ref:`intl` for further reference.
|
2010-06-26 05:38:06 -05:00
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2010-06-26 05:38:06 -05:00
|
|
|
|
2010-08-21 12:20:50 -05:00
|
|
|
.. versionadded:: 1.1
|
2010-06-26 05:38:06 -05:00
|
|
|
|
2008-11-29 13:04:11 -06:00
|
|
|
.. module:: sphinx.builders.changes
|
2008-03-12 16:37:22 -05:00
|
|
|
.. class:: ChangesBuilder
|
|
|
|
|
2010-04-17 03:39:51 -05:00
|
|
|
This builder produces an HTML overview of all :rst:dir:`versionadded`,
|
2024-01-21 14:12:52 -06:00
|
|
|
:rst:dir:`versionchanged`, :rst:dir:`deprecated` and :rst:dir:`versionremoved`
|
|
|
|
directives for the current :confval:`version`. This is useful to generate a
|
|
|
|
changelog file, for example.
|
2008-03-16 06:19:26 -05:00
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2008-03-16 06:19:26 -05:00
|
|
|
|
2015-06-23 13:59:22 -05:00
|
|
|
.. module:: sphinx.builders.dummy
|
|
|
|
.. class:: DummyBuilder
|
|
|
|
|
|
|
|
This builder produces no output. The input is only parsed and checked for
|
|
|
|
consistency. This is useful for linting purposes.
|
|
|
|
|
|
|
|
.. autoattribute:: name
|
|
|
|
|
|
|
|
.. autoattribute:: supported_image_types
|
|
|
|
|
|
|
|
.. versionadded:: 1.4
|
|
|
|
|
2008-11-29 13:04:11 -06:00
|
|
|
.. module:: sphinx.builders.linkcheck
|
2008-03-12 16:37:22 -05:00
|
|
|
.. class:: CheckExternalLinksBuilder
|
|
|
|
|
2008-03-16 06:19:26 -05:00
|
|
|
This builder scans all documents for external links, tries to open them with
|
2017-09-18 09:57:08 -05:00
|
|
|
``requests``, and writes an overview which ones are broken and redirected to
|
|
|
|
standard output and to :file:`output.txt` in the output directory.
|
2008-03-16 06:19:26 -05:00
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2008-03-16 06:19:26 -05:00
|
|
|
|
2017-09-18 09:57:08 -05:00
|
|
|
.. versionchanged:: 1.5
|
|
|
|
|
2023-01-08 13:28:40 -06:00
|
|
|
Since Sphinx 1.5, the linkcheck builder uses the requests module.
|
2017-09-18 09:57:08 -05:00
|
|
|
|
2020-10-04 14:40:14 -05:00
|
|
|
.. versionchanged:: 3.4
|
|
|
|
|
|
|
|
The linkcheck builder retries links when servers apply rate limits.
|
|
|
|
|
2012-12-04 21:10:15 -06:00
|
|
|
.. module:: sphinx.builders.xml
|
|
|
|
.. class:: 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.
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2012-12-04 21:10:15 -06:00
|
|
|
|
|
|
|
.. versionadded:: 1.2
|
|
|
|
|
|
|
|
.. class:: PseudoXMLBuilder
|
|
|
|
|
|
|
|
This builder is used for debugging the Sphinx/Docutils "Reader to Transform
|
|
|
|
to Writer" pipeline. It produces compact pretty-printed "pseudo-XML", files
|
|
|
|
where nesting is indicated by indentation (no end-tags). External
|
|
|
|
attributes for all elements are output, and internal attributes for any
|
|
|
|
leftover "pending" elements are also given.
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: name
|
|
|
|
|
2015-09-14 20:25:50 -05:00
|
|
|
.. autoattribute:: format
|
|
|
|
|
2014-08-29 09:14:12 -05:00
|
|
|
.. autoattribute:: supported_image_types
|
2012-12-04 21:10:15 -06:00
|
|
|
|
|
|
|
.. versionadded:: 1.2
|
|
|
|
|
2008-03-21 13:59:28 -05:00
|
|
|
|
|
|
|
Built-in Sphinx extensions that offer more builders are:
|
|
|
|
|
|
|
|
* :mod:`~sphinx.ext.doctest`
|
|
|
|
* :mod:`~sphinx.ext.coverage`
|
2008-03-25 14:20:26 -05:00
|
|
|
|
|
|
|
|
2008-06-26 04:40:42 -05:00
|
|
|
.. _serialization-details:
|
|
|
|
|
|
|
|
Serialization builder details
|
|
|
|
-----------------------------
|
2008-03-25 14:20:26 -05:00
|
|
|
|
2008-06-26 04:40:42 -05:00
|
|
|
All serialization builders outputs one file per source file and a few special
|
2024-07-14 00:00:08 -05:00
|
|
|
files. They also copy the reStructuredText source files
|
|
|
|
to the ``_sources`` directory under the output directory.
|
2008-03-25 14:20:26 -05:00
|
|
|
|
2010-08-05 06:39:23 -05:00
|
|
|
The :class:`.PickleHTMLBuilder` is a builtin subclass that implements the pickle
|
2008-06-26 04:40:42 -05:00
|
|
|
serialization interface.
|
2008-03-25 14:20:26 -05:00
|
|
|
|
2008-06-26 04:40:42 -05:00
|
|
|
The files per source file have the extensions of
|
2010-08-05 06:39:23 -05:00
|
|
|
:attr:`~.SerializingHTMLBuilder.out_suffix`, and are arranged in directories
|
2008-06-26 04:40:42 -05:00
|
|
|
just as the source files are. They unserialize to a dictionary (or dictionary
|
|
|
|
like structure) with these keys:
|
2008-03-25 14:20:26 -05:00
|
|
|
|
|
|
|
``body``
|
|
|
|
The HTML "body" (that is, the HTML rendering of the source file), as rendered
|
|
|
|
by the HTML translator.
|
|
|
|
|
|
|
|
``title``
|
|
|
|
The title of the document, as HTML (may contain markup).
|
|
|
|
|
|
|
|
``toc``
|
|
|
|
The table of contents for the file, rendered as an HTML ``<ul>``.
|
|
|
|
|
|
|
|
``display_toc``
|
|
|
|
A boolean that is ``True`` if the ``toc`` contains more than one entry.
|
|
|
|
|
|
|
|
``current_page_name``
|
|
|
|
The document name of the current file.
|
|
|
|
|
|
|
|
``parents``, ``prev`` and ``next``
|
|
|
|
Information about related chapters in the TOC tree. Each relation is a
|
|
|
|
dictionary with the keys ``link`` (HREF for the relation) and ``title``
|
|
|
|
(title of the related document, as HTML). ``parents`` is a list of
|
|
|
|
relations, while ``prev`` and ``next`` are a single relation.
|
|
|
|
|
|
|
|
``sourcename``
|
|
|
|
The name of the source file under ``_sources``.
|
|
|
|
|
|
|
|
The special files are located in the root output directory. They are:
|
|
|
|
|
2010-08-05 06:39:23 -05:00
|
|
|
:attr:`.SerializingHTMLBuilder.globalcontext_filename`
|
2008-03-25 14:20:26 -05:00
|
|
|
A pickled dict with these keys:
|
|
|
|
|
|
|
|
``project``, ``copyright``, ``release``, ``version``
|
|
|
|
The same values as given in the configuration file.
|
|
|
|
|
2010-02-19 18:13:23 -06:00
|
|
|
``style``
|
|
|
|
:confval:`html_style`.
|
2008-03-25 14:20:26 -05:00
|
|
|
|
|
|
|
``last_updated``
|
|
|
|
Date of last build.
|
|
|
|
|
|
|
|
``builder``
|
|
|
|
Name of the used builder, in the case of pickles this is always
|
|
|
|
``'pickle'``.
|
|
|
|
|
|
|
|
``titles``
|
|
|
|
A dictionary of all documents' titles, as HTML strings.
|
|
|
|
|
2010-08-05 06:39:23 -05:00
|
|
|
:attr:`.SerializingHTMLBuilder.searchindex_filename`
|
2008-03-25 14:20:26 -05:00
|
|
|
An index that can be used for searching the documentation. It is a pickled
|
|
|
|
list with these entries:
|
|
|
|
|
|
|
|
* A list of indexed docnames.
|
|
|
|
* A list of document titles, as HTML strings, in the same order as the first
|
|
|
|
list.
|
|
|
|
* A dict mapping word roots (processed by an English-language stemmer) to a
|
|
|
|
list of integers, which are indices into the first list.
|
2008-06-26 04:40:42 -05:00
|
|
|
|
|
|
|
``environment.pickle``
|
|
|
|
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
|
2010-01-17 12:21:04 -06:00
|
|
|
started.
|
2008-06-26 04:40:42 -05:00
|
|
|
|
2010-01-17 12:21:04 -06:00
|
|
|
.. todo:: Document common members.
|
|
|
|
|
|
|
|
Unlike the other pickle files this pickle file requires that the ``sphinx``
|
|
|
|
package is available on unpickling.
|