1. Matt McClure
  2. sphinx

Commits

Roland Meister  committed 41b9bd7

Add the builder name as predefined tag for the only directive.

At the moment only the epub builder distinguishes between format and name.
Explicit entries with format_ and builder_ prefix are also added.

  • Participants
  • Parent commits 20445f7
  • Branches default

Comments (0)

Files changed (2)

File doc/markup/misc.rst

View file
    within :file:`conf.py`) are true.  Boolean expressions, also using
    parentheses (like ``html and (latex or draft)``) are supported.
 
-   The format of the current builder (``html``, ``latex`` or ``text``) is always
-   set as a tag.
+   The format and the name of the current builder (``html``, ``latex`` or
+   ``text``) is always set as a tag [#]_. To make the distinction between
+   format and name explicit, they are also added with the prefix ``format_`` and
+   ``builder_``.
 
    .. versionadded:: 0.6
+   .. versionchanged:: 1.2
+      Added the name of the builder and the prefixes.
 
 
 Tables
    means that by default, Sphinx generates such column specs for such tables.
    Use the :rst:dir:`tabularcolumns` directive to get finer control over such
    tables.
+
+.. rubric:: Footnotes
+
+.. [#] At the moment only the epub builder distinguishes between the builder
+   format and the builder name.
+

File sphinx/builders/__init__.py

View file
         self.config = app.config
         self.tags = app.tags
         self.tags.add(self.format)
+        self.tags.add(self.name)
+        self.tags.add("format_%s" % self.format)
+        self.tags.add("builder_%s" % self.name)
 
         # images that need to be copied over (source -> dest)
         self.images = {}