From 779f4f936817e5eeb0bce3c58088ed69b19671e2 Mon Sep 17 00:00:00 2001 From: aNNiMON Date: Mon, 27 Nov 2023 19:54:01 +0200 Subject: [PATCH] Collapse long Constants block by default --- docs/src/docgen-md.own | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/src/docgen-md.own b/docs/src/docgen-md.own index 622f2e1..aff6ccc 100644 --- a/docs/src/docgen-md.own +++ b/docs/src/docgen-md.own @@ -45,7 +45,8 @@ messages = { "functions": {"en": "Functions", "ru": "Функции"}, "types": {"en": "Types", "ru": "Типы"}, "example": {"en": "Example", "ru": "Пример"}, - "since": {"en": "Since", "ru": "Начиная с"} + "since": {"en": "Since", "ru": "Начиная с"}, + "elements": {"en": " elements", "ru": " элементов"} } // Write modules pages to vuepress config @@ -104,11 +105,13 @@ def writeConstants(f, constants, lang) { } else { mapValues = constValue.substring(1, constValue.length - 1).split(", ") if (mapValues.length >= 7) { - writeText(f, "\n\n```own\n{\n "); - writeText(f, mapValues.joinToString(",\n ")); - writeText(f, "\n}\n```"); + writeText(f, "\n\n::: details %d %s".sprintf(mapValues.length, messages.elements[lang])); + writeText(f, "\n\n```own:no-line-numbers\n{\n "); + writeText(f, mapValues.joinToString(",\n ")); + writeText(f, "\n}\n```"); + writeText(f, "\n:::"); } else { - writeText(f, "`%s`".sprintf(constValue)); + writeText(f, "`%s`".sprintf(constValue)); } } writeLine(f, "")