Syntax Highlighting

Last modified: 4/19/2026

Syntax Highlighting

Fenced code blocks with a language specifier are rendered with syntax highlighting automatically.

Description

Place a language name immediately after the opening triple backtick. The block is highlighted using highlight.js — no configuration required.

Syntax

` ` `javascript
const greeting = 'hello';
` ` `

produces a highlighted JavaScript block. Replace javascript with any supported language name.

Examples

JavaScript:

function greet(name) {
  return `Hello, ${name}!`;
}

JSON:

{
  "title": "Example",
  "enabled": true,
  "count": 42
}

YAML:

ngdpbase:
  telemetry:
    enabled: true
    metrics:
      port: 9464

Bash:

./server.sh restart
npm run build

SQL:

SELECT username, email
FROM users
WHERE is_active = true
ORDER BY username;

A block with no language specifier renders as plain monospace — no highlighting applied:

This is plain text.
No language specified.

Supported Languages

highlight.js supports over 190 languages. Commonly used ones on this platform:

SpecifierLanguage
javascript or jsJavaScript
typescript or tsTypeScript
jsonJSON
yamlYAML
bash or shellShell / Bash
sqlSQL
html or xmlHTML / XML
cssCSS
markdownMarkdown
pythonPython

For the full list see the highlight.js supported languages page.

Notes