Update syntax highlighting support

Adds new languages and removes an unused language. The built, minified
and gzipped size of the HighlightJS library increases from 17KB to 25KB.

Change-Id: Id3c83e5b0592b85c9f2adf53f07b6852966dcced
This commit is contained in:
Wyatt Allen 2016-08-02 12:17:11 -07:00
parent 7acf5164ba
commit 03f0ce6c0f
3 changed files with 130 additions and 48 deletions

View File

@ -22,8 +22,35 @@ languages included. Build it with the following:
$> # start in some temp directory
$> git clone https://github.com/isagalaev/highlight.js.git
$> cd highlight.js
$> node tools/build.js -n json css xml html javascript cpp go haskell \
markdown perl python bash sql scala prolog java objectivec
$> node tools/build.js -n \
bash \
cpp \
cs \
clojure \
css \
d \
dart \
go \
haskell \
java \
javascript \
json \
lisp \
lua \
markdown \
objectivec \
ocaml \
perl \
protobuf \
python \
ruby \
rust \
scala \
sql \
swift \
typescript \
xml \
yaml
The resulting JS file will appear in the "build" directory of the Highlight.js
repo under the name "highlight.pack.js".

File diff suppressed because one or more lines are too long

View File

@ -15,21 +15,35 @@
'use strict';
var LANGUAGE_MAP = {
'application/dart': 'dart',
'application/json': 'json',
'application/typescript': 'typescript',
'text/css': 'css',
'text/html': 'html',
'text/javascript': 'js',
'text/x-clojure': 'clojure',
'text/x-common-lisp': 'lisp',
'text/x-csharp': 'csharp',
'text/x-csrc': 'cpp',
'text/x-c++src': 'cpp',
'text/x-d': 'd',
'text/x-go': 'go',
'text/x-haskell': 'haskell',
'text/x-java': 'java',
'text/x-lua': 'lua',
'text/x-markdown': 'markdown',
'text/x-objectivec': 'objectivec',
'text/x-ocaml': 'ocaml',
'text/x-perl': 'perl',
'text/x-protobuf': 'protobuf',
'text/x-python': 'python',
'text/x-ruby': 'ruby',
'text/x-rustsrc': 'rust',
'text/x-scala': 'scala',
'text/x-sh': 'bash',
'text/x-sql': 'sql',
'text/x-scala': 'scala',
'text/x-swift': 'swift',
'text/x-yaml': 'yaml',
};
var ASYNC_DELAY = 10;
var HLJS_PATH = '../../../bower_components/highlightjs/highlight.min.js';