templates - 找不到 Sphinx 内置主题

标签 templates themes jinja2 python-sphinx

在我的 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/

相关文章:

themes - Plone 4.2 - 如何更改 Diazo 主题中的 Logo ?

cakephp - 如何为错误页面使用自定义主题?

themes - 在 Windows Phone Mango 中停用和重新激活应用程序时更改主题时是否存在错误

python - CSS 样式未正确填充

javascript - Flask - 每个模板都有不同的 Javascript 文件

flask - WTForms 在 Jinja2 中使用引号

c++ - 你能 static_assert 一个元组只有一种类型满足特定条件吗?

python - 在 django 模板中显示单个表单字段?

c++ - 为什么 C++ 中的这种部分特化会产生编译器错误 "invalid use of incomplete type"?

jquery - AngularJS - 无法在链接函数中动态更改指令模板