X-Git-Url: https://repo.jachan.dev/J-u-boot.git/blobdiff_plain/5e957ae3504290a0c62188331a429ec9b908aa1b..c46760d5967d12b6f7d37402878d1607a98b2b84:/doc/conf.py diff --git a/doc/conf.py b/doc/conf.py index 00f24136647..ced3a6723fc 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -21,6 +21,14 @@ from subprocess import check_output # Get Sphinx version major, minor, patch = sphinx.version_info[:3] +# Set canonical URL from the Read the Docs Domain +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + +# Tell Jinja2 templates the build is running on Read the Docs +if os.environ.get("READTHEDOCS", "") == "True": + html_context = { + 'READTHEDOCS' : True, + } # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -39,7 +47,7 @@ needs_sphinx = '2.4.4' extensions = ['kerneldoc', 'rstFlatTable', 'kernel_include', 'kfigure', 'sphinx.ext.ifconfig', # 'automarkup', 'maintainers_include', 'sphinx.ext.autosectionlabel', - 'kernel_abi', 'kernel_feat'] + 'kernel_abi', 'kernel_feat', 'sphinx-prompt'] # # cdomain is badly broken in Sphinx 3+. Leaving it out generates *most* @@ -228,7 +236,7 @@ highlight_language = 'none' try: import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + extensions.append('sphinx_rtd_theme') except ImportError: sys.stderr.write('Warning: The Sphinx \'sphinx_rtd_theme\' HTML theme was not found. Make sure you have the theme installed to produce pretty HTML output. Falling back to the default theme.\n')