2016-09-29 128 views
0

我想使用Sphinx作爲文檔生成器。當我嘗試運行將HTML命令,我有以下錯誤:在Sphinx(Python文檔生成器)配置文件中添加擴展

Extension error: Could not import extension sphinxcontrib.httpdomain (exception: No module named sphinxcontrib.httpdomain) make: *** [html] Error 1

我發現這個網頁的解釋,我要擴展手動添加到獅身人面像的配置文件https://pythonhosted.org/sphinxcontrib-httpdomain/#module-sphinxcontrib.httpdomain

但我找不到這個配置文件。

你知道我在哪裏可以找到它嗎?我在Mac OS X上

回答

0

該配置位於Sphinx項目的source文件夾中。它被命名爲conf.py並且包含一個extensions選項,它應該看起來像這樣:

# Add any Sphinx extension module names here, as strings. They can be 
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 
# ones. 
extensions = [ 
    'sphinx.ext.autodoc', 
    'sphinx.ext.intersphinx', 
    'sphinx.ext.todo', 
    ... 
]