DSH VERIFY KIT · dsh-citelint
报告引用检查清单
它决定一件事:引用编号、来源与本地链接是否自洽。
检查规则
| 规则 | 判定 |
|---|---|
numbering-gap | 编号出现 1, 2, 4 → warn,指出期望 1..N(删段落后的典型残留) |
duplicate-number | 同一个编号定义了两次 → error |
duplicate-url | 两个编号指向同一来源 → warn |
unreferenced | 来源列在文末但正文从未引用 → warn |
undefined | 正文引用了 [3] 但文末没有 [3] → error |
local-missing | 引用指向 ./nope.csv 但交付目录里没有这个文件 → error |
用法
npx citelint report.md --jsonnpx citelint report.md --warnings-fail
真实输入输出
输入
## 结论
见 [1] 与 [3]。
[1]: https://example.com/a
[2]: https://example.com/b
[3]: ./missing-appendix.md$ citelint report-cite.md
warn unreferenced [2] is defined and never cited in the text
error local-missing [3] points at ./missing-appendix.md, which is not in the delivered directory
fail: 1 errors, 1 warnings
出口码:1。输出为真实 CLI 运行的逐字结果,由测试与工具保持同步。
出口码:0 干净、1 有发现、2 用法或读文件错误。--json 输出机器可读结果,--warnings-fail 让警告也算失败。DSH 内同样的函数在 POST /citelint/api({"text":"…"} 或 {"path":"…"}),面板与 CI 调同一实现,不可能不一致。
这是清单,不是专业人士。每条发现都是文件里可判定的结构缺陷,带行号或路径;它从不说「内容好不好」。
http(s) 引用不查文件系统;本地相对路径才会对照交付目录。检查的是引用结构,不是引用内容对不对。 · dsh-verify-kit 全部五个检查