-
Notifications
You must be signed in to change notification settings - Fork 200
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: properly handle CSS objects in css_files #791
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me - a minor nitpick but LGTM regardless.
Should double-check that the "unexpected warnings" test failure is real or not though
@@ -117,7 +131,7 @@ def hash_html_assets(app, pagename, templatename, context, doctree): | |||
# run but the book theme CSS file won't be linked in Sphinx. | |||
if app.config.html_theme == "sphinx_book_theme": | |||
assets.append("styles/sphinx-book-theme.css") | |||
hash_assets_for_files(assets, get_html_theme_path() / "static", context) | |||
hash_assets_for_files(assets, get_html_theme_path() / "static", context, app) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is public, but I can't imagine anyone using it. Are you happy with the breaking change?
…lebooks/sphinx-book-theme into agoose77/fix-sphinx-726-warning
Sphinx 7.26 (approximately) deprecates implicit string operations on the contents of
context['css_files']
. This, in turn, raises warnings for users that enable strict warning checks. This was observed injupyter-book
's test-suite.This PR updates our handling to first assume objects within this list are
_CascadingStyleSheet
objects, and replaces the object back on the path.