包括sphinx中的ipynb文件索引.rst当它们位于子目录中时

2024-09-27 23:27:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我被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。你知道吗

有人能指出我做错了什么吗?你知道吗


Tags: 文件pybuildprojectrefdocsindexsphinx

热门问题