ひよこsphinx
と付き合っています。私のディレクトリツリーは次のようになります。サブディレクトリにあるときにipynbファイルをsphinx index.rstに入れる
| - 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
ファイルを変更しています。
.. 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
ファイルが現在のように見えるものです。ここで指定されたファイルパスは、index.rst
ファイルの相対パスであることを理解しています。この場合、project_root/docs/source
となり、sphinxは上記index.rst
ファイルを持つmoudles.rst
のhtmlを生成することができます。
問題はドキュメントにチュートリアルを含めることですが、../../importable_project/Tutorials/tutorial1
という行はtutorial1.ipynb
を見つけることができません。
誰かが私が間違っていることを示唆できますか?
チュートリアルはドキュメントであり、 'docs/source'ディレクトリに移動する必要があります。 autodocによるパッケージを除き、Sphinxはソースディレクトリの外にあるファイルを見つけることができません。 '.ipynb'ファイルを動かした後にパスを調整する必要があります。 –
ありがとうございます。これはうまくいった。回答を投稿すると私は受け入れます。 – CiaranWelsh