From 6f37a953ed73d998c6042c8c7e4b39f8a0b6a3f6 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Feb 2026 13:06:38 +0000 Subject: [PATCH 1/2] Add 8 admonition types for visually rich documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend the LaTeX→Markdown→Zensical pipeline from 2 admonition types (note, warning) to 8 by detecting bold-text prefixes in blockquotes and mapping them to distinct Zensical types with proper titles: - **Warning:** → !!! warning "Warning" - **Caution:** → !!! danger "Caution" - **Important:** → !!! info "Important" - **Tip:** → !!! tip "Tip" - **Note:** → !!! note "Note" - **Example:** → !!! example "Example" - **See Also:** → !!! abstract "See Also" - **Limitation:** → !!! failure "Limitation" Lua filter: replace single if/else with data-driven ADMONITION_MAP table. Preprocessor: generalize \warning{} into convert_admonition_macros() handling 8 LaTeX macros (\warning, \caution, \important, \tip, \note, \example, \seealso, \limitation). https://claude.ai/code/session_01EC6b95DksGwS61813obV4g --- scripts/latex_preprocessor.py | 42 +++++++++++++++++------- scripts/pandoc_filters/energyplus.lua | 47 +++++++++++++++++++++------ 2 files changed, 68 insertions(+), 21 deletions(-) diff --git a/scripts/latex_preprocessor.py b/scripts/latex_preprocessor.py index 619860d02..1e9fa969c 100644 --- a/scripts/latex_preprocessor.py +++ b/scripts/latex_preprocessor.py @@ -4,7 +4,8 @@ - siunitx \\SI{}, \\si{}, \\IP{}, \\ip{} macros and custom unit declarations - Bracket macros: \\PB{}, \\RB{}, \\CB{} - callout environment -> quote (Pandoc-friendly) -- \\warning{} -> bold warning markers +- Admonition macros: \\warning{}, \\caution{}, \\important{}, \\tip{}, + \\note{}, \\example{}, \\seealso{}, \\limitation{} -> bold-prefixed quotes - Strip \\input{} directives (child files are separate pages) """ @@ -190,17 +191,36 @@ def convert_callout_env(text: str) -> str: return text -def convert_warning_macro(text: str) -> str: - r"""Convert \warning{text} to a quote environment with bold warning prefix. +# Admonition macros: LaTeX command name -> bold prefix label. +# Each macro \{text} is converted to \begin{quote}\n\textbf{