feat: add docfill mvp cli

This commit is contained in:
赵义仑
2026-06-18 20:03:47 +08:00
commit ca444bd5d0
22 changed files with 2539 additions and 0 deletions

16
examples/README.md Normal file
View File

@@ -0,0 +1,16 @@
# docfill examples
These examples are intentionally small and script-friendly.
Run all examples through the smoke script:
```bash
bash scripts/smoke.sh
```
The smoke script copies this directory to a temp folder, generates the Office and SQLite fixture files, builds `docfill`, and runs the example tasks.
## Examples
- `excel-to-word`: Excel daily rows to Word daily reports.
- `sqlite-to-excel`: SQLite summary rows to Excel department reports.

View File

@@ -0,0 +1,18 @@
{
"vars": {
"date": "2026-06-18"
},
"data": {
"type": "excel",
"path": "./data.xlsx",
"sheet": "Daily",
"header_row": 1
},
"template": {
"path": "./template.docx"
},
"output": {
"path": "./out/daily_{{date}}_{{name}}_{{_row}}.docx",
"overwrite": true
}
}

View File

@@ -0,0 +1,18 @@
{
"vars": {
"date": "2026-06-18"
},
"data": {
"type": "sqlite",
"path": "./data.db",
"query": "select department, report_date, total_count, abnormal_count from department_summary where report_date = ? order by department",
"params": ["{{date}}"]
},
"template": {
"path": "./template.xlsx"
},
"output": {
"path": "./out/summary_{{department}}_{{_row}}.xlsx",
"overwrite": true
}
}