mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #9447 from Blendify/Blendify/html-templates-sphinx-version
HTML Templates: Expose full sphinx version tuple
This commit is contained in:
commit
641174db5d
@ -372,7 +372,16 @@ in the future.
|
||||
|
||||
.. data:: sphinx_version
|
||||
|
||||
The version of Sphinx used to build.
|
||||
The version of Sphinx used to build represented as a string for example "3.5.1".
|
||||
|
||||
.. data:: sphinx_version_tuple
|
||||
|
||||
The version of Sphinx used to build represented as a tuple of five elements.
|
||||
For Sphinx version 3.5.1 beta 3 this would be `(3, 5, 1, 'beta', 3)``.
|
||||
The fourth element can be one of: ``alpha``, ``beta``, ``rc``, ``final``.
|
||||
``final`` always has 0 as the last element.
|
||||
|
||||
.. versionadded:: 4.2
|
||||
|
||||
.. data:: style
|
||||
|
||||
|
@ -26,6 +26,7 @@ from docutils.nodes import Node
|
||||
from docutils.utils import relative_path
|
||||
|
||||
from sphinx import __display_version__, package_dir
|
||||
from sphinx import version_info as sphinx_version
|
||||
from sphinx.application import Sphinx
|
||||
from sphinx.builders import Builder
|
||||
from sphinx.config import ENUM, Config
|
||||
@ -516,6 +517,7 @@ class StandaloneHTMLBuilder(Builder):
|
||||
'language': self.config.language,
|
||||
'css_files': self.css_files,
|
||||
'sphinx_version': __display_version__,
|
||||
'sphinx_version_tuple': sphinx_version,
|
||||
'style': self._get_style_filename(),
|
||||
'rellinks': rellinks,
|
||||
'builder': self.name,
|
||||
|
Loading…
Reference in New Issue
Block a user