-
Notifications
You must be signed in to change notification settings - Fork 749
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
Conversation
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-5277.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
fix links
fix links
docs/api/paddle/heaviside_cn.rst
Outdated
@@ -19,7 +19,7 @@ heaviside | |||
\right. | |||
|
|||
.. note:: | |||
``paddle.heaviside`` 遵守广播机制,如您想了解更多,请参见 :ref:`cn_user_guide_broadcasting`。 | |||
``paddle.heaviside`` 遵守广播机制,如您想了解更多,请参见 :ref:`cn_api_paddle_distributed_broadcast`。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里链接依旧没有正常生成,请 @momozi1996 关注
There was a problem hiding this comment.
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 能彻底解决很多问题
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样貌似每个 API 都需要单独计算下相对路径吧,如果想要全量修复的话应该挺麻烦的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对,按目录来改吧,绝对路径不太行,很容易失效,而且没办法随版本走
update
update
update |
docs/api/paddle/heaviside_cn.rst
Outdated
@@ -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`。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这样应该确实可以解决,但是不会从根本上解决问题,因此暂时恢复了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该是之前这个文档用了rst格式,但是后面文档更新的时候整合到其他地方了,所以alias被迫失效
ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job!LGTM
fix chinese docs errors
PADDLEPADDLE_PR=45752
used AI Studio