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] don't append CSS files to the end of html_static_path list #153

Merged
merged 1 commit into from Mar 16, 2022

Conversation

return42
Copy link
Contributor

html_static_path is a list of paths that contain custom static files. They are
copied to the output’s _static directory after the theme’s static files, so a
file named default.css will overwrite the theme’s default.css [1]

Without this patch a tabs.css can't be overwritten by the conf.py file:

html_static_path = [ 'static/tabs.css', ]

The /static folder from sphinx-tabs needs to be added in front of
html_static_path since the last item in the list will be written last to
/_static.

[1] https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_static_path

Signed-off-by: Markus Heiser markus.heiser@darmarit.de

html_static_path is a list of paths that contain custom static files.  They are
copied to the output’s _static directory **after** the theme’s static files, so a
file named default.css will overwrite the theme’s default.css [1]

Without this patch a tabs.css can't be overwritten by the `conf.py` file:

   html_static_path = [ 'static/tabs.css', ]

The /static folder from sphinx-tabs needs to be added in front of
html_static_path since the last item in the list will be written last to
/_static.

[1] https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_static_path

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
@welcome
Copy link

welcome bot commented Mar 11, 2022

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.

Welcome to the EBP community! 🎉

@foster999
Copy link
Collaborator

Thanks for this, I hadn't considered that someone would want to overwrite the CSS file(s) for a plugin!

Please could you add a line to our Sphinx docs to describe how a user would do this in their sphinx conf?

@return42
Copy link
Contributor Author

Please could you add a line to our Sphinx docs to describe how a user would do this in their sphinx conf?

IMO this is not needed, it is the common solution to overwrite static files (images, CSS, JS ..) and is described in the Spinx framework, see html_static_path. By example: this was the first I tried to implement a workaround for #152.

return42 added a commit to return42/searxng that referenced this pull request Mar 12, 2022
The myst-parser requires >= docutils v.0.17 what ends in a dependency hell where
plugins sphinx-tabs and sphinx-jinja we use are involved.

This patch can be reverted when [1], [2] and [3] are solved and new releases are
available.

[1] searxng#954
[2] executablebooks/sphinx-tabs#152
[3] executablebooks/sphinx-tabs#153

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 added a commit to return42/searxng that referenced this pull request Mar 12, 2022
The myst-parser requires >= docutils v.0.17 what ends in a dependency hell where
plugins sphinx-tabs and sphinx-jinja we use are involved.

This patch can be reverted when [1], [2] and [3] are solved and new releases are
available.

[1] searxng#954
[2] executablebooks/sphinx-tabs#152
[3] executablebooks/sphinx-tabs#153

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 added a commit to return42/searxng that referenced this pull request Mar 12, 2022
The myst-parser requires >= docutils v.0.17 what ends in a dependency hell where
plugins sphinx-tabs and sphinx-jinja we use are involved.

This patch can be reverted when [2], [3], [4]  are solved and new release is
available / see [1].

[1] searxng#954
[2] executablebooks/sphinx-tabs#152
[3] executablebooks/sphinx-tabs#153
[4] executablebooks/sphinx-tabs#154

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
@codecov
Copy link

codecov bot commented Mar 15, 2022

Codecov Report

Merging #153 (887062b) into master (53b6a63) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #153   +/-   ##
=======================================
  Coverage   92.69%   92.69%           
=======================================
  Files           2        2           
  Lines         219      219           
=======================================
  Hits          203      203           
  Misses         16       16           
Flag Coverage Δ
pytests 92.69% <ø> (ø)

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

Impacted Files Coverage Δ
sphinx_tabs/tabs.py 92.62% <ø> (ø)

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 53b6a63...887062b. Read the comment docs.

@foster999 foster999 merged commit 154f273 into executablebooks:master Mar 16, 2022
@welcome
Copy link

welcome bot commented Mar 16, 2022

Congrats on your first merged pull request in this project! 🎉
congrats

Thank you for contributing, we are very proud of you! ❤️

@return42 return42 deleted the fix-html_static_path branch March 16, 2022 20:09
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.

None yet

2 participants