From 2330cfd1e3514602e29ea4f7b016c0aacfcca023 Mon Sep 17 00:00:00 2001 From: ron Date: Wed, 11 Feb 2026 12:58:56 -0500 Subject: [PATCH] doc: add example for the envvar directive The ``.. envvar::`` directive documentation did not include an example showing that it accepts body text with a description, unlike the neighbouring ``confval`` directive which has a full example. Add one following the same pattern (RST source + rendered output). --- doc/usage/domains/standard.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/doc/usage/domains/standard.rst b/doc/usage/domains/standard.rst index dfc837fc2e1..7981cca1cd2 100644 --- a/doc/usage/domains/standard.rst +++ b/doc/usage/domains/standard.rst @@ -87,6 +87,24 @@ There is a set of directives allowing documenting command-line programs: Describes an environment variable that the documented code or program uses or defines. Referenceable by :rst:role:`envvar`. + Example: + + .. code-block:: rst + + .. envvar:: PYTHONINSPECT + + If this is set to a non-empty string, it is equivalent to specifying + the :option:`-i` option. + + will be rendered as follows: + + .. envvar:: PYTHONINSPECT + :no-contents-entry: + :no-index-entry: + + If this is set to a non-empty string, it is equivalent to specifying + the :option:`-i` option. + .. rst:directive:: .. program:: name Like :rst:dir:`py:currentmodule`, this directive produces no output.