mirror of
https://github.com/aNNiMON/Own-Programming-Language-Tutorial.git
synced 2024-09-20 00:34:20 +03:00
Collapse long Constants block by default
This commit is contained in:
parent
3cafd29221
commit
779f4f9368
@ -45,7 +45,8 @@ messages = {
|
|||||||
"functions": {"en": "Functions", "ru": "Функции"},
|
"functions": {"en": "Functions", "ru": "Функции"},
|
||||||
"types": {"en": "Types", "ru": "Типы"},
|
"types": {"en": "Types", "ru": "Типы"},
|
||||||
"example": {"en": "Example", "ru": "Пример"},
|
"example": {"en": "Example", "ru": "Пример"},
|
||||||
"since": {"en": "Since", "ru": "Начиная с"}
|
"since": {"en": "Since", "ru": "Начиная с"},
|
||||||
|
"elements": {"en": " elements", "ru": " элементов"}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write modules pages to vuepress config
|
// Write modules pages to vuepress config
|
||||||
@ -104,11 +105,13 @@ def writeConstants(f, constants, lang) {
|
|||||||
} else {
|
} else {
|
||||||
mapValues = constValue.substring(1, constValue.length - 1).split(", ")
|
mapValues = constValue.substring(1, constValue.length - 1).split(", ")
|
||||||
if (mapValues.length >= 7) {
|
if (mapValues.length >= 7) {
|
||||||
writeText(f, "\n\n```own\n{\n ");
|
writeText(f, "\n\n::: details %d %s".sprintf(mapValues.length, messages.elements[lang]));
|
||||||
writeText(f, mapValues.joinToString(",\n "));
|
writeText(f, "\n\n```own:no-line-numbers\n{\n ");
|
||||||
writeText(f, "\n}\n```");
|
writeText(f, mapValues.joinToString(",\n "));
|
||||||
|
writeText(f, "\n}\n```");
|
||||||
|
writeText(f, "\n:::");
|
||||||
} else {
|
} else {
|
||||||
writeText(f, "`%s`".sprintf(constValue));
|
writeText(f, "`%s`".sprintf(constValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writeLine(f, "")
|
writeLine(f, "")
|
||||||
|
Loading…
Reference in New Issue
Block a user