@ docmd/ plugin- okf
生成一个 打开知识格式 (OKF)在构建时间捆绑,所以你的文档可以被AI代理消耗——双子座,克洛德,GPT,Cursor,以及任何能说出供应商中立的OKF spec的工具.
OKF 代表组织知识,作为带有 YAML 前题并加有打入的表的下标文件目录(okf.yaml),交互式图表查看器,以及机器可读的捆绑摘要. 捆绑坐在你的网站旁边(例如. site/okf/)所以可以直接指向代理人.
// docmd.config.json
{
"plugins": {
"okf": {
// config options, okf is enabled by default
}
}
}
部分 医生 文档引擎.
产出结构
site/okf/ # Always emitted
├── okf.yaml # Typed manifest (bundle summary)
├── index.md # Karpathy-style catalog grouped by type
├── concepts/
│ └── <slug>.md # One markdown file per page
└── _meta/
├── bundle.json # JSON mirror of okf.yaml
└── lint-report.txt # Warnings produced during generation
# Emitted only when `plugins.okf.graph: true`
├── graph/ # Interactive viewer (open /okf/graph/)
│ ├── index.html # Force-directed graph viewer
│ ├── graph.json # Graph data (nodes + edges)
│ ├── graph.js # Viewer runtime (vanilla, no CDN deps)
│ └── graph.css # Viewer styles (theme-aware)
每个概念文件都带有 OKF 要求 type 字段在前题加上正版的平面标记,所以一个代理既可以导航清单,也可以阅读完整页.
选项
| 选项 | 类型 | 默认 | 说明 |
|---|---|---|---|
outputDir | string | 'okf' | Bundle 目录,相对于站点输出. |
bundleName | string | 斜体 config.title | 内部使用的名称 okf.yaml 和图查看器标题. |
defaultType | string | 'concept' | 类型指定为没有明确类型的页面 . |
typeField | string | 'type' | OKF类型的前题字段名. |
warnOnMissingType | boolean | true | 发送一个 TUI 警告,用于返回到 defaultType。 。 。 . |
includeFullMarkdown | boolean | true | 复制原始 .md 每个概念文件的正文. |
graph | boolean | false | 释放一个 graph/ 包含 index.html + 键 graph.js + 键 graph.css + 键 graph.json. Opt-in自0.8.8起——OKF spec不需要取景器,而运出额外文件默认会给干净的捆绑增加噪音. 观众可以到达 /okf/graph/ 没有自定义文件名,并获取 graph.json 从运行时的同一目录中, 所以 file:// 还行. |
localeStrategy | 'default-only' | 'folders' | 'mixed' | 'latest-only' | 'default-only' | 默认的单- locale( 捆绑只包含默认地块中的页面) 。 设定为 'folders' 当 i18n 启用时, 以 locale id 为单位嵌入概念,或 'mixed' 编号 : 'latest-only' 其他战略. |
versionStrategy | 'folders' | 'mixed' | 'latest-only' | 'latest-only' | 启用版本时, 以版本 id 为单位的巢穴概念 . |
excludePatterns | string[] | [] | 在顶部跳过的额外光彩图案 frontmatter.noindex 编号 : frontmatter.okf === false。 。 。 . |
每页选择退出
页面可以选择两种方式退出 OKF 捆绑:
---
noindex: true # also excludes from sitemap, llms.txt, etc.
---
---
okf: false # only excludes from the OKF bundle
---
类型分辨率优先
每页插件选择一个具有此优先级的类型 :
frontmatter.okf.type(已注销)frontmatter.type(顶级)frontmatter.okfType(遗产)- 路径前缀推论( 如.
/guides/foo→guide(中文(简体) ) defaultType(如果warnOnMissingType(中文(简体) )
路径前缀地图覆盖 guides/, (中文(简体) ), api/, (中文(简体) ), reference/, (中文(简体) ), concepts/, (中文(简体) ), runbooks/, (中文(简体) ), datasets/, (中文(简体) ), metrics/,以及 tables/。 。 。 .
文档
见 文件.doc.docmd.io 用于充分使用和API参考.
许可证
麻省理工学院