Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some cn_docs format issues #5277

Merged
merged 31 commits into from
Sep 21, 2022
Merged

fix some cn_docs format issues #5277

merged 31 commits into from
Sep 21, 2022

Conversation

enkilee
Copy link
Contributor

@enkilee enkilee commented Sep 15, 2022

fix chinese docs errors

PADDLEPADDLE_PR=45752

used AI Studio

@paddle-bot
Copy link

paddle-bot bot commented Sep 15, 2022

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-5277.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:[Beta]飞桨文档预览工具

docs/api/paddle/erfinv_cn.rst Outdated Show resolved Hide resolved
@@ -19,7 +19,7 @@ heaviside
\right.

.. note::
``paddle.heaviside`` 遵守广播机制,如您想了解更多,请参见 :ref:`cn_user_guide_broadcasting`。
``paddle.heaviside`` 遵守广播机制,如您想了解更多,请参见 :ref:`cn_api_paddle_distributed_broadcast`。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里链接依旧没有正常生成,请 @momozi1996 关注

Copy link
Member

@SigureMo SigureMo Sep 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个我前几天看了下,这个 label 是没有定义的,因此无法链接到正确的位置,当然按理说解决方案很简单,就添加一个 label 就行了,但问题是它在 Markdown 文件里

目前 Paddle docs 的 Sphinx 配置采用 recommonmark 进行 Markdown 解析,这个前段时间我想解决部分 Markdown 缩进表格渲染问题(如 API 命名规范 大量缩进表格无法正确渲染)时就发现了

MarkdownParser = parser.CommonMarkParser

recommonmark 确实有很多问题,而且官方也已经不维护了,在置顶 issue 中推荐使用 MyST-Parser 来替代 recommonmark,而且我也不清楚 recommonmark 是否有方法能在 Markdown 中创建 label,至少我在文档中没看到

当然,如果 recommonmark 中有创建 label 的方式,使用该种方式直接在文档中链上即可

readthedoc 文档中明确说明了 MyST-Parser 使用 Markdown 创建 label 的方式,因此我认为也许将 Markdown 解析器换为 MyST-Parser 能彻底解决很多问题

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我在这个PR中测试了英文API文档互相引用和API文档中引用其他文档,都可以正常显示,可以参考:PaddlePaddle/Paddle#46347

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样貌似每个 API 都需要单独计算下相对路径吧,如果想要全量修复的话应该挺麻烦的

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对,按目录来改吧,绝对路径不太行,很容易失效,而且没办法随版本走

docs/api/paddle/nn/functional/log_loss_cn.rst Show resolved Hide resolved
docs/api/paddle/nn/functional/log_loss_cn.rst Outdated Show resolved Hide resolved
@enkilee
Copy link
Contributor Author

enkilee commented Sep 16, 2022

update

@@ -19,7 +19,7 @@ heaviside
\right.

.. note::
``paddle.heaviside`` 遵守广播机制,如您想了解更多,请参见 :ref:`cn_user_guide_broadcasting`。
``paddle.heaviside`` 遵守广播机制,如您想了解更多,请参见 :ref:`https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/beginner/tensor_cn.html#id7`。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样应该确实可以解决,但是不会从根本上解决问题,因此暂时恢复了

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该是之前这个文档用了rst格式,但是后面文档更新的时候整合到其他地方了,所以alias被迫失效

@enkilee
Copy link
Contributor Author

enkilee commented Sep 21, 2022

ok

Copy link
Collaborator

@Ligoml Ligoml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good job!LGTM

@Ligoml Ligoml changed the title fix chinese docs errors fix some chinese docs format issues Sep 21, 2022
@Ligoml Ligoml changed the title fix some chinese docs format issues fix some cn_docs format issues Sep 21, 2022
@Ligoml Ligoml merged commit 9bedc07 into PaddlePaddle:develop Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants