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
分支
36k
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 摘要。