Expand admonition support from warning-only to multiple types#11
Merged
samuelduchesne merged 2 commits intomainfrom Feb 26, 2026
Merged
Expand admonition support from warning-only to multiple types#11samuelduchesne merged 2 commits intomainfrom
samuelduchesne merged 2 commits intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
|
Docs preview for this PR is available at: |
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
Add three new preprocessing steps that activate the admonition type system
for content that actually exists in the EnergyPlus docs:
1. normalize_bold_prefix_colons: Fix \textbf{Note}: (colon outside braces)
to \textbf{Note:} so the Lua filter can match it (7 occurrences)
2. promote_callout_prefixes: Convert plain-text "Note:", "NOTE:", "Caution:"
at the start of callout bodies to \textbf{Note:} etc. so they become
typed admonitions instead of generic notes (~28 occurrences). Requires
a colon after the keyword to avoid false positives like "Note that..."
3. wrap_standalone_bold_admonitions: Wrap standalone \textbf{Note:} paragraphs
(not inside any callout/quote env) in \begin{quote}...\end{quote} so the
Lua filter's BlockQuote handler can process them (20 occurrences)
Together these activate ~55 existing admonition-like patterns in the source
that were previously rendered as plain text or generic untitled notes.
https://claude.ai/code/session_01EC6b95DksGwS61813obV4g
54b7edb to
ffb269b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extended the admonition conversion system to support multiple admonition types beyond just warnings. The LaTeX preprocessor now handles 8 different admonition macros (
\warning{},\caution{},\important{},\tip{},\note{},\example{},\seealso{},\limitation{}), each mapping to appropriate Zensical admonition types with display titles.Key Changes
LaTeX Preprocessor (
scripts/latex_preprocessor.py)convert_warning_macro()function with generalizedconvert_admonition_macros()function_ADMONITION_MACROSdictionary mapping LaTeX macro names to bold-prefixed labels\begin{quote}blocks with\textbf{<Type>:}prefixesPandoc Lua Filter (
scripts/pandoc_filters/energyplus.lua)ADMONITION_MAPtable with 8 entries, each specifying:BlockQuote()function to iterate through the mapping table instead of hardcoding warning detection!!! <type> "<title>"instead of!!! <type> ""Implementation Details
https://claude.ai/code/session_01EC6b95DksGwS61813obV4g