WeKnora
Tencent
Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:GitTOU/dsh-tool-gbt9704
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Model-facing gbt9704_convert tool: reformat a Markdown (.md) or Word (.docx) source into the GB/T 9704-2012 党政机关公文格式 (Party-and-government official document) body layout as a new .docx.
The converter is self-contained: it reads the source with Node's fs, parses it through a shared document model (mdast for Markdown, an OOXML extractor for existing .docx files), renders the model onto a hand-built OOXML document (a minimal .docx container via fflate), and writes the output file. It registers no service and keeps no state; a call is a pure path-in/path-out conversion.
| Element | Rule |
|---|---|
| Sheet | A4 210 mm × 297 mm |
| Margins | 天头 37, 订口 28, 地脚 35, 翻口 26 mm → 版心 156 mm × 225 mm |
| Body | 三号仿宋_GB2312 (16 pt), justified, first-line indent two characters |
| Grid | 22 lines per page, 28 characters per line, fixed 28.95 pt (579 twips) line spacing |
| Title | 二号小标宋 (22 pt), centered, two blank lines after |
| 层次标题 | 一、黑体 / (一)楷体_GB2312 / 1. and (1)仿宋, first-line indent |
| 主送机关 | 顶格, ends with a full-width colon, one blank line before the body |
| 署名/成文日期 | Right-aligned; the date's first character sits two characters right of the signature's (right indents computed from both lengths, per §7.3.5.2) |
| 页码 | 四号宋体 "—1—", odd pages right-空一字, even pages left-空一字 (evenAndOddHeaders) |
All values are Config fields with the standard's defaults; a deployment may override fonts, sizes, margins, or line pitch from cordis.yml.
The tool needs no metadata block; it reads the document by position:
一、 / (一) / 1. / (1) become the four 层次标题 levels, regardless of Markdown heading depth.2024年1月5日 or 二〇二四年一月五日).All fields are optional; the standard's defaults apply. z schema in src/index.ts.
| Key | Default | Meaning |
|---|---|---|
bodyFont |
仿宋_GB2312 | 正文/主送机关/三级四级标题 font |
titleFont |
方正小标宋简体 | 标题 font |
heading1Font |
黑体 | 一级标题 font |
heading2Font |
楷体_GB2312 | 二级标题 font |
latinFont |
Times New Roman | Latin/digit font |
pageNumberFont |
宋体 | 页码 font |
bodySizePt / titleSizePt / pageNumberSizePt |
16 / 22 / 14 | sizes in points |
linePitchTwips |
579 | fixed line pitch in twips |
topMarginMm / leftMarginMm / bottomMarginMm / rightMarginMm |
37 / 28 / 35 / 26 | page margins in mm |
The tool's full description plus the standard's layout summary; the model supplies a source path and optional overrides. The description pins the conversion conventions verbatim so the model knows which Markdown forms map to which 公文 elements.
One tool description, fixed; no data-dependent prompt growth. The model-facing result is a short summary (output path, detected title, block counts, warnings).
The tool description is a stable prefix; it does not invalidate cache reuse. Results vary per call but are result-turn content, not request context.
http(s) image URLs in Markdown are reported as warnings.Config when a deployment standardizes on different names.fs reads and writes and does not go through the ctx.fs service, so its writes are not recorded as agent-observed file state and are not confined by the filesystem sandbox. Model-facing file mutation tools remain the sandboxed path; this tool is a dedicated converter.CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: chinese-document、official-document。