respec icon indicating copy to clipboard operation
respec copied to clipboard

Consider use Prism instead of highlight.js

Open sidvishnoi opened this issue 5 years ago • 7 comments

Prism has:

  • arguably better syntax highlighting
  • much simpler language loading
  • scope for some nice extensions.

Syntax highlighting comparison (color schemes are slightly different):

Highlight.js Prism
image image
image image
image image
image image
image image
image image

sidvishnoi avatar Jul 07 '20 21:07 sidvishnoi

I honestly don't mind which one we use - I no longer maintain hljs, and if Prism has a good community that maintains the software, all the better. I like the hljs style more tho... it has better contrast for me.

marcoscaceres avatar Jul 08 '20 03:07 marcoscaceres

I like the hljs style more tho... it has better contrast for me.

Can we control the CSS rules as we do in highlight.js?

saschanaz avatar Jul 31 '20 18:07 saschanaz

Can we control the CSS rules as we do in highlight.js?

You mean the styling (assets/highlight.css), right? If that, yes.

sidvishnoi avatar Jul 31 '20 18:07 sidvishnoi

Great, I vote for prism assuming that we can enhance the contrast. (And optionally upstream the changes 😁)

saschanaz avatar Jul 31 '20 18:07 saschanaz

I personally don't have a preference, but just FYI - another benefit of Prism is that it is small. I tried downloading custom packages including syntax highlighting for CSS+HTML+HTTP+JavaScript+JSON+XML, and highlight.js is many times bigger than Prism.

xfq avatar Feb 17 '22 07:02 xfq

if Prism has a good community that maintains the software, all the better.

Prism has an active developer community

I like the hljs style more tho... it has better contrast for me.

Prism has multiple themes available, and a theme is just a CSS file so making a new one is pretty easy.

svgeesus avatar Jul 27 '23 16:07 svgeesus

There's also Shiki:

For i18n articles (like this) we use Prism as it's easier to use and is small.

xfq avatar Jul 28 '23 01:07 xfq