Skip to content

Languages

All Languages

Inherited from shiki, here are all the languages bundled in shikiji.

IDNameAliases
abapABAP
actionscript-3ActionScript
adaAda
apacheApache Conf
apexApex
aplAPL
applescriptAppleScript
araAra
asmAssembly
astroAstro
awkAWK
ballerinaBallerina
batBatchbatch
beancountBeancount
berryBerrybe
bibtexBibTeX
bicepBicep
bladeBlade
cC
cadenceCadencecdc
clarityClarity
clojureClojureclj
cmakeCMake
cobolCOBOL
codeqlCodeQLql
coffeeCoffeeScript
cppC++c++
crystalCrystal
csharpC#c#, cs
cssCSS
csvcsv syntax
cueCUE
cypherCyphercql
dD
dartDart
daxDAX
diffDiff
dockerDockerdockerfile
dream-makerDream Maker
elixirElixir
elmElm
erbERB
erlangErlangerl
fishFish
fsharpF#f#, fs
gdresourceGDResource
gdscriptGDScript
gdshaderGDShader
gherkinGherkin
git-commitGit Commit Message
git-rebaseGit Rebase Message
glimmer-jsGlimmer JSgjs
glimmer-tsGlimmer TSgts
glslGLSL
gnuplotGnuplot
goGo
graphqlGraphQLgql
groovyGroovy
hackHack
hamlRuby Haml
handlebarsHandlebarshbs
haskellHaskellhs
hclHashiCorp HCL
hjsonHjson
hlslHLSL
htmlHTML
httpHTTP
imbaImba
iniINIproperties
javaJava
javascriptJavaScriptjs
jinja-htmlJinja
jisonJison
jsonJSON
json5JSON5
jsoncJSON with Comments
jsonlJSON Lines
jsonnetJsonnet
jssmJSSMfsl
jsxJSX
juliaJulia
kotlinKotlinkt, kts
kustoKustokql
latexLaTeX
lessLess
liquidLiquid
lispLisp
logoLogo
luaLua
makeMakefilemakefile
markdownMarkdownmd
markoMarko
matlabMATLAB
mdcmdc
mdxMDX
mermaidMermaid
mojoMagicPython
narratNarrat Languagenar
nextflowNextflownf
nginxNginx
nimNim
nixNix
nushellnushellnu
objective-cObjective-Cobjc
objective-cppObjective-C++
ocamlOCaml
pascalPascal
perlPerl
phpPHP
plsqlPL/SQL
postcssPostCSS
powerqueryPowerQuery
powershellPowerShellps, ps1
prismaPrisma
prologProlog
protoProtocol Buffer 3
pugPugjade
puppetPuppet
purescriptPureScript
pythonPythonpy
rR
rakuRakuperl6
razorASP.NET Razor
regWindows Registry Script
relRel
riscvRISC-V
rstreStructuredText
rubyRubyrb
rustRustrs
sasSAS
sassSass
scalaScala
schemeScheme
scssSCSS
shaderlabShaderLabshader
shellscriptShellbash, sh, shell, zsh
shellsessionShell Sessionconsole
smalltalkSmalltalk
soliditySolidity
sparqlSPARQL
splunkSplunk Query Languagespl
sqlSQL
ssh-configSSH Config
stataStata
stylusStylusstyl
svelteSvelte
swiftSwift
system-verilogSystemVerilog
taslTasl
tclTcl
texTeX
tomlTOML
tsxTSX
turtleTurtle
twigTwig
typescriptTypeScriptts
vV
vbVisual Basiccmd
verilogVerilog
vhdlVHDL
vimlVim Scriptvim, vimscript
vue-htmlVue HTML
vueVue
vyperVypervy
wasmWebAssembly
wenyanWenyan文言
wgslWGSL
wolframWolframwl
xmlXML
xslXSL
yamlYAMLyml
zenscriptZenScript
zigzig

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
    },
  ]
})

Released under the MIT License.