For AI agents: the complete documentation index is available at https://lazygophers.github.io/pamphlet/llms.txt, the full documentation bundle is available at https://lazygophers.github.io/pamphlet/llms-full.txt, and this page is available as Markdown at https://lazygophers.github.io/pamphlet/reference/cli/extract.md.
  • 简体中文
  • extract

    从产物里把源文档原样吐回来。

    pamphlet extract 方案.html > 还原.md

    源文档默认内嵌在产物的 HTML 注释里,所以产物即备份 —— 只剩一个 HTML 文件也能把 .md 拿回来。

    用 --no-embed-source 编的就没有

    那样编出来的产物里没有这段注释,extract 会失败退出 1。

    什么时候该关掉内嵌:产物要发给外部、而源文档里有不该给对方看的注释或草稿。代价就是失去这个还原能力。

    体积上的代价可以量出来 —— 跑 pamphlet build --verbose 看「源文档注释」那一行占多少(实测本仓库的示例是 3.8KB,占 11%)。