What is an easy way to create a local sphinx assembly with static resources that readthedocs.org uses?

Currently, the only way to find the current design assets used by readthedocs.org is to install a complete theme and build it that requires SASS, etc.

I would just like to get a static set of files that allows me to see locally what my assembly on readthedocs will look like. Is there a way to do this without creating assets from the above link? The goal is for beginners to easily contribute to documents.

+4
source share
1 answer

, / . , 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
+1

Source: https://habr.com/ru/post/1548099/


All Articles