Docs HTML render redesign

The HTML design feels outdated as it uses older HTML styling. I suggest to refresh the design at least by means of partial modernization. It’s especially visible when you visit devguide subdomain and compare it to docs. Some of these things can be considered taste preference, while others are representing legitimate concern. A few suggestions provided below:

  1. Make design more responsive
With wider screens, `devguide` definitely renders much nicer

  1. Add more spacing to top bar: it is too dense

  2. Remove list style type (or at least add option to make lists without type/use that option in many places)

  3. Add tooltips at least for the glossary and basic terms

  4. Add more themes, make font customizable, improve accessibility

  5. Add labels for the select input elements in the top bar to improve accessibility

  6. Redesign side bar

  7. Remove vertical bars from the tables

  8. Remove excessive important! properties from the css.

P.S. I was unable to provide images for illustration because of the forum’s limitation on embedded media posting for new users…

Full unformatted version with illustrations
1. Make design more responsive
[details=With wider screens, `devguide` definitely renders much nicer]
![image|690x174](upload://nesD7CZfOWalH826uOvpnnghVQ8.png)

![image|690x173](upload://wePKPnC2Si63cMQVEklZMFdR3v9.png)
[/details]

2. Add more spacing to top bar: it is too dense
[details]
![image|690x17](upload://nZPex9XBp1B7lY15HkIlE1jn6ns.png)
I will compare it to Github's one since `devguide` doesn't have a topbar
![image|690x18](upload://9XE4B21kpwIRV2w3ntc95z6wxII.png)
[/details]

3. Remove list style type (or at least add option to make lists without type/use that option in many places)
[details]
Before:
![image|347x500](upload://k0ch9orbqVvpdTof2gv8YP4qLp3.png)

After:
![image|353x500](upload://kuEEuSVC2xp0e3yLRulus68cfOI.png)
[/details]

4. Add tooltips at least for the glossary and basic terms
5. Add more themes, make font customizable, improve accessibility
6. Add labels for the `select` input elements in the top bar to improve [accessibility](https://dequeuniversity.com/rules/axe/4.8/select-name)
7. Redesign side bar
8. Remove vertical bars from the tables
[details]
Example-1:
![image|617x390](upload://210rzHDJImRQGGSae3NvZZoRo9y.png)
to
![image|567x385](upload://zFYoJ15xCECpnYEQlPqaYVIRuoF.png)

Example-2:
![image|642x500](upload://jrhSviWZnISs7u8lh3ARwb0HNK.png)
to
![image|640x500](upload://yJrW1b3pSPmEnO2KBuRnw7CzmW2.png)
[/details]
9. Remove excessive `important!` properties from the css.
devguide render

(message for test, I am not sure if I even should make 10 messages just to post illustrations)

Hi Kerim, I bumped your account up a trust level so you should be able to post your images and links, or edit your posts above to contain them.

As to your points, the docs theme is certainly quite old and creaky as far as it comes to HTML styling. The docs team has been notionally strongly considering a migration to highly modern theme like @pradyunsg 's Lutra, under development with large documentation sets like CPython’s specifically in mind, as well as work by @hugovk and others to modernize low-hanging fruit in the current theme (dark mode, a11y, etc) where feasible.

I’m sure we’d welcome your contributions along these lines to both of those efforts, after due consideration and discussion of any major changes that might warrant broader feedback.

1 Like

Here’s the full list with images:


  1. Make design more responsive
With wider screens, `devguide` definitely renders much nicer

  1. Add more spacing to top bar: it is too dense


I will compare it to Github’s one since devguide doesn’t have a topbar

  1. Remove list style type (or at least add option to make lists without type/use that option in many places)

Before:

After:

  1. Add tooltips at least for the glossary and basic terms
  2. Add more themes, make font customizable, improve accessibility
  3. Add labels for the select input elements in the top bar to improve accessibility
  4. Redesign side bar
  5. Remove vertical bars from the tables

Example-1:
image
to
image

Example-2:


to

  1. Remove excessive important! properties from the css.
2 Likes

These generally sound like good ideas.

The main docs uses a Sphinx theme that lives at GitHub - python/python-docs-theme: Sphinx theme for Python documentation. Would you like to open separate issues or PRs over there, and we can go through them one-by-one? Some of these things might be in Sphinx itself.

Do you mean using <abbr>? It has limited and inconsistent support for keyboard users, touch users (e.g. mobile) and for screenreader and Braille users:

https://adrianroselli.com/2024/01/using-abbr-element-with-title-attribute.html#Verdict

I’m not sure if we should have multiple themes, or if Sphinx even supports it. It would mean we need to maintain integration of 2x or 3x or more themes (plus light+dark).

If we can let people customise the font via browser settings, that would probably be best.

I think we should use the system font stack for wider support, improved readability and consistency, and quicker loads, which both the devguide (via the Furo theme) and PEPs site use. Here’s a demo: 3.13.0a4 Documentation

3 Likes

Do you mean using ? It has limited and inconsistent support for keyboard users, touch users (e.g. mobile) and for screenreader and Braille users:

I meant more like wikipedia-style tooltips so users recap information quickly, it might help in studying. We can add “title” attritbute to <a> tags and display it with JS from cached json with dictionary.

I’m not sure if we should have multiple themes, or if Sphinx even supports it. It would mean we need to maintain integration of 2x or 3x or more themes (plus light+dark).

I was thinking more of “light” themes which would rather mostly be a color schemes, like obsidian, monokai etc.

I think we should use the system font stack for wider support

Sure, sounds good

2 Likes

I bumped your account up a trust level so you should be able to post your images and links

Thanks :slight_smile:

Also thank you for providing an accurate depiction of the current situation along with links, hopefully I can make meaningful contribution for both of these efforts. It would make sense to start with minor improvements and move to another theme for bigger things (e.g. top/side-bar redesign).

2 Likes

Please see PR python/python-docs-theme#176.

1 Like