[Python-checkins] r67072 - doctools/trunk/doc/ext/ifconfig.rst

georg.brandl python-checkins at python.org
Sat Nov 1 15:54:52 CET 2008


Author: georg.brandl
Date: Sat Nov  1 15:54:51 2008
New Revision: 67072

Log:
Bring up to date and link to add_config_value().


Modified:
   doctools/trunk/doc/ext/ifconfig.rst

Modified: doctools/trunk/doc/ext/ifconfig.rst
==============================================================================
--- doctools/trunk/doc/ext/ifconfig.rst	(original)
+++ doctools/trunk/doc/ext/ifconfig.rst	Sat Nov  1 15:54:51 2008
@@ -12,10 +12,22 @@
 
    Include content of the directive only if the Python expression given as an
    argument is ``True``, evaluated in the namespace of the project's
-   configuration (that is, all variables from :file:`conf.py` are available).
+   configuration (that is, all registered variables from :file:`conf.py` are
+   available).
 
    For example, one could write ::
 
       .. ifconfig:: releaselevel in ('alpha', 'beta', 'rc')
 
          This stuff is only included in the built docs for unstable versions.
+
+   To make a custom config value known to Sphinx, use
+   :func:`~sphinx.application.Sphinx.add_config_value` in the setup function in
+   :file:`conf.py`, e.g.::
+
+      def setup(app):
+          app.add_config_value('releaselevel', '', True)
+
+   The second argument is the default value, the third should always be ``True``
+   for such values (it selects if Sphinx re-reads the documents if the value
+   changes).


More information about the Python-checkins mailing list