chore: prepare docfill project for gitea
This commit is contained in:
@@ -1,16 +1,32 @@
|
||||
# docfill examples
|
||||
# docfill 示例配置
|
||||
|
||||
These examples are intentionally small and script-friendly.
|
||||
本目录保存可自动化运行的最小示例配置。示例中的 Office 文件和 SQLite 文件由 `scripts/smoke.sh` 在临时目录中生成,因此仓库只提交配置文件,不提交临时生成的数据文件。
|
||||
|
||||
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
|
||||
```text
|
||||
generated 2 file(s)
|
||||
- /tmp/.../examples/excel-to-word/out/daily_2026-06-18_张三_1.docx
|
||||
- /tmp/.../examples/excel-to-word/out/daily_2026-06-18_李四_2.docx
|
||||
generated 2 file(s)
|
||||
- /tmp/.../examples/sqlite-to-excel/out/summary_客服部_1.xlsx
|
||||
- /tmp/.../examples/sqlite-to-excel/out/summary_营销部_2.xlsx
|
||||
smoke ok
|
||||
```
|
||||
|
||||
- `excel-to-word`: Excel daily rows to Word daily reports.
|
||||
- `sqlite-to-excel`: SQLite summary rows to Excel department reports.
|
||||
## 示例列表
|
||||
|
||||
- `excel-to-word`: 从 Excel 日报数据生成 Word 日报。
|
||||
- `excel-filter-to-word`: 从 Excel 工单数据中按日期和工单编号筛选一条记录,再生成 Word 工单。
|
||||
- `sqlite-to-excel`: 从 SQLite 汇总数据生成 Excel 部门汇总表。
|
||||
|
||||
## 与 manual_tests 的区别
|
||||
|
||||
- `examples/` 用于自动化冒烟测试,文件尽量少,数据文件运行时临时生成。
|
||||
- `manual_tests/` 用于人工验证,包含可以直接打开的 Word、Excel 和 SQLite 测试素材。
|
||||
|
||||
25
examples/excel-filter-to-word/task.json
Normal file
25
examples/excel-filter-to-word/task.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"vars": {
|
||||
"date": "2026-06-18"
|
||||
},
|
||||
"data": {
|
||||
"type": "excel",
|
||||
"path": "./data.xlsx",
|
||||
"sheet": "Tickets",
|
||||
"header_row": 1
|
||||
},
|
||||
"filter": {
|
||||
"equals": {
|
||||
"date": "{{date}}",
|
||||
"ticket_no": "{{ticket_no}}"
|
||||
},
|
||||
"expect": "one"
|
||||
},
|
||||
"template": {
|
||||
"path": "./template.docx"
|
||||
},
|
||||
"output": {
|
||||
"path": "./out/ticket_{{date}}_{{ticket_no}}.docx",
|
||||
"overwrite": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user