Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python sphinx 如何从Sphinx文档创建指向local index.html的链接?_Python Sphinx_Restructuredtext - Fatal编程技术网

Python sphinx 如何从Sphinx文档创建指向local index.html的链接?

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

我正在为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
在我的计算机上,静态文件夹位于:

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