Files
team/.claude/commands/isos-md-export.md
T
2026-04-19 21:47:08 +08:00

44 lines
909 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
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`