Skip to content

Commit 779f4f9

Browse files
committed
Collapse long Constants block by default
1 parent 3cafd29 commit 779f4f9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

docs/src/docgen-md.own

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ messages = {
4545
"functions": {"en": "Functions", "ru": "Функции"},
4646
"types": {"en": "Types", "ru": "Типы"},
4747
"example": {"en": "Example", "ru": "Пример"},
48-
"since": {"en": "Since", "ru": "Начиная с"}
48+
"since": {"en": "Since", "ru": "Начиная с"},
49+
"elements": {"en": " elements", "ru": " элементов"}
4950
}
5051

5152
// Write modules pages to vuepress config
@@ -104,11 +105,13 @@ def writeConstants(f, constants, lang) {
104105
} else {
105106
mapValues = constValue.substring(1, constValue.length - 1).split(", ")
106107
if (mapValues.length >= 7) {
107-
writeText(f, "\n\n```own\n{\n ");
108-
writeText(f, mapValues.joinToString(",\n "));
109-
writeText(f, "\n}\n```");
108+
writeText(f, "\n\n::: details %d %s".sprintf(mapValues.length, messages.elements[lang]));
109+
writeText(f, "\n\n```own:no-line-numbers\n{\n ");
110+
writeText(f, mapValues.joinToString(",\n "));
111+
writeText(f, "\n}\n```");
112+
writeText(f, "\n:::");
110113
} else {
111-
writeText(f, "`%s`".sprintf(constValue));
114+
writeText(f, "`%s`".sprintf(constValue));
112115
}
113116
}
114117
writeLine(f, "")

0 commit comments

Comments
 (0)