Open joepio opened 9 months ago
Only if the switch is moving from client-side highlight.js to build-side Prism.
Client-side highlight.js & Prism both are incredibly wasteful for documentation. For the most part, your documentation’s code samples aren’t changing so why is mdBook shipping client-side parsing libraries at all & making all downstream users parse & highlight the exact same unchanging content when this tool should be doing the syntax highlighting at build time to save energy, data, & time for users. See also: https://github.com/rust-lang/mdBook/issues/1383
Prism is currently unmaintained and the documentation isn't great. I'd definitely like mdBook to switch to some sort of build-time syntax highlighting (client-side syntax highlighting for static code in 2024 😔) - but Prism isn't it. Shiki is the most powerful and maintained syntax highlighter right now, might be worth a look though I'm not sure how it would integrate into the build system.
Where does it say Prism is unmaintained? Last I heard they were working on v2.
The main branch hasn't been updated in 2 years and the v2 branch hasn't had a commit for 9 months. Seems to have stalled. I don't see any benefits of Prism over Highlight.js but especially compared to Shiki.
9 months. Single-maintainer project dead. Lol.
9 months. Single-maintainer project dead. Lol.
I don't mean to criticize the maintainer but the project only having a single maintainer is yet another reason not to switch to it. And 9 months is a long time! Do you have any thoughts about Shiki?
Problem
The current highlighter (powered by highlight.ts) does not support
.tsx
.Proposed Solution
Switch to
Prism
Notes
Some related discussions:
https://github.com/highlightjs/highlight.js/issues/3625