Skip to content
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

Merged
merged 11 commits into from
Sep 23, 2022
Merged

Move autosummary templates to within the theme #18

merged 11 commits into from
Sep 23, 2022

Conversation

josh146
Copy link
Member

@josh146 josh146 commented Sep 23, 2022

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 install importlib_resources for backwards compatibility. This is the official recommended approach by PyPA.

Related GitHub Issues: n/a

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name and GitHub username in the contributors section.

README.rst Outdated Show resolved Hide resolved
Copy link
Collaborator

@Mandrenkov Mandrenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! 🎉

.github/CHANGELOG.md Outdated Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
requirements-dev.txt Outdated Show resolved Hide resolved
xanadu_sphinx_theme/__init__.py Show resolved Hide resolved
Comment on lines +26 to +27
To use this in your theme, add the following to your ``conf.py``
configuration file:
Copy link
Collaborator

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?

Copy link
Member Author

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

Base automatically changed from sidebar to master September 23, 2022 21:44
josh146 and others added 4 commits September 23, 2022 18:03
Co-authored-by: Mikhail Andrenkov <Mandrenkov@users.noreply.github.com>
Co-authored-by: Mikhail Andrenkov <Mandrenkov@users.noreply.github.com>
@josh146 josh146 merged commit 7d425c6 into master Sep 23, 2022
@josh146 josh146 deleted the templates branch September 23, 2022 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants