Skip to content

Commit f031875

Browse files
authored
Unpin sphinx_rtd_theme and add a workaround for sphinx_rtd_theme v3.0 (#3892)
1 parent 48dadec commit f031875

File tree

5 files changed

+31
-21
lines changed

5 files changed

+31
-21
lines changed

.github/workflows/ci_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
sphinx-copybutton
115115
sphinx-design
116116
sphinx-gallery
117-
sphinx_rtd_theme<3.0
117+
sphinx_rtd_theme
118118
cairosvg
119119
sphinxcontrib-svg2pdfconverter
120120
tectonic

ci/requirements/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ dependencies:
3131
- sphinx-copybutton
3232
- sphinx-design
3333
- sphinx-gallery
34-
- sphinx_rtd_theme<3.0
34+
- sphinx_rtd_theme
3535
# Dev dependencies (building PDF documentation)
3636
# 'sphinxcontrib-svg2pdfconverter' is required since it's added to `extensions`.
3737
- sphinxcontrib-svg2pdfconverter

doc/_static/style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ p {
5252
max-width: 1000px;
5353
}
5454

55+
/* Compatibility with sphinx_rtd_theme v3.x.x */
56+
/* https://github.com/TexasInstruments/processor-sdk-doc/commit/4fa6276ddcf7f9db919af2e5b3aec7e70a1afa16 */
57+
.wy-side-nav-search>div.version {
58+
margin-top: -.4045em;
59+
margin-bottom: .809em;
60+
font-weight: 400;
61+
color: hsla(0, 0%, 100%, .3);
62+
}
63+
5564
/* Format parameters section similar to sphinx_rtd_theme v4.x.x (not a grid) */
5665
html.writer-html5 .rst-content dl.field-list {
5766
display: initial;

doc/_templates/layout.html

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,25 @@
3131
{% endblock %}
3232

3333

34-
{% block sidebartitle %}
35-
<a href="{{ pathto(root_doc) }}"><h2 class="sidebar-title">{{ project }}</h2></a>
36-
37-
{% if theme_display_version %}
38-
{%- set nav_version = version %}
39-
{% if READTHEDOCS and current_version %}
40-
{%- set nav_version = current_version %}
41-
{% endif %}
42-
{% if nav_version %}
43-
<div class="version">
44-
{{ nav_version }}
45-
</div>
46-
{% endif %}
47-
{% endif %}
48-
49-
{% include "searchbox.html" %}
50-
51-
{% endblock %}
34+
{%- block sidebartitle %}
35+
{# the logo helper function was removed in Sphinx 6 and deprecated since Sphinx 4 #}
36+
{# the master_doc variable was renamed to root_doc in Sphinx 4 (master_doc still exists in later Sphinx versions) #}
37+
{%- set _logo_url = logo_url|default(pathto('_static/' + (logo or ""), 1)) %}
38+
{%- set _root_doc = root_doc|default(master_doc) %}
39+
<a href="{{ pathto(_root_doc) }}">
40+
{% if not theme_logo_only %}<h2 class="sidebar-title">{{ project }}</h2>{% endif %}
41+
{%- if logo or logo_url %}
42+
<img src="{{ _logo_url }}" class="logo" alt="{{ _('Logo') }}"/>
43+
{%- endif %}
44+
</a>
45+
{%- set nav_version = version %}
46+
{%- if nav_version %}
47+
<div class="version">
48+
{{ nav_version }}
49+
</div>
50+
{%- endif %}
51+
{%- include "searchbox.html" %}
52+
{% endblock %}
5253

5354

5455
{% block menu %}

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies:
4343
- sphinx-copybutton
4444
- sphinx-design
4545
- sphinx-gallery>=0.19.0
46-
- sphinx_rtd_theme<3.0
46+
- sphinx_rtd_theme
4747
# Dev dependencies (building PDF documentation)
4848
- cairosvg
4949
- sphinxcontrib-svg2pdfconverter

0 commit comments

Comments
 (0)