我尝试使用从 Sphinx 的内置 ReadTheDocs 主题继承的自定义主题。
当我在本地计算机上使用它时,我有很好的设计。但是当我阅读文档版本(从 github 导入)时,没有 CSS。
我错过了什么?
使用自定义主题的分支的存储库:https://github.com/DigitalSkills-fr/Docs/tree/custom_theme/docs https://github.com/DigitalSkills-fr/Docs/tree/custom_theme/docs
目标分支的 RTD 文档:http://digitalskills-docs.readthedocs.io/fr/custom_theme/index.html http://digitalskills-docs.readthedocs.io/fr/custom_theme/index.html
您应该仅在您的文件中指定内置主题名称conf.py https://github.com/DigitalSkills-fr/Docs/blob/custom_theme/docs/conf.py#L107.
# 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'
假设您已经修改了分支中的 CSS 文件custom_theme
,那么 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']
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)