2017-10-11 9 views
0

나는 비단뱀 sphinx과 붙어 있습니다. 내 디렉토리 트리는 다음과 같습니다 : 나는 지시에 따라, nbsphinx extention을 활성화하고 나는 소스 폴더 내에서 index.rst 파일을 수정하고있어서브 디렉토리에있을 때 sphinx index.rst에 ipynb 파일 포함하기

| - 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 

.

.. 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이고 스핑크스는 위의 index.rst 파일을 가지고 moudles.rst에 대한 html을 생성 할 수 있습니다.

문제는 설명서에 자습서를 포함하고 싶지만 ../../importable_project/Tutorials/tutorial1 줄은 tutorial1.ipynb을 찾을 수 없다는 것입니다.

아무도 내가 뭘 잘못하고 있다고 제안 할 수 있습니까?

+1

자습서는 문서이므로 'docs/source' 디렉토리로 이동해야합니다. 스핑크스는 autodoc을 통한 패키지를 제외하고 소스 디렉토리의 외부에서 파일을 찾을 수 없습니다. '.ipynb' 파일을 이동 한 후에 그에 따라 경로를 조정해야합니다. –

+0

감사합니다. 이것은 효과가있다. 답변을 게시하면 동의 할 것입니다. – CiaranWelsh

답변

2

자습서는 설명서이므로 docs/source 디렉토리로 이동해야합니다. 스핑크스는 autodoc을 통한 패키지를 제외하고 소스 디렉토리의 외부에서 파일을 찾을 수 없습니다. .ipynb 파일을 이동 한 후에 경로를 적절하게 조정해야합니다.