Skip to content

Commit bd3bc65

Browse files
committed
Hopefully this will fix deployment error
1 parent d623ed4 commit bd3bc65

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

deploy.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ using Franklin;
22
include("utils.jl")
33
println("Running deploy.jl!")
44

5+
function get_hassim_value(content::AbstractString)
6+
m = match(r"@def\s+hassim\s*=\s*(true|false)", content)
7+
if m === nothing
8+
return false;
9+
else
10+
return m.captures[1] == "true"
11+
end
12+
end
13+
514
function eager_generate_js()
615
md_dir = joinpath(@__DIR__, ".")
716

@@ -14,6 +23,7 @@ function eager_generate_js()
1423
title = match(r"title *= *\"([^\"]+)\"", content)
1524
type = match(r"type *= *\"([^\"]+)\"", content)
1625
vars = match(r"vars *= *\[([^\]]+)\]", content)
26+
hassim = get_hassim_value(content);
1727
if isnothing(type) || isnothing(vars)
1828
continue
1929
end
@@ -25,7 +35,7 @@ function eager_generate_js()
2535
if (page_type == "2D")
2636
ids = ["tableOutputs", "phasePlot", "timePlot", "phasePlot", "animation", "animation"];
2737
funcs = ["generateTable()", "removeTable()", "generatePhasePlot(solveProblem(RKF45, readInputs()))", "removePhasePlot()", "generateTimePlot(solveProblem(RKF45, readInputs()))", "removeTimePlot()", "generatePlots(readInputs())", "removePlots()", "generateAnimation()", "removeAnimation()","generateAllOutputs()", "removeAllOutputs()"];
28-
else
38+
elseif hassim
2939
ids = split(match(r"ids *= *\[([^\]]+)\]", content).captures[1], r"\s*,\s*")
3040
funcs = split(match(r"funcs *= *\[([^\]]+)\]", content).captures[1], r"\s*,\s*")
3141
end

0 commit comments

Comments
 (0)