Install
openclaw skills install page-doc-generatorGenerate Word documentation from mini-program/uni-app project screenshots and source code. Use when user wants to document pages with screenshots and code. Triggered by requests like "create page document", "generate project documentation", "document with screenshots and code", "create Word document from project screenshots".
openclaw skills install page-doc-generatorGenerate Word (.docx) documentation from mini-program/uni-app projects, embedding screenshots and source code for each page.
| Input | Description | Example |
|---|---|---|
project_path | Absolute path to the project root | D:\Project\myapp |
screenshots_dir | Absolute path to screenshots directory | D:\Project\myapp\static\页面截图 |
Generates two files in the project directory:
{project_name}_页面文档.md - Markdown source{project_name}_页面文档.docx - Word documentFind all Vue page files in pages/ directory:
# Pages are in: project_path/pages/{page_name}/{page_name}.vue
pages = find_pages(project_path)
# Returns: [{"name": "index", "path": "...", "dir": "..."}, ...]
Find all images in screenshots directory:
screenshots = find_screenshots(screenshots_dir)
# Returns: {"书籍录入02": "D:/Project/.../书籍录入02.png", ...}
Generate documentation with this structure per page:
# 页面:page_name
## 页面截图

## 页面信息
| 项目 | 内容 |
|------|------|
| 路径 | `pages/xxx/xxx.vue` |
| 总行数 | N |
## 源代码
```vue
<!-- Vue code here -->
### Step 4: Convert to Word
Use pandoc to convert Markdown to DOCX:
```bash
pandoc "markdown_file.md" -o "output.docx" --resource-path="screenshots_dir"
Main generation script:
python scripts/generate_page_doc.py <project_path> <screenshots_dir> [output_dir]
Convert Markdown to Word:
python scripts/convert_to_docx.py <markdown_file> [output_dir]
# Full pipeline
python scripts/generate_page_doc.py "D:\Project\myapp" "D:\Project\myapp\static\截图"
python scripts/convert_to_docx.py "D:\Project\myapp\myapp_页面文档.md"
The script matches pages to screenshots by filename:
index → screenshot index.png or index01.pngnotes → screenshot notes.png or notes01.pngIf exact match not found, tries common variations (append 01, 02, etc.).