python / python/cpython

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

未关闭 适合新手
#155,601 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

stdlib type-feature
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 Lib/pydoc.py 和 Lib/pydoc_data/_pydoc.css 开始,然后对一个模块运行 python -m pydoc -w 以检查生成的页面。完成的标志是发布的输出包含 viewport meta 标签,并且在窄屏幕上,导航位于内容上方且不会溢出。

由索引模型根据 Issue 内容生成。

评估

技术栈
css, python
领域
documentation, frontend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
冷清
描述清晰度
描述清楚
新手友好度
78/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。