Skip to content

Instantly share code, notes, and snippets.

@ozooxo
Last active December 30, 2015 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozooxo/7811145 to your computer and use it in GitHub Desktop.
Save ozooxo/7811145 to your computer and use it in GitHub Desktop.
Tools like highlight.js can help detecting the name of a programming language from a piece of code. The set up in ubuntu is as follows. You can further decrease the number of programming languages by commenting the potential languages in line 641--707 of highlight.js file. It can increase the speed a little bit, but it's still to slow for a huge…
beta@landmark:~/Downloads$ sudo apt-get install nodejs
beta@landmark:~/Downloads$ sudo apt-get install npm
beta@landmark:~/Downloads$ npm install highlight.js
beta@landmark:~/Downloads$ node
> var hljs = require('highlight.js');
undefined
> hljs.highlightAuto("<p>abc</p>").language;
'xml'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment