Change extension setup() return value to a dictionary of metadata.

This makes it possible to introduce more metadata values later.
This commit is contained in:
Georg Brandl
2014-09-22 11:06:42 +02:00
parent 57e897669d
commit 71cd2f7e50
20 changed files with 43 additions and 31 deletions
+15 -5
View File
@@ -18,15 +18,25 @@ imports this module and executes its ``setup()`` function, which in turn
notifies Sphinx of everything the extension offers -- see the extension tutorial
for examples.
.. versionadded:: 1.3
The ``setup()`` function can return a string, this is treated by Sphinx as
the version of the extension and used for informational purposes such as the
traceback file when an exception occurs.
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.
Extension metadata
------------------
.. versionadded:: 1.3
The ``setup()`` function can return a dictionary. This is treated by Sphinx
as metadata of the extension. Metadata keys currently recognized are:
* ``'version'``: a string that identifies the extension version. It is used for
extension version requirement checking (see :confval:`needs_extensions`) and
informational purposes. If not given, ``"unknown version"`` is substituted.
APIs used for writing extensions
--------------------------------
.. toctree::
tutorial