Add docutils_version_info to StandaloneHTMLBuilder.globalcontext

This commit is contained in:
Adam Turner 2022-06-04 17:45:09 +01:00
parent 1e30b8cd4d
commit 7286291f93
3 changed files with 13 additions and 0 deletions

View File

@ -13,6 +13,9 @@ Deprecated
Features added
--------------
* #10523: html theme: Expose the Docutils's version info tuple as a template variable,
``docutils_version_info``. Patch by Adam Turner.
Bugs fixed
----------

View File

@ -383,6 +383,15 @@ in the future.
.. versionadded:: 4.2
.. data:: docutils_version_info
The version of Docutils used to build represented as a tuple of five elements.
For Docutils version 0.16.1 beta 2 this would be `(0, 16, 1, 'beta', 1)``.
The fourth element can be one of: ``alpha``, ``beta``, ``candidate``, ``final``.
``final`` always has 0 as the last element.
.. versionadded:: 5.0.2
.. data:: style
The name of the main stylesheet, as given by the theme or

View File

@ -536,6 +536,7 @@ class StandaloneHTMLBuilder(Builder):
'css_files': self.css_files,
'sphinx_version': __display_version__,
'sphinx_version_tuple': sphinx_version,
'docutils_version_info': docutils.__version_info__[:5],
'style': self._get_style_filename(),
'rellinks': rellinks,
'builder': self.name,