diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21e7ca2f..659c941a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,6 +114,27 @@ jobs: # silently ignored the fork we install above and built with upstream # mystmd (visible as 23 `unknown export output extension: *.ipynb` # errors, since ipynb export is a fork-only capability). + # Build the theme from per-page-thebe (adds enable_thebe/disable_thebe/ + # default_thebe support). Remove this step once the feature ships in a + # tagged release and the template URL below is bumped to that release. + - name: Build theme (per-page-thebe) + run: | + git clone --depth 1 --branch per-page-thebe \ + https://github.com/QuantEcon/quantecon-theme.mystmd.git /tmp/qe-theme + cd /tmp/qe-theme && npm ci && make build-theme + # Patch myst.yml to use the local build instead of the release zip. + python -c " + import re, os + path = os.path.join(os.environ['GITHUB_WORKSPACE'], 'lectures/myst.yml') + txt = open(path).read() + txt = re.sub( + r'template: https://github\.com/QuantEcon/quantecon-theme\.mystmd/releases/download/[^\n]+', + 'template: /tmp/qe-theme/.deploy/quantecon-theme', + txt + ) + open(path, 'w').write(txt) + " + - name: Build HTML working-directory: ./lectures env: diff --git a/lectures/functions.md b/lectures/functions.md index db4f7ab4..c6249c62 100644 --- a/lectures/functions.md +++ b/lectures/functions.md @@ -17,6 +17,8 @@ downloads: title: Markdown (md) - file: exports/functions.ipynb title: IPython (.ipynb) +site: + enable_thebe: true --- # Functions diff --git a/lectures/matplotlib.md b/lectures/matplotlib.md index b39e45a1..bd1042a7 100644 --- a/lectures/matplotlib.md +++ b/lectures/matplotlib.md @@ -17,6 +17,8 @@ downloads: title: Markdown (md) - file: exports/matplotlib.ipynb title: IPython (.ipynb) +site: + enable_thebe: true --- # Matplotlib diff --git a/lectures/myst.yml b/lectures/myst.yml index 6884fd7d..aaaba069 100644 --- a/lectures/myst.yml +++ b/lectures/myst.yml @@ -80,6 +80,8 @@ project: error_rules: - rule: reference-syntax-valid severity: ignore + jupyter: + lite: true # exports: # - id: book-pdf # format: typst @@ -109,3 +111,6 @@ site: launch_notebook_repo: QuantEcon/lecture-python-programming.notebooks launch_notebook_source_dir: lectures launch_colab: true + # Opt-in mode: Power toggle is hidden site-wide; only pages that set + # `site: enable_thebe: true` in their frontmatter show it. + default_thebe: false