Skip to content

Commit 888136b

Browse files
committed
Merge branch 'main' into improve-documentation-readability-and-onboarding-84e45ba7
2 parents 8fd860f + 91d7bee commit 888136b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+3142
-1228
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Index docs
2+
3+
on:
4+
schedule:
5+
- cron: "0 */3 * * *"
6+
7+
jobs:
8+
lint:
9+
name: Lint
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: '18'
17+
18+
- name: Install CLI
19+
run: npm install -g @team-plain/cli@latest
20+
21+
- name: Index Docs
22+
run: plain index-sitemap https://mintlify.com/docs/sitemap.xml
23+
env:
24+
PLAIN_API_KEY: ${{ secrets.PLAIN_API_KEY }}
File renamed without changes.
File renamed without changes.

advanced/rest-api/overview.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,24 @@ associated with the entire org and can be used across multiple deployments.
1919
<img src="/images/external-api-key.png" />
2020
</Frame>
2121

22-
## Discovery API
22+
## Chat API
2323

24-
The Discovery API allows you to embed an AI chat experience grounded in your docs and continually kept up to date into any application of your choosing.
24+
The Chat API allows you to embed an AI chat experience grounded in your docs and continually kept up to date into any application of your choosing.
2525
Responses include citations so you can point your users to the right places they need to get help.
2626

2727
## Getting Started
2828

29-
To get started, you'll need to generate a Discovery API key in the [dashboard](https://dashboard.mintlify.com/products/chat/widget):
29+
To get started, you'll need to generate a Chat API key in the [dashboard](https://dashboard.mintlify.com/products/chat/widget):
3030

3131
<Frame>
3232
<img
33-
alt="Create a Discovery API key"
33+
alt="Create a Chat API key"
3434
src="/images/generate-discovery-api-key.png"
3535
/>
3636
</Frame>
3737

3838
<Note>
39-
The Discovery API token is a public token that can be referenced in your
39+
The Chat API token is a public token that can be referenced in your
4040
frontend code whereas the API key is a server-side token that should be kept
4141
secret.
4242
</Note>

api-playground/mdx/authentication.mdx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ description: "You can set authentication parameters to let users use their real
55

66
## Enabling Authentication
77

8-
You can add an authentication method to your mint.json to enable it on every page or you can set it on a per-page basis.
8+
You can add an authentication method to your docs.json to enable it on every page or you can set it on a per-page basis.
99

10-
The page's authentication method will override mint.json if both are set.
10+
The page's authentication method will override docs.json if both are set.
1111

1212
### Bearer Token
1313

1414
<CodeGroup>
1515

16-
```json mint.json
16+
```json docs.json
1717
"api": {
18-
"auth": {
18+
"mdx": {
19+
"auth": {
1920
"method": "bearer"
21+
}
2022
}
2123
}
2224
```
@@ -34,10 +36,12 @@ authMethod: "bearer"
3436

3537
<CodeGroup>
3638

37-
```json mint.json
39+
```json docs.json
3840
"api": {
39-
"auth": {
41+
"mdx": {
42+
"auth": {
4043
"method": "basic"
44+
}
4145
}
4246
}
4347
```
@@ -55,11 +59,13 @@ authMethod: "basic"
5559

5660
<CodeGroup>
5761

58-
```json mint.json
62+
```json docs.json
5963
"api": {
60-
"auth": {
64+
"mdx": {
65+
"auth": {
6166
"method": "key",
6267
"name": "x-api-key"
68+
}
6369
}
6470
}
6571
```
@@ -75,7 +81,7 @@ authMethod: "key"
7581

7682
### None
7783

78-
The "none" authentication method is useful to disable authentication on a specific endpoint after setting a default in mint.json.
84+
The "none" authentication method is useful to disable authentication on a specific endpoint after setting a default in docs.json.
7985

8086
<CodeGroup>
8187
```md Page Metadata

api-playground/mdx/configuration.mdx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@ title: 'MDX Setup'
33
description: 'Generate docs pages for your API endpoints using MDX'
44
---
55

6-
Mintlify allows you to define your API endpoints using a combination of `mint.json` configuration, MDX metadata fields, and the `<ParamFields />` component. From the defined endpoints, we generate an API playground, request examples, and response examples.
6+
Mintlify allows you to define your API endpoints using a combination of `docs.json` configuration, MDX metadata fields, and the `<ParamFields />` component. From the defined endpoints, we generate an API playground, request examples, and response examples.
77

88
<Steps>
99
<Step title="Configure your API">
10-
In your `mint.json` file, define your base URL and auth method:
10+
In your `docs.json` file, define your base URL and auth method:
1111

1212
```json
13-
{
14-
"api": {
15-
"baseUrl": "https://mintlify.com/api", // string array for multiple base URLs
13+
"api": {
14+
"mdx": {
15+
"server": "https://mintlify.com/api", // string array for multiple base URLs
1616
"auth": {
17-
"method": "bearer" // options: bearer, basic, key.
17+
"method": "key",
18+
"name": "x-api-key" // options: bearer, basic, key.
1819
}
1920
}
2021
}
@@ -23,16 +24,14 @@ Mintlify allows you to define your API endpoints using a combination of `mint.js
2324
If you would not like to show an API playground, you don't need to include auth types. Hide the playground with the following field:
2425

2526
```json
26-
{
27-
"api": {
28-
"playground": {
29-
"mode": "hide"
30-
}
27+
"api": {
28+
"playground": {
29+
"display": "none"
3130
}
3231
}
3332
```
3433

35-
Find a full list of API configurations [here](/settings/global#api-configurations).
34+
Find a full list of API configurations [here](/settings/global#param-api).
3635
</Step>
3736

3837
<Step title="Create your endpoint pages">
@@ -54,12 +53,12 @@ Mintlify allows you to define your API endpoints using a combination of `mint.js
5453

5554
<Note>
5655

57-
If you have `baseUrl` configured in [mint.json](/settings/global), you can use relative paths like `/v1/endpoint`.
56+
If you have `server` configured in [docs.json](/settings/global), you can use relative paths like `/v1/endpoint`.
5857

5958
</Note>
6059
</Step>
6160

6261
<Step title="Add your endpoints to your docs">
63-
Add your endpoint pages to the sidebar by adding the paths to the `navigation` field in your `mint.json`. Learn more about structuring your docs [here](/settings/navigation).
62+
Add your endpoint pages to the sidebar by adding the paths to the `navigation` field in your `docs.json`. Learn more about structuring your docs [here](/settings/navigation).
6463
</Step>
6564
</Steps>

api-playground/openapi/setup.mdx

Lines changed: 56 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,48 +8,47 @@ description: "Reference OpenAPI endpoints in your docs pages"
88
To describe your endpoints with OpenAPI, make sure you have a valid OpenAPI
99
document in either JSON or YAML format that follows the
1010
[OpenAPI specification](https://swagger.io/specification/). Your document must
11-
follow OpenAPI specification 3.0+.
11+
follow OpenAPI specification 3.0+.
12+
<Tip>To validate your OpenAPI spec, use our [CLI](https://www.npmjs.com/package/mintlify) and run this command: <br/>`mintlify openapi-check <openapiFilenameOrUrl>`</Tip>
1213

1314
## Auto-populate API pages
1415

15-
The fastest way to get started with OpenAPI is to add an `openapi` field to a tab or anchor in the `mint.json`. This field can contain either the path to an OpenAPI document in your docs repo, or the URL of a hosted OpenAPI document. Mintlify will automatically generate a page for each OpenAPI operation and place them in the tab/anchor.
16+
The fastest way to get started with OpenAPI is to add an `openapi` field to a tab in the `docs.json`. This field can contain either the path to an OpenAPI document in your docs repo, or the URL of a hosted OpenAPI document. Mintlify will automatically generate a page for each OpenAPI operation and place them in the tab.
1617

17-
**Example with Anchors:**
1818

19+
**Example with Tabs:**
1920
```json {5}
20-
{
21-
"anchors": [
21+
"navigation": {
22+
"tabs": [
2223
{
23-
"name": "API Reference",
24-
"openapi": "/path/to/openapi.json",
25-
"url": "api-reference",
26-
"icon": "square-terminal"
24+
"tab": "API Reference",
25+
"openapi": "https://petstore3.swagger.io/api/v3/openapi.json"
2726
}
2827
]
2928
}
3029
```
30+
![](/images/autogeneration-with-tabs.png)
3131

32-
![](/images/anchors-autogeneration-anchors.png)
33-
34-
**Example with Tabs:**
35-
36-
```json {6}
37-
{
32+
**Example with Groups:**
33+
```json {8-11}
34+
"navigation": {
3835
"tabs": [
3936
{
40-
"name": "API Reference",
41-
"url": "api-reference",
42-
"openapi": "https://petstore3.swagger.io/api/v3/openapi.json"
37+
"tab": "API Reference",
38+
"groups": [
39+
{
40+
"group": "Endpoints",
41+
"openapi": {
42+
"source": "/path/to/openapi-1.json",
43+
"directory": "api-reference"
44+
}
45+
}
46+
]
4347
}
4448
]
4549
}
4650
```
4751

48-
![](/images/autogeneration-with-tabs.png)
49-
50-
<Tip>To validate your OpenAPI spec, you can use this command: <br/>`mintlify openapi-check <openapiFilenameOrUrl>`</Tip>
51-
52-
5352
When using this option, the metadata for the generated pages will have the following default values:
5453

5554
* `title`: The `summary` field from the OpenAPI operation, if present. Otherwise a title generated from the HTTP method and endpoint.
@@ -62,39 +61,9 @@ There are some scenarios in which the default behavior isn't sufficient. If you
6261

6362
## Create MDX files for API pages
6463

65-
If you want to customize the page metadata, add additional content, omit certain OpenAPI operations, or reorder OpenAPI pages in your navigation, you'll need an MDX page for each operation. Here is [an example MDX OpenAPI page](https://github.com/elevenlabs/elevenlabs-docs/blob/e5e267c97b8d1e4c21db1dcdb8b005eb1dfed7da/api-reference/speech-to-speech.mdx?plain=1#L2) from [Elevenlabs](https://elevenlabs.io/docs/api-reference/speech-to-speech).&#x20;
66-
67-
![](/images/elevenlabs-mdx-autogeneration-example.png)
68-
69-
### Autogenerate files
70-
71-
For large OpenAPI documents, creating one MDX page for each OpenAPI operation can be a lot of work. To make it easier, we created a local OpenAPI page scraper.
72-
73-
Our Mintlify [scraper](https://www.npmjs.com/package/@mintlify/scraping)
74-
autogenerates MDX files for your OpenAPI endpoints. Use the relative path to the
75-
OpenAPI document in your codebase.
76-
77-
```bash
78-
npx @mintlify/scraping@latest openapi-file <path-to-openapi-file>
79-
```
80-
81-
Add the `-o` flag to specify a folder to populate the files into. If a folder is
82-
not specified, the files will populate in the working directory.
83-
84-
```bash
85-
npx @mintlify/scraping@latest openapi-file <path-to-openapi-file> -o api-reference
86-
```
87-
88-
Learn more about our scraping package [here](https://www.npmjs.com/package/@mintlify/scraping).
89-
90-
The scraper will output an array of
91-
[Navigation entries](/settings/global#structure) containing your OpenAPI MDX
92-
files. You can either append these entries to your existing Navigation, or
93-
reorder and add the files to your navigation manually.
64+
If you want to customize the page metadata, add additional content, omit certain OpenAPI operations, or reorder OpenAPI pages in your navigation, you'll need an MDX page for each operation. Here is [an example MDX OpenAPI page](https://github.com/mindsdb/mindsdb/blob/main/docs/rest/databases/create-databases.mdx) from [MindsDB](https://docs.mindsdb.com/rest/databases/create-databases).&#x20;
9465

95-
<Note>
96-
If your OpenAPI document is invalid, the files will not autogenerate.
97-
</Note>
66+
![](/images/mindsdb.png)
9867

9968
### Manually specify files
10069

@@ -132,6 +101,38 @@ only one OpenAPI file - it will automatically detect your OpenAPI file.
132101
the page will be empty.
133102
</Note>
134103

104+
### Autogenerate files
105+
106+
For large OpenAPI documents, creating one MDX page for each OpenAPI operation can be a lot of work. To make it easier, we created a local OpenAPI page scraper.
107+
108+
Our Mintlify [scraper](https://www.npmjs.com/package/@mintlify/scraping)
109+
autogenerates MDX files for your OpenAPI endpoints. Use the relative path to the
110+
OpenAPI document in your codebase.
111+
112+
```bash
113+
npx @mintlify/scraping@latest openapi-file <path-to-openapi-file>
114+
```
115+
116+
Add the `-o` flag to specify a folder to populate the files into. If a folder is
117+
not specified, the files will populate in the working directory.
118+
119+
```bash
120+
npx @mintlify/scraping@latest openapi-file <path-to-openapi-file> -o api-reference
121+
```
122+
123+
Learn more about our scraping package [here](https://www.npmjs.com/package/@mintlify/scraping).
124+
125+
The scraper will output an array of
126+
[Navigation entries](/settings/global#structure) containing your OpenAPI MDX
127+
files. You can either append these entries to your existing Navigation, or
128+
reorder and add the files to your navigation manually.
129+
130+
<Note>
131+
If your OpenAPI document is invalid, the files will not autogenerate.
132+
</Note>
133+
134+
135+
135136
## Create MDX files for OpenAPI schemas
136137

137138
Mintlify also allows you to create individual pages for any OpenAPI schema

api-playground/troubleshooting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ openapi: "v1 GET /users/{id}"
7676

7777
Alternatively, if your reverse proxy prevents you from accepting `POST` requests, you can configure
7878
Mintlify to send requests directly to your backend with the `api.playground.disableProxy`
79-
setting in the `mint.json`, as described [here](/settings/global#api-configurations). This will
79+
setting in the `docs.json`, as described [here](/settings/global#api-configurations). This will
8080
likely require you to configure CORS on your server, as these requests will now come directly
8181
from your users' browsers.
8282

0 commit comments

Comments
 (0)