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

gh-153906: Modernize pydoc HTML output by serhiy-storchaka · Pull Request #153909 · python/cpython · GitHub

Repository navigation

gh-153906: Modernize pydoc HTML output - #153909

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:pydoc-modern-html
Jul 19, 2026
Merged

serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:pydoc-modern-html

Conversation

serhiy-storchaka commented Jul 18, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Finish the modernization started in gh-54925: replace the remaining 1990s-era markup with semantic HTML5 and restyle the pages after the python-docs-theme used by docs.python.org.

  • <header>/<section>/<h1>–<h4> instead of layout tables; flexbox <nav> for the server's navigation bar
  • multi-column lists via CSS columns; docstrings rendered with white-space: pre-wrap instead of &nbsp;/<br>
  • id= anchors instead of the obsolete <a name=...> (anchor names unchanged)
  • members inherited from other classes are collapsed by default using <details>
  • new style sheet: python-docs-theme fonts and colors, dark mode, docs.python.org-style literal blocks for topic pages
  • ServerHTMLDoc in xmlrpc.server updated to match

The HTMLDoc API is unchanged: all method signatures are kept, obsolete parameters are accepted and ignored.

🤖 Generated with Claude Code

Follow-up of the HTML5 migration in bpo-10716: replace the layout
tables, the &nbsp;/<br> encoding of docstrings and the obsolete
<a name=...> anchors with semantic markup (header, section, h1-h4,
CSS multi-column lists, white-space: pre-wrap, id= anchors), and
restyle the pages after the python-docs-theme used by docs.python.org,
including dark mode support.  Members inherited from other classes
are now collapsed by default.  The pydoc API is unchanged; obsolete
arguments of HTMLDoc methods are accepted and ignored.  ServerHTMLDoc
in xmlrpc.server is updated to match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

read-the-docs-community Bot commented Jul 18, 2026 •
edited
Loading

Copy link
Copy Markdown

picnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Small nits but otheriwse LGTM.

Comment thread Lib/pydoc.py Outdated
Comment thread Lib/pydoc.py
Comment thread Lib/pydoc.py
heading = html.heading(
'<strong class="title">Index of Modules</strong>'
)
heading = html.heading('Index of Modules')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should we make it translatable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is out of scope of this PR. It should be a part of a larger issue -- pydoc has many untranslated strings.

Addressed all other comments. Thank you.

Comment thread Lib/pydoc.py Outdated
- Restore the non-breakable space before "(package)" in module index
  links.
- Indent the navigation bar HTML template.
- Use the "keyword" CSS class for keyword help pages, in addition to
  "topic" for topic help pages.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
serhiy-storchaka enabled auto-merge (squash) July 19, 2026 09:37
serhiy-storchaka merged commit cae8ec8 into python:main Jul 19, 2026
51 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL