Skip to content

AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.

feat(demo): display three distinct Mermaid diagram types in overview note

tianma-if294851e496cc
diff --git a/apps/api/src/index.ts b/apps/api/src/index.ts
index a63b60c5..903b0e91 100644
--- a/apps/api/src/index.ts
+++ b/apps/api/src/index.ts
@@ -304,7 +304,7 @@ const DEMO_SEED_MEMOS_ZH = [
tags: ["overview", "features", "demo"],
isPinned: true,
markdown:
- "## 🌟 EdgeEver 核心特性全景指南\n\n> **EdgeEver** 是一款基于 Cloudflare 的开源 Serverless 个人知识库。保留经典的**印象笔记三栏布局**与优雅体验,同时提供 **100% 免费**、数据完全掌控、可视化双向编辑与 AI Agent (MCP) 原生集成。\n\n---\n\n### 🚀 1. 核心优势对比 (可视化表格编辑)\n\n*提示:在线模式下点击下方表格单元格即可直接修改文字;在编辑器模式下右键可快捷添加或删除行列。*\n\n| 核心维度 | 印象笔记 (Evernote) | Obsidian | EdgeEver |\n| --- | --- | --- | --- |\n| **托管成本** | 商业订阅 ($15+/月) | 官方同步 ($5/月) | **100% 免费 (Cloudflare 免费额度)** |\n| **部署方式** | 封闭中心化云端 | 本地文件 + 插件配置 | **Serverless 自建 (零维护)** |\n| **交互体验** | 经典三栏 (广告较多) | 双栏/多面板 (移动端较重) | **经典三栏 + 原生 App / PWA** |\n| **数据与 API** | 封闭,导出一键设限 | 本地 Markdown | **标准 D1 SQLite / REST API / MCP** |\n| **AI Agent 支持** | 限制/仅特定版本 | 需配置第三方插件 | **原生支持 MCP 端点与 OpenAPI** |\n\n---\n\n### 🎨 2. 双向双视图与富文本排版 (Rich-Text & Dual View)\n\nEdgeEver 支持在**所见即所得富文本**与 **Markdown 源码**之间无缝切换(点击右上角 `</>` 按钮)。\n\n- [x] 经典三栏笔记本与树状无限层级\n- [x] 多端无缝同步(Web PWA / iOS & Android 原生 App)\n- [x] 图片上传前本地自动压缩 (体积节省 50% ~ 90%)\n- [x] 碎片笔记多选合并 (Shift / Cmd 组合键操作)\n\n> 💡 **小贴士**:所有富文本样式在切换至 Markdown 源码时均能保持完美兼容,不会丢失任何格式元数据。\n\n---\n\n### 💻 3. 代码高亮与快捷复制 (Syntax Highlighting)\n\n支持 Python、TypeScript、Rust、SQL 等数十种编程语言高亮,并在右上角提供一键复制功能:\n\n```python\nimport requests\n\n# 使用 REST API 获取 EdgeEver 笔记本列表\ndef fetch_edgeever_notebooks(instance_url: str, token: str):\n headers = {\"Authorization\": f\"Bearer {token}\"}\n response = requests.get(f\"{instance_url}/api/v1/notebooks\", headers=headers)\n \n if response.status_code == 200:\n data = response.json()\n print(f\"成功加载 {len(data['data'])} 个笔记本!\")\n return data[\"data\"]\n return []\n```\n\n---\n\n### 📊 4. Mermaid 图表即时渲染 (Interactive Diagrams)\n\n在代码块中使用 `mermaid` 语法,即可在富文本视图与预览界面实时渲染交互式流程图:\n\n```mermaid\nflowchart TD\n subgraph Client[\"📱 客户端生态\"]\n A[\"Web / PWA 浏览器\"]\n B[\"iOS / Android 原生 App\"]\n C[\"Chrome / Edge 剪藏插件\"]\n end\n\n subgraph EdgeEver[\"⚡ EdgeEver Cloudflare Backend\"]\n D[\"Cloudflare Workers API Engine\"]\n E[(\"D1 Database SQLite\")]\n F[(\"R2 Storage 图片与附件\")]\n end\n\n subgraph AIAgent[\"🤖 AI & 智能体生态\"]\n G[\"Claude Code / Antigravity / Cursor\"]\n H[\"Model Context Protocol (MCP)\"]\n end\n\n A & B & C --> D\n D <--> E & F\n G -->|\"/mcp 端点\"| H --> D\n```\n\n---\n\n### 🖼️ 5. 多媒体与图片集成 (Rich Media Integration)\n\n支持拖拽或粘贴插入图片与文件附件。本地浏览器会在上传前自动进行高保真 WebP 压缩:\n\n![EdgeEver 编辑器与系统架构](/api/v1/resources/res_demo_editor_image/blob)\n\n---\n\n### 🤖 6. 面向 AI Agent 的原生生态 (Agent-Ready)\n\nEdgeEver 为 AI 时代而设计,原生提供 MCP 端点:\n\n1. **REST API**:提供完整标准的 `/api/openapi.json` 定义。\n2. **MCP 端点**:部署在 `/mcp`,AI Agent(如 Antigravity, Claude Code, Cursor)可以直接连接并读写您的笔记库。\n3. **数据自动化**:实现自动归档、Markdown 导入导出、飞书多维表格 / Notion 数据库同步。\n\n---\n\n> 🎯 **快速体验建议**:\n> - 试试在左侧列表中按住 `Cmd` / `Ctrl` 选中多篇笔记,点击底栏「合并」;\n> - 试试切换右上角 Markdown 源码模式,感受纯净的写作体验!",
+ "## 🌟 EdgeEver 核心特性全景指南\n\n> **EdgeEver** 是一款基于 Cloudflare 的开源 Serverless 个人知识库。保留经典的**印象笔记三栏布局**与优雅体验,同时提供 **100% 免费**、数据完全掌控、可视化双向编辑与 AI Agent (MCP) 原生集成。\n\n---\n\n### 🚀 1. 核心优势对比 (可视化表格编辑)\n\n*提示:在线模式下点击下方表格单元格即可直接修改文字;在编辑器模式下右键可快捷添加或删除行列。*\n\n| 核心维度 | 印象笔记 (Evernote) | Obsidian | EdgeEver |\n| --- | --- | --- | --- |\n| **托管成本** | 商业订阅 ($15+/月) | 官方同步 ($5/月) | **100% 免费 (Cloudflare 免费额度)** |\n| **部署方式** | 封闭中心化云端 | 本地文件 + 插件配置 | **Serverless 自建 (零维护)** |\n| **交互体验** | 经典三栏 (广告较多) | 双栏/多面板 (移动端较重) | **经典三栏 + 原生 App / PWA** |\n| **数据与 API** | 封闭,导出一键设限 | 本地 Markdown | **标准 D1 SQLite / REST API / MCP** |\n| **AI Agent 支持** | 限制/仅特定版本 | 需配置第三方插件 | **原生支持 MCP 端点与 OpenAPI** |\n\n---\n\n### 🎨 2. 双向双视图与富文本排版 (Rich-Text & Dual View)\n\nEdgeEver 支持在**所见即所得富文本**与 **Markdown 源码**之间无缝切换(点击右上角 `</>` 按钮)。\n\n- [x] 经典三栏笔记本与树状无限层级\n- [x] 多端无缝同步(Web PWA / iOS & Android 原生 App)\n- [x] 图片上传前本地自动压缩 (体积节省 50% ~ 90%)\n- [x] 碎片笔记多选合并 (Shift / Cmd 组合键操作)\n\n> 💡 **小贴士**:所有富文本样式在切换至 Markdown 源码时均能保持完美兼容,不会丢失任何格式元数据。\n\n---\n\n### 💻 3. 代码高亮与快捷复制 (Syntax Highlighting)\n\n支持 Python、TypeScript、Rust、SQL 等数十种编程语言高亮,并在右上角提供一键复制功能:\n\n```python\nimport requests\n\n# 使用 REST API 获取 EdgeEver 笔记本列表\ndef fetch_edgeever_notebooks(instance_url: str, token: str):\n headers = {\"Authorization\": f\"Bearer {token}\"}\n response = requests.get(f\"{instance_url}/api/v1/notebooks\", headers=headers)\n \n if response.status_code == 200:\n data = response.json()\n print(f\"成功加载 {len(data['data'])} 个笔记本!\")\n return data[\"data\"]\n return []\n```\n\n---\n\n### 📊 4. Mermaid 图表即时渲染 (Interactive Diagrams)\n\n在代码块中使用 `mermaid` 标记,即可在富文本与预览界面中即时渲染多种常见的交互式图表:\n\n#### 1️⃣ 架构流程图 (Flowchart)\n```mermaid\nflowchart TD\n subgraph Client[\"📱 客户端生态\"]\n A[\"Web / PWA 浏览器\"]\n B[\"iOS / Android 原生 App\"]\n end\n\n subgraph Backend[\"⚡ Cloudflare 后端服务\"]\n C[\"Cloudflare Workers API\"]\n D[(\"D1 SQLite 数据库\")]\n E[(\"R2 资源存储\")]\n end\n\n A & B --> C\n C <--> D & E\n```\n\n#### 2️⃣ 交互时序图 (Sequence Diagram)\n```mermaid\nsequenceDiagram\n autonumber\n actor User as 用户\n participant App as 客户端 App\n participant Worker as Cloudflare Worker API\n participant D1 as D1 数据库\n\n User->>App: 编辑并保存笔记\n App->>Worker: POST /api/v1/memos (提交更改)\n Worker->>D1: 写入笔记 & 更新修订版本\n D1-->>Worker: 返回成功 (revision + 1)\n Worker-->>App: 200 OK (同步最新游标)\n App-->>User: 界面显示「已保存」\n```\n\n#### 3️⃣ 状态转换图 (State Diagram)\n```mermaid\nstateDiagram-v2\n [*] --> 草稿箱: 新建笔记\n 草稿箱 --> 已发布: 保存并归档\n 已发布 --> 置顶笔记: 快捷置顶\n 置顶笔记 --> 已发布: 取消置顶\n 已发布 --> 回收站: 移入回收站\n 回收站 --> 已发布: 恢复笔记\n 回收站 --> [*]: 彻底删除\n```\n\n---\n\n### 🖼️ 5. 多媒体与图片集成 (Rich Media Integration)\n\n支持拖拽或粘贴插入图片与文件附件。本地浏览器会在上传前自动进行高保真 WebP 压缩:\n\n![EdgeEver 编辑器与系统架构](/api/v1/resources/res_demo_editor_image/blob)\n\n---\n\n### 🤖 6. 面向 AI Agent 的原生生态 (Agent-Ready)\n\nEdgeEver 为 AI 时代而设计,原生提供 MCP 端点:\n\n1. **REST API**:提供完整标准的 `/api/openapi.json` 定义。\n2. **MCP 端点**:部署在 `/mcp`,AI Agent(如 Antigravity, Claude Code, Cursor)可以直接连接并读写您的笔记库。\n3. **数据自动化**:实现自动归档、Markdown 导入导出、飞书多维表格 / Notion 数据库同步。\n\n---\n\n> 🎯 **快速体验建议**:\n> - 试试在左侧列表中按住 `Cmd` / `Ctrl` 选中多篇笔记,点击底栏「合并」;\n> - 试试切换右上角 Markdown 源码模式,感受纯净的写作体验!",
},
];
const DEMO_SEED_REVISIONS = [
@@ -334,7 +334,7 @@ const DEMO_MEMO_ENGLISH = {
memo_demo_overview: {
title: "🌟 EdgeEver Core Features Overview",
markdown:
- "## 🌟 EdgeEver Core Features Overview\n\n> **EdgeEver** is an open-source, serverless personal knowledge base built on Cloudflare. It retains the classic **Evernote-style three-pane layout**, while offering **100% free hosting**, full data ownership, visual editing, and native AI Agent (MCP) integration.\n\n---\n\n### 🚀 1. Feature Comparison (Visual Table Editing)\n\n*Tip: Click any cell in the table below to edit directly; right-click in editor mode to insert/delete rows or columns.*\n\n| Metric | Evernote | Obsidian | EdgeEver |\n| --- | --- | --- | --- |\n| **Hosting Cost** | Commercial ($15+/mo) | Sync Plan ($5/mo) | **100% Free (Cloudflare Free Tier)** |\n| **Deployment** | Closed Cloud | Local Files + Plugins | **Serverless Self-Hosted (0 Maintenance)** |\n| **User Experience**| Classic 3-Pane (Heavy Ads) | Multi-Pane (Heavy Mobile) | **Classic 3-Pane + Native Apps & PWA** |\n| **Data & API** | Proprietary & Locked | Local Markdown | **Standard D1 SQLite / REST API / MCP** |\n| **AI Integration** | Limited / Paid | Requires 3rd Party Plugins| **Native MCP Endpoint & OpenAPI** |\n\n---\n\n### 🎨 2. Dual-View & Rich Formatting\n\nSeamlessly toggle between **WYSIWYG Rich Text** and **Markdown Source** via the `</>` toggle in the top right.\n\n- [x] Classic three-pane layout with infinite notebook hierarchy\n- [x] Seamless multi-device sync (Web PWA / iOS & Android Native Apps)\n- [x] Automatic client-side image compression (saves 50% ~ 90% bandwidth)\n- [x] Multi-note batch merging (Shift / Cmd click)\n\n> 💡 **Tip**: All rich text formatting remains 100% compatible when toggling to Markdown mode.\n\n---\n\n### 💻 3. Syntax Highlighting\n\nSupports dozens of programming languages (Python, TypeScript, Rust, SQL, etc.) with one-click code copying:\n\n```python\nimport requests\n\n# Fetch EdgeEver notebooks via REST API\ndef fetch_edgeever_notebooks(instance_url: str, token: str):\n headers = {\"Authorization\": f\"Bearer {token}\"}\n response = requests.get(f\"{instance_url}/api/v1/notebooks\", headers=headers)\n \n if response.status_code == 200:\n data = response.json()\n print(f\"Successfully fetched {len(data['data'])} notebooks!\")\n return data[\"data\"]\n return []\n```\n\n---\n\n### 📊 4. Interactive Mermaid Diagrams\n\nUse standard `mermaid` fenced code blocks to render real-time flowcharts and architecture diagrams:\n\n```mermaid\nflowchart TD\n subgraph Client[\"📱 Clients\"]\n A[\"Web / PWA\"]\n B[\"iOS / Android Apps\"]\n C[\"Web Clipper\"]\n end\n\n subgraph EdgeEver[\"⚡ EdgeEver Cloudflare Backend\"]\n D[\"Cloudflare Workers\"]\n E[(\"D1 Database\")]\n F[(\"R2 Storage\")]\n end\n\n subgraph AIAgent[\"🤖 AI Ecosystem\"]\n G[\"Claude Code / Antigravity / Cursor\"]\n H[\"Model Context Protocol (MCP)\"]\n end\n\n A & B & C --> D\n D <--> E & F\n G -->|\"/mcp endpoint\"| H --> D\n```\n\n---\n\n### 🖼️ 5. Rich Media & Image Attachments\n\nDrag-and-drop or paste images into your notes. Images are compressed locally before being saved to R2 storage:\n\n![EdgeEver Architecture & Editor](/api/v1/resources/res_demo_editor_image/blob)\n\n---\n\n### 🤖 6. Native AI Agent Ecosystem\n\nDesigned natively for the AI era:\n\n1. **REST API**: Provides standard OpenAPI definitions at `/api/openapi.json`.\n2. **MCP Endpoint**: Accessible at `/mcp`, allowing AI Agents to read/write notes directly.\n3. **Automated Workflows**: Auto-tagging, export/import, sync with Notion or Feishu.\n\n---\n\n> 🎯 **Quick Try**:\n> - Multi-select notes in the left list using `Cmd` / `Ctrl` and click \"Merge\" at the bottom.\n> - Toggle the Markdown view icon in the top right to experience pure code editing!",
+ "## 🌟 EdgeEver Core Features Overview\n\n> **EdgeEver** is an open-source, serverless personal knowledge base built on Cloudflare. It retains the classic **Evernote-style three-pane layout**, while offering **100% free hosting**, full data ownership, visual editing, and native AI Agent (MCP) integration.\n\n---\n\n### 🚀 1. Feature Comparison (Visual Table Editing)\n\n*Tip: Click any cell in the table below to edit directly; right-click in editor mode to insert/delete rows or columns.*\n\n| Metric | Evernote | Obsidian | EdgeEver |\n| --- | --- | --- | --- |\n| **Hosting Cost** | Commercial ($15+/mo) | Sync Plan ($5/mo) | **100% Free (Cloudflare Free Tier)** |\n| **Deployment** | Closed Cloud | Local Files + Plugins | **Serverless Self-Hosted (0 Maintenance)** |\n| **User Experience**| Classic 3-Pane (Heavy Ads) | Multi-Pane (Heavy Mobile) | **Classic 3-Pane + Native Apps & PWA** |\n| **Data & API** | Proprietary & Locked | Local Markdown | **Standard D1 SQLite / REST API / MCP** |\n| **AI Integration** | Limited / Paid | Requires 3rd Party Plugins| **Native MCP Endpoint & OpenAPI** |\n\n---\n\n### 🎨 2. Dual-View & Rich Formatting\n\nSeamlessly toggle between **WYSIWYG Rich Text** and **Markdown Source** via the `</>` toggle in the top right.\n\n- [x] Classic three-pane layout with infinite notebook hierarchy\n- [x] Seamless multi-device sync (Web PWA / iOS & Android Native Apps)\n- [x] Automatic client-side image compression (saves 50% ~ 90% bandwidth)\n- [x] Multi-note batch merging (Shift / Cmd click)\n\n> 💡 **Tip**: All rich text formatting remains 100% compatible when toggling to Markdown mode.\n\n---\n\n### 💻 3. Syntax Highlighting\n\nSupports dozens of programming languages (Python, TypeScript, Rust, SQL, etc.) with one-click code copying:\n\n```python\nimport requests\n\n# Fetch EdgeEver notebooks via REST API\ndef fetch_edgeever_notebooks(instance_url: str, token: str):\n headers = {\"Authorization\": f\"Bearer {token}\"}\n response = requests.get(f\"{instance_url}/api/v1/notebooks\", headers=headers)\n \n if response.status_code == 200:\n data = response.json()\n print(f\"Successfully fetched {len(data['data'])} notebooks!\")\n return data[\"data\"]\n return []\n```\n\n---\n\n### 📊 4. Interactive Mermaid Diagrams\n\nUse standard `mermaid` fenced code blocks to render multiple popular diagram types in real time:\n\n#### 1️⃣ System Flowchart\n```mermaid\nflowchart TD\n subgraph Client[\"📱 Clients Ecosystem\"]\n A[\"Web / PWA\"]\n B[\"iOS / Android Apps\"]\n end\n\n subgraph Backend[\"⚡ Cloudflare Backend Services\"]\n C[\"Cloudflare Workers API\"]\n D[(\"D1 SQLite DB\")]\n E[(\"R2 Object Storage\")]\n end\n\n A & B --> C\n C <--> D & E\n```\n\n#### 2️⃣ Interactive Sequence Diagram\n```mermaid\nsequenceDiagram\n autonumber\n actor User as User\n participant App as EdgeEver Client\n participant Worker as Cloudflare Worker API\n participant D1 as D1 Database\n\n User->>App: Edit and save note\n App->>Worker: POST /api/v1/memos (Save changes)\n Worker->>D1: Write note content & update revision\n D1-->>Worker: Return success (revision + 1)\n Worker-->>App: 200 OK (Latest sync cursor)\n App-->>User: Status updated to \"Saved\"\n```\n\n#### 3️⃣ State Transition Diagram\n```mermaid\nstateDiagram-v2\n [*] --> Drafts: Create new note\n Drafts --> Published: Save & Archive\n Published --> Pinned: Pin to top\n Pinned --> Published: Unpin note\n Published --> Trash: Move to trash\n Trash --> Published: Restore note\n Trash --> [*]: Delete permanently\n```\n\n---\n\n### 🖼️ 5. Rich Media & Image Attachments\n\nDrag-and-drop or paste images into your notes. Images are compressed locally before being saved to R2 storage:\n\n![EdgeEver Architecture & Editor](/api/v1/resources/res_demo_editor_image/blob)\n\n---\n\n### 🤖 6. Native AI Agent Ecosystem\n\nDesigned natively for the AI era:\n\n1. **REST API**: Provides standard OpenAPI definitions at `/api/openapi.json`.\n2. **MCP Endpoint**: Accessible at `/mcp`, allowing AI Agents to read/write notes directly.\n3. **Automated Workflows**: Auto-tagging, export/import, sync with Notion or Feishu.\n\n---\n\n> 🎯 **Quick Try**:\n> - Multi-select notes in the left list using `Cmd` / `Ctrl` and click \"Merge\" at the bottom.\n> - Toggle the Markdown view icon in the top right to experience pure code editing!",
},
} as const;
const DEMO_SEED_MEMOS_EN = DEMO_SEED_MEMOS_ZH.map((memo) => {