forked from MichielStock/STMO
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.jl
62 lines (47 loc) · 1.26 KB
/
build.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#=
Created on Sunday 5 January 2019
Last update: -
@author: Michiel Stock
Build all the notebooks and stuff. Based on a file by Bram De Jaegher.
=#
t₀ = time()
using Weave
dirs = ["00.Introduction",
"01.Brackets",
"02.Quadratic",
"03.AutoDiff",
"04.Unconstrained",
"05.Constrained",
"06.OptimalTransport",
"07.MST",
"08.ShortestPath",
"09.NP-Complete",
"10.Metaheuristics",
"11.TSP"
]
function cleanTemps(filename, dir; exts=[".out", ".log", ".aux", ".fls", ".fdb_latexmk"])
for ext in exts
rm(dir * filename * ext)
end
end
for dir in dirs
dir = "chapters/$dir/"
files = readdir(dir)
filter!(fn -> occursin(".jmd", fn), files)
for filename in files
filename = filename[1:end-4]
println("Building $(filename)...")
weave(joinpath(dir, filename * ".jmd"); doctype="md2pdf")
#cleanTemps(filename, dir)
convert_doc(joinpath(dir, filename * ".jmd"), dir * filename * ".ipynb")
end
end
# FIGURES
include("scripts/maketestfigs.jl")
include("scripts/monge.jl")
include("scripts/unconstrained.jl")
include("scripts/colortransfer.jl")
tₑ = time()
t = Int(round(tₑ - t₀))
println("Building took $(div(t, 60))m$(t % 60)s")