uiwjs / react-textarea-code-editor

A simple code editor with syntax highlighting.
https://uiwjs.github.io/react-textarea-code-editor/
MIT License
476 stars 22 forks source link

Is there no defined type of language available? #136

Closed hwookim closed 1 year ago

hwookim commented 1 year ago

I'm just using it after declaring it myself. Is there any better way? 😢

export type Languages =
  | 'abap'
  | 'aes'
  | 'apex'
  | 'azcli'
  | 'bat'
  | 'bicep'
  | 'brainfuck'
  | 'c'
  | 'cameligo'
  | 'clike'
  | 'clojure'
  | 'coffeescript'
  | 'cpp'
  | 'csharp'
  | 'csp'
  | 'css'
  | 'dart'
  | 'dockerfile'
  | 'ecl'
  | 'elixir'
  | 'erlang'
  | 'flow9'
  | 'freemarker2'
  | 'fsharp'
  | 'go'
  | 'graphql'
  | 'handlebars'
  | 'hcl'
  | 'html'
  | 'ini'
  | 'java'
  | 'javascript'
  | 'js'
  | 'json'
  | 'jsx'
  | 'julia'
  | 'kotlin'
  | 'less'
  | 'lex'
  | 'lexon'
  | 'liquid'
  | 'livescript'
  | 'lua'
  | 'm3'
  | 'markdown'
  | 'mips'
  | 'msdax'
  | 'mysql'
  | 'nginx'
  | 'objective-c'
  | 'pascal'
  | 'pascaligo'
  | 'perl'
  | 'pgsql'
  | 'php'
  | 'pla'
  | 'plaintext'
  | 'postiats'
  | 'powerquery'
  | 'powershell'
  | 'proto'
  | 'pug'
  | 'python'
  | 'qsharp'
  | 'r'
  | 'razor'
  | 'redis'
  | 'redshift'
  | 'restructuredtext'
  | 'ruby'
  | 'rust'
  | 'sb'
  | 'scala'
  | 'scheme'
  | 'scss'
  | 'shell'
  | 'sol'
  | 'sparql'
  | 'sql'
  | 'st'
  | 'stylus'
  | 'swift'
  | 'systemverilog'
  | 'tcl'
  | 'toml'
  | 'ts'
  | 'tsx'
  | 'twig'
  | 'typescript'
  | 'vb'
  | 'vbscript'
  | 'verilog'
  | 'vue'
  | 'xml'
  | 'yaml';

export interface CodeEditorProps extends TextareaCodeEditorProps {
  value: string;
  language: Languages;
}
jaywcjlove commented 1 year ago

Can be customized, using prismjs inside.

@hwookim

hwookim commented 1 year ago

Anyway, there is no defined type and I have to declare myself whether I look for data or do crawling.

Okay. Thx for the answer!