Languages
All Languages
Inherited from shiki, here are all the languages bundled in shikiji.
| ID | Name | Aliases |
|---|---|---|
abap | ABAP | |
actionscript-3 | ActionScript | |
ada | Ada | |
apache | Apache Conf | |
apex | Apex | |
apl | APL | |
applescript | AppleScript | |
ara | Ara | |
asm | Assembly | |
astro | Astro | |
awk | AWK | |
ballerina | Ballerina | |
bat | Batch | batch |
beancount | Beancount | |
berry | Berry | be |
bibtex | BibTeX | |
bicep | Bicep | |
blade | Blade | |
c | C | |
cadence | Cadence | cdc |
clarity | Clarity | |
clojure | Clojure | clj |
cmake | CMake | |
cobol | COBOL | |
codeql | CodeQL | ql |
coffee | CoffeeScript | |
cpp | C++ | c++ |
crystal | Crystal | |
csharp | C# | c#, cs |
css | CSS | |
csv | csv syntax | |
cue | CUE | |
cypher | Cypher | cql |
d | D | |
dart | Dart | |
dax | DAX | |
diff | Diff | |
docker | Docker | dockerfile |
dream-maker | Dream Maker | |
elixir | Elixir | |
elm | Elm | |
erb | ERB | |
erlang | Erlang | erl |
fish | Fish | |
fsharp | F# | f#, fs |
gdresource | GDResource | |
gdscript | GDScript | |
gdshader | GDShader | |
gherkin | Gherkin | |
git-commit | Git Commit Message | |
git-rebase | Git Rebase Message | |
glimmer-js | Glimmer JS | gjs |
glimmer-ts | Glimmer TS | gts |
glsl | GLSL | |
gnuplot | Gnuplot | |
go | Go | |
graphql | GraphQL | gql |
groovy | Groovy | |
hack | Hack | |
haml | Ruby Haml | |
handlebars | Handlebars | hbs |
haskell | Haskell | hs |
hcl | HashiCorp HCL | |
hjson | Hjson | |
hlsl | HLSL | |
html | HTML | |
http | HTTP | |
imba | Imba | |
ini | INI | properties |
java | Java | |
javascript | JavaScript | js |
jinja-html | Jinja | |
jison | Jison | |
json | JSON | |
json5 | JSON5 | |
jsonc | JSON with Comments | |
jsonl | JSON Lines | |
jsonnet | Jsonnet | |
jssm | JSSM | fsl |
jsx | JSX | |
julia | Julia | |
kotlin | Kotlin | kt, kts |
kusto | Kusto | kql |
latex | LaTeX | |
less | Less | |
liquid | Liquid | |
lisp | Lisp | |
logo | Logo | |
lua | Lua | |
make | Makefile | makefile |
markdown | Markdown | md |
marko | Marko | |
matlab | MATLAB | |
mdc | mdc | |
mdx | MDX | |
mermaid | Mermaid | |
mojo | MagicPython | |
narrat | Narrat Language | nar |
nextflow | Nextflow | nf |
nginx | Nginx | |
nim | Nim | |
nix | Nix | |
nushell | nushell | nu |
objective-c | Objective-C | objc |
objective-cpp | Objective-C++ | |
ocaml | OCaml | |
pascal | Pascal | |
perl | Perl | |
php | PHP | |
plsql | PL/SQL | |
postcss | PostCSS | |
powerquery | PowerQuery | |
powershell | PowerShell | ps, ps1 |
prisma | Prisma | |
prolog | Prolog | |
proto | Protocol Buffer 3 | |
pug | Pug | jade |
puppet | Puppet | |
purescript | PureScript | |
python | Python | py |
r | R | |
raku | Raku | perl6 |
razor | ASP.NET Razor | |
reg | Windows Registry Script | |
rel | Rel | |
riscv | RISC-V | |
rst | reStructuredText | |
ruby | Ruby | rb |
rust | Rust | rs |
sas | SAS | |
sass | Sass | |
scala | Scala | |
scheme | Scheme | |
scss | SCSS | |
shaderlab | ShaderLab | shader |
shellscript | Shell | bash, sh, shell, zsh |
shellsession | Shell Session | console |
smalltalk | Smalltalk | |
solidity | Solidity | |
sparql | SPARQL | |
splunk | Splunk Query Language | spl |
sql | SQL | |
ssh-config | SSH Config | |
stata | Stata | |
stylus | Stylus | styl |
svelte | Svelte | |
swift | Swift | |
system-verilog | SystemVerilog | |
tasl | Tasl | |
tcl | Tcl | |
tex | TeX | |
toml | TOML | |
tsx | TSX | |
turtle | Turtle | |
twig | Twig | |
typescript | TypeScript | ts |
v | V | |
vb | Visual Basic | cmd |
verilog | Verilog | |
vhdl | VHDL | |
viml | Vim Script | vim, vimscript |
vue-html | Vue HTML | |
vue | Vue | |
vyper | Vyper | vy |
wasm | WebAssembly | |
wenyan | Wenyan | 文言 |
wgsl | WGSL | |
wolfram | Wolfram | wl |
xml | XML | |
xsl | XSL | |
yaml | YAML | yml |
zenscript | ZenScript | |
zig | zig |
Load Custom Languages
You can load custom languages by passing a TextMate grammar object into the langs array.
ts
import { getHighlighter } from 'shikiji'
const myLang = JSON.parse(fs.readFileSync('my-lang.json', 'utf8'))
const highlighter = await getHighlighter({
langs: [myLang]
})
const html = highlighter.codeToHtml(code, {
lang: 'my-lang',
})You can also load languages after the highlighter has been created.
ts
import { getHighlighter } from 'shikiji'
const myLang = JSON.parse(fs.readFileSync('my-lang.json', 'utf8'))
const highlighter = await getHighlighter()
await highlighter.loadLanguage(myLang) // <--
const html = highlighter.codeToHtml(code, {
lang: 'my-lang',
})Migrate from Shiki
Since shikiji is environment agnostic, that means we don't have access to the file system. That means the path property shiki supports is not available in shikiji. Instead, you need to read them in yourself and pass the object. For example:
ts
const highlighter = await getHighlighter({
langs: [
{
name: 'vue-vine',
scopeName: 'source.vue-vine',
// ‼️ This would not work!
path: join(__dirname, './vine-ts.tmLanguage.json'),
embeddedLangs: [
'vue-html',
'css',
'scss',
'sass',
'less',
'stylus',
],
},
]
})Instead, load that file yourself (via fs, import(), fetch(), etc.) and pass the object:
ts
const vineGrammar = JSON.parse(fs.readFileSync(join(__dirname, './vine-ts.tmLanguage.json'), 'utf8'))
const highlighter = await getHighlighter({
langs: [
{
name: 'vue-vine',
scopeName: 'source.vue-vine',
embeddedLangs: [
'vue-html',
'css',
'scss',
'sass',
'less',
'stylus',
],
...vineGrammar
},
]
})