From b7749c6ca3722f9256d19d4c3ca992b699ed5e0e Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 4 Dec 2017 20:30:23 +0000 Subject: [PATCH] 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 --- doc/extdev/appapi.rst | 11 ++--------- sphinx/config.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/extdev/appapi.rst b/doc/extdev/appapi.rst index 9feaa0884..e7f641e43 100644 --- a/doc/extdev/appapi.rst +++ b/doc/extdev/appapi.rst @@ -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: diff --git a/sphinx/config.py b/sphinx/config.py index 1b3f51a6e..18da9eb9a 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -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)