Skip to content

AI Agent Skill to generate and render beautiful Mermaid diagrams as SVG or terminal ASCII — 15 themes, 6 diagram types, batch CLI, no browser.

feat: add CI, community docs, and theme gallery (#8)

imxv98f91d5b888d
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 0000000..1ed65ac
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,68 @@
+name: Bug report
+description: Report a reproducible rendering, CLI, or documentation problem
+title: "[Bug]: "
+labels:
+ - bug
+body:
+ - type: markdown
+ attributes:
+ value: Thanks for taking the time to report a problem. Do not include security-sensitive details here; follow SECURITY.md instead.
+ - type: input
+ id: version
+ attributes:
+ label: Pretty Mermaid version or commit
+ placeholder: v1.0.0 or a commit SHA
+ validations:
+ required: true
+ - type: input
+ id: node
+ attributes:
+ label: Node.js version
+ placeholder: v20.20.2
+ validations:
+ required: true
+ - type: dropdown
+ id: output
+ attributes:
+ label: Output format
+ options:
+ - SVG
+ - Unicode or ASCII
+ - Both
+ - Documentation only
+ validations:
+ required: true
+ - type: textarea
+ id: source
+ attributes:
+ label: Minimal Mermaid source
+ description: Include Mermaid source when applicable. Remove private or sensitive data.
+ render: mermaid
+ - type: textarea
+ id: command
+ attributes:
+ label: Command and options
+ description: Include the command and options when applicable.
+ render: shell
+ - type: textarea
+ id: expected
+ attributes:
+ label: Expected behavior
+ validations:
+ required: true
+ - type: textarea
+ id: actual
+ attributes:
+ label: Actual behavior
+ description: Include the full error message or a screenshot when useful.
+ validations:
+ required: true
+ - type: checkboxes
+ id: checks
+ attributes:
+ label: Pre-submission checks
+ options:
+ - label: I searched existing issues and did not find a duplicate.
+ required: true
+ - label: I removed secrets and private data from the example.
+ required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..3ba13e0
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1 @@
+blank_issues_enabled: false
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 0000000..317e692
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,37 @@
+name: Feature request
+description: Suggest a diagram, rendering, CLI, theme, or documentation improvement
+title: "[Feature]: "
+labels:
+ - enhancement
+body:
+ - type: textarea
+ id: problem
+ attributes:
+ label: Problem
+ description: What is difficult or impossible today?
+ validations:
+ required: true
+ - type: textarea
+ id: proposal
+ attributes:
+ label: Proposed solution
+ description: Describe the desired input, output, or workflow.
+ validations:
+ required: true
+ - type: textarea
+ id: alternatives
+ attributes:
+ label: Alternatives considered
+ description: Mention current workarounds or related tools if applicable.
+ - type: textarea
+ id: example
+ attributes:
+ label: Example
+ description: Add Mermaid source, a CLI example, or a mock output when helpful.
+ - type: checkboxes
+ id: checks
+ attributes:
+ label: Pre-submission checks
+ options:
+ - label: I searched existing issues and did not find a duplicate.
+ required: true
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..8c652cf
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,21 @@
+## Summary
+
+<!-- What problem does this change solve? -->
+
+## Changes
+
+<!-- List the focused changes in this pull request. -->
+
+## Verification
+
+<!-- Include commands run and relevant rendered output. -->
+
+- [ ] `npm test`
+- [ ] `npm run validate`
+- [ ] `git diff --check`
+- [ ] Theme gallery regenerated when rendering or themes changed
+- [ ] Documentation updated when user-facing behavior changed
+
+## Visual output
+
+<!-- Attach before/after images for rendering or documentation presentation changes. -->
diff --git a/.github/release.yml b/.github/release.yml
new file mode 100644
index 0000000..4b3085a
--- /dev/null
+++ b/.github/release.yml
@@ -0,0 +1,24 @@
+changelog:
+ exclude:
+ labels:
+ - skip-changelog
+ categories:
+ - title: Features
+ labels:
+ - enhancement
+ - feature
+ - title: Fixes
+ labels:
+ - bug
+ - fix
+ - title: Documentation
+ labels:
+ - documentation
+ - docs
+ - title: Maintenance
+ labels:
+ - chore
+ - dependencies
+ - title: Other Changes
+ labels:
+ - '*'
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..60423ce
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,71 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: ci-${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test:
+ name: Node ${{ matrix.node }}
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ node:
+ - 16
+ - 18
+ - 20
+ - 22
+ - 24
+
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v7
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version: ${{ matrix.node }}
+ cache: npm
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Run smoke tests
+ run: npm test
+
+ - name: Validate Skill and documentation
+ run: npm run validate
+
+ gallery:
+ name: Theme gallery is current
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v7
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version: 24
+ cache: npm
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Regenerate theme gallery
+ run: npm run gallery
+
+ - name: Verify generated previews are committed
+ run: git diff --exit-code -- assets/theme_gallery
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..f2363e7
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,57 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - 'v*'
+
+permissions:
+ contents: read
+
+jobs:
+ verify:
+ name: Verify release tag
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@v7
+
+ - name: Set up Node.js
+ uses: actions/setup-node@v7
+ with:
+ node-version: 24
+ cache: npm
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Verify tag matches package version
+ run: test "v$(node -p "require('./package.json').version")" = "$GITHUB_REF_NAME"
+
+ - name: Run smoke tests
+ run: npm test
+
+ - name: Validate Skill and documentation
+ run: npm run validate
+
+ - name: Verify theme gallery is current
+ run: npm run gallery && git diff --exit-code -- assets/theme_gallery
+
+ release:
+ name: Publish GitHub Release
+ needs: verify
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+
+ steps:
+ - name: Create release
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: >-
+ gh release create "$GITHUB_REF_NAME"
+ --repo "$GITHUB_REPOSITORY"
+ --verify-tag
+ --generate-notes
+ --title "Pretty Mermaid $GITHUB_REF_NAME"
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..2557164
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,26 @@
+# Changelog
+
+All notable changes to Pretty Mermaid are documented in this file.
+
+The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [Unreleased]
+
+## [1.0.0] - 2026-08-20
+
+### Added
+
+- SVG and ASCII/Unicode rendering for flowcharts, sequence diagrams, state diagrams, class diagrams, ER diagrams, and XY charts.
+- Fifteen built-in themes, custom colors, transparent SVGs, layout controls, and interactive XY chart tooltips.
+- Single-file and parallel batch CLIs with automatic first-run dependency installation.
+- Example diagrams, detailed references, a generated theme gallery, and English, Chinese, and Japanese documentation.
+- Node.js compatibility CI, contribution guidance, issue forms, and security and conduct policies.
+
+### Fixed
+
+- Reject inherited object properties such as `constructor` and `toString` as theme names.
+- Apply named themes and custom colors consistently to SVG and terminal output.
+- Replace stale documentation commands with the bundled Node.js CLIs.
+
+[Unreleased]: https://github.com/imxv/Pretty-mermaid-skills/compare/v1.0.0...HEAD
+[1.0.0]: https://github.com/imxv/Pretty-mermaid-skills/releases/tag/v1.0.0
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..ce3ac2c
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,73 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment include:
+
+- Demonstrating empathy and kindness toward other people
+- Being respectful of differing opinions, viewpoints, and experiences
+- Giving and gracefully accepting constructive feedback
+- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
+- Focusing on what is best not just for us as individuals, but for the overall community
+
+Examples of unacceptable behavior include:
+
+- The use of sexualized language or imagery, and sexual attention or advances of any kind
+- Trolling, insulting or derogatory comments, and personal or political attacks
+- Public or private harassment
+- Publishing others' private information, such as a physical or email address, without their explicit permission
+- Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing these standards and will take appropriate and fair corrective action in response to behavior they deem inappropriate, threatening, offensive, or harmful.
+
+Community leaders may remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces and when an individual is officially representing the community in public spaces.
+
+## Enforcement
+
+Report abusive, harassing, or otherwise unacceptable behavior privately through the contact options on the [project owner's GitHub profile](https://github.com/imxv). Do not publish sensitive details in a public issue.
+
+All complaints will be reviewed and investigated promptly and fairly. Community leaders will respect the privacy and security of the reporter.
+
+## Enforcement Guidelines
+
+### 1. Correction
+
+**Community impact:** Use of inappropriate language or other behavior deemed unprofessional or unwelcome.
+
+**Consequence:** A private written warning, with an explanation of why the behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community impact:** A violation through a single incident or series of actions.
+
+**Consequence:** A warning with consequences for continued behavior and a defined period of no interaction with the people involved.
+
+### 3. Temporary Ban
+
+**Community impact:** A serious violation of community standards, including sustained inappropriate behavior.
+
+**Consequence:** A temporary ban from community interaction or public communication for a defined period.
+
+### 4. Permanent Ban
+
+**Community impact:** A pattern of violations, harassment, aggression, or disparagement of classes of individuals.
+
+**Consequence:** A permanent ban from public interaction within the community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at [contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).
+
+Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..1321b93
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,59 @@
+# Contributing to Pretty Mermaid
+
+Thanks for helping improve Pretty Mermaid. Contributions are welcome for renderer behavior, diagram compatibility, documentation, themes, examples, and developer experience.
+
+## Before you start
+
+- Search existing issues and pull requests to avoid duplicate work.
+- Open a feature request before a large behavioral change so the approach can be discussed.
+- Keep changes focused. Unrelated fixes are easier to review as separate pull requests.
+
+## Local setup
+
+Pretty Mermaid requires Node.js 16 or newer.
+
+```bash
+git clone https://github.com/imxv/Pretty-mermaid-skills.git
+cd Pretty-mermaid-skills
+npm ci
+npm test
+```
+
+Render an example while developing:
+
+```bash
+node scripts/render.mjs \
+ --input assets/example_diagrams/flowchart.mmd \
+ --output /tmp/pretty-mermaid-preview.svg \
+ --theme tokyo-night
+```
+
+## Making changes
+
+1. Create a branch with a descriptive name.
+2. Add or update a smoke-test case when behavior changes.
+3. Update the relevant README, Skill instructions, or reference document.
+4. Run `npm run gallery` when themes or SVG rendering affect the committed previews.
+5. Run the checks below before opening a pull request.
+
+```bash
+npm test
+npm run validate
+npm run gallery
+git diff --check
+git diff --exit-code -- assets/theme_gallery
+```
+
+`git diff --exit-code -- assets/theme_gallery` should produce no output. If it reports changes, commit the regenerated previews.
+
+## Pull requests
+
+A useful pull request includes:
+
+- a concise problem statement;
+- the behavior before and after the change;
+- tests or reproduction steps;
+- rendered examples for visual changes;
+- documentation updates when commands or supported syntax change.
+
+By participating, you agree to follow the [Code of Conduct](CODE_OF_CONDUCT.md).
diff --git a/README.md b/README.md
index 92e3ec5..e9af4a0 100644
--- a/README.md
+++ b/README.md
@@ -9,11 +9,12 @@ Turn Mermaid source into polished SVGs and terminal-ready ASCII—locally, witho
![Pretty Mermaid converts Mermaid source into themed SVG and terminal ASCII diagrams](assets/social-preview.png)
[![skills.sh](https://skills.sh/b/imxv/pretty-mermaid-skills)](https://www.skills.sh/imxv/pretty-mermaid-skills/pretty-mermaid)
+[![CI](https://github.com/imxv/Pretty-mermaid-skills/actions/workflows/ci.yml/badge.svg)](https://github.com/imxv/Pretty-mermaid-skills/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
-[![Node.js Version](https://img.shields.io/badge/node-%3E%3D14-brightgreen)](https://nodejs.org/)
+[![Node.js Version](https://img.shields.io/badge/node-%3E%3D16-brightgreen)](https://nodejs.org/)
[![GitHub stars](https://img.shields.io/github/stars/imxv/Pretty-mermaid-skills?style=social)](https://github.com/imxv/Pretty-mermaid-skills)
-**English** | [中文](README_CN.md)
+**English** | [中文](README_CN.md) | [日本語](README_JA.md)
</div>
@@ -50,6 +51,15 @@ npx skills add imxv/pretty-mermaid-skills@pretty-mermaid -g -y
| solarized-light | github-dark | |
| | solarized-dark | |
+## 🎨 Theme Gallery
+
+Compare the same flowchart across every built-in theme in the [complete 15-theme gallery](docs/THEME_GALLERY.md).
+
+<p align="center">
+ <img src="assets/theme_gallery/tokyo-night.svg" alt="Tokyo Night theme preview" width="49%">
+ <img src="assets/theme_gallery/github-light.svg" alt="GitHub Light theme preview" width="49%">
+</p>
+
## 🤖 AI Assistant Integration
Seamlessly integrates with the following AI coding environments:
@@ -71,10 +81,9 @@ npx skills add imxv/pretty-mermaid-skills@pretty-mermaid -g -y
### Verify Installation
```bash
-cd Pretty-mermaid
-node scripts/themes.mjs
+npx skills list -g
```
-> **Note**: Dependencies will be auto-installed on first run. Just ensure Node.js is available.
+Confirm that `pretty-mermaid` appears in the global skill list. Node.js 16 or newer is required.
## 📖 Quick Start
@@ -112,10 +121,20 @@ Check the 6 template files in `assets/example_diagrams/`:
The renderer also supports CJK state names, multiline labels, `linkStyle`, configurable ELK layout spacing, interactive XY chart tooltips, and ANSI-colored terminal output.
## 📚 Documentation
-See [SKILL.md](SKILL.md) for detailed usage guide.
+
+- [Skill usage guide](SKILL.md)
+- [Theme gallery](docs/THEME_GALLERY.md)
+- [Diagram syntax reference](references/DIAGRAM_TYPES.md)
+- [Theme and custom color reference](references/THEMES.md)
+- [beautiful-mermaid API reference](references/api_reference.md)
+- [Release process](RELEASING.md)
+
+## 🤝 Community
+
+Read the [contribution guide](CONTRIBUTING.md), report problems with the issue templates, and review the [security policy](SECURITY.md) before sharing sensitive findings. Release history is tracked in the [changelog](CHANGELOG.md).
## ⚙️ Requirements
-- Node.js 14+
+- Node.js 16+
## 📄 License
MIT License
diff --git a/README_CN.md b/README_CN.md
index 5be3bf0..791b017 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -9,11 +9,12 @@
![Pretty Mermaid 将 Mermaid 源码转换为带主题的 SVG 和终端 ASCII 图表](assets/social-preview.png)
[![skills.sh](https://skills.sh/b/imxv/pretty-mermaid-skills)](https://www.skills.sh/imxv/pretty-mermaid-skills/pretty-mermaid)
+[![CI](https://github.com/imxv/Pretty-mermaid-skills/actions/workflows/ci.yml/badge.svg)](https://github.com/imxv/Pretty-mermaid-skills/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
-[![Node.js Version](https://img.shields.io/badge/node-%3E%3D14-brightgreen)](https://nodejs.org/)
+[![Node.js Version](https://img.shields.io/badge/node-%3E%3D16-brightgreen)](https://nodejs.org/)
[![GitHub stars](https://img.shields.io/github/stars/imxv/Pretty-mermaid-skills?style=social)](https://github.com/imxv/Pretty-mermaid-skills)
-**中文** | [English](README.md)
+**中文** | [English](README.md) | [日本語](README_JA.md)
</div>
@@ -50,6 +51,15 @@ npx skills add imxv/pretty-mermaid-skills@pretty-mermaid -g -y
| solarized-light | github-dark | |
| | solarized-dark | |
+## 🎨 主题效果图库
+
+在[完整的 15 主题效果图库](docs/THEME_GALLERY.md)中,对比同一张流程图在所有内置主题下的效果。
+
+<p align="center">
+ <img src="assets/theme_gallery/tokyo-night.svg" alt="Tokyo Night 主题预览" width="49%">
+ <img src="assets/theme_gallery/github-light.svg" alt="GitHub Light 主题预览" width="49%">
+</p>
+
## 🤖 AI 助手集成
支持与以下 AI 编程环境无缝集成,通过自然语言即可调用绘图能力:
@@ -71,10 +81,9 @@ npx skills add imxv/pretty-mermaid-skills@pretty-mermaid -g -y
### 验证安装
```bash
-cd Pretty-mermaid
-node scripts/themes.mjs
+npx skills list -g
```
-> **提示**:首次运行时会自动安装依赖,只需确保您的环境中有 Node.js。
+确认全局 Skill 列表中包含 `pretty-mermaid`。需要 Node.js 16 或更高版本。
## 📖 快速开始
@@ -112,10 +121,20 @@ node scripts/batch.mjs \
渲染器同时支持中日韩状态名称、多行标签、`linkStyle`、可配置的 ELK 布局间距、XY 图交互提示,以及带 ANSI 颜色的终端输出。
## 📚 完整文档
-详细使用指南请参阅 [SKILL.md](SKILL.md)
+
+- [Skill 使用指南](SKILL.md)
+- [主题效果图库](docs/THEME_GALLERY.md)
+- [图表语法参考](references/DIAGRAM_TYPES.md)
+- [主题与自定义配色参考](references/THEMES.md)
+- [beautiful-mermaid API 参考](references/api_reference.md)
+- [版本发布流程](RELEASING.md)
+
+## 🤝 社区
+
+参与项目前请阅读[贡献指南](CONTRIBUTING.md);提交敏感问题前请先查看[安全策略](SECURITY.md)。版本记录见[更新日志](CHANGELOG.md)。
## ⚙️ 系统要求
-- Node.js 14+
+- Node.js 16+
## 📄 许可证
MIT License
diff --git a/README_JA.md b/README_JA.md
new file mode 100644
index 0000000..63a0b39
--- /dev/null
+++ b/README_JA.md
@@ -0,0 +1,150 @@
+<div align="center">
+
+# Pretty Mermaid
+
+**AI エージェントのための美しい Mermaid ダイアグラム**
+
+Mermaid ソースを洗練された SVG とターミナル向け ASCII に変換します。ローカルで動作し、ブラウザーは不要です。
+
+![Pretty Mermaid が Mermaid ソースをテーマ付き SVG とターミナル ASCII に変換する例](assets/social-preview.png)
+
+[![skills.sh](https://skills.sh/b/imxv/pretty-mermaid-skills)](https://www.skills.sh/imxv/pretty-mermaid-skills/pretty-mermaid)
+[![CI](https://github.com/imxv/Pretty-mermaid-skills/actions/workflows/ci.yml/badge.svg)](https://github.com/imxv/Pretty-mermaid-skills/actions/workflows/ci.yml)
+[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
+[![Node.js Version](https://img.shields.io/badge/node-%3E%3D16-brightgreen)](https://nodejs.org/)
+[![GitHub stars](https://img.shields.io/github/stars/imxv/Pretty-mermaid-skills?style=social)](https://github.com/imxv/Pretty-mermaid-skills)
+
+**日本語** | [English](README.md) | [中文](README_CN.md)
+
+</div>
+
+## 🚀 インストール
+
+```bash
+npx skills add imxv/pretty-mermaid-skills@pretty-mermaid -g -y
+```
+
+[skills.sh でインストール数とセキュリティ監査を確認 →](https://www.skills.sh/imxv/pretty-mermaid-skills/pretty-mermaid)
+
+## Pretty Mermaid を選ぶ理由
+
+- **AI エージェント向け**:Claude Code、Cursor、Codex、Gemini CLI などに対応
+- **1 つのソースから 2 形式**:ドキュメント向け SVG とターミナル向け ASCII/Unicode
+- **ブラウザー不要**:Chromium、Puppeteer、DOM に依存せずローカルでレンダリング
+- **柔軟な設定**:15 テーマ、カスタムカラー、6 種類のダイアグラム、バッチ処理
+
+## ✨ 主な機能
+
+- 📊 **複数形式**:SVG と ASCII/Unicode を出力
+- 🎨 **豊富なテーマ**:用途に合わせた 15 の組み込みテーマ
+- 📈 **6 種類のダイアグラム**:Flowchart、Sequence、State、Class、ER、XY Chart
+- ⚡ **高速処理**:複数ファイルを並列でバッチレンダリング
+- 📚 **すぐに使える**:テンプレートと詳細なリファレンスを同梱
+
+### 対応テーマ
+
+| Light Themes | Dark Themes | Other |
+| :--- | :--- | :--- |
+| zinc-light | zinc-dark | nord |
+| tokyo-night-light | tokyo-night | nord-light |
+| catppuccin-latte | tokyo-night-storm | dracula |
+| github-light | catppuccin-mocha | one-dark |
+| solarized-light | github-dark | |
+| | solarized-dark | |
+
+## 🎨 テーマギャラリー
+
+[15 テーマの完全なギャラリー](docs/THEME_GALLERY.md)で、同じフローチャートの見た目を比較できます。
+
+<p align="center">
+ <img src="assets/theme_gallery/tokyo-night.svg" alt="Tokyo Night テーマのプレビュー" width="49%">
+ <img src="assets/theme_gallery/github-light.svg" alt="GitHub Light テーマのプレビュー" width="49%">
+</p>
+
+## 🤖 AI アシスタント連携
+
+次の AI コーディング環境から自然言語で利用できます。
+
+- **Claude Code**
+- **Cursor**
+- **Gemini CLI**
+- **Antigravity**
+- **OpenCode**
+- **Codex**
+- **qoder**
+
+## インストールの確認
+
+```bash
+npx skills list -g
+```
+
+グローバル Skill 一覧に `pretty-mermaid` が表示されることを確認してください。Node.js 16 以上が必要です。
+
+## 📖 クイックスタート
+
+### テーマ一覧
+
+```bash
+node scripts/themes.mjs
+```
+
+### 1 つのダイアグラムをレンダリング
+
+```bash
+node scripts/render.mjs \
+ --input diagram.mmd \
+ --output output.svg \
+ --theme tokyo-night
+```
+
+### ディレクトリをバッチレンダリング
+
+```bash
+node scripts/batch.mjs \
+ --input-dir ./diagrams \
+ --output-dir ./output \
+ --theme dracula
+```
+
+## 📂 サンプル
+
+`assets/example_diagrams/` に 6 種類のテンプレートがあります。
+
+- `flowchart.mmd` - フローチャート
+- `sequence.mmd` - シーケンス図
+- `state.mmd` - 状態遷移図
+- `class.mmd` - クラス図
+- `er.mmd` - ER 図
+- `xychart.mmd` - XY チャート(棒グラフと折れ線グラフ)
+
+CJK の状態名、複数行ラベル、`linkStyle`、ELK レイアウト間隔、XY チャートのツールチップ、ANSI カラーのターミナル出力にも対応します。
+
+## 📚 ドキュメント
+
+- [Skill 利用ガイド](SKILL.md)
+- [テーマギャラリー](docs/THEME_GALLERY.md)
+- [ダイアグラム構文リファレンス](references/DIAGRAM_TYPES.md)
+- [テーマとカスタムカラー](references/THEMES.md)
+- [beautiful-mermaid API リファレンス](references/api_reference.md)
+- [リリース手順](RELEASING.md)
+
+## 🤝 コミュニティ
+
+参加する前に[コントリビューションガイド](CONTRIBUTING.md)を確認してください。機密性のある問題を共有する前に[セキュリティポリシー](SECURITY.md)をお読みください。リリース履歴は[変更履歴](CHANGELOG.md)にあります。
+
+## ⚙️ 動作要件
+
+- Node.js 16 以上
+
+## 📄 ライセンス
+
+MIT License
+
+## Star History
+
+[![Star History Chart](https://api.star-history.com/svg?repos=imxv/Pretty-mermaid-skills&type=timeline&legend=top-left)](https://www.star-history.com/?repos=imxv%2FPretty-mermaid-skills&type=timeline&legend=bottom-right)
+
+## 🙏 謝辞
+
+[beautiful-mermaid](https://github.com/lukilabs/beautiful-mermaid) を利用しています。
diff --git a/RELEASING.md b/RELEASING.md
new file mode 100644
index 0000000..afad34d
--- /dev/null
+++ b/RELEASING.md
@@ -0,0 +1,37 @@
+# Releasing Pretty Mermaid
+
+This process is for maintainers publishing a version from the default branch. Do not create a release from a feature branch.
+
+## 1. Prepare the version
+
+1. Confirm `package.json` contains the intended semantic version.
+2. Move completed entries from `Unreleased` into a dated section in `CHANGELOG.md`.
+3. Confirm the release notes describe user-visible behavior, compatibility, and important fixes.
+4. Merge the release changes into `main` and wait for CI to pass.
+
+## 2. Verify from `main`
+
+```bash
+git switch main
+git pull --ff-only origin main
+npm ci
+npm test
+npm run validate
+npm run gallery
+git diff --exit-code -- assets/theme_gallery
+```
+
+The working tree should remain clean after verification.
+
+## 3. Tag and publish
+
+For the first release:
+
+```bash
+git tag -a v1.0.0 -m "Pretty Mermaid v1.0.0"
+git push origin v1.0.0
+```
+
+Pushing a `v*` tag starts the Release workflow. It reruns tests and documentation validation, then creates a GitHub Release with generated notes categorized by `.github/release.yml`.
+
+If the workflow fails, fix the underlying problem on `main`, create a new version tag, and publish that tag. Do not move a public release tag after users may have fetched it.
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000..9008542
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,18 @@
+# Security Policy
+
+## Supported versions
+
+The latest release receives security fixes. Older versions may be asked to upgrade before a fix is investigated.
+
+| Version | Supported |
+| --- | --- |
+| 1.x | Yes |
+| < 1.0 | No |
+
+## Reporting a vulnerability
+
+Please do not disclose vulnerabilities or exploit details in a public issue.
+
+Use GitHub's [private vulnerability reporting form](https://github.com/imxv/Pretty-mermaid-skills/security/advisories/new). Do not use a public issue for security reports.
+
+Include the affected version, impact, reproduction steps, and any suggested mitigation only after a private channel has been established. You can expect an initial acknowledgement within seven days.
diff --git a/SKILL.md b/SKILL.md
index 59457e1..46b21e3 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -12,536 +12,173 @@ description: |
# Pretty Mermaid
-Render stunning, professionally-styled Mermaid diagrams with one command. Supports SVG for web/docs and ASCII for terminals.
+Create or render Mermaid diagrams with the bundled Node.js CLI. Use SVG for documentation and presentations; use ASCII or Unicode for terminals and plain text.
-## Quick Start
+## Working directory
-### Render a Single Diagram
+Treat the directory containing this file as `<skill-root>`. Run bundled scripts from that directory, or invoke them with absolute paths. Keep user source and rendered output in the user's requested location; do not copy the renderer into their project.
-**From a file:**
-```bash
-node scripts/render.mjs \
- --input diagram.mmd \
- --output diagram.svg \
- --format svg \
- --theme tokyo-night
-```
-
-**From user-provided Mermaid code:**
-1. Save the code to a `.mmd` file
-2. Run the render script with desired theme
+## Workflow
-### Batch Render Multiple Diagrams
+1. Determine whether the user supplied Mermaid source or needs a diagram authored from prose.
+2. Choose the diagram type and output format from the tables below.
+3. Read only the relevant reference file when syntax, theme selection, or API behavior needs more detail.
+4. Save new source as a `.mmd` file, preserving user terminology and relationships.
+5. Render with a named theme or explicit colors.
+6. Inspect the result. Fix syntax, clipping, crowded layout, or unclear labels and render again.
+7. Return the source and output paths, plus the selected format and theme.
-```bash
-node scripts/batch.mjs \
- --input-dir ./diagrams \
- --output-dir ./output \
- --format svg \
- --theme dracula \
- --workers 4
-```
+Do not overwrite an existing source or output file unless the user asked for replacement.
-### ASCII Output (Terminal-Friendly)
+## Choose a diagram type
-```bash
-node scripts/render.mjs \
- --input diagram.mmd \
- --format ascii \
- --use-ascii \
- --color-mode none
-```
+| Need | Diagram type | Starter |
+| --- | --- | --- |
+| Process, decision tree, architecture | Flowchart | `flowchart LR` |
+| API calls, messages, interactions | Sequence | `sequenceDiagram` |
+| Lifecycle or finite-state machine | State | `stateDiagram-v2` |
+| Classes, modules, relationships | Class | `classDiagram` |
+| Database entities and cardinality | ER | `erDiagram` |
+| Bars, lines, trends, comparisons | XY chart | `xychart-beta` |
----
+Read `references/DIAGRAM_TYPES.md` when authoring non-trivial Mermaid syntax.
-## Workflow Decision Tree
+## Choose an output
-**Step 1: What does the user want?**
-- **Render existing Mermaid code** → Go to [Rendering](#rendering-diagrams)
-- **Create new diagram** → Go to [Creating](#creating-diagrams)
-- **Apply/change theme** → Go to [Theming](#theming)
-- **Batch process** → Go to [Batch Rendering](#batch-rendering)
+| Output | Best for | Notes |
+| --- | --- | --- |
+| SVG | READMEs, docs, slides, websites | Scalable, themed, supports transparency |
+| Unicode | Modern terminals and readable text previews | Default ASCII renderer output |
+| Plain ASCII | Logs and restricted terminals | Add `--use-ascii` |
+| ANSI-colored text | Interactive terminals | Set `--color-mode` |
-**Step 2: Choose output format**
-- **SVG** (web, docs, presentations) → `--format svg`
-- **ASCII** (terminal, logs, plain text) → `--format ascii`
+## Core commands
-**Step 3: Select theme**
-- **Dark mode docs** → `tokyo-night` (recommended)
-- **Light mode docs** → `github-light`
-- **Vibrant colors** → `dracula`
-- **See all themes** → Run `node scripts/themes.mjs`
+Run these from `<skill-root>`.
----
+### List themes
-## Rendering Diagrams
-
-### From File
-
-When user provides a `.mmd` file or Mermaid code block:
-
-1. **Save to file** (if code block):
- ```bash
- cat > diagram.mmd << 'EOF'
- flowchart LR
- A[Start] --> B[End]
- EOF
- ```
-
-2. **Render with theme**:
- ```bash
- node scripts/render.mjs \
- --input diagram.mmd \
- --output diagram.svg \
- --theme tokyo-night
- ```
-
-3. **Verify output**:
- - SVG: Open in browser or embed in docs
- - ASCII: Display in terminal
-
-### Output Formats
-
-**SVG (Scalable Vector Graphics)**
-- Best for: Web pages, documentation, presentations
-- Features: Full color support, transparency, scalable
-- Usage: `--format svg --output diagram.svg`
-
-**ASCII (Terminal Art)**
-- Best for: Terminal output, plain text logs, README files
-- Features: Pure text, works anywhere, no dependencies
-- Usage: `--format ascii` (prints to stdout)
-- Options:
- - `--use-ascii` - Use pure ASCII (no Unicode)
- - `--padding-x 5` - Horizontal spacing
- - `--padding-y 5` - Vertical spacing
- - `--color-mode auto` - Terminal colors (`none`, `auto`, `ansi16`, `ansi256`, `truecolor`, or `html`)
-
-### Advanced Options
-
-**Custom Colors** (overrides theme):
```bash
-node scripts/render.mjs \
- --input diagram.mmd \
- --bg "#1a1b26" \
- --fg "#a9b1d6" \
- --accent "#7aa2f7" \
- --output custom.svg
+node scripts/themes.mjs
```
-**Transparent Background**:
-```bash
-node scripts/render.mjs \
- --input diagram.mmd \
- --transparent \
- --output transparent.svg
-```
+### Render SVG
-**Custom Font**:
```bash
node scripts/render.mjs \
--input diagram.mmd \
- --font "JetBrains Mono" \
- --output custom-font.svg
-```
-
-**Layout and interactive XY charts**:
-```bash
-node scripts/render.mjs \
- --input chart.mmd \
- --node-spacing 32 \
- --layer-spacing 56 \
- --interactive \
- --output chart.svg
-```
-
-Use `--padding`, `--node-spacing`, `--layer-spacing`, and `--component-spacing` to tune ELK layout. `--interactive` enables hover tooltips for XY chart bars and points.
-
----
-
-## Creating Diagrams
-
-### Using Templates
-
-**Step 1: List available templates**
-```bash
-ls assets/example_diagrams/
-# flowchart.mmd sequence.mmd state.mmd class.mmd er.mmd xychart.mmd
-```
-
-**Step 2: Copy and modify**
-```bash
-cp assets/example_diagrams/flowchart.mmd my-workflow.mmd
-# Edit my-workflow.mmd with user requirements
-```
-
-**Step 3: Render**
-```bash
-node scripts/render.mjs \
- --input my-workflow.mmd \
- --output my-workflow.svg \
- --theme github-dark
-```
-
-### Diagram Type Reference
-
-For detailed syntax and best practices, see [DIAGRAM_TYPES.md](references/DIAGRAM_TYPES.md).
-
-**Quick reference:**
-
-**Flowchart** - Processes, workflows, decision trees
-```mermaid
-flowchart LR
- A[Start] --> B{Decision}
- B -->|Yes| C[Action]
- B -->|No| D[End]
-```
-
-**Sequence** - API calls, interactions, message flows
-```mermaid
-sequenceDiagram
- User->>Server: Request
- Server-->>User: Response
-```
-
-**State** - Application states, lifecycle, FSM
-```mermaid
-stateDiagram-v2
- [*] --> Idle
- Idle --> Loading
- Loading --> [*]
-```
-
-**Class** - Object models, architecture, relationships
-```mermaid
-classDiagram
- User --> Post: creates
- Post --> Comment: has
-```
-
-**ER** - Database schema, data models
-```mermaid
-erDiagram
- USER ||--o{ ORDER : places
- ORDER ||--|{ ORDER_ITEM : contains
-```
-
-**XY Chart** - Bar charts, line charts, trends, and comparisons
-```mermaid
-xychart-beta
- title "Monthly Revenue"
- x-axis [Jan, Feb, Mar]
- bar [3200, 4100, 3800]
- line [3000, 3700, 4200]
-```
-
-Flowcharts and state diagrams support `linkStyle`; state names may contain CJK text. SVG output supports `<br>` multiline labels and simple `<b>`, `<i>`, `<u>`, and `<s>` inline formatting.
-
-### From User Requirements
-
-**Step 1: Identify diagram type**
-- **Process/workflow** → Flowchart
-- **API/interaction** → Sequence
-- **States/lifecycle** → State
-- **Object model** → Class
-- **Database** → ER
-- **Metrics/trends** → XY Chart
-
-**Step 2: Create diagram file**
-```bash
-cat > user-diagram.mmd << 'EOF'
-# [Insert generated Mermaid code]
-EOF
-```
-
-**Step 3: Render and iterate**
-```bash
-node scripts/render.mjs \
- --input user-diagram.mmd \
- --output preview.svg \
+ --output diagram.svg \
--theme tokyo-night
-
-# Review with user, edit diagram.mmd if needed, re-render
-```
-
----
-
-## Theming
-
-### List Available Themes
-
-```bash
-node scripts/themes.mjs
-```
-
-**Output:**
```
-Available Beautiful-Mermaid Themes:
-
- 1. zinc-light
- 2. zinc-dark
- 3. tokyo-night
- 4. tokyo-night-storm
- 5. tokyo-night-light
- 6. catppuccin-mocha
- 7. catppuccin-latte
- 8. nord
- 9. nord-light
-10. dracula
-11. github-light
-12. github-dark
-13. solarized-light
-14. solarized-dark
-15. one-dark
-
-Total: 15 themes
-```
-
-### Theme Selection Guide
-**For dark mode documentation:**
-- `tokyo-night` ⭐ - Modern, developer-friendly
-- `github-dark` - Familiar GitHub style
-- `dracula` - Vibrant, high contrast
-- `nord` - Cool, minimalist
-
-**For light mode documentation:**
-- `github-light` - Clean, professional
-- `zinc-light` - High contrast, printable
-- `catppuccin-latte` - Warm, friendly
-
-**Detailed theme information:** See [THEMES.md](references/THEMES.md)
-
-### Apply Theme to Diagram
+### Render terminal text
```bash
node scripts/render.mjs \
--input diagram.mmd \
- --output themed.svg \
- --theme tokyo-night
-```
-
-### Compare Themes
-
-Render the same diagram with multiple themes:
-```bash
-for theme in tokyo-night dracula github-dark; do
- node scripts/render.mjs \
- --input diagram.mmd \
- --output "diagram-${theme}.svg" \
- --theme "$theme"
-done
+ --output diagram.txt \
+ --format ascii \
+ --color-mode none
```
----
+Add `--use-ascii` when Unicode box-drawing characters are not acceptable.
-## Batch Rendering
+### Batch render a directory
-### Batch Render Directory
-
-**Step 1: Organize diagrams**
-```bash
-diagrams/
-├── architecture.mmd
-├── workflow.mmd
-└── database.mmd
-```
-
-**Step 2: Batch render**
```bash
node scripts/batch.mjs \
--input-dir ./diagrams \
--output-dir ./rendered \
--format svg \
- --theme tokyo-night \
+ --theme github-dark \
--workers 4
```
-**Output:**
-```
-Found 3 diagram(s) to render...
-✓ architecture.mmd
-✓ workflow.mmd
-✓ database.mmd
-
-3/3 diagrams rendered successfully
-```
-
-### Batch with Multiple Formats
-
-Render both SVG and ASCII:
-```bash
-# SVG for docs
-node scripts/batch.mjs \
- --input-dir ./diagrams \
- --output-dir ./svg \
- --format svg \
- --theme github-dark
-
-# ASCII for README
-node scripts/batch.mjs \
- --input-dir ./diagrams \
- --output-dir ./ascii \
- --format ascii \
- --use-ascii
-```
-
-### Performance Options
-
-- `--workers N` - Parallel rendering (default: 4)
-- Recommended: `--workers 8` for 10+ diagrams
+Use batch rendering for three or more diagrams or when consistent options must be applied to a directory.
----
+## Theme selection
-## Common Use Cases
+- General dark documentation: `tokyo-night`
+- GitHub dark or light surfaces: `github-dark`, `github-light`
+- Print and presentations: `zinc-light`
+- High-contrast color: `dracula`
+- Cool, restrained palette: `nord`, `nord-light`
-### 1. Architecture Diagram for Documentation
+Read `references/THEMES.md` or open `docs/THEME_GALLERY.md` when visual theme choice matters. A named theme can be refined with explicit color flags.
-```bash
-# User provides architecture description
-# → Create flowchart.mmd
-# → Render with professional theme
+## Useful options
-node scripts/render.mjs \
- --input architecture.mmd \
- --output docs/architecture.svg \
- --theme github-dark \
- --transparent
-```
+### Shared styling
-### 2. API Sequence Diagram
+| Option | Purpose |
+| --- | --- |
+| `--theme <name>` | Apply one of the 15 built-in themes |
+| `--bg`, `--fg` | Set required base colors |
+| `--line`, `--accent`, `--muted` | Refine connectors, highlights, and secondary text |
+| `--surface`, `--border` | Refine node fill and stroke |
+| `--font <name>` | Set the SVG font family |
-```bash
-# User describes API flow
-# → Create sequence.mmd
-# → Render with clear theme
+### SVG
-node scripts/render.mjs \
- --input api-flow.mmd \
- --output api-sequence.svg \
- --theme tokyo-night
-```
+| Option | Purpose |
+| --- | --- |
+| `--transparent` | Remove the SVG background |
+| `--padding <n>` | Set canvas padding |
+| `--node-spacing <n>` | Set horizontal node spacing |
+| `--layer-spacing <n>` | Set vertical layer spacing |
+| `--component-spacing <n>` | Separate disconnected components |
+| `--interactive` | Enable XY chart hover tooltips |
-### 3. Database Schema Visualization
+### Terminal output
-```bash
-# User provides table definitions
-# → Create er.mmd
-# → Render for database docs
+| Option | Purpose |
+| --- | --- |
+| `--use-ascii` | Replace Unicode box drawing with plain ASCII |
+| `--padding-x`, `--padding-y` | Tune diagram spacing |
+| `--box-border-padding` | Tune padding inside node boxes |
+| `--color-mode <mode>` | `none`, `auto`, `ansi16`, `ansi256`, `truecolor`, or `html` |
-node scripts/render.mjs \
- --input schema.mmd \
- --output database-schema.svg \
- --theme dracula
-```
+Run `node scripts/render.mjs --help` or `node scripts/batch.mjs --help` for the authoritative CLI list.
-### 4. Terminal-Friendly Workflow
+## Authoring guidance
-```bash
-# For README or terminal display
-node scripts/render.mjs \
- --input workflow.mmd \
- --format ascii \
- --use-ascii > workflow.txt
-```
+- Prefer short, concrete labels; preserve domain-specific terms from the user.
+- Use explicit edge labels when a branch or message is ambiguous.
+- Keep large diagrams readable by splitting unrelated concerns instead of shrinking text.
+- Use `LR` for wide flows and `TB` for narrow documents.
+- Avoid communicating meaning through color alone.
+- Use a light theme for print and confirm contrast against the final background.
+- For unfamiliar syntax, start from `assets/example_diagrams/` and consult the diagram reference.
-### 5. Presentation Slides
+## Validation
-```bash
-# High-contrast for projectors
-node scripts/render.mjs \
- --input slides-diagram.mmd \
- --output presentation.svg \
- --theme zinc-light
-```
+After rendering:
-### 6. Interactive Metrics Chart
+1. Confirm the command exits successfully and the output file is non-empty.
+2. Confirm SVG output begins with `<svg`; confirm text output contains visible diagram content.
+3. Inspect visual output when layout matters, especially long labels, CJK text, disconnected components, and XY charts.
+4. Confirm arrows, cardinalities, states, and labels match the source request.
+5. Report any renderer limitation instead of silently dropping unsupported syntax.
-```bash
-node scripts/render.mjs \
- --input metrics.mmd \
- --output metrics.svg \
- --theme github-light \
- --interactive
-```
-
----
+Run both `npm test` and `npm run validate` when changing this skill, its scripts, templates, or references.
## Troubleshooting
-### beautiful-mermaid Not Installed
-```
-Error: Cannot find module 'beautiful-mermaid'
-```
-**Note:** This should auto-install on first run. If it fails:
-```bash
-cd /path/to/pretty-mermaid-skill && npm install
-```
-
-### Invalid Mermaid Syntax
-```
-Error: Parse error on line 3
-```
-**Solution:**
-1. Validate syntax against [DIAGRAM_TYPES.md](references/DIAGRAM_TYPES.md)
-2. Test on https://mermaid.live/
-3. Check for common errors:
- - Missing spaces in `A --> B`
- - Incorrect node shape syntax
- - Unclosed brackets
-
-### File Not Found
-```
-Error: Input file not found: diagram.mmd
-```
-**Solution:** Verify file path is correct, use absolute path if needed
-
----
-
-## Resources
-
-### scripts/
-Executable Node.js scripts for rendering operations:
-- `render.mjs` - Main rendering script
-- `batch.mjs` - Batch processing script
-- `themes.mjs` - Theme listing utility
-
-### references/
-Documentation to inform diagram creation:
-- `THEMES.md` - Detailed theme reference with examples
-- `DIAGRAM_TYPES.md` - Comprehensive syntax guide for all diagram types
-- `api_reference.md` - beautiful-mermaid API documentation
-
-### assets/
-Template files for quick diagram creation:
-- `example_diagrams/flowchart.mmd` - Flowchart template
-- `example_diagrams/sequence.mmd` - Sequence diagram template
-- `example_diagrams/state.mmd` - State diagram template
-- `example_diagrams/class.mmd` - Class diagram template
-- `example_diagrams/er.mmd` - ER diagram template
-- `example_diagrams/xychart.mmd` - XY bar and line chart template
-
----
-
-## Tips & Best Practices
-
-### Performance
-- Batch render for 3+ diagrams (parallel processing)
-- Keep diagrams under 50 nodes for fast rendering
-- Use ASCII for quick previews
-
-### Quality
-- Use `tokyo-night` or `github-dark` for technical docs
-- Add transparency for dark/light mode compatibility: `--transparent`
-- Test theme in target environment before batch rendering
-
-### Workflow
-1. Start with templates from `assets/example_diagrams/`
-2. Iterate with user feedback
-3. Apply theme last
-4. Render both SVG (docs) and ASCII (README) if needed
-
-### Accessibility
-- Use high-contrast themes for presentations
-- Add text labels to all connections
-- Avoid color-only information encoding
+- Missing dependency: run `npm install` in `<skill-root>`; the CLI also attempts a first-run install.
+- Unknown theme: run `node scripts/themes.mjs` and use an exact listed name.
+- Parse error: consult `references/DIAGRAM_TYPES.md`, reduce to the failing statement, then restore the diagram incrementally.
+- Crowded SVG: increase `--node-spacing`, `--layer-spacing`, or `--component-spacing`.
+- Terminal color escape codes in redirected output: use `--color-mode none`.
+
+## Reference routing
+
+| Resource | Read or use when |
+| --- | --- |
+| `references/DIAGRAM_TYPES.md` | Authoring or debugging Mermaid syntax |
+| `references/THEMES.md` | Comparing themes or defining custom colors |
+| `references/api_reference.md` | Extending scripts or calling `beautiful-mermaid` directly |
+| `docs/THEME_GALLERY.md` | Choosing a theme visually |
+| `assets/example_diagrams/` | Starting from a supported diagram template |
+| `scripts/render.mjs` | Rendering one diagram |
+| `scripts/batch.mjs` | Rendering a directory in parallel |
+| `scripts/themes.mjs` | Listing installed themes |
diff --git a/assets/theme_gallery/catppuccin-latte.svg b/assets/theme_gallery/catppuccin-latte.svg
new file mode 100644
index 0000000..f695a19
--- /dev/null
+++ b/assets/theme_gallery/catppuccin-latte.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#eff1f5;--fg:#4c4f69;--line:#9ca0b0;--accent:#8839ef;--muted:#9ca0b0;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/catppuccin-mocha.svg b/assets/theme_gallery/catppuccin-mocha.svg
new file mode 100644
index 0000000..a0eb28c
--- /dev/null
+++ b/assets/theme_gallery/catppuccin-mocha.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#1e1e2e;--fg:#cdd6f4;--line:#585b70;--accent:#cba6f7;--muted:#6c7086;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/dracula.svg b/assets/theme_gallery/dracula.svg
new file mode 100644
index 0000000..febe8fc
--- /dev/null
+++ b/assets/theme_gallery/dracula.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#282a36;--fg:#f8f8f2;--line:#6272a4;--accent:#bd93f9;--muted:#6272a4;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/github-dark.svg b/assets/theme_gallery/github-dark.svg
new file mode 100644
index 0000000..623503f
--- /dev/null
+++ b/assets/theme_gallery/github-dark.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#0d1117;--fg:#e6edf3;--line:#3d444d;--accent:#4493f8;--muted:#9198a1;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/github-light.svg b/assets/theme_gallery/github-light.svg
new file mode 100644
index 0000000..d401d0c
--- /dev/null
+++ b/assets/theme_gallery/github-light.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#ffffff;--fg:#1f2328;--line:#d1d9e0;--accent:#0969da;--muted:#59636e;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/nord-light.svg b/assets/theme_gallery/nord-light.svg
new file mode 100644
index 0000000..54f079e
--- /dev/null
+++ b/assets/theme_gallery/nord-light.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#eceff4;--fg:#2e3440;--line:#aab1c0;--accent:#5e81ac;--muted:#7b88a1;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/nord.svg b/assets/theme_gallery/nord.svg
new file mode 100644
index 0000000..c387f8b
--- /dev/null
+++ b/assets/theme_gallery/nord.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#2e3440;--fg:#d8dee9;--line:#4c566a;--accent:#88c0d0;--muted:#616e88;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/one-dark.svg b/assets/theme_gallery/one-dark.svg
new file mode 100644
index 0000000..a48d662
--- /dev/null
+++ b/assets/theme_gallery/one-dark.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#282c34;--fg:#abb2bf;--line:#4b5263;--accent:#c678dd;--muted:#5c6370;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/solarized-dark.svg b/assets/theme_gallery/solarized-dark.svg
new file mode 100644
index 0000000..96f1d61
--- /dev/null
+++ b/assets/theme_gallery/solarized-dark.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#002b36;--fg:#839496;--line:#586e75;--accent:#268bd2;--muted:#586e75;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/solarized-light.svg b/assets/theme_gallery/solarized-light.svg
new file mode 100644
index 0000000..e1aabd4
--- /dev/null
+++ b/assets/theme_gallery/solarized-light.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#fdf6e3;--fg:#657b83;--line:#93a1a1;--accent:#268bd2;--muted:#93a1a1;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/source.mmd b/assets/theme_gallery/source.mmd
new file mode 100644
index 0000000..ccdff33
--- /dev/null
+++ b/assets/theme_gallery/source.mmd
@@ -0,0 +1,5 @@
+flowchart LR
+ Idea([Idea]) --> Write[Write Mermaid]
+ Write --> Output{Choose Output}
+ Output -->|Docs| SVG[Themed SVG]
+ Output -->|Terminal| ASCII[ASCII / Unicode]
diff --git a/assets/theme_gallery/tokyo-night-light.svg b/assets/theme_gallery/tokyo-night-light.svg
new file mode 100644
index 0000000..da39ca2
--- /dev/null
+++ b/assets/theme_gallery/tokyo-night-light.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#d5d6db;--fg:#343b58;--line:#34548a;--accent:#34548a;--muted:#9699a3;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/tokyo-night-storm.svg b/assets/theme_gallery/tokyo-night-storm.svg
new file mode 100644
index 0000000..0793a4b
--- /dev/null
+++ b/assets/theme_gallery/tokyo-night-storm.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#24283b;--fg:#a9b1d6;--line:#3d59a1;--accent:#7aa2f7;--muted:#565f89;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/tokyo-night.svg b/assets/theme_gallery/tokyo-night.svg
new file mode 100644
index 0000000..f68b728
--- /dev/null
+++ b/assets/theme_gallery/tokyo-night.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#1a1b26;--fg:#a9b1d6;--line:#3d59a1;--accent:#7aa2f7;--muted:#565f89;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/zinc-dark.svg b/assets/theme_gallery/zinc-dark.svg
new file mode 100644
index 0000000..4a169cc
--- /dev/null
+++ b/assets/theme_gallery/zinc-dark.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#18181B;--fg:#FAFAFA;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/assets/theme_gallery/zinc-light.svg b/assets/theme_gallery/zinc-light.svg
new file mode 100644
index 0000000..2f4c054
--- /dev/null
+++ b/assets/theme_gallery/zinc-light.svg
@@ -0,0 +1,61 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 742.8330000000001 207.165" width="742.8330000000001" height="207.165" style="--bg:#FFFFFF;--fg:#27272A;background:var(--bg)">
+<style>
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&amp;display=swap');
+ text { font-family: 'Inter', system-ui, sans-serif; }
+ svg {
+ /* Derived from --bg and --fg (overridable via --line, --accent, etc.) */
+ --_text: var(--fg);
+ --_text-sec: var(--muted, color-mix(in srgb, var(--fg) 60%, var(--bg)));
+ --_text-muted: var(--muted, color-mix(in srgb, var(--fg) 40%, var(--bg)));
+ --_text-faint: color-mix(in srgb, var(--fg) 25%, var(--bg));
+ --_line: var(--line, color-mix(in srgb, var(--fg) 50%, var(--bg)));
+ --_arrow: var(--accent, color-mix(in srgb, var(--fg) 85%, var(--bg)));
+ --_node-fill: var(--surface, color-mix(in srgb, var(--fg) 3%, var(--bg)));
+ --_node-stroke: var(--border, color-mix(in srgb, var(--fg) 20%, var(--bg)));
+ --_group-fill: var(--bg);
+ --_group-hdr: color-mix(in srgb, var(--fg) 5%, var(--bg));
+ --_inner-stroke: color-mix(in srgb, var(--fg) 12%, var(--bg));
+ --_key-badge: color-mix(in srgb, var(--fg) 10%, var(--bg));
+ }
+</style>
+<defs>
+ <marker id="arrowhead" markerWidth="8" markerHeight="5" refX="7" refY="2.5" orient="auto">
+ <polygon points="0 0, 8 2.5, 0 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+ <marker id="arrowhead-start" markerWidth="8" markerHeight="5" refX="1" refY="2.5" orient="auto-start-reverse">
+ <polygon points="8 0, 0 2.5, 8 5" fill="var(--_arrow)" stroke="var(--_arrow)" stroke-width="0.75" stroke-linejoin="round" />
+ </marker>
+</defs>
+<polyline class="edge" data-from="Idea" data-to="Write" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="95.14399999999999,103.5825 135.144,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Write" data-to="Output" data-style="solid" data-arrow-start="false" data-arrow-end="true" points="260.827,103.5825 300.827,103.5825" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="SVG" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Docs" points="426.7978333333333,78.38833333333332 479.99199999999996,78.38833333333332 479.99199999999996,73.1325 574.9060000000001,73.1325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<polyline class="edge" data-from="Output" data-to="ASCII" data-style="solid" data-arrow-start="false" data-arrow-end="true" data-label="Terminal" points="426.7978333333333,128.77666666666664 479.9920000000001,128.77666666666664 479.9920000000001,134.0325 574.9060000000001,134.0325" fill="none" stroke="var(--_line)" stroke-width="1" marker-end="url(#arrowhead)" />
+<g class="edge-label" data-from="Output" data-to="SVG" data-label="Docs">
+ <rect x="487.99199999999996" y="57.1325" width="42.598" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="509.29099999999994" y="72.2825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Docs</text>
+</g>
+<g class="edge-label" data-from="Output" data-to="ASCII" data-label="Terminal">
+ <rect x="487.9920000000001" y="118.0325" width="59.23000000000001" height="30.3" rx="2" ry="2" fill="var(--bg)" stroke="var(--_inner-stroke)" stroke-width="1" />
+ <text x="517.6070000000001" y="133.1825" text-anchor="middle" font-size="11" font-weight="400" fill="var(--_text-sec)" dy="3.8499999999999996">Terminal</text>
+</g>
+<g class="node" data-id="Idea" data-label="Idea" data-shape="stadium">
+ <rect x="28" y="85.1325" width="67.14399999999999" height="36.900000000000006" rx="18.450000000000003" ry="18.450000000000003" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="61.571999999999996" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Idea</text>
+</g>
+<g class="node" data-id="Write" data-label="Write Mermaid" data-shape="rectangle">
+ <rect x="135.144" y="85.1325" width="125.68299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="197.9855" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Write Mermaid</text>
+</g>
+<g class="node" data-id="Output" data-label="Choose Output" data-shape="diamond">
+ <polygon points="376.4095,28 451.99199999999996,103.5825 376.4095,179.165 300.827,103.5825" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="376.4095" y="103.5825" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Choose Output</text>
+</g>
+<g class="node" data-id="SVG" data-label="Themed SVG" data-shape="rectangle">
+ <rect x="574.9060000000001" y="54.68249999999999" width="118.27299999999998" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="634.0425" y="73.1325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">Themed SVG</text>
+</g>
+<g class="node" data-id="ASCII" data-label="ASCII / Unicode" data-shape="rectangle">
+ <rect x="574.9060000000001" y="115.5825" width="131.611" height="36.900000000000006" rx="0" ry="0" fill="var(--_node-fill)" stroke="var(--_node-stroke)" stroke-width="0.75" />
+ <text x="640.7115000000001" y="134.0325" text-anchor="middle" font-size="13" font-weight="500" fill="var(--_text)" dy="4.55">ASCII / Unicode</text>
+</g>
+</svg>
\ No newline at end of file
diff --git a/docs/THEME_GALLERY.md b/docs/THEME_GALLERY.md
new file mode 100644
index 0000000..3d653c8
--- /dev/null
+++ b/docs/THEME_GALLERY.md
@@ -0,0 +1,61 @@
+# Pretty Mermaid Theme Gallery
+
+Use this gallery to compare every built-in theme against the same flowchart. Light themes work well for print and white documentation surfaces; dark themes work well for developer tools, dark READMEs, and presentations. The shared Mermaid source is available in `assets/theme_gallery/source.mmd`.
+
+Regenerate all previews after a theme or renderer change:
+
+```bash
+npm run gallery
+```
+
+## Light themes
+
+| `zinc-light` | `tokyo-night-light` |
+| --- | --- |
+| ![zinc-light theme](../assets/theme_gallery/zinc-light.svg) | ![tokyo-night-light theme](../assets/theme_gallery/tokyo-night-light.svg) |
+
+| `catppuccin-latte` | `nord-light` |
+| --- | --- |
+| ![catppuccin-latte theme](../assets/theme_gallery/catppuccin-latte.svg) | ![nord-light theme](../assets/theme_gallery/nord-light.svg) |
+
+| `github-light` | `solarized-light` |
+| --- | --- |
+| ![github-light theme](../assets/theme_gallery/github-light.svg) | ![solarized-light theme](../assets/theme_gallery/solarized-light.svg) |
+
+## Dark themes
+
+| `zinc-dark` | `tokyo-night` |
+| --- | --- |
+| ![zinc-dark theme](../assets/theme_gallery/zinc-dark.svg) | ![tokyo-night theme](../assets/theme_gallery/tokyo-night.svg) |
+
+| `tokyo-night-storm` | `catppuccin-mocha` |
+| --- | --- |
+| ![tokyo-night-storm theme](../assets/theme_gallery/tokyo-night-storm.svg) | ![catppuccin-mocha theme](../assets/theme_gallery/catppuccin-mocha.svg) |
+
+| `nord` | `dracula` |
+| --- | --- |
+| ![nord theme](../assets/theme_gallery/nord.svg) | ![dracula theme](../assets/theme_gallery/dracula.svg) |
+
+| `github-dark` | `solarized-dark` |
+| --- | --- |
+| ![github-dark theme](../assets/theme_gallery/github-dark.svg) | ![solarized-dark theme](../assets/theme_gallery/solarized-dark.svg) |
+
+| `one-dark` | |
+| --- | --- |
+| ![one-dark theme](../assets/theme_gallery/one-dark.svg) | |
+
+## Custom colors
+
+Use a built-in theme as a starting point or supply explicit colors:
+
+```bash
+node scripts/render.mjs \
+ --input diagram.mmd \
+ --output custom.svg \
+ --bg '#0f172a' \
+ --fg '#e2e8f0' \
+ --accent '#38bdf8' \
+ --line '#818cf8'
+```
+
+See the [theme reference](../references/THEMES.md) for every color role and selection guidance.
diff --git a/package-lock.json b/package-lock.json
index a39d0f1..bca8df3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,6 +14,9 @@
"batch-mermaid": "scripts/batch.mjs",
"list-mermaid-themes": "scripts/themes.mjs",
"render-mermaid": "scripts/render.mjs"
+ },
+ "engines": {
+ "node": ">=16"
}
},
"node_modules/beautiful-mermaid": {
diff --git a/package.json b/package.json
index c5cc82a..fac06e7 100644
--- a/package.json
+++ b/package.json
@@ -8,8 +8,13 @@
"batch-mermaid": "./scripts/batch.mjs",
"list-mermaid-themes": "./scripts/themes.mjs"
},
+ "engines": {
+ "node": ">=16"
+ },
"scripts": {
- "test": "node scripts/smoke-test.mjs"
+ "gallery": "node scripts/generate-theme-gallery.mjs",
+ "test": "node scripts/smoke-test.mjs",
+ "validate": "node scripts/validate-docs.mjs"
},
"dependencies": {
"beautiful-mermaid": "^1.1.3"
diff --git a/references/DIAGRAM_TYPES.md b/references/DIAGRAM_TYPES.md
index 0084f5e..4a7f6c1 100644
--- a/references/DIAGRAM_TYPES.md
+++ b/references/DIAGRAM_TYPES.md
@@ -1,5 +1,15 @@
# Mermaid Diagram Types Reference
+## Contents
+
+- [Flowchart / Graph](#flowchart--graph)
+- [Sequence Diagram](#sequence-diagram)
+- [State Diagram](#state-diagram)
+- [Class Diagram](#class-diagram)
+- [ER Diagram](#er-diagram)
+- [XY Chart](#xy-chart)
+- [General Best Practices](#general-best-practices)
+
## Flowchart / Graph
### Basic Syntax
diff --git a/references/THEMES.md b/references/THEMES.md
index b766413..66107d2 100644
--- a/references/THEMES.md
+++ b/references/THEMES.md
@@ -2,6 +2,16 @@
Beautiful-Mermaid 提供 15 个精心设计的内置主题,涵盖亮色和暗色方案。每个主题都基于两种核心颜色(背景 `bg` 和前景 `fg`),并可通过可选的丰富色彩进行增强。
+## 目录
+
+- [快速选择指南](#快速选择指南)
+- [主题详细说明](#主题详细说明)
+- [自定义主题](#自定义主题)
+- [主题选择决策树](#主题选择决策树)
+- [实用示例](#实用示例)
+- [颜色值速查表](#颜色值速查表)
+- [常见问题](#常见问题)
+
## 快速选择指南
### 亮色主题
diff --git a/scripts/generate-theme-gallery.mjs b/scripts/generate-theme-gallery.mjs
new file mode 100644
index 0000000..c8b2a27
--- /dev/null
+++ b/scripts/generate-theme-gallery.mjs
@@ -0,0 +1,44 @@
+#!/usr/bin/env node
+
+import { execFileSync } from 'node:child_process';
+import {
+ mkdirSync,
+ readFileSync,
+ readdirSync,
+ unlinkSync,
+} from 'node:fs';
+import { dirname, join } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { THEMES } from 'beautiful-mermaid';
+
+const scriptsDir = dirname(fileURLToPath(import.meta.url));
+const skillRoot = join(scriptsDir, '..');
+const outputDir = join(skillRoot, 'assets', 'theme_gallery');
+const input = join(outputDir, 'source.mmd');
+const renderer = join(scriptsDir, 'render.mjs');
+const themes = Object.keys(THEMES);
+
+mkdirSync(outputDir, { recursive: true });
+
+for (const file of readdirSync(outputDir)) {
+ if (file.endsWith('.svg')) {
+ unlinkSync(join(outputDir, file));
+ }
+}
+
+for (const theme of themes) {
+ const output = join(outputDir, `${theme}.svg`);
+ execFileSync(process.execPath, [
+ renderer,
+ '--input', input,
+ '--output', output,
+ '--theme', theme,
+ '--padding', '28',
+ ], { stdio: 'inherit' });
+
+ if (!readFileSync(output, 'utf8').startsWith('<svg')) {
+ throw new Error(`Gallery render did not produce SVG: ${theme}`);
+ }
+}
+
+console.log(`Generated ${themes.length} theme previews in assets/theme_gallery/`);
diff --git a/scripts/validate-docs.mjs b/scripts/validate-docs.mjs
new file mode 100644
index 0000000..dea9e05
--- /dev/null
+++ b/scripts/validate-docs.mjs
@@ -0,0 +1,86 @@
+#!/usr/bin/env node
+
+import assert from 'node:assert/strict';
+import {
+ existsSync,
+ readFileSync,
+ readdirSync,
+ statSync,
+} from 'node:fs';
+import { dirname, join, resolve } from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { THEMES } from 'beautiful-mermaid';
+
+const scriptsDir = dirname(fileURLToPath(import.meta.url));
+const skillRoot = join(scriptsDir, '..');
+const ignoredDirectories = new Set(['.git', 'node_modules']);
+
+function collectMarkdownFiles(directory) {
+ const files = [];
+ for (const entry of readdirSync(directory)) {
+ if (ignoredDirectories.has(entry)) continue;
+ const path = join(directory, entry);
+ if (statSync(path).isDirectory()) {
+ files.push(...collectMarkdownFiles(path));
+ } else if (entry.endsWith('.md')) {
+ files.push(path);
+ }
+ }
+ return files;
+}
+
+function localTargets(markdown) {
+ const targets = [];
+ const patterns = [
+ /!?\[[^\]]*\]\(([^)]+)\)/g,
+ /(?:src|href)="([^"]+)"/g,
+ ];
+
+ for (const pattern of patterns) {
+ for (const match of markdown.matchAll(pattern)) {
+ const target = match[1].trim().replace(/^<|>$/g, '');
+ if (
+ !target ||
+ target.startsWith('#') ||
+ /^[a-z][a-z0-9+.-]*:/i.test(target)
+ ) {
+ continue;
+ }
+ targets.push(decodeURIComponent(target.split('#')[0].split('?')[0]));
+ }
+ }
+ return targets;
+}
+
+const skillPath = join(skillRoot, 'SKILL.md');
+const skill = readFileSync(skillPath, 'utf8');
+const skillLines = skill.split('\n').length;
+
+assert.match(skill, /^---\nname: pretty-mermaid\ndescription: \|\n/);
+assert.ok(skillLines < 500, `SKILL.md must stay below 500 lines; found ${skillLines}`);
+
+const markdownFiles = collectMarkdownFiles(skillRoot);
+for (const file of markdownFiles) {
+ const markdown = readFileSync(file, 'utf8');
+ for (const target of localTargets(markdown)) {
+ const path = resolve(dirname(file), target);
+ assert.ok(existsSync(path), `${file} links to missing local target: ${target}`);
+ }
+ assert.doesNotMatch(markdown, /(?:render_mermaid|batch_render)\.py/);
+}
+
+const expectedThemes = Object.keys(THEMES).sort();
+const galleryDir = join(skillRoot, 'assets', 'theme_gallery');
+const galleryThemes = readdirSync(galleryDir)
+ .filter(file => file.endsWith('.svg'))
+ .map(file => file.slice(0, -4))
+ .sort();
+
+assert.deepEqual(galleryThemes, expectedThemes, 'Theme gallery must match built-in themes');
+assert.equal(expectedThemes.length, 15, 'Expected 15 built-in themes');
+
+for (const name of ['README.md', 'README_CN.md', 'README_JA.md']) {
+ assert.ok(existsSync(join(skillRoot, name)), `Missing ${name}`);
+}
+
+console.log(`Documentation valid: ${markdownFiles.length} Markdown files, ${skillLines} Skill lines, ${galleryThemes.length} theme previews.`);