deno doc: Generate API Docs in CI
deno doc reads the JSDoc and type signatures of a module and prints or emits its public API.
deno doc turns your exports plus JSDoc into reference output, and with --lint it can fail CI when public symbols are undocumented.
What it does
deno doc analyzes the exported symbols of a module and renders their documentation. It can print to the terminal, emit JSON, generate static HTML, or with --lint enforce that public API is documented.
Common usage
deno doc mod.ts
deno doc --json mod.ts
deno doc --html --name=MyLib mod.ts
# fail CI on missing or invalid docs
deno doc --lint mod.tsOptions
| Flag | What it does |
|---|---|
| --json | Output documentation as JSON |
| --html | Generate a static HTML documentation site |
| --lint | Fail on missing or invalid documentation |
| --name <name> | Project name for HTML output |
| --filter <symbol> | Show docs for a specific symbol |
| --private | Include non-exported symbols |
In CI
Add deno doc --lint as a gate so public exports must carry JSDoc, and run deno doc --html in a docs job to publish the site. Neither needs permissions, so they are cheap to add.
Common errors in CI
deno doc --lint reports "Missing JSDoc comment" or "Exported symbol ... is missing an explicit type" and exits non-zero. "Module not found" means the entry path is wrong. If --html writes nothing, confirm the module actually has exports to document.