dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
用简单标记稿生成并排版中文 Word(.docx)文档,使用内置标题样式、宋体与 Times New Roman 字体,图表题注按章自动编号。
Generate and format Word (.docx) documents from a simple markup file. Generic for Chinese long documents — lab/experiment reports, course-design reports, theses, project summaries, manuals, research reports, etc. No specific major or domain.
中文版见 README.md
word-docx-writer turns a small Markdown-like markup file into a properly formatted
.docx, and can also re-style an existing .docx in one command.
Default typography (all overridable from the CLI):
| Role | Word built-in style | Chinese size | pt | Paragraph format |
|---|---|---|---|---|
| Body | 正文 / Normal | 小四 | 12 | first-line indent 2 chars, justified, 1.5 line spacing, 0 before/after |
| Heading 1 | 标题 1 | 三号 | 16 | 0 before/after, 1.5 line spacing, left |
| Heading 2 | 标题 2 | 四号 | 14 | same as Heading 1 |
| Heading 3 | 标题 3 | 小四 | 12 | same as Heading 1 |
| Figure/table caption | 正文 + 黑体 | 小五 | 9 | SimHei, not bold, centered, single spacing |
表1.1 ... / 图1.1 ...), table caption above the table, figure caption below the figure..doc conversion, TOC refresh)..docx.SKILL.md, AGENTS.md, CLAUDE.md, GEMINI.md, Copilot and Cursor entry files.word-docx-writer/
├── SKILL.md # DSH / Claude Skill entry
├── AGENTS.md / AGENTS_EN.md # generic agent instructions
├── CLAUDE.md / GEMINI.md # Claude Code / Gemini CLI entries
├── README.md / README_EN.md
├── LICENSE / CHANGELOG.md
├── scripts/
│ ├── word_style.py # single source of truth for formatting
│ ├── build_docx.py # markup -> .docx
│ └── read_docx.py # read / convert .doc, .docx
├── references/
│ ├── style-spec.md # formatting cheatsheet
│ └── markup.md # markup syntax
├── assets/blank.docx # bundled blank template
├── examples/ # runnable example
├── skills/word-docx-writer.md # bundled skill for the DSH plugin build
├── src/index.js # minimal DSH plugin entry (skills-only bundle)
└── package.json / cordis.patch.yml
git clone https://github.com/RempleXI/word-docx-writer ~/.dsh/skills/word-docx-writer # DeepSeek Harness
git clone https://github.com/RempleXI/word-docx-writer ~/.claude/skills/word-docx-writer # Claude Code
Project-local:
git clone https://github.com/RempleXI/word-docx-writer <your-project>/.dsh/skills/word-docx-writer
Download word-docx-writer-v1.0.0.zip and unzip it into any skill directory above.
Codex / OpenCode read AGENTS.md (and AGENTS_EN.md); Gemini CLI reads GEMINI.md;
Claude Code reads CLAUDE.md; GitHub Copilot reads .github/copilot-instructions.md;
Cursor reads .cursor/rules/word-docx-writer.mdc.
This repository can also be installed as a DSH plugin:
npm publish --access public # publishes dsh-plugin-word-docx-writer
dsh plugin --profile web add dsh-plugin-word-docx-writer@latest
The plugin is a skills-only bundle: src/index.js is a no-op plugin entry, and the skill is
bundled at skills/word-docx-writer.md.
content.txt (see references/markup.md):TITLE|Lab Report Title
H1|1. Objective
H2|1.1 Background
P|Body text: 2-char first-line indent, justified, 1.5 line spacing.
TCAP|Experiment data
TBL|No.;;Item;;Result
ROW|1;;Sample item;;Sample result
FCAP|Experiment setup
IMG|fig.png|12
python scripts/build_docx.py --content content.txt --out report.docx
python scripts/word_style.py report.docx # COM first, OOXML fallback
python scripts/word_style.py report.docx --method ooxml
python scripts/read_docx.py report.docx
| Capability | Requirement |
|---|---|
| Generation / styling (OOXML) | Python 3.8+; Pillow only for images |
.doc conversion | Windows + Microsoft Word (COM) |
| TOC / page-number refresh | Windows + Microsoft Word (COM), or press F9 manually |
| Fonts | SimSun (宋体), SimHei (黑体), Times New Roman installed |
pip install pywin32 Pillow
On non-Windows platforms
build_docx.pyandword_style.py --method ooxmlwork fully;.docconversion and TOC refresh must be done with Word or LibreOffice.
| Option | Default | Description |
|---|---|---|
--content | required | markup file |
--out | required | output .docx |
--template | assets/blank.docx | template .docx / .doc |
--font / --font-ascii | 宋体 / Times New Roman | East-Asian / Latin font |
--body --h1 --h2 --h3 | 12 / 16 / 14 / 12 | font sizes (pt) |
--table-size | 10.5 | table font size |
--caption-font --caption-size | 黑体 / 9 | caption font / size |
--color | 000000 | default text color |
--title | — | cover title (when the template has a placeholder) |
--no-update-toc | — | skip the Word COM TOC refresh |
MIT. Please keep the copyright notice.
Issues and PRs are welcome. Please run the examples/ case before submitting.