python / python/python-docs-es
`pospell` fails with code entries
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 371
- 派生
- 413
- PR 合并指标
- 30 天内没有已合并 PR
描述
For 3.13, there was a change in the documentation that now snippets were marked as translatable.
This means that there is a large number of "new entries" that are snippets from the documentation page.
Even though I believe this is a great thing, the tooling around might need to be adapted.
Recently I discovered that in some cases, pospell fails to parse and handle such entries.
For example:
#: ../Doc/library/typing.rst:3167
msgid ""
"@type_check_only\n"
"class Response: # private or not available at runtime\n"
" code: int\n"
" def get_header(self, name: str) -> str: ...\n"
"\n"
"def fetch_response() -> Response: ..."
msgstr ""
"@type_check_only\n"
"class Response: # privada o no disponible en runtime\n"
" code: int\n"
" def get_header(self, name: str) -> str: ...\n"
"\n"
"def fetch_response() -> Response: ..."
Produces a
<rst-doc>:3: (ERROR/3) Unexpected indentation. while parsing: @type_check_only
class Response: # privada o no disponible en runtime
code: int
def get_header(self, name: str) -> str: ...
def fetch_response() -> Response: ...
Marking those entries as fuzzy or adding three back-ticks "```" doesn't work, so I'm trying to brainstorm a bit how we could solve this.
A couple of ideas would be to:
- Just try to fix at the docutils level (which is the source of the parsing error)
- Introduce a new identifier like
python-formatin order to take the content for granted and avoid parsing it.
Ideas?
CC: @JulienPalard
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
使用 Doc/library/typing.rst 中引用的多行 PO 条目重现该故障,然后检查 pospell 如何将代码条目传递给 docutils。确定所需的更改应位于 pospell 中还是 docutils 层;完成的标准应是这些条目能够在不出现所报告的解析错误的情况下得到处理。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- documentation, tooling
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100