mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Simplify `Tags` (#12490)
- Use a set to store the list of tags - Cache evaluated expressions - Extract locally-defined function into a private method
This commit is contained in:
@@ -51,9 +51,9 @@ Important points to note:
|
||||
|
||||
* 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
|
||||
``tags.has('tag')`` to query, ``tags.add('tag')`` and ``tags.remove('tag')``
|
||||
``'tag' in tags`` to query, ``tags.add('tag')`` and ``tags.remove('tag')``
|
||||
to change. Only tags set via the ``-t`` command-line option or via
|
||||
``tags.add('tag')`` can be queried using ``tags.has('tag')``.
|
||||
``tags.add('tag')`` can be queried using ``'tag' in tags``.
|
||||
Note that the current builder tag is not available in ``conf.py``, as it is
|
||||
created *after* the builder is initialized.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user