FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improving readability of documentation tables · Issue #311 · python/python-docs-theme · GitHub

Repository navigation

Improving readability of documentation tables #311

Description

Documentation

I was reading through the documentation and I thought of a way you could make it read better.
You could do the thing thats done with tables where you alternate the background color to make the elements easier to distinguish at a glance.

I made a quick example using inspect element to color every other method in the documentation.

vs what it looks like currently.

My quick test was done by adding

.py.method:nth-child(odd) {
  background-color: #2d2d2d;
}

And replacing the margin on the dl elements with padding so the background color would fill it.

I originally used dl:nth-child(odd) but .py.method:nth-child(odd) worked better, but it would probably be better to add a new class to the elements you want highlight instead, because dl:nth-child(odd) highlights too much and .py.method:nth-child(odd) doesnt highlight all of the elements you would probably want highlighted.

*:is(.py.method, .describe):nth-child(odd of *:is(.py.method, .describe)) {
   background-color: #2b2b2b;
}

Should work but adding a new class is probably easier to maintain and you could reuse it in more places.

Activity

  1. changed the title [-]Improving readability of documentation[/-] [+]Improving readability of documentation tables[/+] on May 17, 2026
  2. terryjreedy commented on May 17, 2026

    Member

    I am not convinced that this would be better. This particlar listing is not really a table. I would change

    The following table lists operations available for [set](https://docs.python.org/3/library/stdtypes.html#set) that do not apply to immutable instances of [frozenset](https://docs.python.org/3/library/stdtypes.html#frozenset):
    

    to

    The following [set](https://docs.python.org/3/library/stdtypes.html#set) operations do not apply to immutable instances of [frozenset](https://docs.python.org/3/library/stdtypes.html#frozenset):
    
  3. Vwert commented on May 17, 2026

    Author

    Its not really about it being a table or not, its that alternating background colors makes it easier to read.

  4. vadmium commented on May 17, 2026

    Member

    The biggest trouble with your illustration is the background colour changes between related operations, which is harder to read. It might be more palatable with set.update, set |= other, and the description all one shade, then set.intersection_update, set &= other, and its description a different shade, etc.

  5. Vwert commented on May 17, 2026

    Author

    It was just a quick example, you could customise it more if you wanted to.

  6. terryjreedy commented on May 22, 2026

    Member

    I think this feature proposal needs discussion on https://discuss.python.org/c/documentation/26 and should be closed until there is consensus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL