doc: Move sphinx.config API docs to code

Once again, we make things a little smarter by using Python domain
roles.

Signed-off-by: Stephen Finucane <stephen@that.guru>
This commit is contained in:
Stephen Finucane 2017-12-04 20:30:23 +00:00
parent 391cd8195b
commit b7749c6ca3
2 changed files with 11 additions and 11 deletions

View File

@ -686,16 +686,9 @@ Use this to adapt your extension to API changes in Sphinx.
The Config object
-----------------
.. module:: sphinx.config
.. currentmodule:: sphinx.config
.. class:: Config
The config object makes the values of all config values available as
attributes.
It is available as the ``config`` attribute on the application and
environment objects. For example, to get the value of :confval:`language`,
use either ``app.config.language`` or ``env.config.language``.
.. autoclass:: Config
.. _template-bridge:

View File

@ -78,8 +78,15 @@ if PY2:
class Config(object):
"""
Configuration file abstraction.
"""Configuration file abstraction.
The config object makes the values of all config values available as
attributes.
It is exposed via the :py:attr:`sphinx.application.Application.config` and
:py:attr:`sphinx.environment.Environment.config` attributes. For example,
to get the value of :confval:`language`, use either ``app.config.language``
or ``env.config.language``.
"""
# the values are: (default, what needs to be rebuilt if changed)