From 577c5c2a3ca754f9f4dc99173bc428291ae6cde7 Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Sun, 25 Jan 2026 13:13:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=20Mermaid=20?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=A4=9A=E7=A7=8D=E5=9B=BE=E8=A1=A8=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 ER 图配置(需求 2.3) - 添加状态图配置(需求 2.4) - 添加类图、饼图、Git 图、用户旅程图配置 - 优化注释,明确标注需求对应关系 - 保持主题自动切换和安全级别配置(需求 2.1) - 完成任务 2.2 --- argontheme.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/argontheme.js b/argontheme.js index 7b27060..b704519 100644 --- a/argontheme.js +++ b/argontheme.js @@ -4869,23 +4869,52 @@ void 0; const theme = this.getMermaidTheme(); // 配置 Mermaid + // 需求 2.1-2.4: 支持多种图表类型,设置正确的主题和安全级别 try { window.mermaid.initialize({ startOnLoad: false, // 手动控制渲染时机 - theme: theme, + theme: theme, // 根据网站主题自动切换 securityLevel: 'loose', // 允许 HTML 标签 logLevel: this.config.debugMode ? 'debug' : 'error', + // 流程图配置 (需求 2.2) flowchart: { useMaxWidth: true, htmlLabels: true, curve: 'basis' }, + // 时序图配置 sequence: { useMaxWidth: true, wrap: true }, + // 甘特图配置 gantt: { useMaxWidth: true + }, + // ER 图配置 (需求 2.3) + er: { + useMaxWidth: true, + layoutDirection: 'TB' + }, + // 状态图配置 (需求 2.4) + stateDiagram: { + useMaxWidth: true + }, + // 类图配置 + class: { + useMaxWidth: true + }, + // 饼图配置 + pie: { + useMaxWidth: true + }, + // Git 图配置 + gitGraph: { + useMaxWidth: true + }, + // 用户旅程图配置 + journey: { + useMaxWidth: true } });