Sphinx logo

Previous topic

sphinx.ext.refcounting – Keep track of reference counting behavior

Next topic

sphinx.ext.coverage – Collect doc coverage stats

This Page

Quick search

sphinx.ext.ifconfig – Include content based on configuration

This extension is quite simple, and features only one directive:

.. ifconfig::

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 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.