在ReadTheDocs上使用自定义主题

时间:2017-08-25 09:59:53

标签: documentation python-sphinx read-the-docs

我尝试使用从Sphinx内置的ReadTheDocs主题继承的自定义主题。

当我在我的本地计算机上使用它时,我有很好的设计。但是当我在阅读doc版本(从github导入)时,没有CSS。

我错过了什么吗?

使用自定义主题的分支的回购:https://github.com/DigitalSkills-fr/Docs/tree/custom_theme/docs

有关目标分支的RTD文档:http://digitalskills-docs.readthedocs.io/fr/custom_theme/index.html

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

您应该只在conf.py中指定内置主题名称。

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#html_theme = 'default'
html_theme = 'theme_digitalskills'

删除自定义条目并将原始文件恢复为:

html_theme = 'default'

假设您已修改分支custom_theme中的CSS文件,则RTD应复制html_static_path中指定的目录列表中的所有文件,从而覆盖内置主题的CSS文件:

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
相关问题