2017-03-05 16 views
4

我正在为我的项目添加一个Read The Docs页面。目前,我需要在我的“读取文档”主页上使用与我的自述文件中相同的内容。我的docs/index.rst文件看起来像:在sphinx和github中使用相同的README内容 - 相对链接

.. include:: ../README.rst 

.. toctree:: 
    :maxdepth: 2 
    :caption: Contents: 


Indices and tables 
================== 

* :ref:`genindex` 
* :ref:`modindex` 
* :ref:`search` 

这主要是工作,除了相对链接。例如,我的自述包含:

See `INSTALL.rst`_ for advanced and detailed instructions. 

由于狮身人面像建造的docs目录内的一切,它希望找到INSTALL.rst的文档目录中。

由于Github从根目录中提取文件,它预计会在根目录中找到INSTALL.rst

我该如何让Github和Read The Docs(Sphinx)都能正确呈现相关链接而不会有重复文件(或者最好是任何重复)?

回答

1

尝试使用符号链接。

在狮身人面像目录:

INSTALL.rst -> ../INSTALL.rst