Build all languages for highlight.js

Change-Id: I35c90466873464172bb00f30f2d6cf02a5156d8e
(cherry picked from commit f1aa3da840)
This commit is contained in:
Paladox none
2018-07-30 14:50:12 +00:00
committed by David Pursehouse
parent 2050bc9dc8
commit ef8b2ffaca
3 changed files with 437 additions and 130 deletions

View File

@@ -22,39 +22,8 @@ languages included. Build it with the following:
$> # start in some temp directory
$> git clone https://github.com/highlightjs/highlight.js
$> cd highlight.js
$> node tools/build.js -n \
bash \
cpp \
cs \
clojure \
css \
d \
dart \
erb \
go \
haskell \
java \
javascript \
json \
kotlin \
lisp \
lua \
objectivec \
ocaml \
perl \
php \
protobuf \
puppet \
python \
ruby \
rust \
scala \
shell \
sql \
swift \
typescript \
xml \
yaml
$> npm install
$> node tools/build.js -n
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

@@ -20,7 +20,9 @@
const LANGUAGE_MAP = {
'application/dart': 'dart',
'application/json': 'json',
'application/x-powershell': 'powershell',
'application/typescript': 'typescript',
'application/xquery': 'xquery',
'application/x-erb': 'erb',
'text/css': 'css',
'text/html': 'html',
@@ -29,15 +31,35 @@
'text/x-c': 'cpp',
'text/x-c++src': 'cpp',
'text/x-clojure': 'clojure',
'text/x-cmake': 'cmake',
'text/x-coffeescript': 'coffeescript',
'text/x-common-lisp': 'lisp',
'text/x-crystal': 'crystal',
'text/x-csharp': 'csharp',
'text/x-csrc': 'cpp',
'text/x-d': 'd',
'text/x-diff': 'diff',
'text/x-django': 'django',
'text/x-dockerfile': 'dockerfile',
'text/x-ebnf': 'ebnf',
'text/x-elm': 'elm',
'text/x-erlang': 'erlang',
'text/x-fortran': 'fortran',
'text/x-go': 'go',
'text/x-groovy': 'groovy',
'text/x-haml': 'haml',
'text/x-haskell': 'haskell',
'text/x-haxe': 'haxe',
'text/x-ini': 'ini',
'text/x-java': 'java',
'text/x-julia': 'julia',
'text/x-kotlin': 'kotlin',
'text/x-latex': 'latex',
'text/x-less': 'less',
'text/x-lua': 'lua',
'text/x-mathematica': 'mathematica',
'text/x-nginx-conf': 'nginx',
'text/x-nsis': 'nsis',
'text/x-objectivec': 'objectivec',
'text/x-ocaml': 'ocaml',
'text/x-perl': 'perl',
@@ -45,14 +67,22 @@
'text/x-protobuf': 'protobuf',
'text/x-puppet': 'puppet',
'text/x-python': 'python',
'text/x-q': 'q',
'text/x-ruby': 'ruby',
'text/x-rustsrc': 'rust',
'text/x-scala': 'scala',
'text/x-scss': 'scss',
'text/x-scheme': 'scheme',
'text/x-shell': 'shell',
'text/x-spreadsheet': 'excel',
'text/x-sh': 'bash',
'text/x-sql': 'sql',
'text/x-swift': 'swift',
'text/x-tcl': 'tcl',
'text/x-twig': 'twig',
'text/x-vb': 'vb',
'text/x-yaml': 'yaml',
'text/vbscript': 'vbscript',
};
const ASYNC_DELAY = 10;