Skip to content

Make fastpylight highlighting optional, shrinking the wheel from 8.8MB to 0.95MB - #50

Merged
jph00 merged 1 commit into
mainfrom
pr/make-fastpylight-highlighting-optional-shrinking
Aug 25, 2026
Merged

Make fastpylight highlighting optional, shrinking the wheel from 8.8MB to 0.95MB#50
jph00 merged 1 commit into
mainfrom
pr/make-fastpylight-highlighting-optional-shrinking

Conversation

@jph00

@jph00 jph00 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

The hl cargo feature is gone: mdhtml no longer links fastpylight. HtmlExportOptions gains an hl_fn hook, (code, lang, mode) -> Result<Option<String>, String> in plain std types, so any highlighter can plug in. Rust consumers who want fastpylight depend on it themselves and pass its functions through. The spans path accepts inner spans or a whole <pre><code> block and keeps mdhtml's own wrapper and attributes, and md fences still self-highlight with no dependency.

From Python nothing changes when fastpylight is present: pip install 'mdhtml[hl]' provides it, mdhtml wires it in lazily per export, and output is byte-identical to the linked build. A bare install renders code blocks plain and adds a warning naming the extra. mdhtml.theme_css and mdhtml.themes are removed: use fastpylight's directly, as viewmd and md2html now do.

Also fixes two stale wikitext test assertions.

@jph00 jph00 added the enhancement New feature or request label Aug 25, 2026
@jph00
jph00 merged commit 3ebc53f into main Aug 25, 2026
@jph00
jph00 deleted the pr/make-fastpylight-highlighting-optional-shrinking branch August 25, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant