在我的 conf.py 中,它说我应该查看内置主题列表的文档。现在我的第一个谷歌搜索将我带到 http://www.sphinx-doc.org/en/stable/theming.html#builtin-themes .那里有很多我的狮身人面像不知道的主题。例如“经典”。
在 conf.pyhtml_theme = 'classic'
在我的 shell 上,我这样做:sphinx-build -b html source build
writing output... [100%] index
Exception occurred:
File "~\appdata\local\programs\python\python35\lib\site-packages\sphinx\jinja2glue.py", line 200, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: about.html
狮身人面像版本:1.6.3。
最佳答案
我遇到了同样的问题,因为我之前使用过雪花石膏主题。 conf.py
中有几行需要雪花石膏和打破其他主题。您需要将它们注释掉。
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
# html_sidebars = {
# '**': [
# 'about.html',
# 'navigation.html',
# 'relations.html', # needs 'show_related': True theme option to display
# 'searchbox.html',
# 'donate.html',
# ]
# }
关于templates - 找不到 Sphinx 内置主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45549165/