From f910b787656fb2fcb4d85b8e8238f16d0713b667 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Thu, 4 Dec 2025 00:08:10 +0000 Subject: [PATCH 1/2] Improve notebook generation --- assets/scripts/notebooks/notebooks.jl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/assets/scripts/notebooks/notebooks.jl b/assets/scripts/notebooks/notebooks.jl index 24f635b3d..d78ed18ef 100644 --- a/assets/scripts/notebooks/notebooks.jl +++ b/assets/scripts/notebooks/notebooks.jl @@ -60,7 +60,7 @@ function fix_callouts(md_content::AbstractString)::String # Quarto callouts look like, for example, `::: {.callout-note}` # There isn't a good Jupyter equivalent, so we'll just use blockquotes. # https://github.com/quarto-dev/quarto-cli/issues/1167 - callout_regex = r"^:::\s*\{\.callout-\w+\}.*$" + callout_regex = r"^:::\s*\{\.callout-.+\}.*$" callout_end_regex = r"^:::\s*$" new_lines = String[] in_callout = false @@ -116,9 +116,15 @@ function parse_cells(qmd_path::String)::Notebook lang = match.captures[1] code = strip(match.captures[2]) if lang == "julia" - cell = JuliaCodeCell(code) - push!(cells, cell) - union!(packages, extract_imports(cell)) + if "#| eval: false" in code + # This is a code cell that is not meant to be executed. + push!(cells, MarkdownCell("```julia\n$code\n```")) + continue + else + cell = JuliaCodeCell(code) + push!(cells, cell) + union!(packages, extract_imports(cell)) + end else # There are some code cells that are not Julia for example # dot and mermaid. You can see what cells there are with From e4a91860223705f5b427d84cfb62f0417eb9d121 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Thu, 4 Dec 2025 00:20:50 +0000 Subject: [PATCH 2/2] this isn't python --- assets/scripts/notebooks/notebooks.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/scripts/notebooks/notebooks.jl b/assets/scripts/notebooks/notebooks.jl index d78ed18ef..800f01609 100644 --- a/assets/scripts/notebooks/notebooks.jl +++ b/assets/scripts/notebooks/notebooks.jl @@ -116,7 +116,7 @@ function parse_cells(qmd_path::String)::Notebook lang = match.captures[1] code = strip(match.captures[2]) if lang == "julia" - if "#| eval: false" in code + if occursin(r"#|\s*eval:\s*false", code) # This is a code cell that is not meant to be executed. push!(cells, MarkdownCell("```julia\n$code\n```")) continue