md2docx-gongwen
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "md2docx-gongwen" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-ad83a7d132fbbd709ce50381d4ef00004671cdbb4651b130b9b5792465a3c99d. Verify the upstream source and version against https://skillhub.cn/skills/user_00bf439a/md2docx-gongwen before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Markdown-to-official-Docx skill: converts Markdown files to .docx documents formatted to Chinese official document layout, automatically setting title hierarchy fonts/sizes, line spacing, and first-line indentation, and converting English straight quotes to Chinese curved quotes. Intended for formal documents such as official documents, reports, scripts, and proposals. Common triggers include “convert to word,” “official layout,” and “md to word.”
Introduction source: third_party · user_00bf439a · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Not specified in the source documentation.
- Audience
- Not specified in the source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Software, accounts and paid services
- Translation pending; see source documentation.
- Limits and differences
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: md2docx-gongwen
description: >-
Markdown 转公文排版 Word 文档技能。将 Markdown 文件转换为符合中国公文排版规范的 .docx 文档,
自动设置标题层级字体字号、行间距、首行缩进,并将英文直引号转换为中文弯引号。
适用于公文、报告、剧本、方案等需要正式排版的文档。触发词:转word、转docx、公文排版、
md转word、markdown转word、公文格式、排版转换。
agent_created: trueMarkdown 转公文 Word 文档
用途
将 Markdown 文件快速转换为符合公文排版规范的 Word 文档,适用于公文、报告、剧本、方案、通知等正式文档场景。
排版规范
| 层级 | Markdown 语法 | 字体 | 字号 | 加粗 | 首行缩进 |
|---|---|---|---|---|---|
| 主标题 | # |
方正小标宋简体 | 小二(18pt) | 否 | 无(居中) |
| 一级标题 | ## |
黑体 | 三号(16pt) | 否 | 2字符 |
| 二级标题 | ### |
楷体 | 三号(16pt) | 否 | 2字符 |
| 三级标题 | #### |
仿宋 | 三号(16pt) | 是 | 2字符 |
| 正文 | 普通文本 | 仿宋 | 三号(16pt) | 否 | 2字符 |
- 行间距:固定值 20 磅
- 首行缩进:正文及各级标题(主标题除外)首行缩进 2 字符
- 页面:A4 纸,上下边距 2.54cm,左右边距 3.17cm
- 引号转换:英文直引号
"'自动转换为中文弯引号“”‘’ - 加粗标记:Markdown
**加粗**语法保留为加粗文本 - 表格:仿宋小四(12pt),表头加粗居中
- 列表标记:自动去除 Markdown 列表前缀(
-、*、1.)
使用方法
前置条件
需安装 python-docx 库。首次使用时安装:
# 确保 Python 虚拟环境存在
"C:/Users/64862/.workbuddy/binaries/python/versions/3.13.12/python.exe" -m venv "C:/Users/64862/.workbuddy/binaries/python/envs/default"
# 安装依赖
"C:/Users/64862/.workbuddy/binaries/python/envs/default/Scripts/pip.exe" install python-docx
执行转换
# 基本用法(输出文件名自动从输入派生)
"C:/Users/64862/.workbuddy/binaries/python/envs/default/Scripts/python.exe" \
"~/.workbuddy/skills/md2docx-gongwen/scripts/convert.py" \
"输入文件.md"
# 指定输出路径
"C:/Users/64862/.workbuddy/binaries/python/envs/default/Scripts/python.exe" \
"~/.workbuddy/skills/md2docx-gongwen/scripts/convert.py" \
"输入文件.md" \
--output "输出文件.docx"
Markdown 写作要点
为确保转换效果,Markdown 源文件需遵循以下结构:
# 主标题(方正小标宋简体,居中)
## 一、一级标题(黑体)
### (一)二级标题(楷体)
#### 1. 三级标题(仿宋加粗)
正文内容,首行缩进2字符,仿宋三号。
**加粗文本** 会保留加粗效果。
- 列表项会自动去掉 `-` 前缀
- 多行连续文本会在同一段落内换行
注意事项
- 字体可用性:方正小标宋简体需在系统中安装,否则 Word 会自动替换为相近字体。黑体、楷体、仿宋为 Windows 系统自带字体。
- 引号转换规则:双引号按出现顺序交替转换为左右引号;单引号在两个字母之间时视为撇号不转换(如
don't)。 - 表格字号:表格使用小四(12pt)以避免列宽溢出,如需三号可在 Word 中手动调整。
- 文件占用:如果输出文件已在 Word 中打开,转换会报 PermissionError,需先关闭文件或更换输出文件名。
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决正式文档排版刚需,适用于公文、报告、剧本等高频场景
- 符合中国公文排版规范,自动处理字体、字号、引号转换等细节
Highlights
- 触发词覆盖完整,包含转word、转docx、公文排版等多种变体
- 边界清晰,无明显歧义
Areas to improve
-
排版表格格式对齐 Reported severity: Minor
排版规范表格中'首行缩进'列名与内容不完全对齐
Recommendation: 调整表格列宽或内容对齐方式,提升可读性
Highlights
- Phase/步骤清晰,包含用途、排版规范、使用方法、注意事项
- 提供端到端示例,涵盖前置条件、执行转换、Markdown写作要点
Areas to improve
-
字体缺失处理机制 Reported severity: Minor
未明确说明如何处理网络字体缺失的fallback机制
Recommendation: 补充字体缺失时的自动替换策略说明
Highlights
- 工具来源明确,使用python-docx库
- 覆盖主要异常场景,如字体可用性、文件占用等
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Translation pending; see source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.