From 8508d04bbc479e77309d162f24b9baa7bfc002a2 Mon Sep 17 00:00:00 2001 From: Igor20264 Date: Sat, 5 Sep 2026 09:47:57 +0300 Subject: [PATCH] Small fix 0.4.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update gitignore - Rewrite blocks text - Add custom "Отступы от края страницы" --- .gitignore | 3 ++- md2gost/help_content.py | 2 +- md2gost/page_geometry.py | 16 ++++++++++++++++ prompts/README.md | 3 ++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 16474dd..a7385b5 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ __pycache__/ # Distribution / packaging .Python build/ +build-fast/ develop-eggs/ dist/ downloads/ @@ -180,4 +181,4 @@ cython_debug/ md2gost.schemes.json md2gost.include-cache.json include-cache/ -.md2gost-cache/ +.md2gost-cache/ \ No newline at end of file diff --git a/md2gost/help_content.py b/md2gost/help_content.py index 8f7ef72..784219c 100644 --- a/md2gost/help_content.py +++ b/md2gost/help_content.py @@ -18,7 +18,7 @@ USAGE_HELP = """md2gost — Markdown → DOCX (ТЗ МИРЭА / ГОСТ 7.32) 3. Нажмите «Конвертировать». Документ сохранится рядом с исходником (или по пути «Выходной DOCX»). Дебаг (меню сверху) — следующая сборка с отладочными данными в документе. -Типы: practice (по умолчанию) / coursework / vkr — ГОСТ МИРЭА; PIS_custom — отчёт по практикам; APID_coursework — курсовая АПИД. +Типы: practice (по умолчанию) / coursework / vkr — ГОСТ МИРЭА; PIS_custom — отчёт по практикам ПИС; APID_coursework — курсовая АПИД. Полезные галочки • «—» → «-» — заменить типографское тире на дефис (по умолчанию **выкл.**; методичка требует «—»). diff --git a/md2gost/page_geometry.py b/md2gost/page_geometry.py index 2e68ace..7b4fd63 100644 --- a/md2gost/page_geometry.py +++ b/md2gost/page_geometry.py @@ -15,6 +15,22 @@ MARGIN_RIGHT = Mm(10) MARGIN_TOP = Mm(20) MARGIN_BOTTOM = Mm(20) +# mirea / pis_custom — 30/10/20/20; paco_custom — форма ПАЦО 20/20/20/20 +MARGIN_PRESETS = { + "mirea": (Mm(30), Mm(10), Mm(20), Mm(20)), + "pis_custom": (Mm(30), Mm(10), Mm(20), Mm(20)), +} + + +def apply_margin_preset(preset: str) -> None: + """Switch active page margins used by apply_section_geometry / content_size.""" + global MARGIN_LEFT, MARGIN_RIGHT, MARGIN_TOP, MARGIN_BOTTOM + left, right, top, bottom = MARGIN_PRESETS.get(preset, MARGIN_PRESETS["mirea"]) + MARGIN_LEFT = left + MARGIN_RIGHT = right + MARGIN_TOP = top + MARGIN_BOTTOM = bottom + A4_SHORT = Mm(210) A4_LONG = Mm(297) diff --git a/prompts/README.md b/prompts/README.md index 309234e..20622bb 100644 --- a/prompts/README.md +++ b/prompts/README.md @@ -2,7 +2,8 @@ ## Основной файл -[`generate-mirea-report.md`](generate-mirea-report.md) — полный системный промпт. +[`generate-mirea-report.md`](generate-mirea-report.md) — полный системный промпт (ГОСТ / МИРЭА). +[`generate-pis-custom-report.md`](generate-pis-custom-report.md) — итоговый отчёт ПИС. ### Как использовать