-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathantora-playbook.dhall
163 lines (142 loc) · 4.6 KB
/
antora-playbook.dhall
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
161
162
163
let Prelude = https://prelude.dhall-lang.org/package.dhall
let Map = https://prelude.dhall-lang.org/Map/Type
let Playbook = ./antora-playbook-schema.dhall
let reposDir = Some env:REPOS_DIR as Text ? None Text
let Branch = < Master | Other : Text >
let site =
{ title = "Decidim Docs"
, url =
merge
{ Some = λ(_ : Text) → "http://localhost:5500/build/site/"
, None = "https://docs.decidim.org"
}
reposDir
, start_page = Some "decidim:ROOT:index.adoc"
, keys = None (Map Text Text)
, robots = Some Playbook.Robots.allow
}
: Playbook.Site
let branchesDefault = None (List Text)
let languageDefault =
{ branches = Some [ Branch.Master ], tags = None (List Text) }
let sources
: List
{ name : Text
, languages :
List
{ name : Text
, branches : Optional (List Branch)
, tags : Optional (List Text)
}
}
= [ { name = "docs-base"
, languages = [ languageDefault ⫽ { name = "en" } ]
}
]
let ui =
{ bundle =
{ snapshot = Some True
, start_path = None Text
, url =
merge
{ Some =
λ(dir : Text) → "${dir}/docs-ui.git/build/ui-bundle.zip"
, None =
"https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/master/raw/build/ui-bundle.zip?job=bundle-stable"
}
reposDir
}
, default_layout = None Text
, output_dir = None Text
, supplemental_files = Some "./supplemental_ui"
}
: Playbook.Ui
let asciidoc =
Some
{ attributes = Some
[ { mapKey = "idseparator", mapValue = "-" }
, { mapKey = "xrefstyle", mapValue = "short" }
, { mapKey = "idprefix", mapValue = "" }
]
, extensions = None (List Text)
}
: Playbook.Asciidoc
let output =
None
{ clean : Optional Bool
, destinations : List { provider : Text }
, dir : Optional Text
}
: Playbook.Output
let runtime =
Some { cache_dir = Some "./.cache/antora", fetch = Some True }
: Playbook.Runtime
let content =
let Language =
{ name : Text
, branches : Optional (List Branch)
, tags : Optional (List Text)
}
let SourceIn
: Type
= { languages : List Language, name : Text }
let SourceOut
: Type
= { branches : Optional (List Text)
, start_path : Optional Text
, tags : Optional (List Text)
, url : Text
}
let mkUrl
: Text → Text
= λ(name : Text)
→ merge
{ Some = λ(dir : Text) → "${dir}/${name}.git"
, None = "https://github.com/decidim/${name}.git"
}
reposDir
let branch2text =
λ(branch : Branch)
→ merge
{ Master =
merge
{ Some = λ(_ : Text) → "HEAD", None = "master" }
reposDir
, Other = λ(t : Text) → t
}
branch
let addSource =
λ(sourceName : Text)
→ λ(language : Language)
→ λ(list : List SourceOut)
→ list
# [ { url = mkUrl sourceName
, start_path = Some language.name
, branches =
merge
{ Some =
λ(l : List Branch)
→ Some (Prelude.List.map Branch Text branch2text l)
, None = None (List Text)
}
language.branches
, tags = language.tags
}
]
let func
: SourceIn → List SourceOut
= λ(s : SourceIn)
→ List/fold
Language
s.languages
(List SourceOut)
(addSource s.name)
([] : List SourceOut)
in { branches = branchesDefault }
⫽ { sources =
Prelude.List.concat
SourceOut
(Prelude.List.map SourceIn (List SourceOut) func sources)
}
: Playbook.Content
in { site, content, ui, asciidoc, runtime, output } : Playbook.Playbook