Reduce Prism.js bundle size by stripping unused languages and plugins - #865
Amrit-raj50 wants to merge 9 commits into
Conversation
|
Thanks @Amrit-raj50 ! @sivaraam, since you were involved in the previous syntax highlighting improvements, can you take a look at this too? |
|
@chriscool , @sivaraam could you review this , so that i can apply changes if any . |
|
Why is the prism.css unchaged? Would it not change too? |
|
Regarding the non-language content in your comment:
I think we can use the command-line plugin for terminal output. Some helpful doc about this in README would be useful. |
|
thanks @sivaraam , i will check the README |
|
hi @sivaraam ,
but when he/she needs to update the commands in the file again he/she has to update the ; {: .command-line data-output="..."} , otherwise it rendered wrong way ....so this is constraint for using command line plugin.
so , now tell me sir which one should i apply thankyou |
there is no need to change the .css file it is already up-to-date |
I think second one makes more sense. We can go with it. Could you add some guidelines alone in the README?
This does not really fit the CONTRIBUTING.md which should ideally be about guidelines related to contributing process |
Could you add the header comment there too? Also check Christian's comment here. |
Optimizes syntax highlighting by updating
script/prism.jsto only include languages actually used across the repository, reducing the bundle size .Changes
Kept languages:Markup, C-like, Bash (covering
sh/shell), C, Diff, Git, and INI.unused languages:Go, Python, Ruby, Perl, Makefile, JSON, YAML, and C++.
unused plugins:Autoloader and File Highlight.
Retained header comment:Preserved the official download configuration URL at the top of the file for future maintainability.
Note on Email Newsletter
Regarding syntax highlighting in the email version: Prism.js cannot run in email clients because JavaScript (
<script>tags) is blocked for security. Achieving syntax highlighting in emails would require server-side pre-rendering with inline CSS (e.g., via Rouge/Jekyll) before publishing to Mailchimp.Closes #862