mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add a new `confval` directive to document settings and configuration values (#12536)
This commit is contained in:
@@ -42,6 +42,44 @@ There is a set of directives allowing documenting command-line programs:
|
||||
|
||||
``cmdoption`` directive is a deprecated alias for the ``option`` directive.
|
||||
|
||||
.. rst:directive:: .. confval:: name
|
||||
|
||||
Describes a configuration value or setting that the documented
|
||||
code or program uses or defines.
|
||||
Referenceable by :rst:role:`confval`.
|
||||
|
||||
.. rst:directive:option:: type
|
||||
:type: text
|
||||
|
||||
Describes the type of the configuration value.
|
||||
This is optional, and if specified will be interpreted as reStructuredText.
|
||||
|
||||
.. rst:directive:option:: default
|
||||
:type: text
|
||||
|
||||
Describes the default value of the configuration value.
|
||||
This is optional, and if specified will be interpreted as reStructuredText.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: rst
|
||||
|
||||
.. confval:: the_answer
|
||||
:type: ``int`` (a *number*)
|
||||
:default: **42**
|
||||
|
||||
This is a setting that controls the value of the answer.
|
||||
|
||||
will be rendered as follows:
|
||||
|
||||
.. confval:: the_answer
|
||||
:no-contents-entry:
|
||||
:no-index-entry:
|
||||
:type: ``int`` (a *number*)
|
||||
:default: **42**
|
||||
|
||||
This is a setting that controls the value of the answer.
|
||||
|
||||
.. rst:directive:: .. envvar:: name
|
||||
|
||||
Describes an environment variable that the documented code or program uses
|
||||
|
||||
Reference in New Issue
Block a user