-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.jl
43 lines (35 loc) · 1.34 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
using Literate
repo_src = joinpath(@__DIR__, "..", "src")
notebooks_dir = joinpath(@__DIR__, "..", "notebooks")
files = [
"t001_introduction" => "t001_introduction",
"t002_data_ingestion" => "t002_data_ingestion",
"t003_flux_intro" => "t003_flux_intro",
"t004_conv_layers" => "t004_conv_layers",
"t005_recurrent_layers" => "t005_recurrent_layers",
"t006_optimization" => "t006_optimization",
"t007_conclusion" => "t007_conclusion"
]
function colab_blank(content)
content = replace(content, "COLAB" => "")
return content
end
Sys.rm(notebooks_dir;recursive=true,force=true)
for (file,name) in files
file_jl = file*".jl"
Literate.notebook(joinpath(repo_src,file_jl), notebooks_dir; name=name, documenter=false, execute=false, preprocess=colab_blank)
end
###################################################################
# colab notebooks
repo_src = joinpath(@__DIR__, "..", "src")
notebooks_dir = joinpath(@__DIR__, "..", "colab/notebooks")
colab_header = read("./deps/colab_header", String)
function colab_install(content)
content = replace(content, "COLAB" => colab_header)
return content
end
Sys.rm(notebooks_dir;recursive=true,force=true)
for (file,name) in files
file_jl = file*".jl"
Literate.notebook(joinpath(repo_src,file_jl), notebooks_dir; name=name, documenter=false, execute=false, preprocess=colab_install)
end