【发布时间】:2018-01-18 12:09:40
【问题描述】:
我已设置好 sphinx 文档并想使用自定义主题。我已经阅读了 sphinx 网站上的主题说明:http://www.sphinx-doc.org/en/stable/theming.html,但它不起作用。
我的主题名称与 conf.py 文件中的相同,并且它位于同一目录中的 zip 文件夹中,但我不断收到以下错误:
Theme error:
no theme named 'tera' found (missing theme.conf?)
make: *** [html] Error 2
我的 conf.py 代码是:
html_theme = "tera"
html_theme_options = {
}
html_theme_path = ['.']
按照说明,我在.zip 文件中有一个theme.conf 文件以及我需要的所有其他文件。不知道如何修复。
在我的 theme.conf 文件中,我有:
[theme]
inherit = basic
stylesheet = css/Terra.css
pygments_style = default
文件结构如下:Documents > Documentation >_themes。在主题中,我有一个“tera”文件夹和一个“tera.zip”文件。
我也试过直接将 tera.zip 文件放在我的文档文件夹中,因此它与 conf.py 文件位于同一目录中,但仍然没有成功
【问题讨论】:
-
它是 .zip 文件还是文件夹/目录?您的问题是“zip 文件夹”,这令人困惑。请包括您的目录和文件结构,以及您的
theme.conf的内容。 -
在我的 theme.conf 文件中我有: [theme] inherit = basic stylesheet = css/Terra.css pygments_style = default 文件结构如下:Documents > Documentation >_themes。在主题中,我有一个“tera”文件夹和一个“tera.zip”文件
-
我也试过直接将 tera.zip 文件放在我的文档文件夹中,所以它与 conf.py 文件位于同一目录中,但仍然没有成功
-
tera.zip 里面有什么?
-
theme.conf 文件和包含我的 css 和图像的 '_static' 文件夹
标签: python python-sphinx