The libs option configures how Docgeni scans a component library, organizes documentation, generates API docs, and groups components. Each entry in the libs array represents one library.
stringnullThe library name. It should match the lib field in global navs configuration.
string{name}The library abbreviation prefix. Angular libraries commonly use a short prefix, such as mat for Material and nz for NG-ZORRO.
If the abbreviation is thy, modules and components typically use that prefix, for example ThyButtonModule and thyButton. Docgeni uses it to generate component identifiers and example code:
html<thy-button></thy-button> <example name="thy-button-basic-example" />
stringnullThe library root directory. It must contain package.json. Docgeni scans first-level folders under this directory as components and looks for documentation, API definitions, and examples in each one. The default folders are doc, api, and examples.
string | Array<string>[]By default, Docgeni only scans first-level folders under rootDir. Use include to scan additional nested paths when components are not placed directly under rootDir.
For example, with include: 'common', Docgeni scans first-level folders under common and matches documentation, API files, and examples using the same component rules.
We recommend placing components directly under
rootDir. If you use Angular CLI's defaultsrc/libstructure, configureinclude: ['src', 'src/lib']and keeprootDirat the same level aspackage.json.
string | Array<string>[]By default, every folder under rootDir is treated as a component directory. Use exclude to skip non-component folders. Glob syntax is supported.
stringtsconfig.lib.jsonThe TypeScript config file name. When NgDoc generates API docs, it combines rootDir and tsConfig into tsConfigPath.
{[id: string]: { text: string; color: string }} | Array<LabelDef>[{ id: 'new', ... }, { id: 'deprecated', ... }, { id: 'experimental', ... }]Library label configuration. Built-in labels include new, deprecated, and experimental. You can override or extend them and reference the corresponding id in a component's Front Matter label field. Default labels:
json{ "new": { "text": "New", "color": "#73D897" }, "deprecated": { "text": "Deprecated", "color": "#AAAAAA" }, "experimental": { "text": "Experimental", "color": "#F6C659" } }
stringdocThe component documentation directory. Docgeni looks for {localeKey}.md files based on locales and displays them in the component overview.
├── doc │ ├── zh-cn.md │ ├── en-us.md
stringapiThe component API directory. Docgeni looks for {localeKey}.suffix files based on locales. Supported suffixes are .json, .yaml, .yml, .js, and .config.js. Example using js:
jsmodule.exports = [ { type: 'directive', name: 'alibButton', description: 'Button component, supports both alibButton directive and alib-button component forms', // Optional properties: [ { name: 'alibType', type: 'string', default: 'primary', description: 'Button type, supports primary | info | warning | danger' }, { name: 'alibSize', type: 'string', default: 'null', description: 'Button size, supports sm | md | lg' } ] } ];
To generate API docs automatically, configure apiMode.
stringexamplesThe root directory for component examples. Each first-level folder under this directory is treated as one example.
├── examples │ ├── basic │ │ ├── basic.component.html │ │ ├── basic.component.scss │ │ └── basic.component.ts │ ├── advance │ │ ├── advance.component.html │ │ ├── advance.component.scss │ │ └── advance.component.ts
Array<Category>nullComponent category configuration. Docgeni groups components with the same category in the left menu. Each category includes id, title, and locales:
id: unique category identifier, referenced by the component Front Matter category fieldtitle: category titlelocales: localized titlesjson[ { "name": "alib", "rootDir": "./packages/a-lib", "categories": [ { "id": "general", "title": "General", "locales": { "en-us": { "title": "General" } } }, { "id": "layout", "title": "Layout", "locales": { "en-us": { "title": "Layout" } } } ] } ]
'compatible' | 'manual' | 'automatic'manualAPI generation mode for components:
manual: define API docs manually in configuration files; this is the defaultautomatic: generate API docs automatically from source commentscompatible: use API definition files when present, otherwise fall back to comment-based generation