Workflow
When user asks to format/layout a document to one A4 page:
- 1. Setup (if repo not present):
CODEBLOCK0
- 2. Convert source (PDF/DOCX/Excel) to Markdown first if needed
- 3. Write Markdown to a temp file
- 4. Run CLI (default output to user desktop):
CODEBLOCK1
- 5. Read output files (PDF/PNG/MD), send to user
- 6. After delivery, ALWAYS:
- Ask:
效果满意吗?如需微调可以帮你打开 Web 编辑器
- If user wants to tweak, start the dev server and open the browser:
cd SmartPage
npm run dev
Then open
http://localhost:5173 in the browser for the user.
CLI Options
| Flag | Default | Values |
|---|
| INLINECODE2 | classic | classic, warm, academic, editorial, smartisan, noir, mint, ink, tech, kraft |
| INLINECODE3 |
Noto Sans SC | Any font family |
|
--margin | 20 | mm |
|
--line-height | 1.5 | ratio |
|
--paragraph-spacing | 0.5 | em |
|
--first-line-indent | 0 | em |
|
--output-dir | (current dir) | Path |
|
--output-name | output | Name without extension |
工作流程
当用户要求将文档格式化/排版为一页A4纸时:
- 1. 初始化(如果仓库不存在):
bash
git clone https://github.com/fxjhello/SmartPage.git
cd SmartPage
npm install
- 2. 如有需要,先将源文件(PDF/DOCX/Excel)转换为Markdown格式
- 3. 将Markdown写入临时文件
- 4. 运行CLI(默认输出至用户桌面):
bash
npm smartpage <文件.md> --theme <主题> --output-dir <用户桌面路径>
- 5. 读取输出文件(PDF/PNG/MD),发送给用户
- 6. 交付后,务必:
- 询问:效果满意吗?如需微调可以帮你打开 Web 编辑器
- 若用户希望调整,启动开发服务器并打开浏览器:
bash
cd SmartPage
npm run dev
然后在浏览器中为用户打开 http://localhost:5173
CLI选项
| 标志 | 默认值 | 可选值 |
|---|
| --theme | classic | classic, warm, academic, editorial, smartisan, noir, mint, ink, tech, kraft |
| --font |
Noto Sans SC | 任意字体族 |
| --margin | 20 | 毫米 |
| --line-height | 1.5 | 比例 |
| --paragraph-spacing | 0.5 | em |
| --first-line-indent | 0 | em |
| --output-dir | (当前目录) | 路径 |
| --output-name | output | 不含扩展名的文件名 |