Skip to content

Add IDF Monaco editor, schema-driven field metadata pills, and TOC/math fixes#19

Merged
samuelduchesne merged 4 commits intomainfrom
feature/idf-editor-and-schema-pills
Feb 28, 2026
Merged

Add IDF Monaco editor, schema-driven field metadata pills, and TOC/math fixes#19
samuelduchesne merged 4 commits intomainfrom
feature/idf-editor-and-schema-pills

Conversation

@samuelduchesne
Copy link
Copy Markdown
Contributor

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.

…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>
@github-actions
Copy link
Copy Markdown
Contributor

Docs preview for this PR is available at:
https://docs.idfkit.com/pr-preview/pr-19/

github-actions Bot added a commit that referenced this pull request Feb 28, 2026
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>
github-actions Bot added a commit that referenced this pull request Feb 28, 2026
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>
github-actions Bot added a commit that referenced this pull request Feb 28, 2026
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>
github-actions Bot added a commit that referenced this pull request Feb 28, 2026
@samuelduchesne samuelduchesne merged commit 9ffc40d into main Feb 28, 2026
4 checks passed
@samuelduchesne samuelduchesne deleted the feature/idf-editor-and-schema-pills branch February 28, 2026 13:13
github-actions Bot added a commit that referenced this pull request Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant