Conversation
srid
added a commit
to srid/emanote
that referenced
this pull request
Dec 19, 2025
Replaces client-side JavaScript syntax highlighters (highlight.js, prism.js) with static highlighting using skylighting, the same library used by Pandoc. Key improvements: - Code blocks are now highlighted at build time using skylighting (140+ languages supported) - No JavaScript required, resulting in faster page loads and better compatibility - Works seamlessly with live preview mode - Both light and dark mode themes included - Configurable via `syntaxHighlighting` option (default: true) The documentation has been updated to reflect the new approach, and legacy JavaScript snippets have been removed from example configurations. Resolves #337 Uses srid/heist-extra#10
srid
added a commit
that referenced
this pull request
Apr 21, 2026
* Add static math rendering via texmath (#11) Mirrors the skylighting pattern from #10: a new Heist.Extra.Splices.Pandoc.Texmath module converts LaTeX math to MathML at build time using texmath's readTeX + writeMathML, producing XmlHtml nodes browsers render natively without a client-side JS dependency. Intercept B.Math in Render.hs, gated by a new enableStaticMath field on RenderCtx (alongside enableSyntaxHighlighting). mkRenderCtx now takes the extra Bool. * refactor(hickey+lowy): RenderFeatures record with sum-typed backends Hickey H1 + Lowy A1: replace positional Bool flags (enableSyntaxHighlighting, enableStaticMath) with a named RenderFeatures record carrying sum-typed backends (CodeBackend = NoHighlighting | Skylighting, MathBackend = NoStaticMath | StaticMathML). mkRenderCtx now takes one RenderFeatures arg instead of two trailing Bools, so adding a third backend is zero-cost at call sites and the 'which backend' axis is named rather than positional. Hickey H2: extract renderMathPassthrough so the B.Math case is purely backend selection, with error handling as a single local case in the static arm. * refactor(hickey): preserve CRef entities instead of silently dropping Hickey H3: fromContent previously returned [] for XL.CRef, which would have silently dropped character references. In practice texmath's MathML writer emits Unicode directly so this branch is unreachable, but preserve the entity literally so any future regression is visible rather than invisible. * fix(police): fact-check — repair merged .gitignore line Earlier append via heredoc lost the trailing newline and glued .direnv and .do-results.json into one broken token. Restore both entries on their own lines. * refactor(police): elegance — replace hand-rolled XL→XmlHtml walker /simplify reuse pass: serialize texmath's Text.XML.Light.Element via showElement, then let xmlhtml's own parseXML rebuild the tree. Drops the fromElement/fromAttr/fromContent helpers (~20 lines) and the now-moot CRef-handling branch. Mirrors the existing pattern at Heist/Extra/TemplateState.hs:69.
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.
Adds syntax highlighting for code blocks using the skylighting library. When enabled, code blocks in Pandoc documents will be tokenized and rendered with appropriate elements containing CSS classes for syntax highlighting. Falls back to plain text when language is unknown or highlighting is disabled.
The implementation includes:
Refs: srid/emanote#337