2

我正在尝试在我已经完成的烧瓶网络应用程序上实现 Sphinx 文档。当我尝试使用以下命令运行 Sphinx 时:

sphinx-apidoc -F -A "MonitoringApplication" -V "0.1" -o docs App

它为我的 python 脚本创建了第一个文件,但随后退出并出现以下错误:在:Sphinx\quickstart.py, line 1328, in generate conf_text = QUICKSTART_CONF % d KeyError: u'language

谷歌这个错误对我没有多大好处,所以我来到了这里!额外的信息:

Sphinx 版本 1.3b1-py2.7,操作系统:Windows 7,在虚拟环境 (venv) 中运行的 Sphinx

项目目录示例:

App/
  --MoitoringApplication.py
  --models.py
  --database.py
  --functions.py
  --etc.py
  templates/
    --index.html
    --overview.html
    --etc.html
  static/
    --jquery.js
    --etc.js
    images/
      --logo.jpg

运行 Sphinx-apidoc 命令,构建了以下目录:

docs/
  _build/
    ..
  _static/
    ..
  _templates/
    ..
  --MonitoringApplication.rst
  --functions.rst
  --models.rst
  --database.rst
  --etc.rst

我使用了错误的命令还是我的目录排序不正确,或者我需要的是不同的 Sphinx 版本?谢谢你的时间。

4

2 回答 2

0

在 Sphinx 配置文件中设置语言,例如:

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = 'de'
于 2014-11-26T10:09:57.530 回答
0

发现我错过__init__了包裹中的 .py。

还需要添加sys.path.append("../App")config.py

然后使用sphinx-apidoc生成新的 .rst 文件。

然后做了make html这对我有用。

于 2014-11-26T15:18:10.297 回答