[fix] don't append CSS files to the end of html_static_path list#153
Conversation
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>
|
Thanks for submitting your first pull request! You are awesome! 🤗 |
|
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? |
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. |
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>
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>
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 Report
@@ Coverage Diff @@
## master #153 +/- ##
=======================================
Coverage 92.69% 92.69%
=======================================
Files 2 2
Lines 219 219
=======================================
Hits 203 203
Misses 16 16
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|

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.pyfile: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