Skip to content

Conversation

@Bibo-Joshi
Copy link
Member

@Bibo-Joshi Bibo-Joshi commented Apr 23, 2021

So, I was procastinating and noticed that pillows docs have a dark mode that's activated when your browser does the prefers-color-scheme thingy. My eyes like dark mode, so I had a look at how they did that.

Apparently the RTD theme won't have a native dark mode for a while (readthedocs/sphinx_rtd_theme#224 is open since 2015, so ~as old as PTB). So they just took the https://darkreader.org Chromium-Extension and exported the CSS generated by that. Looks neat IMHO. Can be previewed at https://python-telegram-bot.readthedocs.io/en/docs-dark-mode/. If you don't find the dark-mode setting in your browser, here are some screenshots:

Click to expand

image

image

image

Alternative approaches would be to go with different sphinx templates like Furo, but I actually like the RTD theme and this manual approach isn't maintenance-heavy.

Obviously this is anything but pressing, but still nice-to-have IMO. If you like it, we can merge, if not I won't be too sad 🙂

@harshil21
Copy link
Member

Definitely like the dark mode, since we're improving the docs anyway, how about these features/changes (maybe in another PR?):

@Bibo-Joshi
Copy link
Member Author

Nice ideas @harshil21 ! the external-links thingy was easy, pushing that directly to doc-fixes in a sec.

edit on github: IISC that would require either manually inserting :github_url: https://github.com/ptb/ptb/blos/master/telegram/… in each file or doing something hacky as proposed at readthedocs/sphinx_rtd_theme#465 (comment), see peterjc/thapbi-pict@f14b1df . IMO the first is tedious & the second error-prone (and will probably break at some point). As I personally don't see a great value, I won't try to get that to work - but also won't stand in the way of it :)

regarding the reference list: I've played around a bit, but didn't find a completey satisfactory solution. The best I could do was adding a :hidden: to the toctree:: directives in index.rst which hides doesn't render them on the start page but still includes them in the TOC in the navigation bar. Don't know if that's what we want …

Copy link
Member

@Poolitzer Poolitzer left a comment

Choose a reason for hiding this comment

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

LGTM

@Bibo-Joshi Bibo-Joshi merged commit 28cfb54 into doc-fixes Apr 29, 2021
@Bibo-Joshi Bibo-Joshi deleted the docs-dark-mode branch April 29, 2021 11:15
@github-actions github-actions bot locked and limited conversation to collaborators Apr 30, 2021
@Bibo-Joshi Bibo-Joshi added 🔌 enhancement pr description: enhancement and removed enhancement labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

⚙️ documentation affected functionality: documentation 🔌 enhancement pr description: enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants