fn(language$0, name$1) =>
@definy.read-branch-snapshot(
project: "docs",
branch: "main",
then: fn(commit$2, commits$3) =>
match $2 {
#none(_) =>
@html-ui.not-found(language: $0, path: @core.string-concat(left: "/docs/", right: $1)),
#some(found$4) =>
match @core.equal(left: $1, right: "") {
true =>
@html-ui.docs-index-page(language: $0, names: @definy.snapshot-part-names(commits: [$4])),
false =>
match @definy.snapshot-part-find(commits: [$4], name: @core.string-concat(left: "docs.", right: $1), index: 0) {
#none(_) =>
@html-ui.not-found(language: $0, path: @core.string-concat(left: "/docs/", right: $1)),
#some(part$5) =>
@definy.read-part-contents(
parts: [$5.part],
then: fn(parts$6) =>
match @core.list-get(list: $6, index: 0) {
#none(_) =>
@html-ui.not-found(language: $0, path: @core.string-concat(left: "/docs/", right: $1)),
#some(resolved$7) =>
match $7.content {
#none(_) =>
@html-ui.not-found(language: $0, path: @core.string-concat(left: "/docs/", right: $1)),
#some(content$8) =>
match $8.expression {
#none(_) =>
@html-ui.not-found(language: $0, path: @core.string-concat(left: "/docs/", right: $1)),
#some(expression$9) =>
match $9 {
#string(text$10) =>
@html-ui.docs-document-page(language: $0, name: $1, part_id: $5.part.id, text: $10),
_ =>
@html-ui.not-found(language: $0, path: @core.string-concat(left: "/docs/", right: $1))
}
}
}
}
)
}
}
}
)