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