From e58b1ad24573228ed449f99b7d94024115098005 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 19 Dec 2025 17:02:22 +1100 Subject: [PATCH 1/3] Update _config.yml for quantecon-book-theme upgrade - Add path_to_docs option for proper repository links - Add nb_merge_streams for merged stdout/stderr output - Add nb_mime_priority_overrides for proper notebook widget rendering - Add exercise_style setting for sphinx-exercise - Reorganize comments for sphinx-proof and sphinx-exercise sections --- lectures/_config.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/lectures/_config.yml b/lectures/_config.yml index 069af81d3..72af677fa 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -44,8 +44,43 @@ sphinx: nb_render_image_options: width: 80% nb_code_prompt_show: "Show {type}" + nb_merge_streams: true + nb_mime_priority_overrides: [ + # HTML + ['html', 'application/vnd.jupyter.widget-view+json', 10], + ['html', 'application/javascript', 20], + ['html', 'text/html', 30], + ['html', 'text/latex', 40], + ['html', 'image/svg+xml', 50], + ['html', 'image/png', 60], + ['html', 'image/jpeg', 70], + ['html', 'text/markdown', 80], + ['html', 'text/plain', 90], + # Jupyter Notebooks + ['jupyter', 'application/vnd.jupyter.widget-view+json', 10], + ['jupyter', 'application/javascript', 20], + ['jupyter', 'text/html', 30], + ['jupyter', 'text/latex', 40], + ['jupyter', 'image/svg+xml', 50], + ['jupyter', 'image/png', 60], + ['jupyter', 'image/jpeg', 70], + ['jupyter', 'text/markdown', 80], + ['jupyter', 'text/plain', 90], + # LaTeX + ['latex', 'text/latex', 10], + ['latex', 'application/pdf', 20], + ['latex', 'image/png', 30], + ['latex', 'image/jpeg', 40], + ['latex', 'text/markdown', 50], + ['latex', 'text/plain', 60], + # Link Checker + ['linkcheck', 'text/plain', 10], + ] suppress_warnings: [mystnb.unknown_mime_type, myst.domains] + # sphinx-proof proof_minimal_theme: true + # sphinx-exercise + exercise_style: "solution_follow_exercise" # ------------- html_js_files: - https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js @@ -63,6 +98,7 @@ sphinx: header_organisation: QuantEcon repository_url: https://github.com/QuantEcon/lecture-python-intro nb_repository_url: https://github.com/QuantEcon/lecture-python-intro.notebooks + path_to_docs: lectures twitter: quantecon twitter_logo_url: https://assets.quantecon.org/img/qe-twitter-logo.png og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png From cb9af460119a452739fe4d5e2718667f309acc3d Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 19 Dec 2025 17:05:50 +1100 Subject: [PATCH 2/3] Update quantecon-book-theme to 0.15.1 - Includes fix for path_to_docs stripping in notebook launch URLs - Colab/JupyterHub/Binder buttons now generate correct URLs for flat notebook repos --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 8272a0c48..a173c1918 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ dependencies: - pip - pip: - jupyter-book==1.0.4post1 - - quantecon-book-theme==0.15.0 + - quantecon-book-theme==0.15.1 - sphinx-tojupyter==0.3.1 - sphinxext-rediraffe==0.3.0 - sphinx-exercise==1.0.1 From ffc8b594679d83f466d50a9bcfa7aac0d142e54a Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Fri, 19 Dec 2025 17:17:26 +1100 Subject: [PATCH 3/3] Remove exercise_style config (not supported by sphinx-exercise 1.0.1) --- lectures/_config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/lectures/_config.yml b/lectures/_config.yml index 72af677fa..bb8173d0a 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -79,8 +79,6 @@ sphinx: suppress_warnings: [mystnb.unknown_mime_type, myst.domains] # sphinx-proof proof_minimal_theme: true - # sphinx-exercise - exercise_style: "solution_follow_exercise" # ------------- html_js_files: - https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js