Asciidoctor
$ asciidoctor 官方出品 低风险Asciidoctor(asciidoctor)是高性能的 Ruby AsciiDoc 官方参考处理器,可将 .adoc 文档转换为 HTML5、DocBook 5 或 Unix man 手册页。支持 -o - 标准输出流、-a 文档属性、-S safe 安全沙箱模式,以及 --failure-level WARN 严格警告失败退出码。
brew install asciidoctor 使用 asciidoctor 在本地毫秒级将 .adoc 编译为 HTML5、DocBook 或 man 手册页,无需 MCP 介入。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
确定性的无交互 CLI,支持 -o - 标准输出流、--failure-level WARN 与 -q,但缺少原生 --json 输出。
-o -stdout output and--failure-level WARNexit codes- Plain-text stderr diagnostics with no
--jsonflag
内置 -S(--safe-mode)多级安全模式(unsafe、safe、server、secure),可有效限制恶意文件包含与远程 URI 读取。
- Configurable
-Ssafe-mode sandbox for untrusted documents
可通过 brew install asciidoctor、gem install asciidoctor 及各 Linux 发行版包管理器轻松安装。
- Widely packaged via Homebrew, RubyGems, apt, and dnf
高速且符合规范的 AsciiDoc 处理器,支持 HTML5、DocBook5、man 手册及 asciidoctor-diagram/asciidoctor-pdf 扩展。
- Multi-backend conversion with rich
-aattribute overrides
Asciidoctor 官方项目(asciidoctor/asciidoctor),采用 MIT 协议持续维护。
- Official Asciidoctor GitHub organization
docs.asciidoctor.org 提供优秀的 CLI 手册页与命令参考。
- Official CLI reference at docs.asciidoctor.org
安全边界、鉴权与放权指南
无需凭据;纯离线处理本地 .adoc 文件。
100% 免费、离线、开源(MIT)。
# Asciidoctor Agent Rules - Keep default safe mode (`-S safe` or `-S secure`) when compiling untrusted `.adoc` inputs; avoid `-S unsafe` or `-a allow-uri-read`. - Use `--failure-level WARN` in CI/verification runs so broken `include::` directives fail the command. - Pass `-o -` for dry stdout validation without leaving build artifacts behind.
Agent 高频安全命令配方
只读查询(安全推荐)
asciidoctor -b html5 -o - --failure-level WARN doc.adoc > /dev/null
将 doc.adoc 渲染到 stdout 而不写入磁盘文件,出现警告时返回非零退出码。
asciidoctor --version
输出当前 asciidoctor 及 Ruby 运行时版本。
受控写入与预演
asciidoctor -b html5 -a toc=left -o out.html doc.adoc
将 doc.adoc 转换为独立的 out.html 并附带左侧目录属性。
核心优势
- + 支持
-o -标准输出流与--failure-level WARN,可实现零写入的语法与include::校验。 - + 内置
-S安全沙箱模式,能限制不可信文档的include::文件包含与外部 URI 读取。
注意事项与踩坑点
- ! 无
--json输出模式,无法结构化返回警告或 AST 信息。 - ! 导出 PDF 或渲染内嵌图表需额外安装 Ruby gem(
asciidoctor-pdf、asciidoctor-diagram)。