配置: 初始化 ISOS Agent Teams 软件研发模板
CI / lint (push) Successful in 6s

This commit is contained in:
2026-04-19 21:47:08 +08:00
parent 3ab6fe6504
commit 34346be862
202 changed files with 23544 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
---
name: 导出文档
description: 将 Markdown 文件中的 Mermaid 图表渲染为图片后导出为 docx/pdf
---
## 用户输入
```text
$ARGUMENTS
```
## 参数解析
从用户输入中提取:
1. **文件路径**:Markdown 文件的相对路径(如 `docs/建模论文-v7.md`
2. **导出格式**`docx`(默认)或 `pdf`
如果用户未指定格式,默认使用 `docx`
## 执行步骤
1. 确认文件路径存在且为 `.md` 文件
2. 运行导出脚本:
```bash
uv run python scripts/md_export.py <文件路径> --format <格式>
```
3. 使用以下格式输出结果:
```text
源文件: xxx
导出格式: xxx
输出文件: xxx
Mermaid 图表数: xxx
```
## 错误处理
- 文件不存在时,提示用户确认路径
- mmdc 未安装时,提示运行 `npm install -g @mermaid-js/mermaid-cli`
- pandoc 未安装时,提示运行 `sudo apt install -y pandoc`