在ReadTheDocs上使用自定义主题 [英] Use custom theme on ReadTheDocs
本文介绍了在ReadTheDocs上使用自定义主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用从Sphinx的内置ReadTheDocs主题继承的自定义主题。
当我在本地计算机上使用它时,我拥有良好的设计。但当我阅读文档版本(从GitHub导入)时,没有css。
我错过了什么吗?
使用自定义主题的分支的repo:https://github.com/DigitalSkills-fr/Docs/tree/custom_theme/docs
目标分支的RTD单据:http://digitalskills-docs.readthedocs.io/fr/custom_theme/index.html
推荐答案
您应该在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']
这篇关于在ReadTheDocs上使用自定义主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文