dsh-cn-doc-formatter: A DSH plugin that produces compliant Chinese official documents
feely0208/dsh-cn-doc-formatter
A DSH plugin that formats Chinese official documents per GB/T 9704-2012, generating .docx/.pdf/.txt with built-in compliance self-checks.
dsh-cn-doc-formatter is a document layout plugin for DeepSeek Harness that arranges titles, body text, signatures and dates into standards-compliant .docx, .pdf or .txt files following GB/T 9704-2012, the Chinese format standard for Party and government documents. It targets the delivery risk of files that look close enough but are actually non-compliant: after generating, it really opens the output and checks margins, font sizes, line spacing, fonts and page dimensions item by item, reporting an error when something is off, with an exit code usable as a delivery gate. Maintained by feely0208 under the MIT license and written in Python, it performs layout, font detection and self-verification entirely on your machine, and its output carries no watermark, generation marker or author info.
How to Install
dsh plugin --profile web add @deepwhale-cn/dsh-cn-doc-formatter- Category
- Data & Knowledge
- Platform
- DSH Plugin
- Author
- feely0208
- Distribution
- Plugin
dsh-cn-doc-formatter Key Features
dsh-cn-doc-formatter Repo Summary
What Does It Do?
Chinese Official Document Formatter is a DSH plugin for DeepSeek Harness that produces standards-compliant .docx, .pdf and .txt files following GB/T 9704-2012, the Chinese format standard for Party and government documents. It solves the "looks close enough but is actually non-compliant" delivery problem: after generating a file it checks margins, font sizes, line spacing, fonts and page dimensions item by item, and reports an error instead of letting you hand over a non-compliant document. Maintained by feely0208 under the MIT license and written in Python, it performs layout, font detection and self-verification entirely on your machine.
Core Features
- Standards-based layout: title in FangSong 22pt bold and centered, body in FangSong 14pt with fixed 28pt line spacing and a strict two-character first-line indent, margins of 3.7/3.5/2.8/2.6 cm, and a 22-line by 28-character page grid.
- Output self-verification: it actually opens the generated file and checks margins, font sizes, line spacing, fonts and page size, returning exit code 0 on success and 1 when something is off, so it can gate CI or delivery pipelines.
- Markdown input adaptation: it maps Markdown heading levels onto official document levels, demotes lists and tables to body text, and merges soft line breaks inside a paragraph so stray punctuation is not left on its own line.
- Cross-platform font detection: it reads the name table of font files directly, working the same on macOS, Windows and Linux without misreporting installed fonts as missing.
- No AI traces: output files carry no watermark, generation marker, author info, version note or comments.
How to Use This Plugin?
Once enabled in DSH, the skill becomes available automatically whenever the agent needs it. You supply the title, body text, issuing organization and date, and the plugin generates a Word or PDF file; Markdown content is converted into the proper document hierarchy for you. Always run the output self-check afterwards and confirm every item passes before delivering.
Fonts are yours to provide: the required FangSong typeface is a commercial font, so the plugin acts only as a layout engine and never redistributes font files. You can point it at a font file or a font directory, or install the font into your system font directory; installing WPS Office also works. It never fails silently when a font is missing — the PDF falls back to a system Song typeface and prints guidance — and if you only have regular FangSong without a bold cut, headings stay in FangSong without bold to keep the font family consistent throughout.
This page is an independent rewrite of the plugin's official README — for authoritative documentation and the latest changes, refer to the source: feely0208/dsh-cn-doc-formatter. The plugin is third-party code that runs on your machine once installed; inclusion does not imply endorsement — please review the source before installing.
