mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
merge with stable
This commit is contained in:
@@ -3,34 +3,12 @@
|
||||
Sphinx Extensions
|
||||
=================
|
||||
|
||||
.. module:: sphinx.application
|
||||
:synopsis: Application class and extensibility interface.
|
||||
|
||||
Since many projects will need special features in their documentation, Sphinx is
|
||||
designed to be extensible on several levels.
|
||||
|
||||
This is what you can do in an extension: First, you can add new
|
||||
:term:`builder`\s to support new output formats or actions on the parsed
|
||||
documents. Then, it is possible to register custom reStructuredText roles and
|
||||
directives, extending the markup. And finally, there are so-called "hook
|
||||
points" at strategic places throughout the build process, where an extension can
|
||||
register a hook and run specialized code.
|
||||
|
||||
An extension is simply a Python module. When an extension is loaded, Sphinx
|
||||
imports this module and executes its ``setup()`` function, which in turn
|
||||
notifies Sphinx of everything the extension offers -- see the extension tutorial
|
||||
for examples.
|
||||
|
||||
The configuration file itself can be treated as an extension if it contains a
|
||||
``setup()`` function. All other extensions to load must be listed in the
|
||||
:confval:`extensions` configuration value.
|
||||
|
||||
.. toctree::
|
||||
|
||||
ext/tutorial
|
||||
ext/appapi
|
||||
ext/builderapi
|
||||
Since many projects will need special features in their documentation, Sphinx
|
||||
allows to add "extensions" to the build process, each of which can modify almost
|
||||
any aspect of document processing.
|
||||
|
||||
This chapter describes the extensions bundled with Sphinx. For the API
|
||||
documentation on writing your own extension, see :ref:`dev-extensions`.
|
||||
|
||||
Builtin Sphinx extensions
|
||||
-------------------------
|
||||
|
||||
Reference in New Issue
Block a user