使用sphinx自带的bizstyle theme没有问题,运行后生成html样式如下:
.
我想把bizstyle改成Sphinx Bootstrap Theme,链接在这里:
https://ryan-roemer.github.io/sphinx-bootstrap-theme/README.html
按它的安装说明,我运行:
pip install sphinx_bootstrap_theme
然后修改conf.py,在文件最上方添加:
import sphinx_bootstrap_theme
在文件中间theme处修改为:
html_theme = 'bootstrap'
并在下面添加一行:
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
然后运行make html会报错,全部错误信息如下:
Running Sphinx v1.7.9
Configuration error:
There is a programable error in your configuration file:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/sphinx/config.py", line 161, in __init__
execfile_(filename, config)
File "/usr/lib/python3/dist-packages/sphinx/util/pycompat.py", line 150, in execfile_
exec_(code, _globals)
File "conf.py", line 9, in <module>
import sphinx_bootstrap_theme
ImportError: No module named 'sphinx_bootstrap_theme'
Makefile:20: recipe for target 'html' failed
make: *** [html] Error 2
有点搞不懂了,应该咋搞?
