-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmake.jl
More file actions
64 lines (56 loc) · 1.95 KB
/
make.jl
File metadata and controls
64 lines (56 loc) · 1.95 KB
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
63
64
using Documenter
using Pluto
include("definitions.jl")
repo_dir = dirname(@__DIR__)
build_dir = joinpath(repo_dir, "docs", "build")
plutos = [
joinpath(repo_dir, "class01", "background_materials", "math_basics.jl"),
joinpath(repo_dir, "class01", "background_materials", "optimization_basics.jl"),
joinpath(repo_dir, "class01", "background_materials", "optimization_motivation.jl"),
joinpath(repo_dir, "class01", "class01_intro.jl"),
]
if !isdir(build_dir)
symlink(joinpath(repo_dir, "class01"),
joinpath(repo_dir, "docs", "src", "class01")
)
end
makedocs(
sitename = "LearningToControlClass",
format = Documenter.HTML(;
assets = ["assets/wider.css", "assets/redlinks.css"],
mathengine = Documenter.MathJax3(Dict(
:tex => Dict(
"macros" => make_macros_dict("docs/src/assets/definitions.tex"),
"inlineMath" => [["\$","\$"], ["\\(","\\)"]],
"tags" => "ams",
),
)),
),
pages = [
"Home" => "index.md",
"Class 1" => ["class01/class01.md",
"class01/background_materials/git_adventure_guide.md",
],
],
)
rm(joinpath(repo_dir, "docs", "src", "class01"), force=true)
s = Pluto.ServerSession();
for pluto in plutos
nb = Pluto.SessionActions.open(s, pluto; run_async=false)
html_contents = Pluto.generate_html(nb; binder_url_js="undefined")
filename = replace(pluto, repo_dir => build_dir)
html_path = replace(filename, r"\.jl$" => ".html")
mkpath(dirname(html_path))
open(html_path, "w") do f
write(f, html_contents)
end
end
# Documenter can also automatically deploy documentation to gh-pages.
# See "Hosting Documentation" and deploydocs() in the Documenter manual
# for more information.
include("patch.jl")
deploydocs(
repo="github.com/LearningToOptimize/LearningToControlClass.git",
push_preview=true,
deploy_config=L2CCGitHubActionsAllowExternalPreviews()
)