From 2245f924bea269f45d63125b048f25ac936e6067 Mon Sep 17 00:00:00 2001 From: Simon Exner <43469235+0815Creeper@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:24:15 +0200 Subject: [PATCH] fix for svgs --- .github/workflows/Example.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Example.yml b/.github/workflows/Example.yml index ae19d78d..3d99b893 100644 --- a/.github/workflows/Example.yml +++ b/.github/workflows/Example.yml @@ -41,10 +41,17 @@ jobs: run: pip install jupyter nbconvert - name: "Execute notebook" + env: + FILE: examples/jupyter-src/${{ matrix.file-name }}.ipynb + run: jupyter nbconvert --ExecutePreprocessor.kernel_name="julia-${{ matrix.julia-version }}" --to notebook --inplace --execute ${{ env.FILE }} + + - name: "Fix SVGs" + run: julia -e 'using Pkg; Pkg.add("JSON"); using JSON; data = JSON.parsefile("examples/jupyter-src/${{ matrix.file-name }}.ipynb"); function search_and_remove!(json, tag, content=""); if typeof(json) == Vector{Any}; for e in json; search_and_remove!(e, tag, content); end; elseif typeof(json) == Dict{String, Any}; for (t, c) in json; if contains(t, tag) && (content == "" || any([contains(line, content) for line in c])); pop!(json, t); else; search_and_remove!(c, tag, content); end; end; end; end; search_and_remove!(data, "text/html", "