-
Notifications
You must be signed in to change notification settings - Fork 327
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
Improving ABlog style and configuration #1075
Conversation
cc for @12rambau - I couldn't get the new
Did you run into this at all? |
The way it displays error is not always straight forward (specifically the first time when nothing was prettiffied but no I never saw this one I'm going to try on my side |
yep I confirmed, nothing from my side:
|
OK I pushed a commit that adds a test for this so that we can confirm our "config override" behavior! I think this is ready to go unless folks have style suggestions |
@@ -1044,7 +1048,7 @@ def setup(app): | |||
app.set_translator("readthedocs", BootstrapHTML5Translator, override=True) | |||
app.set_translator("readthedocsdirhtml", BootstrapHTML5Translator, override=True) | |||
|
|||
app.connect("env-updated", update_config) | |||
app.connect("builder-inited", update_config) |
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.
the fact that you now intercept "builder-inited" instead of "env-update" means that you take into account default values from theme.conf
.
Does it means that verything that is done in prepare_html_config
could be moved to update_config
?
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.
I do think that this is the "cleaner" way to intercept and/or set our own defaults for config. Happy to explore moving that functionality to this event if you think that'd be useful
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.
I think it would make sense in a folow-up PR but great that you found out this event !
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.
A quick follow-up here. I actually don't think that we can move the theme-related deprecations into the builder-inited
event.
This is because builder-inited
(by its name) comes after the HTML builder has been inited, and at that point the theme's configuration structure has already been finalized. We can then alter that structure later on in the html-page-context
event, but if we alter it in app.config
earlier on, it will have no effect.
This PR improves a number of the ABlog style and layout, and fixes up some of our configuration setting to set config values at the right point of the Sphinx build.
Here are the major changes:
ABlog
CSS now that it has better-labeled HTML #1067 (but that is waiting on an ABlog release)update_config
function earlier in the Sphinx build event chain, I think to where we are "supposed" to be updating configuration values.Demo here 👉 https://pydata-sphinx-theme--1075.org.readthedocs.build/en/1075/user_guide/ablog.html