md2docx-cn
把 UTF-8 Markdown 中文文章转换成排版整洁的 Word 文档,适合投稿、方案、 公众号长文留档和日常办公交付。
实际效果
下面是仓库内 examples/sample.md 经过本工具转换后的真实 Word 页面,预览图由生成的
DOCX 直接渲染,未使用 AI 模拟排版。
能做什么
- 识别一至三级标题、普通段落、项目符号、编号步骤和引用。
- 自动应用中文字体、首行缩进、行距、页边距和标题层级。
- 写入文档标题与作者元数据。
- Windows、macOS 和 Linux 均可运行,输入文件保持在本机处理。
30 秒开始使用
需要 Python 3.10 或更高版本。
python -m pip install md2docx-cn
md2docx-cn article.md -o article.docx --author "你的名字"
article.md 替换为自己的 Markdown 文件。文件只在本机处理,不会上传。
需要查看源码或其他版本,可进入
Releases;开发者也可以克隆仓库后
使用 python -m pip install -e . 安装。
支持的 Markdown
# 文档标题
普通正文段落。
## 小节
- 项目一
- 项目二
1. 第一步
2. 第二步
> 一段引用或提示。
商业服务
免费版适合通用中文文章。需要匹配单位模板、投稿格式或批量流程时,可在 定制排版 Issue 中说明需求。
试运营参考价:
- 99 元:调整一套现有排版参数。
- 299 元:制作一套专用 Word 模板,含一次修改。
- 699 元起:批量转换、目录规则或现有工作流集成。
- 999 元起:团队内部工具、品牌化封装或 OEM 集成。
- 199 元/月起:模板维护、兼容性升级和优先技术支持。
完整服务边界、交付内容和合作流程见 商业服务说明。基础代码仍按 MIT License 开放;收费部分是需求分析、私有模板、集成实施、维护和支持。
业务联系邮箱:1066536086@qq.com。提交公开 Issue 后, 请通过邮件发送 Issue 链接;报价、支付宝付款方式、私有材料和交付信息均不在公开 Issue 中传递。付款节点和验收规则见 付款与交付说明。
提交需求不等于下单。先确认文件格式、交付边界、价格和时间,再决定是否合作; Issue 是公开页面,请勿上传隐私材料、未发表全文、密钥或客户数据。
验证
$env:PYTHONPATH = "src"
python -m unittest discover -s tests -v
当前边界
- 这是聚焦中文文章的 Markdown 子集转换器,不追求完整 CommonMark 兼容。
- 暂不解析图片、复杂表格、脚注、公式和嵌套列表。
- 不上传文档,不包含遥测,也不需要账号或 API 密钥。
开源许可
代码使用 MIT License。免费版可以自由使用和修改;付费服务出售的是 模板适配、批量自动化、部署和支持,而不是限制用户使用基础代码。
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file md2docx_cn-0.1.2.tar.gz.
File metadata
- Download URL: md2docx_cn-0.1.2.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08e2404dd395d60338cac298de8c63cc398edcf7fa04d7bc3417ffd133d40551
|
|
| MD5 |
4a22a6819918e50f6a77c4dbfca0d40c
|
|
| BLAKE2b-256 |
1ec96b7eaa89c3945935b2c931168e00108cad420f90ece06762de9903ca7347
|
Provenance
The following attestation bundles were made for md2docx_cn-0.1.2.tar.gz:
Publisher:
release.yml on codex2026-user/md2docx-cn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
md2docx_cn-0.1.2.tar.gz -
Subject digest:
08e2404dd395d60338cac298de8c63cc398edcf7fa04d7bc3417ffd133d40551 - Sigstore transparency entry: 2580786993
- Sigstore integration time:
-
Permalink:
codex2026-user/md2docx-cn@28c810838ead7b492e559f39609e751548c7205d -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/codex2026-user
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@28c810838ead7b492e559f39609e751548c7205d -
Trigger Event:
push
-
Statement type:
File details
Details for the file md2docx_cn-0.1.2-py3-none-any.whl.
File metadata
- Download URL: md2docx_cn-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b42526e740cfa6ab850f280e994dc79089053f1e8ecacfa3aadce9aae43af7a9
|
|
| MD5 |
9e106a28b4b65a8ff36ccc42480ebbf2
|
|
| BLAKE2b-256 |
b46d0469d5388d7a43eb191d7b90b0021570723451c353c9ab12b6be2c3a78bb
|
Provenance
The following attestation bundles were made for md2docx_cn-0.1.2-py3-none-any.whl:
Publisher:
release.yml on codex2026-user/md2docx-cn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
md2docx_cn-0.1.2-py3-none-any.whl -
Subject digest:
b42526e740cfa6ab850f280e994dc79089053f1e8ecacfa3aadce9aae43af7a9 - Sigstore transparency entry: 2580787008
- Sigstore integration time:
-
Permalink:
codex2026-user/md2docx-cn@28c810838ead7b492e559f39609e751548c7205d -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/codex2026-user
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@28c810838ead7b492e559f39609e751548c7205d -
Trigger Event:
push
-
Statement type: