-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better syntax highlighting support - consider switchting from HighlightJS to Prism #2313
Comments
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: #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.
|
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:
highlightjs/highlight.js#3625
The text was updated successfully, but these errors were encountered: