DumbWareio_DumbPad/constants.js
Chris 3b5325bc68
Feat/add code syntax highlighting (#65)
* Add syntax highlighting to markdown preview

* Include highlight styles

* disable markedhighlight for now

* fix proper importing for code syntax highlighting with css files and register all languages

* Add language examples for code syntax highlighting

* bump version and update readme.md

* update readme
- add code syntax highlight example

* update readme.md

* Using default languages for highlight.js

* Include all language support by default with option to specify/limit list

* clean up app.js execution

* implement tab indenting and deindenting

* refactor preview code into preview manager

* Add language to copy button and include language label to print preview as well

* Add lazy loading to markdown code styles

* update readme.md image

* Cache highlight languages and simplify variable in server.js

* fix tab indenting / deindenting and refactor all functions to declarations instead of arrow functions for hoisting

* collaborative editing fix for accurate representations between local and remote changes

* refactor undo and redo functionality to be session based per client per notepad
2025-07-13 16:12:05 -07:00

20 lines
1.8 KiB
JavaScript

// All available highlight.js language identifiers
// This list includes all supported languages for syntax highlighting
// Note: Frontend now uses lazy-loading based on content detection instead of loading all languages
export const ALL_HIGHLIGHT_LANGUAGES = `1c,abnf,accesslog,actionscript,ada,angelscript,apache,applescript,arcade,arduino,
armasm,asciidoc,aspectj,autohotkey,autoit,avrasm,awk,axapta,bash,basic,bnf,brainfuck,c,cal,capnproto,ceylon,clean,
clojure-repl,clojure,cmake,coffeescript,coq,cos,cpp,crmsh,crystal,csharp,csp,css,d,dart,delphi,diff,django,dns,dockerfile,
dos,dsconfig,dts,dust,ebnf,elixir,elm,erb,erlang-repl,erlang,excel,fix,flix,fortran,fsharp,gams,gauss,gcode,gherkin,glsl,gml,
go,golo,gradle,graphql,groovy,haml,handlebars,haskell,haxe,hsp,http,hy,inform7,ini,irpf90,isbl,java,javascript,jboss-cli,json,
julia-repl,julia,kotlin,lasso,latex,ldif,leaf,less,lisp,livecodeserver,livescript,llvm,lsl,lua,makefile,markdown,mathematica,
matlab,maxima,mel,mercury,mipsasm,mizar,mojolicious,monkey,moonscript,n1ql,nestedtext,nginx,nim,nix,node-repl,nsis,objectivec,
ocaml,openscad,oxygene,parser3,perl,pf,pgsql,php-template,php,plaintext,pony,powershell,processing,profile,prolog,properties,
protobuf,puppet,purebasic,python-repl,python,q,qml,r,reasonml,rib,roboconf,routeros,rsl,ruby,ruleslanguage,rust,sas,scala,scheme,
scilab,scss,shell,smali,smalltalk,sml,sqf,sql,stan,stata,step21,stylus,subunit,swift,taggerscript,tap,tcl,thrift,tp,twig,typescript,
vala,vbnet,vbscript-html,vbscript,verilog,vhdl,vim,wasm,wren,x86asm,xl,xml,xquery,yaml,zephir`;
// Helper function to get language array from the constant
// Used by server for configuration, client now uses lazy-loading
export const getHighlightLanguages = () => {
return ALL_HIGHLIGHT_LANGUAGES.split(',').map(lang => lang.trim()).filter(lang => lang);
};