Code blocks
Code blocks are rendered by Expressive Code, which Starlight bundles. Every block gets a copy button (hover or focus the block). The theme is monochrome: token kinds differ by weight and style, because colour is reserved for state.
Plain block with a language
Section titled “Plain block with a language”```tsconst answer = 42;```const answer = 42;A title="..." on the opening fence adds a file tab.
```ts title="knetik.module.ts"import { defineModule } from '@knetikdotdev/sdk';```import { defineModule } from '@knetikdotdev/sdk';
export default defineModule({ id: 'hello', version: '0.1.0', title: 'Hello module' /* ... */ });Line highlight
Section titled “Line highlight”Put line numbers or ranges in braces: {2,4-5}.
```ts title="module.test.ts" {2,4-5}test('picks a greeting', async () => { const r = await runModule(mod, { agents, input, model, gates: { choose: 'warm' } }); assert.equal(r.status, 'completed'); assert.deepEqual(Object.keys(r.artifacts).sort(), ['hello.html', 'hello.md']);});```test('picks a greeting', async () => { const r = await runModule(mod, { agents, input, model, gates: { choose: 'warm' } }); assert.equal(r.status, 'completed'); assert.deepEqual(Object.keys(r.artifacts).sort(), ['hello.html', 'hello.md']);});Mark text
Section titled “Mark text”Wrap text in quotes to mark it wherever it appears, or use a regular expression between slashes.
```bash "KNETIK_SECRET_KEY"node packages/cli/src/bin.ts keygen# prints KNETIK_SECRET_KEY=...```node packages/cli/src/bin.ts keygen# prints KNETIK_SECRET_KEY=...Insertions and deletions
Section titled “Insertions and deletions”Mark lines with ins={...} and del={...}. Inserted lines get a +, deleted lines a -, in neutral tones.
```ts title="knetik.module.ts" del={2} ins={3}connectors: { slack: { scopes: ['chat:write'] }, slack: { scopes: ['chat:write'], required: false },},```connectors: { slack: { scopes: ['chat:write'] }, slack: { scopes: ['chat:write'], required: false },},Diff syntax
Section titled “Diff syntax”A block with the language diff uses a leading + or - on each line. Add lang="..." to also highlight the code itself.
```diff lang="json" title="package.json" "scripts": {- "build": "npm run build -w @knetikdotdev/web",+ "build": "npm run build -w @knetikdotdev/web && npm run build -w @knetikdotdev/server", "start": "node apps/server/dist/server.mjs" }```"scripts": { "build": "npm run build -w @knetikdotdev/web", "build": "npm run build -w @knetikdotdev/web && npm run build -w @knetikdotdev/server", "start": "node apps/server/dist/server.mjs"}Terminal frame
Section titled “Terminal frame”Shell languages (bash, sh, powershell) use a terminal frame automatically. Force a frame with frame="terminal", frame="code" or frame="none".
```bashnpm run check:envnpm start```npm run check:envnpm startYour .env looks good. mode local agents openrouter/anthropic/claude-sonnet-5.5A block with no frame and no title, for plain output.Long lines
Section titled “Long lines”Long lines scroll sideways by default. Add wrap to wrap them instead.
KNETIK_MODULE_CONFIG='{"content-creator":{"brandVoice":"Plain, warm and specific. No hype.","bannedTerms":"guaranteed, miracle","imageStyle":"flat, monochrome, geometric"}}'Languages
Section titled “Languages”Common languages work out of the box.
{ "modules": [ { "id": "hello", "version": "0.2.0", "approvedBy": "someone" } ]}services: knetik: image: knetik:local ports: - "3000:3000"export function Example({ name }: { name: string }) { return <p className="eyebrow">Hello, {name}</p>;}Inline code
Section titled “Inline code”Inline code uses the mono face, for things like KNETIK_MODE=local, /api/runs and run_7f3a.