Last active
December 30, 2015 09:39
-
-
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…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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