---
title: "Code blocks and code tabs"
url: "/help/buuk/code-blocks-and-code-tabs"
updated: "2026-10-22T11:13:33.660Z"
---
# Code blocks and code tabs

A code block keeps a snippet in a monospaced box with syntax highlighting. A code tabs block groups several code blocks under labeled tabs, so one sample can cover several languages.

## Insert a code block

1. Press `/` and choose **Code block**. New blocks start in JavaScript.
2. Or type ````` plus a language id, then a space — ````js`, ````bash`, ````python`. A bare ````` gives you JavaScript.
3. Pick another language from the dropdown at the top of the block — plain text, TypeScript, Python, Ruby, Go, Rust, Java, Swift, SQL, JSON, YAML, Bash, GraphQL, Dockerfile, and more.

## Why the language matters

Three reasons to set it rather than leave the default:

- Syntax highlighting reads the language attribute — a bash snippet highlighted as JavaScript looks wrong and scans slower
- The label tells readers the framework at a glance, which is usually all they need to decide whether to copy the snippet
- The language travels with the block. Every rendered view of the article, including markdown and the snippets Ask AI can quote back, stays unambiguous about what the code is

## Get out again

Code blocks trap the cursor so typing and indentation flow naturally. Press `⌘↵` (or Ctrl+Enter) to leave the block and start a new paragraph. `Esc` works too. Inside the block, `Tab` inserts a real tab character, and clearing the block's text turns it back into a normal paragraph.

## When one language is enough

A single code block does the job when the audience is one tool:

```bash
curl https://app.getbuuk.com/api/public/articles \
  -H "Authorization: Bearer buuk_cli_…"
```

## When readers use three

Press `/` and choose **Code tabs** to group snippets. Tab labels are your own — npm, curl, Node, Python. In the editor the labeled panes sit together; on the public site they render as switchable tabs without any JavaScript.

<!-- curl -->

```bash
curl https://app.getbuuk.com/api/public/articles \
  -H "Authorization: Bearer buuk_cli_…"
```

<!-- Node -->

```javascript
const res = await fetch(
  "https://app.getbuuk.com/api/public/articles",
  { headers: { Authorization: "Bearer buuk_cli_…" } }
);
const articles = await res.json();
```

<!-- Python -->

```python
import requests

res = requests.get(
    "https://app.getbuuk.com/api/public/articles",
    headers={"Authorization": "Bearer buuk_cli_…"},
)
articles = res.json()
```

The same request, three languages, one vertical space on the page. A new code tabs block arrives with two install-command tabs to throw away.

## Related

- [Editor overview](./editor-overview)
- [API tokens and MCP](./api-tokens-and-mcp)
- [Tables](./tables)
- [Embeds](./embeds)