-
Notifications
You must be signed in to change notification settings - Fork 1
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
Move autosummary templates to within the theme #18
Conversation
Hello. You may have forgotten to update the changelog!
|
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.
Excellent! 🎉
To use this in your theme, add the following to your ``conf.py`` | ||
configuration file: |
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.
Is it worth mentioning that these templates are included by default?
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.
Sorry, what do you mean @Mandrenkov? They won't be included by default (unfortunately), since you'll need to configure your own conf.py
to set the template path.
As far as I could tell, after browsing the Sphinx dev docs, there is no way of having a HTML theme automatically register new templates
Co-authored-by: Mikhail Andrenkov <Mandrenkov@users.noreply.github.com>
Co-authored-by: Mikhail Andrenkov <Mandrenkov@users.noreply.github.com>
Context: Currently, all projects using this theme need to duplicate the autosummary templates manually.
Description of the Change: Moves the autosummary templates to within the theme package.
Benefits: Reduction in code and setup for packages
Possible Drawbacks: Only a minor one;
importlib.resources
has only been added by Python 3.10ish, so we need to installimportlib_resources
for backwards compatibility. This is the official recommended approach by PyPA.Related GitHub Issues: n/a