2020-07-02 16:22:19 -05:00
|
|
|
Configuring builders
|
|
|
|
====================
|
|
|
|
|
|
|
|
Discover builders by entry point
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
.. versionadded:: 1.6
|
|
|
|
|
2020-07-20 13:03:33 -05:00
|
|
|
:term:`builder` extensions can be discovered by means of `entry points`_ so
|
2020-07-02 16:22:19 -05:00
|
|
|
that they do not have to be listed in the :confval:`extensions` configuration
|
|
|
|
value.
|
|
|
|
|
2023-10-03 13:26:37 -05:00
|
|
|
Builder extensions should define an entry point in the ``"sphinx.builders"``
|
2020-07-02 16:22:19 -05:00
|
|
|
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
|
2023-10-03 13:26:37 -05:00
|
|
|
for 'mybuilder' can be defined in the extension's ``pyproject.toml``
|
|
|
|
|
|
|
|
.. code-block:: toml
|
|
|
|
|
|
|
|
[project.entry-points."sphinx.builders"]
|
|
|
|
mybuilder = "my.extension.module"
|
2020-07-02 16:22:19 -05:00
|
|
|
|
|
|
|
Note that it is still necessary to register the builder using
|
|
|
|
:meth:`~.Sphinx.add_builder` in the extension's :func:`setup` function.
|
|
|
|
|
2024-03-25 05:39:05 -05:00
|
|
|
.. _entry points: https://setuptools.pypa.io/en/latest/userguide/entry_point.html
|