Add module definitions

main
Mike Fix 8 years ago
parent 8272d81753
commit 54201ba701

@ -1,51 +1,3 @@
if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') {
require('codemirror/mode/clojure/clojure')
require('codemirror/mode/cobol/cobol')
require('codemirror/mode/coffeescript/coffeescript')
require('codemirror/mode/commonlisp/commonlisp')
require('codemirror/mode/crystal/crystal')
require('codemirror/mode/css/css')
require('codemirror/mode/d/d')
require('codemirror/mode/dart/dart')
require('codemirror/mode/django/django')
require('codemirror/mode/dockerfile/dockerfile')
require('codemirror/mode/elm/elm')
require('codemirror/mode/erlang/erlang')
require('codemirror/mode/fortran/fortran')
require('codemirror/mode/go/go')
require('codemirror/mode/groovy/groovy')
require('codemirror/mode/handlebars/handlebars')
require('codemirror/mode/haskell/haskell')
require('codemirror/mode/haxe/haxe')
require('codemirror/mode/htmlembedded/htmlembedded')
require('codemirror/mode/htmlmixed/htmlmixed')
require('codemirror/mode/javascript/javascript')
require('codemirror/mode/julia/julia')
require('codemirror/mode/lua/lua')
require('codemirror/mode/markdown/markdown')
require('codemirror/mode/mathematica/mathematica')
require('codemirror/mode/nginx/nginx')
require('codemirror/mode/pascal/pascal')
require('codemirror/mode/perl/perl')
require('codemirror/mode/php/php')
require('codemirror/mode/python/python')
require('codemirror/mode/r/r')
require('codemirror/mode/ruby/ruby')
require('codemirror/mode/rust/rust')
require('codemirror/mode/shell/shell')
require('codemirror/mode/smalltalk/smalltalk')
require('codemirror/mode/spreadsheet/spreadsheet')
require('codemirror/mode/sql/sql')
require('codemirror/mode/swift/swift')
require('codemirror/mode/tcl/tcl')
require('codemirror/mode/vb/vb')
require('codemirror/mode/verilog/verilog')
require('codemirror/mode/vhdl/vhdl')
require('codemirror/mode/vue/vue')
require('codemirror/mode/xml/xml')
require('codemirror/mode/yaml/yaml')
}
export const THEMES = [ export const THEMES = [
{ {
id: 'dracula', id: 'dracula',
@ -89,10 +41,6 @@ export const THEMES = [
id: 'cobalt', id: 'cobalt',
name: 'Cobalt' name: 'Cobalt'
}, },
{
id: 'oceanic',
name: 'Oceanic'
},
{ {
id: '3024-day', id: '3024-day',
name: '3024 Day', name: '3024 Day',
@ -108,130 +56,176 @@ export const LANGUAGES = [
name: 'Plain Text' name: 'Plain Text'
}, },
{ {
name: 'Clojure' name: 'Clojure',
module: 'clojure'
}, },
{ {
name: 'Cobol' name: 'Cobol',
module: 'cobol'
}, },
{ {
name: 'CoffeeScript' name: 'CoffeeScript',
module: 'coffeescript'
}, },
{ {
name: 'Crystal' name: 'Crystal',
module: 'crystal'
}, },
{ {
name: 'CSS' name: 'CSS',
module: 'css'
}, },
{ {
name: 'D' name: 'D',
module: 'd'
}, },
{ {
name: 'Dart' name: 'Dart',
module: 'dart'
}, },
{ {
name: 'Django' name: 'Django',
module: 'django'
}, },
{ {
name: 'Docker' name: 'Docker',
module: 'dockerfile'
}, },
{ {
name: 'Elm' name: 'Elm',
module: 'elm'
}, },
{ {
name: 'Erlang' name: 'Erlang',
module: 'erlang'
}, },
{ {
name: 'Fortran' name: 'Fortran',
module: 'fortran'
}, },
{ {
name: 'Groovy' name: 'Go',
module: 'go'
}, },
{ {
name: 'Handlebars' name: 'Groovy',
module: 'groovy'
}, },
{ {
name: 'Haskell' name: 'Handlebars',
module: 'handlebars'
}, },
{ {
name: 'Haxe' name: 'Haskell',
module: 'haskell'
}, },
{ {
name: 'HTML' name: 'Haxe',
module: 'haxe'
}, },
{ {
name: 'JavaScript' name: 'HTML',
module: 'htmlmixed'
}, },
{ {
name: 'JSX' name: 'JavaScript',
module: 'javascript'
}, },
{ {
name: 'Julia' name: 'Julia',
module: 'julia'
}, },
{ {
name: 'Lua' name: 'Lisp',
module: 'commonlisp'
}, },
{ {
name: 'Markdown' name: 'Lua',
module: 'lua'
}, },
{ {
name: 'Mathematica' name: 'Markdown',
module: 'markdown'
}, },
{ {
name: 'NGINX' name: 'Mathematica',
module: 'mathematica'
}, },
{ {
name: 'Pascal' name: 'NGINX',
module: 'nginx'
}, },
{ {
name: 'Perl' name: 'Pascal',
module: 'pascal'
}, },
{ {
name: 'PHP' name: 'Perl',
module: 'perl'
}, },
{ {
name: 'Python' name: 'PHP',
module: 'php'
}, },
{ {
name: 'R' name: 'Python',
module: 'python'
}, },
{ {
name: 'Ruby' name: 'R',
module: 'r'
}, },
{ {
name: 'Rust' name: 'Ruby',
module: 'ruby'
}, },
{ {
name: 'Sass' name: 'Rust',
module: 'rust'
}, },
{ {
name: 'Smalltalk' name: 'Sass',
module: 'sass'
}, },
{ {
name: 'SQL' name: 'Smalltalk',
module: 'smalltalk'
}, },
{ {
name: 'Swift' name: 'SQL',
module: 'sql'
}, },
{ {
name: 'TCL' name: 'Swift',
module: 'swift'
}, },
{ {
name: 'VB.NET' name: 'TCL',
module: 'tcl'
}, },
{ {
name: 'Verilog' name: 'VB.NET',
module: 'vb'
}, },
{ {
name: 'VHDL' name: 'Verilog',
module: 'verilog'
}, },
{ {
name: 'Vue' name: 'VHDL',
module: 'vhdl'
}, },
{ {
name: 'XML' name: 'Vue',
module: 'vue'
}, },
{ {
name: 'YAML' name: 'XML',
module: 'xml'
},
{
name: 'YAML',
module: 'yaml'
} }
] ]
@ -250,3 +244,11 @@ const unfold = (f, seed) => {
} }
return go(f, seed, []) return go(f, seed, [])
}` }`
if (typeof window !== 'undefined' && typeof window.navigator !== 'undefined') {
LANGUAGES.forEach((language) => {
if (language.module) {
require(`codemirror/mode/${language.module}/${language.module}`)
}
})
}

Loading…
Cancel
Save