Sphinx从子文件夹访问兄弟文件夹中的文件

时间:2017-01-15 15:45:14

标签: python-sphinx

给定文件夹结构

docs              # Source folder for sphinx doumentation
  chapter         # One of the chapters
    section.rst   # One of the sections
    ...
  figures         # Collection of figures
    figure.fig    # One of the figures
    ...
make.bat          # The root folder from which one compiles their documentation
...

section.rst内,我尝试使用相对路径导入figure.fig,如下所示

.. figure :: ../figures/figure.fig

   The caption for the figure

我收到错误

E:\..\docs\chapter\section.rst:XX: WARNING: image file not readable: chapter\../figures/figure.fig

很明显,Sphinx没有解决相对路径。我很想知道是否有一项不涉及重组项目的工作。

0 个答案:

没有答案