-
Notifications
You must be signed in to change notification settings - Fork 7
/
make.jl
106 lines (97 loc) · 3.02 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import Documenter, DocumenterCitations, Literate
import ClimaCore,
ClimaCoreVTK,
ClimaCoreMakie,
ClimaCorePlots,
ClimaCoreTempestRemap,
ClimaCoreSpectra
if !@isdefined(TUTORIALS)
TUTORIALS = ["introduction"]
end
rm(joinpath(@__DIR__, "src", "tutorials"), force = true, recursive = true)
function preprocess_markdown(input)
line1, rest = split(input, '\n', limit = 2)
string(
line1,
"\n# *This tutorial is available as a [Jupyter notebook](@__NAME__.ipynb).*\n",
rest,
)
end
for tutorial in TUTORIALS
Literate.markdown(
joinpath(@__DIR__, "tutorials", tutorial * ".jl"),
joinpath(@__DIR__, "src", "tutorials");
preprocess = preprocess_markdown,
)
Literate.notebook(
joinpath(@__DIR__, "tutorials", tutorial * ".jl"),
joinpath(@__DIR__, "src", "tutorials");
execute = false,
)
end
withenv("GKSwstype" => "nul") do
bib =
DocumenterCitations.CitationBibliography(joinpath(@__DIR__, "refs.bib"))
mathengine = Documenter.MathJax(
Dict(
:TeX => Dict(
:equationNumbers => Dict(:autoNumber => "AMS"),
:Macros => Dict(),
),
),
)
format = Documenter.HTML(
prettyurls = !isempty(get(ENV, "CI", "")),
mathengine = mathengine,
collapselevel = 1,
)
Documenter.makedocs(;
plugins = [bib],
sitename = "ClimaCore.jl",
format = format,
checkdocs = :exports,
clean = true,
doctest = true,
modules = [
ClimaCore,
ClimaCoreVTK,
ClimaCoreSpectra,
ClimaCorePlots,
ClimaCoreMakie,
ClimaCoreTempestRemap,
],
pages = Any[
"Home" => "index.md",
"Introduction" => "intro.md",
"Mathematical Framework" => "math_framework.md",
"Installation and How-to Guides" => "installation_instructions.md",
"Geometry" => "geometry.md",
"Operators" => "operators.md",
"MatrixFields" => "matrix_fields.md",
"API" => "api.md",
"Developer docs" => ["Performance tips" => "performance_tips.md"],
"Tutorials" => [
joinpath("tutorials", tutorial * ".md") for
tutorial in TUTORIALS
],
"Examples" => "examples.md",
"Libraries" => [
joinpath("lib", "ClimaCorePlots.md"),
joinpath("lib", "ClimaCoreMakie.md"),
joinpath("lib", "ClimaCoreVTK.md"),
joinpath("lib", "ClimaCoreTempestRemap.md"),
joinpath("lib", "ClimaCoreSpectra.md"),
],
"Contributing guide" => "Contributing.md",
"Code of Conduct" => "code_of_conduct.md",
"references.md",
],
)
end
Documenter.deploydocs(
repo = "github.com/CliMA/ClimaCore.jl.git",
target = "build",
push_preview = true,
devbranch = "main",
forcepush = true,
)