-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathmake.jl
More file actions
157 lines (142 loc) · 4.78 KB
/
make.jl
File metadata and controls
157 lines (142 loc) · 4.78 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
using TimerOutputs
dto = TimerOutput()
reset_timer!(dto)
const liveserver = "liveserver" in ARGS
if liveserver
using Revise
@timeit dto "Revise.revise()" Revise.revise()
end
using Documenter, DocumenterCitations, Ferrite, FerriteGmsh, FerriteMeshParser,
SparseArrays, LinearAlgebra, Changelog
using BlockArrays
const FerriteBlockArrays = Base.get_extension(Ferrite, :FerriteBlockArrays)
const is_ci = haskey(ENV, "GITHUB_ACTIONS")
# Generate tutorials and how-to guides
include("generate.jl")
# Changelog
Changelog.generate(
Changelog.Documenter(),
joinpath(@__DIR__, "..", "CHANGELOG.md"),
joinpath(@__DIR__, "src", "changelog.md");
repo = "Ferrite-FEM/Ferrite.jl",
)
bibtex_plugin = CitationBibliography(
joinpath(@__DIR__, "src", "assets", "references.bib"),
style = :numeric
)
# Build documentation.
@timeit dto "makedocs" makedocs(
format = Documenter.HTML(
assets = [
"assets/custom.css",
"assets/citations.css",
"assets/favicon.ico",
],
canonical = "https://ferrite-fem.github.io/Ferrite.jl/stable",
collapselevel = 1,
),
sitename = "Ferrite.jl",
doctest = false,
warnonly = is_ci ? false : [:cross_references], # Local build exception required for Literate's `@__NBVIEWER_ROOT_URL__`
draft = liveserver,
pages = Any[
"Home" => "index.md",
hide("Changelog" => "changelog.md"),
"Tutorials" => [
"Tutorials overview" => "tutorials/index.md",
"tutorials/heat_equation.md",
"tutorials/linear_elasticity.md",
"tutorials/incompressible_elasticity.md",
"tutorials/hyperelasticity.md",
"tutorials/plasticity.md",
"tutorials/transient_heat_equation.md",
"tutorials/computational_homogenization.md",
"tutorials/stokes-flow.md",
"tutorials/porous_media.md",
"tutorials/ns_vs_diffeq.md",
"tutorials/reactive_surface.md",
"tutorials/linear_shell.md",
"tutorials/dg_heat_equation.md",
],
"Topic guides" => [
"Topic guide overview" => "topics/index.md",
"topics/fe_intro.md",
"topics/reference_shapes.md",
"topics/FEValues.md",
"topics/degrees_of_freedom.md",
"topics/sparse_matrix.md",
"topics/assembly.md",
"topics/boundary_conditions.md",
"topics/constraints.md",
"topics/grid.md",
"topics/export.md",
],
"API reference" => [
"Reference overview" => "reference/index.md",
"reference/quadrature.md",
"reference/interpolations.md",
"reference/fevalues.md",
"reference/dofhandler.md",
"reference/sparsity_pattern.md",
"reference/assembly.md",
"reference/boundary_conditions.md",
"reference/grid.md",
"reference/export.md",
"reference/utils.md",
],
"How-to guides" => [
"How-to guide overview" => "howto/index.md",
"howto/postprocessing.md",
"howto/threaded_assembly.md",
"howto/gpu_assembly.md",
],
"gallery/index.md",
# "Code gallery" => [
# "Code gallery overview" => "gallery/index.md",
# "gallery/helmholtz.md",
# "gallery/quasi_incompressible_hyperelasticity.md",
# "gallery/landau.md",
# "gallery/topology_optimization.md",
# ],
"devdocs/index.md",
"cited-literature.md",
"ferritepapers.md",
],
plugins = [
bibtex_plugin,
]
)
# make sure there are no *.vtu files left around from the build
@timeit dto "remove vtk files" cd(joinpath(@__DIR__, "build", "tutorials")) do
foreach(file -> endswith(file, ".vtu") && rm(file), readdir())
end
# Insert some <br> in the side menu
for (root, _, files) in walkdir(joinpath(@__DIR__, "build")), file in joinpath.(root, files)
endswith(file, ".html") || continue
str = read(file, String)
# Insert <br> after "Reference" (before "Code gallery")
str = replace(str, r"""(<li(?: class="is-active")?><a class="tocitem" href(?:="[\./\w]+")?>Code gallery</a></li>)""" => s"<br>\1")
write(file, str)
end
# Deploy built documentation
if !liveserver
@timeit dto "deploydocs" deploydocs(
repo = "github.com/Ferrite-FEM/Ferrite.jl.git",
push_preview = true,
versions = [
"stable" => "v^",
"v#.#",
"v0.3.13",
"v0.3.12",
"v0.3.11",
"v0.3.10",
"v0.3.9",
"v0.3.8",
"v0.3.7",
"v0.3.6",
"v0.3.5",
"dev" => "dev",
]
)
end
print_timer(dto)