Add IDF Monaco editor, schema-driven field metadata pills, and TOC/math fixes#19
Merged
samuelduchesne merged 4 commits intomainfrom Feb 28, 2026
Merged
Conversation
…th fixes Integrate a browser-side Monaco editor for IDF code blocks with hover documentation powered by idfkit epJSON schemas. Each IDF field heading gets inline HTML pills showing type, units, default, range, and constraints. The editor bundle is built from TypeScript/Vite source in idf-editor/ and bundled into scripts/assets/. Also fixes LaTeX equation rendering (enable pymdownx.arithmatex), adds a collapsible right-side TOC with mobile hamburger menu support, a custom Pygments IDF lexer, and optimizes bracket macro expansion in the LaTeX preprocessor. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
Docs preview for this PR is available at: |
Move markdown extensions from zensical.toml to convert.py so that Zensical's defaults (superfences, highlight, etc.) are not overridden. Without superfences, fenced code blocks rendered as inline <code> tags. Also add Node.js setup and IDF editor build steps to the PR preview workflow so the Monaco editor bundle is available in previews. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
document$ is a ReplaySubject that replays its last value on subscribe, causing initPage() to run twice concurrently on initial load. The race condition injected loader.js twice, triggering a _commonjsGlobal duplicate variable error. Additionally, Zensical replaces the DOM even for same-page anchor clicks, so editors need to re-initialize after each document$ emission. Fixes: - Skip the initial ReplaySubject emission (matching mathjax-config.js) - Add initInProgress guard to prevent concurrent initPage() calls - Cache the loadMonacoFromCDN() promise to prevent duplicate injection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Zensical may or may not replace the DOM when clicking a same-page anchor (TOC link). When it does not replace the DOM, calling initPage() would dispose working editors and fail to recreate them since the original code blocks no longer exist (replaced by editor containers). Add isStillInDOM() check: if any tracked element is still in the live document, skip re-initialization to preserve working editors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Feb 28, 2026
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.
Integrate a browser-side Monaco editor for IDF code blocks with hover documentation powered by idfkit epJSON schemas. Each IDF field heading gets inline HTML pills showing type, units, default, range, and constraints. The editor bundle is built from TypeScript/Vite source in idf-editor/ and bundled into scripts/assets/.
Also fixes LaTeX equation rendering (enable pymdownx.arithmatex), adds a collapsible right-side TOC with mobile hamburger menu support, a custom Pygments IDF lexer, and optimizes bracket macro expansion in the LaTeX preprocessor.