政府公文格式文档生成器。支持所有常见文档格式输入(.md .txt .docx .pdf .html .rtf),输出符合国家标准的.docx公文格式。使用场景:产业调研报告、政策分析报告、工作报告等需要严格按照政府公文格式排版的文档。
将多种格式文档转换为符合政府公文格式的.docx文档。
格式扩展名说明Markdown.md原生支持,#为大标题,##为一级标题,###为二级标题纯文本.txt按行解析,通过文本模式自动判断标题层级Word文档.docx通过段落样式和字号判断标题层级PDF文档.pdf使用pdfminer.six提取文本,按段落分割网页.html .htm使用BeautifulSoup解析,h1→标题,h2→一级标题,h3→二级标题富文本.rtf使用striprtf提取文本后按段落分割
bash
# Markdown → .docx
python3 SKILL_DIR/scripts/convert.py <input.md> <output.docx>
# 纯文本 → .docx
python3 SKILL_DIR/scripts/convert.py <input.txt> <output.docx>
# .docx → .docx(重新格式化)
python3 SKILL_DIR/scripts/convert.py <input.docx> <output.docx>
# PDF → .docx
python3 SKILL_DIR/scripts/convert.py <input.pdf> <output.docx>
# HTML → .docx
python3 SKILL_DIR/scripts/convert.py <input.html> <output.docx>
# RTF → .docx
python3 SKILL_DIR/scripts/convert.py <input.rtf> <output.docx>
SKILL_DIR 为本技能目录的绝对路径。
详见 references/format-rules.md
Markdown文件需满足:
## 作为一级标题(对应一、二、三、)### 作为二级标题(自动转换为(一)(二))# 开头的为报告大标题(居中显示)**...** 和 __...__[text](url)