# KnowledgeFormatter

**Kind:** Class

**Source:** [`atloria-monorepo/packages/doc-automation/src/v2/stages/stage-14-meta/knowledge-formatter.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/packages/doc-automation/src/v2/stages/stage-14-meta/knowledge-formatter.ts#L20)

## Methods

| Method | Signature | Returns |
|---|---|---|
| `format` | `format(reference: MetaCategoryReference | undefined, options: {
      maxChars: number;
      maxEntries: number;
      snippetTypes?: SnippetType[];
      groupByCategory?: boolean;
    })` | `string` |
| `formatDocList` | `formatDocList(reference: MetaCategoryReference | undefined, options: { maxEntries: number })` | `string` |
| `formatSnippets` | `formatSnippets(entries: KnowledgeEntry[], snippetType: SnippetType, maxChars: number)` | `string` |

## Where it refuses work

- `KnowledgeFormatter` stops the work with an early return when `!reference || !reference.entries || reference.entries.length === 0`, in 2 places.
- `KnowledgeFormatter` stops the work with an early return when `entries.length === 0`.
- `KnowledgeFormatter` stops the work with an early return when `options.groupByCategory`.
- `KnowledgeFormatter` stops the work with an early return when `!entries || entries.length === 0`.
