code-block
Format a fenced code block with syntax highlighting, optional title, line numbers, range highlighting, and macOS/Windows window chrome. Use whenever you write a multi-line code example.
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- code-block
- description
- Format a fenced code block with syntax highlighting, optional title, line numbers, range highlighting, and macOS/Windows window chrome. Use whenever you write a multi-line code example.
03 SKILL.md 正文
Code block
Neko extends fenced code blocks with titles, line numbering, range highlighting, and decorative window chrome.
Basic
```js
const msg = "Hello, world";
console.log(msg);
```
With a title
The first token after the language is interpreted as a title:
```js main.js
console.log("title appears in the block header");
```
Line numbers
A # on its own (or with a title) enables line numbers:
```js #
line 1
line 2
```
```js main.js #
with title and line numbers
```
Highlighted ranges
```js #2-3,5
line 1
line 2 ← highlighted
line 3 ← highlighted
line 4
line 5 ← highlighted
```
To highlight ranges without rendering line numbers, prefix with !:
```js !#2-3
line 1
line 2 ← highlighted, no gutter
line 3 ← highlighted, no gutter
```
Window chrome
```js chrome="mac" main.js
// macOS-style traffic-light header (aliases: chrome="macos", chrome="osx")
```
```js chrome="windows" main.js
// Windows-style title bar
```
Supported languages
Most popular languages are highlighted via highlight.js (C#, JS, TS, Python,
Go, Rust, Ruby, Java, Kotlin, Swift, HTML, CSS, JSON, YAML, TOML, XML, Bash,
PowerShell, SQL, etc.). Use text or plain for no highlighting.
Tips
- Always specify a language for proper highlighting and a11y.
- Use a title (
main.cs,Dockerfile, …) when the language alone is ambiguous. - Keep individual snippets short. For files included from disk, prefer the
code-snippetcomponent.
04 同仓库更多 Skills
youtube
Embed a YouTube video by pasting its URL on its own line. Neko auto-detects watch/youtu.be/embed forms and honours timestamp, autoplay, loop, and mute parameters.
workflow
Render a workflow diagram from a node-and-arrows DSL — labelled boxes with icons and optional badges, auto-arranged in columns. Use for pipelines, data flows, sign-off chains, ETL diagrams.
video
Author a video as a single Markdown file (`video:` front matter) — scenes separated by horizontal rules, every block animating in on its own, video components (lockup, swap, typewriter, scramble, counter, stats, chart, code, terminal, browser/window/phone, cursor, lower-third, captions, quote, steps, checklist, grid/card, cta, logo, media), scene transitions and camera moves, and a synthesized voice-over (`--- {narration}` parts, `narration:` voice, `neko voiceover`) — preview it in the browser and render it to MP4 with `neko render` (Playwright + ffmpeg). Also covers the `[!video]` component that embeds the rendered file in a page. Use when asked for a video, an animated explainer, a product or release teaser, a changelog video, a motion graphic, a narrated walkthrough, or an MP4 from docs content.
update-documentation
Workflow for updating Neko documentation — base every page on the real source code, never invent APIs, warn loudly when the source isn't available, and check that the page (and any changed `tesserae` sample) renders correctly with Playwright / snapframe / a visual check. Use whenever you add or edit docs that describe code, APIs, components, or live samples.
tesserae
Render a live Tesserae C# UI block — Neko compiles and executes the C# at build time and shows both the code and a working preview side-by-side. Use only when the project documents Tesserae or runs live C# samples.
table
Render a Markdown table with alignment, compact mode, and no-wrap option. Use for any tabular comparison, reference matrix, option list.