forked from JuliaGraphs/Graphs.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.jl
111 lines (104 loc) · 3.06 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
107
108
109
110
111
using Documenter
using Graphs
# same for contributing and license
cp(
normpath(@__FILE__, "../../CONTRIBUTING.md"),
normpath(@__FILE__, "../src/contributing.md");
force=true,
)
cp(
normpath(@__FILE__, "../../LICENSE.md"),
normpath(@__FILE__, "../src/license.md");
force=true,
)
cp(
normpath(@__FILE__, "../../README.md"),
normpath(@__FILE__, "../src/index.md");
force=true,
)
function get_title(markdown_file_path::AbstractString)
first_line = open(markdown_file_path) do io
readline(io)
end
return String(chop(first_line; head=2, tail=0))
end
pages_files = [
"First steps" => [
"index.md",
"first_steps/theory.md",
"first_steps/construction.md",
"first_steps/access.md",
"first_steps/paths_traversal.md",
"first_steps/plotting.md",
"first_steps/persistence.md",
],
"Ecosystem" => [
"ecosystem/graphtypes.md",
"ecosystem/interface.md",
],
"Core API" => [
"core_functions/core.md",
"core_functions/interface.md",
"core_functions/module.md",
"core_functions/operators.md",
"core_functions/persistence.md",
"core_functions/simplegraphs_generators.md",
"core_functions/simplegraphs.md",
],
"Algorithms API" => [
"algorithms/biconnectivity.md",
"algorithms/centrality.md",
"algorithms/community.md",
"algorithms/connectivity.md",
"algorithms/cut.md",
"algorithms/cycles.md",
"algorithms/degeneracy.md",
"algorithms/digraph.md",
"algorithms/distance.md",
"algorithms/dominatingset.md",
"algorithms/editdist.md",
"algorithms/independentset.md",
"algorithms/linalg.md",
"algorithms/shortestpaths.md",
"algorithms/spanningtrees.md",
"algorithms/steinertree.md",
"algorithms/traversals.md",
"algorithms/utils.md",
"algorithms/vertexcover.md",
],
"For advanced users" => [
"advanced/errorhandling.md",
"advanced/experimental.md",
"advanced/parallel.md",
"contributing.md",
"license.md",
],
]
pages=[
section_name => [
get_title(joinpath(normpath(@__FILE__, ".."), "src", file)) => file for
file in section_files
] for (section_name, section_files) in pages_files
]
makedocs(;
modules=[Graphs],
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
assets=String[],
collapselevel=1,
canonical="https://gdalle.github.io/Graphs.jl",
),
sitename="Graphs.jl",
doctest=false,
expandfirst=[],
pages=[
section_name => [
get_title(joinpath(normpath(@__FILE__, ".."), "src", file)) => file for
file in section_files
] for (section_name, section_files) in pages_files
],
)
deploydocs(; repo="github.com/JuliaGraphs/Graphs.jl.git", target="build")
rm(normpath(@__FILE__, "../src/contributing.md"))
rm(normpath(@__FILE__, "../src/license.md"))
rm(normpath(@__FILE__, "../src/index.md"))