PaddlePaddle / PaddlePaddle/docs

文档sphinx编译warning的消除

Open
#5,177 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
284
Forks
906
PR merge metrics
No merged PRs in 30d

Description

文档链接&描述 Document Links & Description

Docs-NEW流水线使用sphinx编译文档,配置项设置keep_warnings=True,并没有将其作为error输出。
https://github.com/PaddlePaddle/docs/blob/e4a8e67435e86f1c5a5ed690d0c61387f5b63f15/ci_scripts/doc-build-config/en/conf.py#L152-L153

某条PR流水线 日志为准,存量问题在不同日志中是一样的。

  • Error in "code-block" directive错误,存在41处。accuracy_en 的报错在日志中就有。下面两张图分别是官网报错和CI日志报错。
image image
  • Field list ends without a blank line; unexpected unindent,存在4处。prelu_en的报错在日志中就有。下面两张图分别是官网报错和CI日志报错。
image image

keep_warnings的官方介绍 https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-keep_warnings

  • If true, keep warnings as “system message” paragraphs in the built documents. Regardless of this setting, warnings are always written to the standard error stream when sphinx-build is run.
请提出你的建议/提个PR修复这个问题 Please give your suggestion/update a PR to fix it

Sphinx的warning该如何修复?

  • 不建议全部修复。因为目前有1w8条warning,3400多条error,量非常大。且有些类型,如Title underline too short,不影响预览
image
  • 是否有开关可以设置某些warning as error,存量修复完后通过CI限制增量?keep_warningssuppress_warnings的描述,不是特别清楚如何设置(欢迎大家一起研究👏)

  • 比较合理的修复方式

    1. 根据已经发现的一类问题,寻找报错的关键词,比如 Error in "code-block" directive。在CI日志中进行全量扫描,然后按类修复。可以发现肉眼遗漏的错误部分。
    2. 增量文档预览,都经过TPM的approve,问题不大。目前错误都集中在历史遗留问题上,所以通过步骤1可以解决。

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 ci_scripts/doc-build-config/en/conf.py around lines 152-153 and the linked Sphinx configuration for keep_warnings. Review the referenced CI log and group warnings such as “Error in "code-block" directive” and “Field list ends without a blank line; unexpected unindent.” Done should mean the selected warning classes are addressed or explicitly handled, with a clear incremental CI outcome rather than attempting to remove every historical warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, ci-cd, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.