Skip to content

👌 IMPROVE: Use Sphinx HTML assets policy to decide whether include assets#132

Merged
foster999 merged 3 commits intomasterfrom
use-assets-policy
Aug 4, 2021
Merged

👌 IMPROVE: Use Sphinx HTML assets policy to decide whether include assets#132
foster999 merged 3 commits intomasterfrom
use-assets-policy

Conversation

@foster999
Copy link
Collaborator

See #127

humitos and others added 3 commits July 5, 2021 11:10
…sets

Sphinx v4.1.0 will include `Sphinx.registry.html_assets_policy` that defines the
policy to whether include or not HTML assets in pages where the extension is not
used.

This PR makes usage of this policy to decide if sphinx-tabs assets should be
included or not in the page that's being rendered.

Reference: sphinx-doc/sphinx#9115
@codecov
Copy link

codecov bot commented Aug 4, 2021

Codecov Report

Merging #132 (a97fee5) into master (d921af3) will decrease coverage by 0.32%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #132      +/-   ##
==========================================
- Coverage   92.55%   92.23%   -0.33%     
==========================================
  Files           2        2              
  Lines         215      219       +4     
==========================================
+ Hits          199      202       +3     
- Misses         16       17       +1     
Flag Coverage Δ
pytests 92.23% <83.33%> (-0.33%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sphinx_tabs/tabs.py 92.16% <83.33%> (-0.33%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d921af3...a97fee5. Read the comment docs.

@foster999 foster999 merged commit 7f2146a into master Aug 4, 2021
@foster999 foster999 deleted the use-assets-policy branch August 4, 2021 22:00
stsewd added a commit to readthedocs/sphinx-hoverxref that referenced this pull request Nov 11, 2024
We are disconnecting the html-page-context event from sphinx-tabs,
which was used to delete the static files from html files
that didn't use sphinx-tabs. But in executablebooks/sphinx-tabs#198
this was changed to instead decide if the page should have the static files or not.

Since we are removing that event, sphinx-tabs never gets to inject the
static files, this breaks sphinx-tabs for projects using hoverxref.

We no longer need to disconnect that signal, since we are overriding the html assets policy to `always`,
which sphnx-tabs respects already executablebooks/sphinx-tabs#132
(more than 3 years ago).
stsewd added a commit to readthedocs/sphinx-hoverxref that referenced this pull request Nov 11, 2024
We are disconnecting the html-page-context event from sphinx-tabs,
which was used to delete the static files from html files
that didn't use sphinx-tabs. But in executablebooks/sphinx-tabs#198
this was changed to instead decide if the page should have the static files or not.

Since we are removing that event, sphinx-tabs never gets to inject the
static files, this breaks sphinx-tabs for projects using hoverxref.

We no longer need to disconnect that signal, since we are overriding the html assets policy to `always`,
which sphnx-tabs respects already executablebooks/sphinx-tabs#132
(more than 3 years ago).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants