forked from sphinx-doc/sphinx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
several documentation improvements to theming, templating, and extens…
…ion development
- Loading branch information
1 parent
cc73965
commit 60b105d
Showing
8 changed files
with
290 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ Sphinx documentation contents | |
development/index | ||
man/index | ||
|
||
theming | ||
templating | ||
latex | ||
extdev/index | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Configuring builders | ||
==================== | ||
|
||
Discover builders by entry point | ||
-------------------------------- | ||
|
||
.. versionadded:: 1.6 | ||
|
||
:term:`Builder` extensions can be discovered by means of `entry points`_ so | ||
that they do not have to be listed in the :confval:`extensions` configuration | ||
value. | ||
|
||
Builder extensions should define an entry point in the ``sphinx.builders`` | ||
group. The name of the entry point needs to match your builder's | ||
:attr:`~.Builder.name` attribute, which is the name passed to the | ||
:option:`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 'mybuilder' can be defined in the extension's ``setup.py``:: | ||
|
||
setup( | ||
# ... | ||
entry_points={ | ||
'sphinx.builders': [ | ||
'mybuilder = my.extension.module', | ||
], | ||
} | ||
) | ||
|
||
Note that it is still necessary to register the builder using | ||
:meth:`~.Sphinx.add_builder` in the extension's :func:`setup` function. | ||
|
||
.. _entry points: https://setuptools.readthedocs.io/en/latest/setuptools.html#dynamic-discovery-of-services-and-plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,26 @@ | ||
.. _extension-tutorials-index: | ||
|
||
Extension tutorials | ||
=================== | ||
|
||
Refer to the following tutorials to get started with extension development. | ||
|
||
.. toctree:: | ||
:caption: General extension tutorials | ||
|
||
overview | ||
builders | ||
|
||
.. toctree:: | ||
:caption: Directive tutorials | ||
:maxdepth: 1 | ||
|
||
helloworld | ||
todo | ||
recipe | ||
|
||
.. toctree:: | ||
:caption: Theming | ||
:maxdepth: 1 | ||
|
||
theming-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Developing extensions overview | ||
============================== | ||
|
||
This page contains general information about developing Sphinx extensions. | ||
|
||
Make an extension depend on another extension | ||
--------------------------------------------- | ||
|
||
Sometimes your extension depends on the functionality of another | ||
Sphinx extension. Most Sphinx extensions are activated in a | ||
project's :file:`conf.py` file, but this is not available to you as an | ||
extension developer. | ||
|
||
.. module:: sphinx.application | ||
:noindex: | ||
|
||
To ensure that another extension is activated as a part of your own extension, | ||
use the :meth:`Sphinx.setup_extension` method. This will | ||
activate another extension at run-time, ensuring that you have access to its | ||
functionality. | ||
|
||
For example, the following code activates the "recommonmark" extension: | ||
|
||
.. code-block:: python | ||
def setup(app): | ||
app.setup_extension("recommonmark") | ||
.. note:: | ||
|
||
Since your extension will depend on another, make sure to include | ||
it as a part of your extension's installation requirements. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.