-
Notifications
You must be signed in to change notification settings - Fork 20
/
make.jl
57 lines (51 loc) · 1.71 KB
/
make.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
using Documenter
using Literate
@info "Loading AlgebraicPetri"
using AlgebraicPetri
# Set Literate.jl config if not being compiled on recognized service.
config = Dict{String,String}()
if !(haskey(ENV, "GITHUB_ACTIONS") || haskey(ENV, "GITLAB_CI"))
config["nbviewer_root_url"] = "https://nbviewer.jupyter.org/github/AlgebraicJulia/AlgebraicPetri.jl/blob/gh-pages/dev"
config["repo_root_url"] = "https://github.com/AlgebraicJulia/AlgebraicPetri.jl/blob/master/docs"
end
const literate_dir = joinpath(@__DIR__, "..", "examples")
const generated_dir = joinpath(@__DIR__, "src", "examples")
for (root, dirs, files) in walkdir(literate_dir)
out_dir = joinpath(generated_dir, relpath(root, literate_dir))
for file in files
f,l = splitext(file)
if l == ".jl" && !startswith(f, "_")
Literate.markdown(joinpath(root, file), out_dir;
config=config, documenter=true, credit=false)
Literate.notebook(joinpath(root, file), out_dir;
execute=true, documenter=true, credit=false)
end
end
end
@info "Building Documenter.jl docs"
makedocs(
modules = [AlgebraicPetri],
format = Documenter.HTML(
assets = ["assets/analytics.js"],
),
sitename = "AlgebraicPetri.jl",
doctest = false,
checkdocs = :none,
pages = Any[
"AlgebraicPetri.jl" => "index.md",
"Examples" => Any[
"examples/predation/lotka-volterra.md",
"examples/covid/epidemiology.md",
"examples/covid/coexist/coexist.md",
"examples/enzymes/enzyme_reactions.md",
"examples/covid/bilayerconversion.md",
],
"Library Reference" => "api.md",
]
)
@info "Deploying docs"
deploydocs(
target = "build",
repo = "github.com/AlgebraicJulia/AlgebraicPetri.jl.git",
branch = "gh-pages"
)