狮身人面像的位置来源于我的笔记

Léo*_* 준영 2 python python-sphinx

你怎么能在底部解决狮身人面像的警告?

我想在Sphinx中获取我的Python笔记.我将我的笔记放在与index.rst相同的目录级别的单独文件中.

构建HTML后,我收到以下警告

警告

/home/heo/S_codes/trig_functions.rst:: WARNING: document isn't included in any toctree
Run Code Online (Sandbox Code Playgroud)

构建时的完整信息

sudo sphinx-build -b html ./ _build/html
Running Sphinx v0.6.2
loading pickled environment... done
building [html]: targets for 0 source files that are out of date
updating environment: 1 added, 2 changed, 0 removed
reading sources... [100%] trig_functions
/home/heo/S_codes/databooklet.rst:1: (WARNING/2) malformed hyperlink target.
/home/heo/S_codes/index.rst:11: (ERROR/3) Error in "toctree" directive:
invalid option block.

.. toctree::
   :numbered:
   :glob:
   *
   databooklet.rst
   trig_functions.rst


/home/heo/S_codes/trig_functions.rst:11: (ERROR/3) Unexpected indentation.
looking for now-outdated files... none found
pickling environment... done
checking consistency... /home/heo/S_codes/databooklet.rst:: WARNING: document isn't included in any toctree
/home/heo/S_codes/trig_functions.rst:: WARNING: document isn't included in any toctree
done
preparing documents... done
writing output... [100%] trig_functions
writing additional files... genindex search
copying static files... done
dumping search index... done
dumping object inventory... done
build succeeded, 6 warnings.
Run Code Online (Sandbox Code Playgroud)

S.L*_*ott 6

你知道Sphinx的文件吗? http://sphinx.pocoo.org/contents.html

具体来说,请阅读该toctree指令:http://sphinx.pocoo.org/concepts.html

您可以拥有任意数量的文件.通过toctree您可以从许多部分创建单个文档.


请实际阅读:http://sphinx.pocoo.org/concepts.html#document-names

由于reST源文件可以有不同的扩展名(有些人喜欢.txt,有些人喜欢.rst - 扩展名可以配置source_suffix),不同的操作系统有不同的路径分隔符,Sphinx抽象它们:所有"文档名称"都相对于源目录,剥离扩展名,路径分隔符转换为斜杠.引用"文档"的所有值,参数等都期望这样的文档名称.

对于文件名的例子是index, library/zipfilereference/datamodel/types.请注意,没有前导斜杠.

由于您使用了glob *,因此无需列出文件.

如果您想列出您的文件,请务必阅读遵守上述规则.

  • @Masi:你读过Sphinx文档吗?你读过有关提供给toctree的文件名吗?您是否读过扩展名是在sphinx配置中指定的,而toctree只是名称?你读过那个吗?请说你看了. (2认同)