Editor & Writing·3 min read·

Code block syntax highlighting languages supported

The VeloCMS editor highlights code in 37 languages using lowlight. Here's the full list and how to set the language for each code block.

VeloCMS code blocks highlight 37 languages using lowlight, a highlight.js based highlighter, with the same language set in the editor and in the published post. Insert a code block from the slash menu (Code Block), then pick the language from the dropdown at the top-right of the block. The colours apply immediately in the editor and are baked into the published page.

Supported languages

  • arduino, bash, shell — Arduino sketches, Bash and shell scripts
  • c, cpp, csharp, objectivec — C, C++, C#, Objective-C
  • css, less, scss — CSS, Less, SCSS
  • go, rust, java, kotlin, swift — Go, Rust, Java, Kotlin, Swift
  • javascript, typescript — JavaScript and TypeScript (including JSX and TSX)
  • json, yaml, ini, xml — JSON, YAML, INI and TOML-style config, XML and HTML
  • markdown, plaintext — Markdown and plain text
  • php, php-template — PHP and PHP templates
  • python, python-repl — Python and Python REPL sessions
  • ruby, perl, lua, r — Ruby, Perl, Lua, R
  • sql, graphql — SQL queries and GraphQL
  • diff, makefile, vbnet, wasm — diffs, Makefiles, VB.NET, WebAssembly text

Common short names also work: js, jsx, ts, tsx, py, sh, yml, md, html and toml. Languages that are not in this set, such as Dockerfile and Nginx config, are not highlighted.

Setting the language

After inserting a code block, use the language dropdown in the top-right corner of the block. It lists the supported languages alphabetically; open it and pick one, or type its first letters to jump to it. The language is stored with the code block, so changing it later does not alter the code itself, only the colours applied to it.

A code block with no language set (Auto) publishes unhighlighted, in the monospace font without colour, and so does a language outside the supported set. The editor may colour an Auto block while you write, but the published post does not, so pick a language explicitly for every block you want coloured.

Copy button

Code blocks in the editor have a Copy code button next to the language dropdown, and code blocks in published posts show a copy-to-clipboard button in the top-right corner, so readers can copy a snippet in one click.