fn(language$0, text$1) =>
let ti$2 = @core.string-index-of(text: $1, target: "\n\ntype:\n", start: 0);
match @core.less-than(left: $2, right: 0) {
true =>
[
@html.element(
name: "pre",
attributes: [],
children: @html-ui.link-refs(text: @html-ui.localize-lines(language: $0, text: $1))
)
],
false =>
let lines$3 = @core.string-split(
text: @html-ui.localize-lines(language: $0, text: @core.string-slice(value: $1, start: 0, end: $2)),
separator: "\n"
);
let rest$4 = @core.string-slice(value: $1, start: @core.plus(left: $2, right: 8), end: @core.string-length(value: $1));
let ei$5 = @core.string-index-of(text: $4, target: "\n\nexpression:\n", start: 0);
let type$6 = match @core.less-than(left: $5, right: 0) {
true =>
$4,
false =>
@core.string-slice(value: $4, start: 0, end: $5)
};
let expression$7 = match @core.less-than(left: $5, right: 0) {
true =>
"",
false =>
@core.string-slice(value: $4, start: @core.plus(left: $5, right: 14), end: @core.string-length(value: $4))
};
[
@html.element(
name: "dl",
attributes: [{name: "class", value: "fields"}],
children: [
@html-ui.text-element(name: "dt", text: @html-ui.text(language: $0, en: "description", ja: "説明", eo: "priskribo")),
@html.element(
name: "dd",
attributes: [{name: "class", value: "doc"}],
children: [@html.text(text: @html-ui.line-value(lines: $3, key: "description"))]
),
@html-ui.text-element(name: "dt", text: @html-ui.text(language: $0, en: "type", ja: "型", eo: "tipo")),
@html.element(
name: "dd",
attributes: [],
children: [
@html.element(name: "pre", attributes: [{name: "class", value: "box"}], children: @html-ui.link-refs(text: $6))
]
),
@html-ui.text-element(name: "dt", text: @html-ui.text(language: $0, en: "expression", ja: "式", eo: "esprimo")),
@html.element(
name: "dd",
attributes: [],
children: [
@html.element(name: "pre", attributes: [{name: "class", value: "box"}], children: @html-ui.link-refs(text: $7))
]
),
@html-ui.text-element(
name: "dt",
text: @html-ui.text(language: $0, en: "visibility", ja: "公開範囲", eo: "videbleco")
),
@html-ui.text-element(name: "dd", text: @html-ui.line-value(lines: $3, key: "visibility"))
]
),
@html.element(
name: "pre",
attributes: [{name: "class", value: "meta"}],
children: [
@html.text(
text: @core.string-join(
items: [
@core.string-slice(value: $1, start: 0, end: @core.string-index-of(text: $1, target: "\n", start: 0)),
@core.string-concat(left: "id: ", right: @html-ui.line-value(lines: $3, key: "id")),
@core.string-concat(left: "content hash: ", right: @html-ui.line-value(lines: $3, key: "content hash"))
],
separator: "\n"
)
)
]
)
]
}