Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions docs/API_REFERENCE_GENERATOR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# API Reference Generator

The SDK exports `ApiDocGenerator` for creating API references from TypeScript
source text and JSDoc comments. It can produce complete Markdown and HTML
documents, or a JSON manifest for integration with other documentation tools.

```ts
import { ApiDocGenerator } from '@stellar-split/sdk';

const generator = new ApiDocGenerator({
version: '1.2.0',
title: 'SDK API Reference',
sources: {
client: clientSourceText,
wallets: walletSourceText,
},
categories: {
client: 'Core',
wallets: 'Wallets',
},
includeDeprecated: false,
});

const markdown = generator.generate('markdown');
const html = generator.generate('html');
const manifest = generator.generate('json');
```

`generate()` accepts `markdown`, `html`, or `json`. The JSON output is a
serialized `DocManifest` containing the SDK version, parsed entries, navigation
tree, and sorted entry index. `generateManifest()` returns that typed object
directly. `generateModuleMarkdown()`, `generateIndex()`, `search()`, and the
entry accessors are also available for custom documentation workflows.

Sources are keyed by module name and should contain JSDoc comments immediately
before the declarations they describe. Supported metadata includes
`@param`, `@returns`, `@example`, `@deprecated`, and `@since`. Entries default
to the `General` category when no category mapping is provided.
Loading