crisp icon indicating copy to clipboard operation
crisp copied to clipboard

Change syntax highlighter to Prism

Open obskyr opened this issue 8 years ago • 0 comments

I noticed the syntax highlighting used - highlight.js - was... less than satisfactory, and really messed with the otherwise brilliant and stylish feel of the theme. So I changed it to Prism (which is of course open-source and under a permissive license - MIT, to be exact), fixed up the style a bit extra to fit even better with Crisp and work well on mobile, and I gotta say: the results are wonderful. Here, take a look at some examples - just make sure to click them to get the full-res experience.

Example 1, current style (highlight.js):

Example 1, highlight.js

Example 1, new style (Prism):

Example 1, Prism

Example 2, current style (highlight.js):

Example 2, highlight.js

Example 2, new style (Prism):

Example 2, Prism

Way better, right? I think so, at least. With this PR, Crisp comes with documented support for HTML, CSS, JavaScript, Handlebars, C, C++, C#, C-likes, Python and Ruby, and is easily extensible by any user by following the instructions in the readme. It affects both triple-tick code blocks and inline ones with a unified style.

You can check out a live blog post with the changes implemented here; just scroll down a bit.

obskyr avatar Dec 16 '15 00:12 obskyr