1

我对 Sphinx 完全陌生,已经观看了数小时的教程,但找不到我的问题的答案

我有一个当前的项目结构,如下所示

-project folder
 |-sub folder 1
 | |- sub folder 1.a
 |    | - ...
 |-sub folder 2
 | |- sub folder 2.a
 |    | - ...
 |-sub folder 3
 | |- sub folder 3.a
 |    | - ...
 |- .py files
 |...
 |- conf.py
 |- index.rst
 |- Makefile
 |- _build/
 |  |-doctrees/
 |  |-html/
 |    |...(all the html files generated by "make html")

我在我的 conf.py 中包含了以下内容

extensions = ['autoapi.extension']
# Document Python Code
autoapi_type = 'python'
autoapi_dir = '../project folder'

在每个子文件夹中,我都有 .py 文件,其中包含所有需要记录的类、函数、模块和成员。有没有办法让 sphinx 解析当前项目文件夹及其所有子目录以搜索 .py 文件到 autodoc?如果是这样,我将如何设置我的 index.rst 和 conf.py 文件来实现这一点?

我看到的错误如下:

Removing everything under '_build'...
Running Sphinx v1.8.5  
making output directory...  

Extension error: 
You must configure an autoapi_dirs setting  
Makefile:19: recipe for target 'html' failed 
make: *** [html] Error 2 
4

1 回答 1

0

错误是明确的:You must configure an autoapi_dirs setting。您的conf.py设置中有错字,省略了设置中的“s” autoapi_dirautoapi_dirs请参阅for 的autoapi配置值。

于 2019-04-19T05:07:45.803 回答