我是Sphinx的新手,我想写一个Python包的文档。当我想包含演示文件时,我遇到了一个问题
我想使用扩展名nbsphinx
包含文件demo.ipynb
。它已成功安装在我的计算机上。Sphinx的my conf.py文件中的extensions变量包含以下行:
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
'nbsphinx',
]
my index.rst中的目录树如下所示:
.. toctree::
:maxdepth: 3
:glob:
demo
当我编译我的文档时,我总是得到以下警告:
PATHTOPACKAGE/docs/source/index.rst:19: WARNING: toctree contains reference to document 'demo' that doesn't have a title: no link will be generated
Sphinx是否尝试将该文件作为.rst文件包含?nbsphinx
文档只是说我必须安装包,将nbsphinx
添加到扩展中,然后我将能够将我的文档添加到toctree
。我没有找到任何与此问题相关的信息
每个笔记本都需要一个标题
只需在笔记本中创建一个降价单元格,其中包含以下内容:
另见https://github.com/spatialaudio/nbsphinx/issues/310和https://github.com/spatialaudio/nbsphinx/pull/401
现在有一个更好的警告,请参见https://github.com/spatialaudio/nbsphinx/pull/402
相关问题 更多 >
编程相关推荐