mermaid
Render a Mermaid diagram (flowchart, sequence, class, ER, state, gantt, journey, mindmap, sankey, XY, architecture) from a fenced ```mermaid``` block. Use for any structured diagram in docs.
- License 许可
- MIT
- 最近更新
- 2026-11-10
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- mermaid
- description
- Render a Mermaid diagram (flowchart, sequence, class, ER, state, gantt, journey, mindmap, sankey, XY, architecture) from a fenced ```mermaid``` block. Use for any structured diagram in docs.
03 SKILL.md 正文
Mermaid
Draws Mermaid diagrams with Pele, which turns Mermaid syntax
into SVG in the browser. Supports every diagram type of Mermaid 12.1. Pele is
embedded in Neko — a page loads it from its own assets/ folder, only when the
page has a diagram, and a deck or document inlines it — so no CDN is involved and
the diagrams work offline.
Basic flowchart
```mermaid
graph LR
A[Start] -->|Process| B[End]
```
Decision tree
```mermaid
graph TD
A[Login] --> B{Valid?}
B -->|Yes| C[Dashboard]
B -->|No| D[Show error]
```
Sequence diagram
```mermaid
sequenceDiagram
User->>+API: POST /login
API->>+DB: SELECT user
DB-->>-API: row
API-->>-User: 200 OK
```
Other supported types
classDiagram— class structure.erDiagram— entity relationships.stateDiagram-v2— state machines.gantt— project schedules.journey— user journeys.mindmap— radial idea maps.sankey-beta— flow diagrams.xychart-beta— quick bar / line charts.architecture-beta— cloud architecture.
Theming
Diagrams adopt the site palette automatically — Neko maps Pele's colours onto the
site's theme variables (--neko-primary-N, --neko-accent-N — the resolved theme
colours + accent ramp from neko.yml — and --neko-bg-elevated etc.), with a light
and a dark set. A diagram is drawn once and follows light/dark mode with no redraw. No
directive needed.
Colouring part of a diagram
%%{init}%% theme / themeVariables are ignored (the site theme decides the
colours). To colour individual nodes or links, use Mermaid's own style,
classDef and linkStyle; colours set this way are fixed and do not change with
the colour mode:
```mermaid
flowchart LR
A[Draft] --> B[Review]:::warn --> C[Done]
style C fill:#879a39,stroke:#66800b,color:#fffcf0
classDef warn fill:#d0a215,stroke:#ad8301
linkStyle 0 stroke:#878580,stroke-dasharray:4 4
```
Zoom
A diagram that had to shrink to fit its box gets zoom and pan controls (buttons,
Ctrl/⌘ + wheel, drag, double-click). The page still scrolls normally.
Tips
- Keep node labels short.
- Use
graph LR(left-to-right) for processes;graph TD(top-down) for hierarchies and decisions. - For freeform relationship graphs without a fixed layout, use
force-graph. - For step-by-step processes, prefer
workflow— it has a richer "lane" layout.
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.