From 6c108037122ced1e653ac8aef89898f058821458 Mon Sep 17 00:00:00 2001 From: jverzani Date: Wed, 2 Jul 2025 11:09:37 -0400 Subject: [PATCH] modify adjust_plotly --- quarto/adjust_plotly.jl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/quarto/adjust_plotly.jl b/quarto/adjust_plotly.jl index c646e5e..ec06770 100644 --- a/quarto/adjust_plotly.jl +++ b/quarto/adjust_plotly.jl @@ -7,16 +7,19 @@ #alternatives/plotly_plotting.html function _add_plotly(f) - lineno = 117 + #lineno = 117 -str = """ - -""" r = readlines(f) + inserted = false open(f, "w") do io for (i,l) ∈ enumerate(r) - i == lineno && println(io, str) + if contains(l, "require.min.js") + !inserted && println(io, """ + +""") + inserted = true + end println(io, l) end end @@ -29,7 +32,7 @@ function (@main)(args...) for fᵢ ∈ files f = joinpath(root, fᵢ) if endswith(f, ".html") - @show :adjust, f + dirname(f) == "_book" && continue _add_plotly(f) end end