-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.jl
More file actions
160 lines (149 loc) · 5.62 KB
/
make.jl
File metadata and controls
160 lines (149 loc) · 5.62 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
158
159
160
using MultiDocumenter, Documenter
clonedir = ("--temp" in ARGS) ? mktempdir() : joinpath(@__DIR__, "clones")
outpath = mktempdir()
@info """
Cloning packages into: $(clonedir)
Building aggregate site into: $(outpath)
"""
generate_name(a, b, c) = MultiDocumenter.@htl("<div class=\"headertitle\"> $a </div><br> Unfold<span style=\"color:$c;\">$b</span>.jl")
#---
Documenter.makedocs(
sitename="Unfold.jl Ecosystem",
modules=Module[],
warnonly=true,
format=Documenter.HTML(; inventory_version="1.0.0"),
pages=[
"Overview" => [
"index.md",
"Installation" => "installation.md"
],
"Various" => [
"Other rERP/TRF packages"=>"comparison.md",
"Why Julia?" => "why_julia.md",
"Talks & Workshops" => "outreach.md",
],
"Contributing?" => [
"Overview" => "contr_overview.md",
"Developer Workflow" => "contr_dev_workflow.md",
"Testing" => "contr_testing.md",
"Documentation" => "contr_docs.md",
"Formatting" => "contr_formatting.md",
"Code Style" => "code_style.md",
],]
)
#---
docs = [
MultiDocumenter.MultiDocRef(
upstream=joinpath(@__DIR__, "build"),
path="main",
name=MultiDocumenter.@htl("<div class=\"homebutton\">Home</div>"),
fix_canonical_url=false,
),
MultiDocumenter.MultiDocRef(
upstream=joinpath(clonedir, "Unfold.jl"),
path="Unfold.jl",
name=generate_name("Analysis", "", "#ccc"),
giturl="https://github.com/unfoldtoolbox/Unfold.jl.git",
),
MultiDocumenter.MultiDocRef(
upstream=joinpath(clonedir, "UnfoldMixedModels.jl"),
path="UnfoldMixedModels.jl",
name=generate_name("LMM", "MixedModels", "#197BDD"),
giturl="https://github.com/unfoldtoolbox/UnfoldMixedModels.jl.git",
),
MultiDocumenter.MultiDocRef(
upstream=joinpath(clonedir, "UnfoldMakie.jl"),
path="UnfoldMakie.jl",
name=generate_name("Visualization", "Makie", "#3AAA35"),#MultiDocumenter.@htl("<div class=\"headertitle\">Visualization </div><br> UnfoldMakie.jl"),
giturl="https://github.com/unfoldtoolbox/UnfoldMakie.jl.git",
),
MultiDocumenter.MultiDocRef(
upstream=joinpath(clonedir, "UnfoldSim.jl"),
path="UnfoldSim.jl",
name=generate_name("Simulation", "Sim", "#E6007E"),
giturl="https://github.com/unfoldtoolbox/UnfoldSim.jl.git"),
MultiDocumenter.MultiDocRef(
upstream=joinpath(clonedir, "UnfoldBIDS.jl"),
path="UnfoldBIDS.jl",
name=generate_name("Pipeline", "BIDS", "#FEC700"),
giturl="https://github.com/unfoldtoolbox/UnfoldBIDS.jl.git"),
MultiDocumenter.MultiDocRef(
upstream=joinpath(clonedir, "UnfoldStats.jl"),
path="UnfoldStats.jl",
name=generate_name("Statistics", "Stats", "#E30613"),#MultiDocumenter.@htl("<div class=\"headertitle\">Statistic </div><br> UnfoldStats.jl"),
giturl="https://github.com/unfoldtoolbox/UnfoldStats.jl.git",),
MultiDocumenter.MultiDocRef(
upstream=joinpath(clonedir, "UnfoldDecode.jl"),
path="UnfoldDecode.jl",
name=generate_name("Decoding", "Decode", "#009BA4"),#MultiDocumenter.@htl("<div class=\"headertitle\">Decoding </div><br> UnfoldDecode.jl"),
giturl="https://github.com/unfoldtoolbox/UnfoldDecode.jl.git",),
MultiDocumenter.DropdownNav("Related Tools", [
MultiDocumenter.MultiDocRef(
upstream=joinpath(clonedir, "ClusterDepth.jl"),
path="ClusterDepth.jl",
name=MultiDocumenter.@htl("<div class=\"headertitle\">Multiple Comparisons with ClusterDepth.jl</div>"),
giturl="https://github.com/s-ccs/ClusterDepth.jl.git",
),
#=
pyMNE has no docs :S
MultiDocumenter.MultiDocRef(
upstream=joinpath(clonedir, "PyMNE"),
path="PyMNE.jl",
name=MultiDocumenter.@htl("PyMNE.jl",
giturl="https://github.com/beacon-biosignals/PyMNE.jl/",
),=#
#DeepRecurrentEncoder.jl
]),
]
#outpath = joinpath(@__DIR__, "out")
#---
MultiDocumenter.make(
outpath,
docs,#[1:1];
rootpath="/UnfoldDocs/",
canonical_domain="https://unfoldtoolbox.github.io/",
search_engine=MultiDocumenter.SearchConfig(
index_versions=["stable"],
engine=MultiDocumenter.FlexSearch
),
custom_stylesheets=["assets/style.css"],
hide_previews=true,
prettyurls=true,
assets_dir="assets"
)
if "deploy" in ARGS
@warn "Deploying to GitHub" ARGS
gitroot = @__DIR__#normpath(joinpath(@__DIR__, ".."))
run(`git pull`)
outbranch = "gh-pages"
has_outbranch = true
if !success(`git checkout $outbranch`)
has_outbranch = false
if !success(`git switch --orphan $outbranch`)
@error "Cannot create new orphaned branch $outbranch."
exit(1)
end
end
for file in readdir(gitroot; join=true)
endswith(file, ".git") && continue
rm(file; force=true, recursive=true)
end
for file in readdir(outpath)
cp(joinpath(outpath, file), joinpath(gitroot, file))
end
run(`git add .`)
if success(`git commit -m 'Aggregate documentation'`)
@info "Pushing updated documentation."
if has_outbranch
run(`git push`)
else
run(`git push -u origin $outbranch`)
end
run(`git checkout main`)
else
@info "No changes to aggregated documentation."
end
else
@info "Skipping deployment, 'deploy' not passed. Generated files in 'out'." ARGS
cp(outpath, joinpath(@__DIR__, "out"), force=true)
end