convert_markdown_to_docx
Convert Markdown to Word with Chinese government document formatting. Optionally generate revision suggestions for quality and compliance.
Instructions
Convert a Markdown file to Word (.docx) with formatting.
Applies Chinese government document formatting (公文格式规范) by default:
Headings: 黑体 (H1 三号16pt, H2 小三15pt, H3 四号14pt) bold, left-aligned
Body: 仿宋_GB2312 四号14pt, justified, 2-char first-line indent
Tables: 仿宋_GB2312 五号10.5pt, center-aligned
Line spacing: fixed 28pt for body/headings, single for tables
Args: input_path: Absolute path to the input Markdown file. output_path: Output .docx path. Defaults to /.docx. format_spec: Path to a format description markdown file (like 格式要求.md). Overrides the default format. The file defines fonts, sizes, spacing, and alignment per Word style (H1/H2/H3/正文/表格). reference_docx: Path to a .docx template whose styles overlay on top of the format spec. Useful for matching an existing document's styles. extract_media: Directory to extract media files to. skip_format: If True, bypass ALL formatting (pure pandoc output). no_cache_template: If True, force regeneration of the cached reference template (needed when format spec changes). auto_suggest: If True, automatically generate a modification suggestions report (xx-修改建议.md) after conversion. The report covers heading hierarchy, required sections, format issues, content problems, list continuity, and Chinese punctuation.
Returns: Summary string with input path, output path, file size, and optionally the modification suggestions report path and issue count.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_path | Yes | ||
| format_spec | No | ||
| output_path | No | ||
| skip_format | No | ||
| auto_suggest | No | ||
| extract_media | No | ||
| reference_docx | No | ||
| no_cache_template | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |