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

Add compatibility for sphinx4 #1123

Merged
merged 24 commits into from Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
836467e
Add compatibility for sphinx4
Blendify Apr 10, 2021
db30205
Test with official beta
Blendify Apr 12, 2021
b73b67e
Revert "Test with official beta"
Blendify Apr 12, 2021
bd9010f
Update layout.html
Blendify Jun 10, 2021
09e9e10
Merge branch 'master' into Blendify/sphinx4
Blendify Jun 22, 2021
e94984c
Make sphinx version comparison constistent
Blendify Jul 12, 2021
b47f8b3
Merge branch 'master' into Blendify/sphinx4
Blendify Jul 12, 2021
1f45c11
Fix user-select line numbers class name
Blendify Jul 12, 2021
15d9109
Fix api docs css for sphinx4
Blendify Jul 13, 2021
0ef60e7
Tests: run against sphinx 4.1
Blendify Jul 13, 2021
e171657
Merge branch 'master' into Blendify/sphinx4
Blendify Jul 13, 2021
d93528e
Tests: Add missing sphinx version
Blendify Jul 13, 2021
da20dec
Compare sphinx version using a tuple
Blendify Jul 14, 2021
037890d
Merge branch 'Blendify/sphinx4' of github.com:readthedocs/sphinx_rtd_…
Blendify Jul 14, 2021
6f95012
Fix tests, missing theme extension
agjohnson Jul 14, 2021
6597b25
Fix styles on code block line numbers on Sphinx 4+
agjohnson Jul 14, 2021
796e78b
Make font usage conistent with sphinx<4.0
Blendify Jul 14, 2021
c1aa1b2
Rebuild assets
agjohnson Jul 15, 2021
ee32a53
Add a CI test for unbuilt assets
agjohnson Jul 14, 2021
e6bd3f0
Don't use extension to add sphinx_version_info tuple to build context
agjohnson Jul 15, 2021
8d93cde
Italize keywords
Blendify Jul 17, 2021
047169a
Restore highlighted code lines span full width
Blendify Jul 17, 2021
09e2a0d
Merge branch 'master' into Blendify/sphinx4
agjohnson Jul 19, 2021
0207996
Fix automerge fuck up
agjohnson Jul 19, 2021
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Expand Up @@ -8,7 +8,7 @@ commands:
type: string
sphinx-version:
type: string
default: "16,17,18,20,21,22,23,24,30,31,32,33,34,latest"
default: "16,17,18,20,21,22,23,24,30,31,32,33,34,35,40,latest"
steps:
- checkout
- run: pip install --user tox
Expand Down
8 changes: 6 additions & 2 deletions sphinx_rtd_theme/layout.html
Expand Up @@ -20,8 +20,10 @@
{%- endblock -%}

{#- CSS #}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- if (sphinx_version <= "4.0.0") -%}
Blendify marked this conversation as resolved.
Show resolved Hide resolved
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- endif %}
{%- for css in css_files %}
{%- if css|attr("rel") %}
<link rel="{{ css.rel }}" href="{{ pathto(css.filename, 1) }}" type="text/css"{% if css.title is not none %} title="{{ css.title }}"{% endif %} />
Expand Down Expand Up @@ -57,7 +59,9 @@
{%- if not embedded %}
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
{%- if sphinx_version >= "1.8.0" -%}
{%- if sphinx_version <= "4.0.0" -%}
<script type="text/javascript" id="documentation_options" data-url_root="{{ url_root }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
{%- endif -%}
{%- for scriptfile in script_files %}
{{ js_tag(scriptfile) }}
{%- endfor %}
Expand Down
2 changes: 1 addition & 1 deletion sphinx_rtd_theme/static/css/theme.css

Large diffs are not rendered by default.

9 changes: 2 additions & 7 deletions src/sass/_theme_rst.sass
Expand Up @@ -85,18 +85,13 @@
padding: ($base-line-height / 2) ($base-line-height / 2)
display: block
overflow: auto
& .hll
// Line emphasis spans full width
display: block
margin: 0 (-1 * $base-line-height / 2)
padding: 0 ($base-line-height / 2)
pre.literal-block, div[class^='highlight'] pre, .linenodiv pre
font-family: $code-font-family
font-size: 12px
line-height: 1.4

// Do not allow selection of code block prompts
div.highlight .gp
// Do not allow selection of code block prompts and line numbers
.lineno, .gp
Blendify marked this conversation as resolved.
Show resolved Hide resolved
user-select: none
pointer-events: none

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,36,37,38,39}-sphinx{16,17,18,20,21,22,23,24,30,31,32,33,34,latest}
envlist = py{27,36,37,38,39}-sphinx{16,17,18,20,21,22,23,24,30,31,32,33,34,35,40,latest}

[testenv]
setev =
Expand All @@ -22,6 +22,8 @@ deps =
sphinx32: Sphinx < 3.3
sphinx33: Sphinx < 3.4
sphinx34: Sphinx < 3.5
sphinx35: Sphinx < 4.0
Blendify marked this conversation as resolved.
Show resolved Hide resolved
sphinx40: Sphinx < 4.1
sphinxlatest: Sphinx
commands =
pytest {posargs} tests/
Expand Down