Python sphinx 在Sphinx中链接外部文档
我试图将我们项目的扩展文档链接到Sphinx中的核心文档。我试过intersphinx,但从我看来它只支持对象,而我们的文档没有提到对象,它只是plain.rst 我补充说Python sphinx 在Sphinx中链接外部文档,python-sphinx,Python Sphinx,我试图将我们项目的扩展文档链接到Sphinx中的核心文档。我试过intersphinx,但从我看来它只支持对象,而我们的文档没有提到对象,它只是plain.rst 我补充说 intersphinx_mapping = { 'project': ('http://link-to-readthedocs/index.html', None), } 到conf.py,并编辑指向:ref:`Documentation`和更高版本:doc:`Documentation`的链接。它不起作用 问题是: 如
intersphinx_mapping = {
'project': ('http://link-to-readthedocs/index.html', None),
}
到conf.py,并编辑指向:ref:`Documentation`和更高版本:doc:`Documentation`的链接。它不起作用
问题是: 如何在Sphinx中为普通.rst文件(非对象)从一个项目文档链接到另一个项目文档?
编辑:我已经完成了“生成html”,找到了我的objects.inv,但现在我想我只能在本地找到它???我不确定我在做什么,但当我尝试检查时,我得到:
UserWarning:intersphinx目录'http://myproject.com/index.html/objects.inv'由于:HTTP错误404:未找到而无法获取
“%s:%s%”(库存,错误。\类\错误))
首先要修复的是包含到项目文档基本URL的链接:
intersphinx\u映射={
'项目':('http://link-to-readthedocs/index.html",无),,
}
根据报告:
将唯一标识符映射到元组的字典(目标,目录)
。每个target
都是外部Sphinx文档集的基本URI,可以是本地路径或HTTP URI。inventory
指示可以在何处找到库存文件:它可以是None
(与基本URI位于同一位置)或另一个本地或HTTP URI
因此,错误在于将index.html
放在目标的末尾。它应该是这样的:
intersphinx\u映射={
'项目':('http://project.readthedocs.io/en/latest",无),,
}
如果需要,用首选文档语言替换en
,并用首选RtD构建版本的文档替换最新版本
UserWarning: intersphinx inventory 'http://myproject.com/index.html/objects.inv' not fetchable due to <class 'urllib.error.HTTPError'>: HTTP Error 404: Not Found
'%s: %s' % (inv, err.__class__, err))