我被Python困住了。我的目录树如下所示:
| - project_root
| | - importable_project
| | | - importable_module.py
| | | - another_importable_module.py
| | | - Tutorials
| | | | - tutorial1.ipynb
| | - docs
| | | - build
| | | | - sphinx_build_files_and_folders
| | | - source
| | | | - _static
| | | | - _templates
| | | | - conf.py
| | | | - index.rst
| | | | - modules.rst
我已经按照说明启用了nbsphinx extention,并且正在修改源文件夹中的index.rst
文件。你知道吗
以下是index.rst
文件当前的样子:
.. Pycotools documentation master file, created by
sphinx-quickstart on Wed Oct 11 11:46:06 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Pycotools's documentation!
=====================================
.. toctree::
:maxdepth: 2
:caption: Contents:
/modules
../../importable_project/Tutorials/tutorial1
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
其中大部分是由sphinx-quickstart
自动生成的。我知道这里指定的文件路径是相对于index.rst
文件的位置的。因此在本例中,project_root/docs/source
和sphinx能够使用上面的index.rst
文件为moudles.rst
生成html。你知道吗
问题是我想在文档中包含我的教程,但是行../../importable_project/Tutorials/tutorial1
无法定位tutorial1.ipynb
。你知道吗
有人能指出我做错了什么吗?你知道吗
教程是文档,应该移到
docs/source
目录中。Sphinx找不到源目录之外的文件,除了通过autodoc的包。移动.ipynb
文件后,需要相应地调整路径。你知道吗相关问题 更多 >
编程相关推荐