-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
[feature] Use Material theme for docs #1535
Conversation
You can preview the built version here now: https://gotosocial--1535.org.readthedocs.build/en/1535/ |
This changes the theme to use Material with the slate (dark) theme and the accent colour set to orange. It also replaces the swagger plugin with one that works correctly with the Material theming.
fd036ac
to
f6ffcc7
Compare
ooh very nice! let me see if I can quickly port our colorscheme :) |
palette:
scheme: gotosocial
extra_css:
- assets/colors.css
[data-md-color-scheme="gotosocial"] {
--md-primary-fg-color: #fd6a00;
--md-default-fg-color: #fafaff;
--md-default-fg-color--light: var(--md-default-fg-color);
--md-default-fg-color--lighter: var(--md-default-fg-color);
--md-default-fg-color--lightest: var(--md-default-fg-color);
--md-default-bg-color: #2a2b2f;
--md-default-bg-color--light: #35363b;
--md-default-bg-color--lighter: #3a3b41;
--md-default-bg-color--lightest: #4d4e56;
--md-typeset-color: var(--md-default-fg-color);
--md-typeset-a-color: #66befe;
--md-accent-fg-color: #89caff;
--md-footer-bg-color: var(--md-default-bg-color);
}
.md-content {
background: var(--md-default-bg-color--lightest);
} |
is there a light theme for that as well? |
Amazing, thank you! I'll add that to the PR ❤️ |
There is. Material also allows you to enable switching between dark and light. However, since GTS itself doesn't have a light theme (that I know of) and my goal was to make it feel more as part of the project I haven't looked into that. |
@f0x52 Your changes are awesome but it interacts a bit poorly with the Swagger UI (if you go into API Documentation > API Documentation). Things become a bit difficult to read. Any chance you can come up with a fix for that? |
Co-authored-by: f0x52 <f0x@cthu.lu>
For the Swagger UI, here's:
|
@f0x52 feel free to merge this when you're happy with it, it doesn't need to be before 0.7.1, since the docs at docs.gotosocial.org are always built from main anyways :) |
Just one thing, I haven't updated the Conda environment yet. I'll try and figure that out today. |
The dependencies for cairosvg and pillow can be satisfied on RTD, so this adds them to our requirements.txt and enables the social plugin. This generates opengraph and twitter card tags as well as fancy preview images in GTS colour style for platforms that show that as part of link previews.
5ccb775
to
69deae1
Compare
I think the Conda file is correct now. The dependencies listed make sense at least. |
Had to rename the theme back to "slate" because that's what https://github.com/Amoenus/SwaggerDark/ is hardcoded to detect dark mode 🙄 |
Ah well that's annoying. I might look into fixing that. But some other day. If you're happy with the changes then lets do it 😄 |
Description
environment.yml
yet but I'll go fight with it if this is a change you want to mergeThis changes the theme to use Material with the slate (dark) theme and the accent colour set to orange. It also replaces the swagger plugin with one that works correctly with the Material theming.
I mostly tinkered with this because the Material theme provides a number of enhancement that make the docs easier for me personally to consume:
Potentially useful in the future:
To try it locally:
It ends up looking like this currently:
Checklist
Please put an x inside each checkbox to indicate that you've read and followed it:
[ ]
->[x]
If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).