canvas-design
Create posters and visual art as PNG or PDF, guided by a design philosophy.
ANanthropics/skills203k3,265 new stars in the last 7 days
docx 格式刷:从模板 Word 文档提取格式指纹(字体/字号/行距/缩进/对齐/表格边框/封面/分页),然后统一应用到目标 docx,做到与模板格式完全一致。触发词:格式刷、格式统一、统一格式、套用模板格式、参照模板格式、docx格式修复、Word格式不一致、pandoc转出来的docx格式乱、按模板生成docx、公文格式。凡是'参照某个 docx 模板写/改/修复另一个 docx'的任务都用本 skill,包括新建文档按模板排版、修复其他工具(pandoc/其他模型)产出的格式混乱 docx。
把一份模板 docx 的格式"刷"到另一份 docx 上。核心思想:格式参数从模板实测出来,收敛到唯一出口应用,凭感觉手调必然不统一。
python3 scripts/extract_fingerprint.py "模板.docx"
输出模板的格式指纹(JSON + 可读摘要):
为什么要实测而非只看样式表:中文公文类 docx 几乎都在 run 层直接设置仿宋等字体,样式表里可能还是默认值。只信样式表必然刷错。
python3 scripts/extract_fingerprint.py "目标.docx"
对比两份指纹,列出病灶清单。pandoc 产物的典型病灶:
"xxx" 被转成 ”xxx“)python3 scripts/apply_format.py "目标.docx" --config fingerprint.json [--out "输出.docx"]
不带 --out 时原地修复。脚本按五层顺序应用(顺序重要,样式层先兜底,run 层再精确覆盖):
第X章 型 Heading 1 居中 + pageBreakBefore“xxx”run.font.name 只管西文;必须再 rPr.rFonts.set(qn('w:eastAsia'), '仿宋'),否则 Word 中文回落宋体磅 = EMU / 12700(如 152400 = 12磅,203200 = 16磅)r.font.color.rgb = None 不够,需从 rPr 中 remove w:color 元素w:pageBreakBefore 元素,优于插入分页符 runscripts/gen_from_template.py。脚本内的 title()、para() 和 table() 工厂统一应用指纹参数,所有内容只从工厂函数写入。python3 scripts/gen_from_template.py "content.json" \
--config fingerprint.json \
--out "output/doc/输出.docx"
内容 JSON 使用 cover 和 blocks。blocks 支持 heading、paragraph、table、page_break;完整示例见脚本顶部说明。
python3 scripts/verify_format.py "输出.docx"
通过标准:
第X章 Heading 1 有 pageBreakBefore验证输出贴给用户看,用表格汇报"病灶 → 修复"对照。
output/doc/Create posters and visual art as PNG or PDF, guided by a design philosophy.
ANanthropics/skills203k3,265 new stars in the last 7 days
Read and edit spreadsheets: add columns, compute formulas, format, and clean messy data.
ANanthropics/skills203k3,265 new stars in the last 7 days
Create and edit Word docs with TOC, page numbers, headers and more.
ANanthropics/skills203k3,265 new stars in the last 7 days
Read and edit PDFs: extract text and tables, merge, split, rotate, and fill forms.
ANanthropics/skills203k3,265 new stars in the last 7 days
Co-write specs, proposals and decision docs through a structured, iterative workflow.
ANanthropics/skills203k3,265 new stars in the last 7 days
Create and edit slide decks, generate slides from templates, and extract text.
ANanthropics/skills203k3,265 new stars in the last 7 days