Skip to content
Open
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
32 changes: 30 additions & 2 deletions api-playground/sdk-reference-setup.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Generate SDK reference pages from doc-tool output"
sidebarTitle: "SDK reference setup"
description: "Publish SDK reference documentation in Mintlify from TypeDoc, DocFX, Javadoc, Sphinx, or phpDocumentor artifacts using the sdk navigation property."

Check warning on line 4 in api-playground/sdk-reference-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/sdk-reference-setup.mdx#L4

Use 'SDK' instead of 'sdk'.
keywords: ["sdk", "typedoc", "docfx", "javadoc", "sphinx", "phpdocumentor", "reference"]
---

Expand Down Expand Up @@ -57,8 +57,8 @@
"tab": "SDK Reference",
"sdk": {
"format": "typedoc",
"source": "sdk-artifacts/typedoc.json",

Check warning on line 60 in api-playground/sdk-reference-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/sdk-reference-setup.mdx#L60

Use 'SDK' instead of 'sdk'.
"directory": "sdk/typescript"

Check warning on line 61 in api-playground/sdk-reference-setup.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

api-playground/sdk-reference-setup.mdx#L61

Use 'TypeScript' instead of 'typescript'.
}
}
]
Expand All @@ -82,10 +82,11 @@
A group with `sdk` can also list `pages` that you write yourself. Your pages appear first, followed by the generated reference groups.

<Note>
You can declare `sdk` on a [tab](/organize/navigation#tabs) or a [group](/organize/navigation#groups).
You can declare `sdk` on a [tab](/organize/navigation#tabs), a [group](/organize/navigation#groups), or a [version](/organize/navigation#versions).

- A tab with `sdk` can include `groups`, but no other navigation structures, such as `pages`, `versions`, or `languages`. It also cannot include an `openapi`, `asyncapi`, or `graphql` property.
- A group with `sdk` can include `pages` and nested groups, but cannot include a `graphql` property.
- A version with `sdk` generates pages scoped to that version. See [Version your SDK reference](#version-your-sdk-reference).
</Note>

<ParamField path="format" type="string" required>
Expand All @@ -97,7 +98,7 @@
</ParamField>

<ParamField path="directory" type="string">
The URL path prefix for generated pages. Defaults to `sdk-reference`.
The URL path prefix for generated pages. Defaults to `sdk-reference`, or `sdk-reference/<version>` when declared on a version.
</ParamField>

Add multiple tabs or groups to document multiple libraries. For example, use two groups in the same tab for the stable and beta versions of an SDK. Use a unique `directory` for each library to avoid route collisions.
Expand All @@ -106,6 +107,33 @@
Add your artifact directory to [`.mintignore`](/organize/mintignore) so Mintlify treats artifacts as build inputs rather than publishing them as static assets.
</Tip>

## Version your SDK reference

Declare `sdk` on a version node in `navigation.versions` to generate a separate reference for each version of your SDK. Point each version's `source` at the artifact for that release.

```json
"navigation": {
"versions": [
{
"version": "v2",
"sdk": {
"format": "typedoc",
"source": "sdk-artifacts/typedoc-v2.json"
}
},
{
"version": "v1",
"sdk": {
"format": "typedoc",
"source": "sdk-artifacts/typedoc-v1.json"
}
}
]
}
```

When you omit `directory` on a version, generated pages default to `sdk-reference/<version>`, so versions do not collide. If you set `directory` explicitly, use a unique value for each version. Duplicate directories cause route collisions that fail the build.

## Generated pages

Mintlify adds the generated navigation groups after any `groups` on the tab. If you add `sdk` to a group, the generated groups appear after that group's `pages`. The groups vary by format and may represent modules, packages, namespaces, or symbol types.
Expand Down