mirror of
https://github.com/pybricks/pybricks-api.git
synced 2026-09-12 01:24:17 +00:00
doc/ide: use sphinx.ext.imgmath
MathJax uses a CDN to to distribute the package. So in order to use the docs offline, we would have to include our own copy. But it is a bit large (50-ish MB), so it is easier to use sphinx.ext.imgmath instead to generate svg images. The situation might be different with MathJax v3, but that requires Sphinx v4.
This commit is contained in:
committed by
laurensvalk
parent
ff22c32c24
commit
06e01e5ac8
@@ -8,7 +8,7 @@ on: [ push, pull_request ]
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8, 3.9]
|
||||
@@ -35,5 +35,9 @@ jobs:
|
||||
run: poetry run doc8
|
||||
- name: Build html docs for Read the Docs
|
||||
run: poetry run make -C doc html
|
||||
- name: Instal IDE docs dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install dvisvgm preview-latex-style texlive texlive-fonts-extra texlive-latex-extra
|
||||
- name: Build html docs for Pybricks Code IDE
|
||||
run: poetry run make -C doc html SOURCEDIR=ide
|
||||
|
||||
@@ -19,6 +19,14 @@ html_show_copyright = False
|
||||
html_show_sphinx = False
|
||||
html_css_files = ['css/ide.css']
|
||||
|
||||
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())
|
||||
|
||||
extensions.remove('sphinx.ext.mathjax') # noqa F821
|
||||
extensions.append('sphinx.ext.imgmath') # noqa F821
|
||||
html_theme_options['prev_next_buttons_location'] = None # noqa F821
|
||||
|
||||
Reference in New Issue
Block a user