Consider integrating Prismjs as an option for syntax highlighting #331
Replies: 2 comments
-
Yes, So Simple uses Jekyll's native syntax highlighting which is powered by Rouge. It's not all that obvious but Rouge was built to support Pygments which also has support for themes (styles). Any Pygments syntax highlighting themes should be compatible. What I've done with the theme is support a base16 color palette and created Sass variables for all. Which if you know the base16 colors you want to use, it's fairly trivial to override them in your Sass file to get another color scheme for your highlighted code. Many code highlighting themes are built on base16 which if you search around you can dig them up. It's not plug in play like Prism.js but you really only need to override the following variables to get the theme you want. Not really a fan of adding another dependency, especially since Jekyll has this built in without the need for extra JavaScript. That said there is nothing stopping you from adding it to your site. All you'd need to do is drop in Prism's CSS and JS embeds in |
Beta Was this translation helpful? Give feedback.
-
Thanks for the info - just what I wanted. I may give it a go. And I appreciate your thoughtful consideration - your themes are great because of your continued, measured consideration for updates. |
Beta Was this translation helpful? Give feedback.
-
Summary
Include options for syntax highlighting such as PrismJS.
By using a pluggable syntax highlighter like PrismJS, website users can select different themed highlighters. Demo available on https://prismjs.com/ - click Coy or Solarized Light in the right-hand UI for example.
I think that it would be great to include a syntax highlighter as a choice in the configuration for the theme.
Maybe this is already possible with https://github.com/rouge-ruby/rouge - which I think is what this theme uses already? An alternative could be to document how to get some of the features of Prismjs with Rouge?
Motivation
While the scss-based code syntax highlighter works fine, wondering if it would be simpler to offload that into a JS-based solution.
Would give the theme more uses in displaying technical articles about code, bash, multiple programming language examples.
Drawbacks
It is an external dependency, maintained outside of this theme. But, that's also a benefit if you want to offset your own maintenance of syntax highlighting.
You may not want to consider it if you don't think enough end-users use the syntax highlighting capabilities of this theme.
Beta Was this translation helpful? Give feedback.
All reactions