python / python/cpython

pydoc HTML output is not responsive and has no viewport meta in released versions

Open Beginner friendly
#155,601 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

python -m pydoc -w generates standalone HTML pages for modules. The output is not usable on mobile:

  • The generated page has no tag in any released version (3.11-3.13). A viewport tag was added to the main branch only recently (Lib/pydoc.py), so it is not in any release yet.
  • Lib/pydoc_data/_pydoc.css contains no layout media queries at all; the only @media block is prefers-color-scheme: dark. The navigation sidebar and content are laid out with fixed widths, which overflows on narrow screens.

Related: #127276 ("Missing styles for pages created by a 'python -m pydoc -w' call", open) and #153906 (closed). This issue is specifically about the mobile/responsive behavior.

Expected: backport/keep a viewport meta tag in the generated HTML and add a max-width media query that stacks the sidebar above the content on narrow screens.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Lib/pydoc.py and Lib/pydoc_data/_pydoc.css, then run python -m pydoc -w on a module to inspect the generated page. Done means released output includes the viewport meta tag and narrow screens stack the navigation above the content without overflow.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, python
Domain
documentation, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.