Fenced code blocks with a language specifier are rendered with syntax highlighting automatically.
Place a language name immediately after the opening triple backtick. The block is highlighted using highlight.js — no configuration required.
` ` `javascript
const greeting = 'hello';
` ` `
produces a highlighted JavaScript block. Replace javascript with any supported language name.
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.
highlight.js supports over 190 languages. Commonly used ones on this platform:
| Specifier | Language |
|---|---|
javascript or js | JavaScript |
typescript or ts | TypeScript |
json | JSON |
yaml | YAML |
bash or shell | Shell / Bash |
sql | SQL |
html or xml | HTML / XML |
css | CSS |
markdown | Markdown |
python | Python |
For the full list see the highlight.js supported languages page.
```JavaScript and ```javascript both work.