fre*_*rik 4 restructuredtext python-sphinx
我正在为 Sphinx/rst 编写一些文档。如何链接到本地磁盘上与您正在查看的页面相关的内容?
例如:
====================
My App documentation
====================
The official My App documentation can be found here:
https://myapp.com/docs
A local mirror is available:
../../_static/docs_mirror/index.html
Run Code Online (Sandbox Code Playgroud)
在我的机器上,_static 文件夹位于:
file:///Users/fredrik/code/repos/myapp/docs/_static
Run Code Online (Sandbox Code Playgroud)
...但我不想对该路径进行硬编码,因为对于已下载克隆存储库的另一个用户而言,该路径可能与该路径不同。
这是一种方法:
`local mirror <_static/docs_mirror/index.html>`_
Run Code Online (Sandbox Code Playgroud)
另外一个选项:
`local mirror`_
.. _local mirror: _static/docs_mirror/index.html
Run Code Online (Sandbox Code Playgroud)
参考:http : //docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#hyperlink-references。