-
Notifications
You must be signed in to change notification settings - Fork 144
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
Switch to furo sphinx docs theme #3088
base: main
Are you sure you want to change the base?
Conversation
cb57e18
to
48ad1b6
Compare
"(cat {root}/docs/header.txt; echo; tail -n+8 {root}/docs/overview.rst) > {root}/docs/man.rst", | ||
"sed '/versionadded::/d' -i {root}/docs/man.rst", |
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.
How about adding these to the sphinx setup or the Makefile?
Lines 316 to 327 in a08a4be
def generate_tmt_docs(app: Sphinx, config: Any) -> None: | |
""" Run `make generate` to populate the auto-generated sources """ | |
conf_dir = Path(app.confdir) | |
subprocess.run(["make", "generate"], cwd=conf_dir, check=True) | |
def setup(app: Sphinx) -> None: | |
# Generate sources after loading configuration. That should build | |
# everything, including the logo, before Sphinx starts checking | |
# whether all input files exist. | |
app.connect("config-inited", generate_tmt_docs) |
Probably combining exclude_patterns = [r"man/*"]
and manpages
would work. I don't see config options for specific builder overrides.
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.
sure, whatever works. This is just a PoC of rendering the manpage in the same way as the current setup, just without rst2man.
I like the current documentation theme and I'd probably suggest not to change the look that often. We've switched to |
@psss I'm sure it can be configured to look/feel a bit more like the current theme, if it's about aesthetics.
I mean, we're already forced to use specific versions of packages, only a matter of time until something breaks again. Let alone being able to take advantage of development in newer sphinx versions, etc. |
From experience, themes can lag behind sphinx backend. I had issues on the |
Looking at the repo activity...I'm not sure about that. |
Recently added `custom.css` erases the theme itself, reverting colors and everything to defaults. Use different filename for our custom additions.
# Dark by default | ||
html_theme_options = { | ||
"light_css_variables": { | ||
"color-scheme": "dark", | ||
}, | ||
"dark_css_variables": { | ||
"color-scheme": "dark", | ||
}, | ||
} |
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.
For me furo
already automatically enables dark mode for example on: https://scikit-build-core.readthedocs.io/en/latest/. I have it enabled system wide on the desktop (and firefox by proxy I guess)
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.
From the documentation, it's light by default, but switches to dark automatically when browser is set to prefer dark.
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.
Welp, no reason to complicate things. When I've had an epaper device, the dark-theme sites were unreadable, so in some edge cases it's better to let the system/browser set what it prefers, and let the users set it up or buy a good pair of sunglasses.
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.
Yep, agree, I'm just playing with it while in Draft. Also not happy with introducing js :)
The currently used theme is not being updated and it's dependencies are causing issues, like #3087
This is a proof of concept of using the Furo theme, which is being used, among others, by pip, Python Developer’s Guide and black.
https://github.com/pradyunsg/furo
https://pradyunsg.me/furo/
Removing usage of rst2man and relying on sphinx builder to create manpage. This would be also a good opportunity to improve the man page, perhaps with additional pages and such.
We could also introduce sphinx-design, for which furo is the showpiece theme:https://sphinx-design.readthedocs.io/en/furo-theme/
Having markdown support would be a boon as well: https://myst-parser.readthedocs.io/en/latest/
Perhaps we could add https://github.com/executablebooks/sphinx-copybutton
Pull Request Checklist