Closes #1328: clarify that builder-specific tags are not available when conf.py is executed.

This commit is contained in:
Georg Brandl
2014-01-12 22:40:50 +01:00
parent 31de96330d
commit a72406d434
2 changed files with 8 additions and 2 deletions

View File

@@ -40,6 +40,8 @@ Important points to note:
delete them from the namespace with ``del`` if appropriate. Modules are delete them from the namespace with ``del`` if appropriate. Modules are
removed automatically, so you don't need to ``del`` your imports after use. removed automatically, so you don't need to ``del`` your imports after use.
.. _conf-tags:
* There is a special object named ``tags`` available in the config file. * There is a special object named ``tags`` available in the config file.
It can be used to query and change the tags (see :ref:`tags`). Use It can be used to query and change the tags (see :ref:`tags`). Use
``tags.has('tag')`` to query, ``tags.add('tag')`` and ``tags.remove('tag')`` ``tags.has('tag')`` to query, ``tags.add('tag')`` and ``tags.remove('tag')``

View File

@@ -176,8 +176,9 @@ Including content based on tags
.. only:: html and draft .. only:: html and draft
Undefined tags are false, defined tags (via the ``-t`` command-line option or Undefined tags are false, defined tags (via the ``-t`` command-line option or
within :file:`conf.py`) are true. Boolean expressions, also using within :file:`conf.py`, see :ref:`here <conf-tags>`) are true. Boolean
parentheses (like ``html and (latex or draft)``) are supported. expressions, also using parentheses (like ``html and (latex or draft)``) are
supported.
The *format* and the *name* of the current builder (``html``, ``latex`` or The *format* and the *name* of the current builder (``html``, ``latex`` or
``text``) are always set as a tag [#]_. To make the distinction between ``text``) are always set as a tag [#]_. To make the distinction between
@@ -185,6 +186,9 @@ Including content based on tags
``builder_``, e.g. the epub builder defines the tags ``html``, ``epub``, ``builder_``, e.g. the epub builder defines the tags ``html``, ``epub``,
``format_html`` and ``builder_epub``. ``format_html`` and ``builder_epub``.
These standard tags are set *after* the configuration file is read, so they
are not available there.
.. versionadded:: 0.6 .. versionadded:: 0.6
.. versionchanged:: 1.2 .. versionchanged:: 1.2
Added the name of the builder and the prefixes. Added the name of the builder and the prefixes.