当前,我可以找到的方法来获取readthedocs.org使用的当前设计资产的唯一方法是安装完整主题,然后进行构建,这需要SASS等。
我只想获取一组静态文件,这些文件可以让我在本地查看在readthedocs上构建的内容。有没有一种方法可以不用上面的链接自己构建资产?目的是使新手能够轻松地为文档做出贡献。
如果您要为主题做贡献/开发,则只需要构建主题即可。您可以使用安装主题pip install sphinx_rtd_theme
。然后,您可以在Sphinx中使用主题conf.py
。请参阅:http : //read-the-docs.readthedocs.org/en/latest/theme.html
# on_rtd is whether we are on readthedocs.org
import os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句