kevinsong025 downloadsExport notes to Word documents with a Chinese contract layout: A4, FangSong and Times New Roman, cover page, and page numbers.
Export an Obsidian note to a .docx file that follows a Chinese contract layout. The plugin is self-contained: no Python, no external converter, and it works on desktop and mobile.

colspan / rowspan) are supported.Once the plugin is in the community directory: Settings → Community plugins → Browse → Contract Word Export → Install → Enable.
Manual install: copy main.js, manifest.json, and styles.css from a release into <vault>/.obsidian/plugins/contract-word-export/, then enable the plugin.
Open a Markdown note, then use one of:
The .docx is written into the vault. Set an Export folder in the plugin settings, or leave it empty to save next to the note.
Add cssclasses: contract-pdf to the note properties. The first five blocks of the note must be, in order:
<div class="contract-cover-meta"> with one <p> per line;# Heading 1;<div class="contract-cover-parties"> with one <p> per party;<div class="contract-cover-supervisor">.Example:
---
cssclasses: contract-pdf
---

<div class="contract-cover-meta">
<p>密 级:内部</p>
<p>合同编号:____</p>
<p>签约日期:____ 年 __ 月 __ 日</p>
<p>签约地点:____</p>
</div>
# 顾问服务协议
<div class="contract-cover-parties">
<p>甲方:____</p>
<p>乙方:____</p>
</div>
<div class="contract-cover-supervisor">
<p>监制:____</p>
</div>
If the five blocks are incomplete, the note is exported without a cover and the plugin shows a warning.
Place this paragraph where the numbered body starts:
<p class="body-start-note">(以下为正文)</p>
The paragraph ends the front section and starts a new section whose page numbers begin at 1. Without it the whole note keeps continuous numbering.
). Consecutive matching paragraphs form one two-column blockless table.<div class="contract-page-break"></div>.<div class="party-block"> to indent the block.hanging-indent in cssclasses to switch from first-line indent to a hanging indent.[[Note]] renders as the note name, [[Note|text]] as text.The font names are written into the document; the fonts themselves are not embedded.
FandolFang (the 6.0 layout reference). Change it to FangSong, STFangsong, or another installed font in the settings.Times New Roman.If a font is not installed on the machine that opens the document, Word substitutes another font and pagination can change.
npm install
npm test # build and run the conversion test
npm run build # type-check and bundle main.js
The test fixture test/fixtures/contract-6.0.md covers the cover, headings, lists, tables, images, signatures, and page numbering. npm test writes test/tmp/out-js.docx; open it in Word or LibreOffice to inspect the layout.
MIT. See LICENSE.