Python sphinx 如何从Sphinx文档创建指向local index.html的链接?
我正在为Sphinx/rst写一些文档。如何链接到本地磁盘上与您正在查看的页面相关的内容 例如:Python sphinx 如何从Sphinx文档创建指向local index.html的链接?,python-sphinx,restructuredtext,Python Sphinx,Restructuredtext,我正在为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
====================
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
在我的计算机上,静态文件夹位于:
file:///Users/fredrik/code/repos/myapp/docs/_static
…但我不想硬编码该路径,因为该路径可能与下载克隆存储库的其他用户的路径不同。以下是一种方法:
`local mirror <_static/docs_mirror/index.html>`_
参考资料:。@mzjn是的,非常好,工作非常完美:
`localmirror`
。如果您在这里添加答案,我会将其标记为正确答案。只有在文档根目录中使用此链接时,这才有效。在其他地方,本地镜像
将插入当前URL分支的末尾,并解析为无效页面。
`local mirror`_
.. _local mirror: _static/docs_mirror/index.html