← 返回
未分类

Kai Docx Generator

Generate professional .docx documents from Markdown text or fill data into .docx templates. Use when: converting markdown to Word, generating reports/contrac...
从 Markdown 文本生成专业 .docx 文档或将数据填充至 .docx 模板。适用于:Markdown 转 Word、生成报告/合同等。
kaisersong kaisersong 来源
未分类 clawhub v1.1.1 1 版本 99740.3 Key: 无需
★ 0
Stars
📥 384
下载
💾 0
安装
1
版本
#latest

概述

kai-docx-generator

Generate professional .docx documents from Markdown, or fill data into .docx templates.

Core Principles

  1. Zero Fabrication — Never invent content. If data is missing, use placeholder text ([待填写]) or ask the user.
  2. Template Filling is XML-level{{variable_name}} patterns are matched at the w:t XML node level inside the .docx. Values are sanitized to escape & < > " ' and remove control characters.
  3. Security: Path Validation — Image paths must be relative or within the current working directory. Absolute paths (e.g. /tmp/...) and path traversal (..) are rejected.
  4. Auto-Truncation — Exceeding input limits (200KB, 20 images, 50 table rows, 20 table columns) triggers automatic truncation without error.
  5. Template Strictness--strict mode on fill_template.py returns exit code 1 when any placeholder remains unreplaced, enabling CI/CD gate usage.

Commands

CommandWhat it does
----------------------
python3 /scripts/generate.py Convert Markdown to .docx
python3 /scripts/generate.py --style