diff --git a/doc/common/conf.py b/doc/common/conf.py index 018beb7..acc6f3d 100644 --- a/doc/common/conf.py +++ b/doc/common/conf.py @@ -42,10 +42,6 @@ from pybricks._common import Speaker # noqa E402 # this line of code grabbed from docs.readthedocs.org ON_RTD = os.environ.get('READTHEDOCS', None) == 'True' -# Since tags cannot be passed via SPHINXOPTS on read the docs, add it manually. -if ON_RTD: - tags.add('main') - _pyproject = toml.load(os.path.join(TOP_DIR, 'pyproject.toml')) # -- General configuration ------------------------------------------------ diff --git a/doc/main/conf.py b/doc/main/conf.py index 74ea20a..04141bd 100644 --- a/doc/main/conf.py +++ b/doc/main/conf.py @@ -19,4 +19,31 @@ html_favicon = '../common/images/favicon.ico' html_logo = '../common/images/pybricks-logo-rtd.png' latex_logo = '../common/images/pybricks-logo-large.png' +# Build main docs for RTD by default. +# Since tags cannot be passed via SPHINXOPTS on read the docs, add it manually. +if os.environ.get('READTHEDOCS', None) == 'True': + tags.add('main') # noqa F821 + + +# Addtional configuration of the IDE docs +if 'ide' in tags.tags: # noqa F821 + _DISCLAIMER = '' + html_show_copyright = False + html_show_sphinx = False + html_css_files = ['css/ide.css'] + html_js_files = ['js/ide.js'] + + imgmath_image_format = 'svg' + imgmath_use_preview = True # requires Sphinx v3 + imgmath_latex_preamble = r''' + \usepackage{newtxsf} + ''' + exec(open(os.path.abspath("../common/conf.py")).read()) + +# Addtional configuration of the IDE docs +if 'ide' in tags.tags: # noqa F821 + + extensions.remove('sphinx.ext.mathjax') # noqa F821 + extensions.append('sphinx.ext.imgmath') # noqa F821 + html_theme_options['prev_next_buttons_location'] = None # noqa F821