Skip to content

Commit

Permalink
Spinix: use html_css_files html_js_files
Browse files Browse the repository at this point in the history
We are using an incorrect way to add additional CSS files.

This is causing a number of problems.

 * Unable to update sphinx-rtd-theme, due to no CSS styling
 * Issue#146 Copy button for code (button not displayed as expected)
 * Extensions that contribute CSS not working

The documentation for Spinix confirming this commit uses the correct method:

https://docs.readthedocs.io/en/stable/guides/adding-custom-css.html#how-to-add-custom-css-or-javascript-to-sphinx-documentation
  • Loading branch information
dlmiles committed May 30, 2023
1 parent 05dc927 commit 86d62c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 0 additions & 4 deletions source/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
{% endif %}
{% endfor %}
{% endblock %}
{% block scripts %}
{{ super() }}
<script src="{{ pathto('_static/dialog.js', 1) }}"></script>
{% endblock %}
{% block extrabody %}
{{ super() }}
{% if hasdoc(pagename) %}
Expand Down
15 changes: 10 additions & 5 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,17 @@
'titles_only': False
}

html_css_files = [
'theme_overrides.css', # override wide tables in RTD theme
'gh-fork-ribbon.css',
'spinaldoc.css'
]

html_js_files = [
'dialog.js'
]

html_context = {
'css_files': [
'_static/theme_overrides.css', # override wide tables in RTD theme
'_static/gh-fork-ribbon.css',
'_static/spinaldoc.css'
],
'head_meta': {
'robots': os.getenv('sphinx_html_context_head_meta_robots', None)
},
Expand Down

0 comments on commit 86d62c8

Please sign in to comment.