Torchlight relies on the VS Code engine, giving us access to a wide ecosystem of best-in-class language grammars.
Several of these are the defaults you'd expect, a few have been specially added by request (Laravel Blade, Statamic Antlers), and some have been written by us exclusively for Torchlight (curl, for example).
The name
s below are just for human readability, to use the language in your blocks, use the key
attribute whenever a language is required.
Some lanugages have multiple aliases, those are denoted by the pipes |
. They are provided for your convenience.
Name | Key |
---|---|
ABAP | abap |
Actionscript 3 | actionscript-3 |
Ada | ada |
Alpine.js | alpine | alpinejs |
Apex | apex |
Applescript | applescript |
Assembly | asm |
AWK | awk |
Batch | bat | batch |
C | c |
C# | csharp | c# |
C++ | cpp |
Clojure | clojure | clj |
Cobol | cobol |
Coffee Script | coffee |
Crystal | crystal |
CSS | css |
Curl | curl |
D | d |
Dart | dart |
Dockerfile | dockerfile |
Elixir | elixir |
Elm | elm |
Embedded Ruby (ERB) | html-ruby-erb | erb |
Erlang | erlang |
F# | fsharp | f# |
git-commit | git-commit |
git-diff | diff |
git-ignore | git-ignore | gitignore |
git-rebase | git-rebase |
gnuplot | gnuplot |
Go | go |
GraphQL | graphql |
Groovy | groovy |
Hack | hack |
Haml | haml |
Handlebars | handlebars | hbs |
HashiCorp Configuration Language | hcl |
Haskell | haskell |
HLSL | hlsl |
HTML | html |
INI | ini |
Java | java |
JavaScript | javascript | js |
Jinja HTML | jinja-html |
JSON | json |
jsonc | jsonc |
Jsonnet | jsonnet |
JSX | jsx |
Julia | julia |
Kotlin | kotlin |
Laravel Blade | blade |
Latex | latex | tex |
Less | less |
Lisp | lisp |
Logo | logo |
Lua | lua |
Makefile | makefile |
Markdown | markdown | md |
MATLAB | matlab |
MDX | mdx |
Nix | nix |
Objective-C | objective-c | objc |
OCaml | ocaml |
Pascal | pascal |
Perl | perl |
Perl6 | perl6 |
PHP | php |
Plaintext | (null) | txt | text | plaintext |
PLSQL | pls |
PostCSS | postcss |
PowerShell | powershell | ps | ps1 |
Prolog | prolog |
Pug | pug | jade |
Puppet | puppet |
PureScript | purescript |
Python | python | py |
R | r |
Razor | razor |
Ruby | ruby | rb |
Rust | rust |
SAS | sas |
Sass | sass |
Scala | scala |
Scheme | scheme |
SCSS | scss |
ShaderLab | shaderlab | shader |
Shell | shell |
Smalltalk | smalltalk |
SQL | sql |
ssh-config | ssh-config |
Statamic Antlers | antlers |
Stylus | stylus | styl |
Swift | swift |
Tcl | tcl |
TOML | toml |
tsx | tsx |
TypeScript | typescript | ts |
VB | vb | cmd |
VimL | viml |
Vue | vue |
WebAssembly | wasm |
Wenyan | 文言 | wenyan |
XML | xml |
XSL | xsl |
YAML | yaml |
If you are using Torchlight to document an API, you may find the default highlighting for the shell
language a little uninspired when it comes to curl
examples.
We have written a custom language grammar specifically for curl, to highlight the different parts of the command and its parameters.
Standard shell
language:
1curl https://api.stripe.com/configurations?example1=foo&example2=bar \2 -d "business_profile[privacy_policy_url]"="https://example.com/privacy" \3 -d "business_profile[terms_of_service_url]"="https://example.com/terms" \4 -d "features[invoice_history][enabled]"=true
Custom curl
language:
1curl https://api.stripe.com/configurations?example1=foo&example2=bar \2 -d "business_profile[privacy_policy_url]"="https://example.com/privacy" \3 -d "business_profile[terms_of_service_url]"="https://example.com/terms" \4 -d "features[invoice_history][enabled]"=true
If you have any requests for modifications or new languages, let us know!