restructuredtext link 到其他第一个文件菜单锚点

restructuredtext link to other rst file menu anchor

采用这种结构:

$ tree
.
├── Editors.rst
└── Tool_vim.rst

从 Editor.rst 文件我想对 Tool_vim.rst 文件执行 link。

我得到它:

Follow install from :doc:`Tool_linux_install`

但是在 Tool_linux_install.rst 上,我有一个包含 .. contents:: 和部分的菜单,但是我没有成功地对 vim 章节执行 link:

Follow install from :doc:`Tool_linux_install#vim`

但是我编译的时候报错:

Tool_vim.rst:423: WARNING: unknown document: Tool_linux_install#vim

:doc: 角色可用于 link 到另一个文档,但它不支持 link 到文档中的特定位置。

改为使用 :ref: role to link to a target defined by a label. It is possible to generate labels automatically with the sphinx.ext.autosectionlabel 扩展名。

另见 https://github.com/sphinx-doc/sphinx/issues/6766