Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix double brackets #10523

Merged
merged 6 commits into from Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES
Expand Up @@ -13,10 +13,14 @@ 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
----------

* #10509: autosummary: autosummary fails with a shared library
* #10523: html theme: Fix double brackets on citation references in Docutils 0.18+.

Testing
--------
Expand Down
9 changes: 9 additions & 0 deletions doc/templating.rst
Expand Up @@ -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)``.
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
1 change: 1 addition & 0 deletions sphinx/builders/html/__init__.py
Expand Up @@ -536,6 +536,7 @@ def prepare_writing(self, docnames: Set[str]) -> None:
'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,
Expand Down
2 changes: 2 additions & 0 deletions sphinx/themes/basic/static/basic.css_t
Expand Up @@ -237,6 +237,7 @@ a.headerlink {
visibility: hidden;
}

{%- if docutils_version_info[:2] < (0, 18) %}
a.brackets:before,
span.brackets > a:before{
content: "[";
Expand All @@ -246,6 +247,7 @@ a.brackets:after,
span.brackets > a:after {
content: "]";
}
{% endif %}

h1:hover > a.headerlink,
h2:hover > a.headerlink,
Expand Down