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
DOC: Document helper for dark mode #626
Conversation
@12rambau you might have other better ideas here, too! |
This is a nice idea! I made a few edits and cleaned up this section in general in the latest commit, what do you think? |
@larsoner thanks for the editing of the doc, I was not super confident with what was written there and I think it' much better. With regards to the images, It's a tricky subject. On my documentation I decided to continue using directives so that the other builds (epub and pdf) continue to work but I was forced to inject custom js to make the switch between light and dark versions of the images. Do you think it should be written as well ? (the fact that using pure HTML will prevent pdf build of your images) |
I did the same in the end actually. The https://github.com/mne-tools/mne-python/blame/main/doc/index.rst#L20-L29 This seemed unnecessarily complicated as I figured people would use the docs as a minimal example of how to tweak the HTML (and the getElementsByClassName seemed less minimal), but I could change the example to use this instead if you think it would help people realize they don't have to abandon a standard directive here! |
Switching to keep standard directive use here's the updated text: |
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 like those new changes! This LGTM. I'll hold off on merging for a little bit in case @12rambau would like changes!
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.
LGTM as well!
@12rambau, any thoughts before merging it? |
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.
nothing to add from my side
Many thanks @larsoner !! |
After #540, the first thing I needed to do was to make the main MNE-Python logo responsive. This adds a hint to people for how to do it. (It took me hours because I'm bad at JS!)
FYI I tried the
<picture><srcset ...>
approach where you look at if it prefers dark to light, but this was not responsive to theme changes.