2017-08-25 60 views
1

我嘗試使用從Sphinx RTD主題繼承的自定義主題。在ReadTheDocs上使用自定義主題

當我在本地計算機上使用它時,我的設計很好。但是當我閱讀文檔版本(從github導入)時,沒有CSS。

我錯過了什麼嗎?

使用自定義主題的分支回購:https://github.com/DigitalSkills-fr/Docs/tree/custom_theme/docs

對RTD的文檔與目標分支:http://digitalskills-docs.readthedocs.io/fr/custom_theme/index.html

感謝您的幫助。

+0

問題尋求幫助調試(「?爲什麼不是這個代碼工作」)必須包括所期望的行爲,具體的問題或錯誤,以及在問題本身中重現問題所需的最短代碼。沒有明確問題陳述的問題對其他讀者無益。請參閱:如何創建[mcve]。使用「編輯」鏈接來改善你的*問題* - 不要通過評論添加更多信息。謝謝! – GhostCat

回答

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