-
-
Notifications
You must be signed in to change notification settings - Fork 20
WIP: Add an astropy theme which is a re-configured sunpy-sphinx-theme #93
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
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5ba42f0
Initial sunpy-sphinx-theme config
Cadair a1479b1
more theme hacks
Cadair 0ff7467
First working version of "theme"
Cadair 99866cf
Need dev sunpy-sphinx-theme
Cadair 75d204e
Configure extra rtd search project
Cadair 3b65334
Use main again
Cadair File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # -*- coding: utf-8 -*- | ||
| # Licensed under a 3-clause BSD style license - see LICENSE.rst | ||
| # | ||
| # Astropy shared Sphinx settings. These settings are shared between | ||
| # astropy itself and affiliated packages. | ||
| # | ||
| # v3 extends v2 to use the shared sunpy-sphinx-theme settings | ||
|
|
||
| from sphinx_astropy.conf.v2 import * # noqa: F403 | ||
|
|
||
| html_theme = "astropy" | ||
| html_logo = "https://raw.githubusercontent.com/astropy/astropy-logo/refs/heads/main/astropy_logo_notext.svg" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from pathlib import Path | ||
|
|
||
| from sphinx.application import Sphinx | ||
|
|
||
|
|
||
| def setup(app: Sphinx): | ||
| # Register theme | ||
| theme_dir = Path(__file__).parent.resolve() | ||
| app.add_html_theme("astropy", theme_dir) | ||
| app.add_css_file("css/astropy.css", priority=650) | ||
|
|
||
| return { | ||
| "parallel_read_safe": True, | ||
| "parallel_write_safe": True, | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| :root { | ||
| /* SunPy Theme Colors */ | ||
| /* If you add or change the names of these please update the docs */ | ||
| --sst-accent-color-bright: #ff5000; | ||
| --sst-accent-color-muted: #FC9468; | ||
| --sst-dark-color: #404040; | ||
| --sst-darker-color: #333333; | ||
| --sst-darkest-color: #222222; | ||
| --sst-light-color: rgb(206, 206, 206); | ||
| --sst-lighter-color: rgb(231, 231, 231); | ||
| --sst-lightest-color: rgb(251, 251, 251); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| [theme] | ||
| inherit = "sunpy" | ||
|
|
||
| [options] | ||
| sst_project_name = "Astropy" | ||
| sst_site_root = "https://astropy.org" | ||
| navbar_links = [ | ||
| ["About", | ||
| [ | ||
| ["About Astropy", "about.html", 2], | ||
| ["Code of Conduct", "code_of_conduct.html", 2], | ||
| ["Acknowledging & Citing", "acknowledging.html", 2], | ||
| ["History", "history.html", 2], | ||
| ] | ||
| ], | ||
| ["Documentation", | ||
| [ | ||
| ["astropy", "https://docs.astropy.org", 3], | ||
| ["asdf-astropy", "https://asdf-astropy.readthedocs.io", 3], | ||
| ["astropy-healpix", "https://astropy-healpix.readthedocs.io", 3], | ||
| ["astroquery", "https://astroquery.readthedocs.io", 3], | ||
| ["ccdproc", "https://ccdproc.readthedocs.io", 3], | ||
| ["photutils", "https://photutils.readthedocs.io", 3], | ||
| ["regions", "https://astropy-regions.readthedocs.io", 3], | ||
| ["reproject", "https://reproject.readthedocs.io", 3], | ||
| ["specreduce", "https://specreduce.readthedocs.io", 3], | ||
| ["specutils", "https://specutils.readthedocs.io", 3], | ||
| ] | ||
| ], | ||
| ["Get Help", "help.html", 2], | ||
| ["Contribute", "contribute.html", 2], | ||
| ["Affiliated Packages", "affiliated/index.html", 2], | ||
| ["Team", "team.html", 2], | ||
| ] | ||
| rtd_extra_search_projects = [["astropy-org-test", "https://astropy-org-test.readthedocs.io"]] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can we be a bit more specific on the theme name? Otherwise, if we want to switch again in the future, it might get confusing.
sphinx-astropy/sphinx_astropy/conf/v1.py
Line 259 in e77825c
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.
Got any suggestions? Calling it sunpy-astropy sounds terrible 😜
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.
You should have moved it to OpenAstronomy! :p
Is
astropy-v3-themealso confusing? Naming is hard.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.
calling it openastronomy makes the most sense; even if the package itself if not being moved.
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.
Calling what openastronomy?
Uh oh!
There was an error while loading. Please reload this page.
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.
FWIW we did have a theme package before the current one: https://github.com/astropy/astropy-sphinx-theme
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.
OK, before I go much further here I would like to get a 👍 from you all for the following plan:
I propose to move this micro-theme from this PR into astropy-sphinx-theme, under the name "astropy", and then release v2 of that package (optionally deprecating the old theme). This would mean that package would provide two themes, i.e. if you install it you can set
html_theme = "astropy"orhtml_theme = "bootstrap-astropy". If we want to make major changes to the "astropy" theme, we can control that with major versions of that package, or make a "astropy-v2" in the future if needed.As a prerequisite to that, I will have to do some cleanup of the now very crufty astropy-sphinx-theme repo, and I'll add a doc build to preview the themes etc.
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.
Wouldn't it be cleaner as a new theme package? I still think just "astropy" is too vague as theme name.
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.
Making a whole new repo with a new theme which is ~100 lines of code and config seems extreme when we already have a repo named "astropy-sphinx-theme"?
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.
you have my 👍