Use custom theme on ReadTheDocs

你离开我真会死。 提交于 2019-12-11 07:19:34

问题


I try to use a custom theme inherited from Sphinx's built-in ReadTheDocs Theme.

When I use it on my local computer I have the good design. But when I am on the read the doc version (imported from github) there is no CSS.

Did I miss something?

The repo with the branch using the custom theme: https://github.com/DigitalSkills-fr/Docs/tree/custom_theme/docs

The doc on RTD with the targeted branch: http://digitalskills-docs.readthedocs.io/fr/custom_theme/index.html

Thanks for any help.


回答1:


You should specify only built-in theme names in your 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'

Delete your custom entry and restore the original to:

html_theme = 'default'

Assuming you have modified the CSS files in your branch custom_theme, then RTD should copy all the files within the list of directories specified in html_static_path, overriding the built-in theme's CSS files:

# 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']


来源:https://stackoverflow.com/questions/45878953/use-custom-theme-on-readthedocs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!