Skip to content

Commit 6855751

Browse files
Documentation edits made through Mintlify web editor
1 parent adcc332 commit 6855751

File tree

24 files changed

+388
-588
lines changed

24 files changed

+388
-588
lines changed

advanced/rest-api/overview.mdx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,23 @@ title: Overview
44

55
## Trigger Updates
66

7-
Leverage the REST API to programmatically trigger an update when desired.
8-
The primary use-case will be to trigger updates. We will be adding more and more
9-
functionality to the API overtime. Let us know what else you want to see in
10-
[our community](https://mintlify.com/community)!
7+
Use our REST API to trigger updates programmatically. More API functionality is in development - share feature requests in [our community](https://mintlify.com/community).
118

129
## Authentication
1310

14-
You can generate an API key through
15-
[the dashboard](https://dashboard.mintlify.com/settings/integrations). The API key is
16-
associated with the entire org and can be used across multiple deployments.
11+
Generate your API key in [the dashboard](https://dashboard.mintlify.com/settings/integrations). One API key works for all deployments in your org.
1712

1813
<Frame>
1914
<img src="/images/external-api-key.png" />
2015
</Frame>
2116

2217
## Discovery API
2318

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.
25-
Responses include citations so you can point your users to the right places they need to get help.
19+
The Discovery API lets you embed AI chat into any app. The chat is powered by your docs and provides cited responses to help users find information.
2620

2721
## Getting Started
2822

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

3125
<Frame>
3226
<img
@@ -36,10 +30,7 @@ To get started, you'll need to generate a Discovery API key in the [dashboard](h
3630
</Frame>
3731

3832
<Note>
39-
The Discovery API token is a public token that can be referenced in your
40-
frontend code whereas the API key is a server-side token that should be kept
41-
secret.
33+
Discovery API tokens are public and safe for frontend code. API keys are for server-side use only and should remain private.
4234
</Note>
4335

44-
Now that you have an API key, check out our [example](https://github.com/mintlify/discovery-api-example) for how to use
45-
the API for AI chat. You can also see a deployed version of this example at [chat.mintlify.com](https://chat.mintlify.com).
36+
See our [example implementation](https://github.com/mintlify/discovery-api-example) or check out the live demo at [chat.mintlify.com](https://chat.mintlify.com).

advanced/subpath/cloudflare.mdx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ description: "Host documentation at a /docs subpath using Cloudflare Workers"
55

66
## Create Cloudflare Worker
77

8-
Navigate to the `Workers & Pages > Create application > Create worker`. You
9-
should be able to presented with the following screen where you can create a new
10-
Cloudlfare worker.
8+
Go to `Workers & Pages > Create application > Create worker` to set up a new Cloudflare worker.
119

1210
<Frame>
1311
<img alt="Create a Cloudflare worker" src="/images/cloudflare/worker.png" />
1412
</Frame>
1513

1614
### Add custom domain
1715

18-
Once the worker is created, click `Configure worker`. Navigate to the worker
19-
`Settings > Triggers`. Click on `Add Custom Domain` to add your desired domain
20-
into the list - we recommend you add both the version with and without `www.`
21-
prepended to the domain.
16+
After creating the worker:
17+
1. Click `Configure worker`
18+
2. Go to `Settings > Triggers`
19+
3. Click `Add Custom Domain`
20+
4. Add your domain (both with and without `www.`)
2221

2322
<Frame>
2423
<img
@@ -27,21 +26,18 @@ prepended to the domain.
2726
/>
2827
</Frame>
2928

30-
If you have trouble setting up a custom subdirectory,
31-
[contact our support team](mailto:[email protected]) and we'll walk you through
32-
upgrading your hosting with us.
29+
Need help? [Contact our support team](mailto:[email protected]) for hosting upgrades.
3330

3431
### Edit Worker Script
3532

36-
Click on `Edit Code` and add the following script into the worker's code.
33+
Click `Edit Code` and add this script:
3734

3835
<Frame>
3936
<img alt="Cloudflare edit code" src="/images/cloudflare/edit-code.png" />
4037
</Frame>
4138

4239
<Tip>
43-
Edit `DOCS_URL` by replacing `[SUBDOMAIN]` with your unique subdomain and
44-
`CUSTOM_URL` with your website's base URL.
40+
Replace `[SUBDOMAIN]` with your subdomain and `CUSTOM_URL` with your website's URL in `DOCS_URL`.
4541
</Tip>
4642

4743
```javascript
@@ -76,5 +72,4 @@ async function handleRequest(request) {
7672
}
7773
```
7874

79-
Click on `Deploy` and wait for the changes to propagate (it can take up to a few
80-
hours).
75+
Deploy and wait for changes to propagate (up to a few hours).
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: 'MDX Setup'
3-
description: 'Generate docs pages for your API endpoints using MDX'
3+
description: 'Generate API docs 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+
Define your API endpoints using `mint.json` config, MDX metadata, and the `<ParamFields />` component to generate an API playground with request 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+
Add API configuration to your `mint.json`:
1111

1212
```json
1313
{
@@ -20,7 +20,7 @@ Mintlify allows you to define your API endpoints using a combination of `mint.js
2020
}
2121
```
2222

23-
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:
23+
To hide the API playground:
2424

2525
```json
2626
{
@@ -32,12 +32,11 @@ Mintlify allows you to define your API endpoints using a combination of `mint.js
3232
}
3333
```
3434

35-
Find a full list of API configurations [here](/settings/global#api-configurations).
35+
See all API configurations [here](/settings/global#api-configurations).
3636
</Step>
3737

38-
<Step title="Create your endpoint pages">
39-
40-
Each API endpoint page should have a corresponding MDX file. At the top of each file, define:
38+
<Step title="Create endpoint pages">
39+
Create an MDX file for each endpoint with the required metadata:
4140

4241
```md
4342
---
@@ -46,20 +45,18 @@ Mintlify allows you to define your API endpoints using a combination of `mint.js
4645
---
4746
```
4847

49-
You can specify path parameters by adding the parameter name to the path, wrapped with `{}`:
48+
For path parameters, use `{}`:
5049

5150
```bash
5251
https://api.example.com/v1/endpoint/{userId}
5352
```
5453

5554
<Note>
56-
57-
If you have `baseUrl` configured in [mint.json](/settings/global), you can use relative paths like `/v1/endpoint`.
58-
55+
With `baseUrl` configured in mint.json, you can use relative paths like `/v1/endpoint`
5956
</Note>
6057
</Step>
6158

62-
<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).
59+
<Step title="Add to navigation">
60+
Add endpoint pages to your sidebar in `mint.json`'s `navigation` field. See [navigation docs](/settings/navigation).
6461
</Step>
65-
</Steps>
62+
</Steps>

api-playground/openapi/setup.mdx

Lines changed: 30 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ description: "Reference OpenAPI endpoints in your docs pages"
55

66
## Add an OpenAPI specification file
77

8-
To describe your endpoints with OpenAPI, make sure you have a valid OpenAPI
9-
document in either JSON or YAML format that follows the
10-
[OpenAPI specification](https://swagger.io/specification/). Your document must
11-
follow OpenAPI specification 3.0+.
8+
Add your OpenAPI document (JSON or YAML) following the [OpenAPI 3.0+ specification](https://swagger.io/specification/).
129

1310
## Auto-populate API pages
1411

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.
12+
The quickest setup: Add an `openapi` field to your `mint.json` under a tab or anchor. Use either a file path or URL to your OpenAPI doc.
1613

17-
**Example with Anchors:**
14+
**Using Anchors:**
1815

1916
```json {5}
2017
{
@@ -29,9 +26,7 @@ The fastest way to get started with OpenAPI is to add an `openapi` field to a ta
2926
}
3027
```
3128

32-
![](/images/anchors-autogeneration-anchors.png)
33-
34-
**Example with Tabs:**
29+
**Using Tabs:**
3530

3631
```json {6}
3732
{
@@ -45,108 +40,50 @@ The fastest way to get started with OpenAPI is to add an `openapi` field to a ta
4540
}
4641
```
4742

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-
53-
When using this option, the metadata for the generated pages will have the following default values:
54-
55-
* `title`: The `summary` field from the OpenAPI operation, if present. Otherwise a title generated from the HTTP method and endpoint.
56-
57-
* `description`: The `description` field from the OpenAPI operation, if present.
58-
59-
* `version`: The `version` value from the anchor or tab, if present.
43+
<Tip>Validate your OpenAPI spec: `mintlify openapi-check <openapiFilenameOrUrl>`</Tip>
6044

61-
There are some scenarios in which the default behavior isn't sufficient. If you need more customizability, you can create an MDX page for your OpenAPI operation, and modify it just like any other MDX page.
45+
Default page metadata will use:
46+
- `title`: OpenAPI operation's `summary` or auto-generated from method/endpoint
47+
- `description`: OpenAPI operation's `description`
48+
- `version`: Anchor/tab's version value
6249

63-
## Create MDX files for API pages
50+
## Custom API Pages
6451

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;
52+
Need more control? Create MDX pages for your API operations.
6653

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-
```
54+
### Generate MDX Files Automatically
8055

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.
56+
For large APIs, use our scraper to generate MDX files:
8357

8458
```bash
8559
npx @mintlify/scraping@latest openapi-file <path-to-openapi-file> -o api-reference
8660
```
8761

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.
94-
9562
<Note>
96-
If your OpenAPI document is invalid, the files will not autogenerate.
63+
Invalid OpenAPI docs won't generate files.
9764
</Note>
9865

99-
### Manually specify files
100-
101-
You can always create an MDX page manually, and reference the OpenAPI operation in the page's metadata using the `openapi` field.
102-
103-
<Snippet file="api-playground/openapi.mdx" />
104-
105-
By using the OpenAPI reference, the name, description, parameters, responses,
106-
and the API playground will be automatically generated from the OpenAPI document.
107-
108-
If you have multiple OpenAPI files, include the path to the OpenAPI file to ensure Mintlify finds the correct OpenAPI document. This is not required if you have
109-
only one OpenAPI file - it will automatically detect your OpenAPI file.
110-
111-
<CodeGroup>
112-
```md Example
113-
---
114-
title: "Get users"
115-
openapi: "/path/to/openapi-1.json GET /users"
116-
---
117-
```
66+
### Manual MDX Creation
11867

119-
```md Format
120-
---
121-
title: "title of the page"
122-
openapi: openapi-file-path method path
123-
---
124-
```
125-
</CodeGroup>
68+
Create custom MDX pages by referencing OpenAPI operations in the frontmatter:
12669

127-
<br />
70+
```md
71+
---
72+
title: "Get users"
73+
openapi: "/path/to/openapi.json GET /users"
74+
---
75+
```
12876

12977
<Note>
130-
The method and path must match the method and path specified in the OpenAPI
131-
document exactly. If the endpoint doesn't exist in the OpenAPI file,
132-
the page will be empty.
78+
Method and path must exactly match your OpenAPI document.
13379
</Note>
13480

135-
## Create MDX files for OpenAPI schemas
81+
## OpenAPI Schema Pages
13682

137-
Mintlify also allows you to create individual pages for any OpenAPI schema
138-
defined in an OpenAPI document's `components.schemas` field:
83+
Create pages for schema definitions using:
13984

140-
<CodeGroup>
141-
```md Example
142-
---
143-
openapi-schema: OrderItem
144-
---
145-
```
146-
147-
```md Format
148-
---
149-
openapi-schema: "schema-key"
150-
---
151-
```
152-
</CodeGroup>
85+
```md
86+
---
87+
openapi-schema: "schema-key"
88+
---
89+
```

code.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ icon: 'code'
88

99
### Inline Code
1010

11-
To denote a `word` or `phrase` as code, enclose it in backticks (`).
11+
Use backticks (`) to mark `code` within text.
1212

1313
```
14-
To denote a `word` or `phrase` as code, enclose it in backticks (`).
14+
Use backticks (`) to mark `code` within text.
1515
```
1616

1717
### Code Block
1818

19-
Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks and follow the leading ticks with the programming language of your snippet to get syntax highlighting. Optionally, you can also write the name of your code after the programming language.
19+
Create code blocks using three backticks. Add a language name for syntax highlighting, and optionally a filename.
2020

2121
```java HelloWorld.java
2222
class HelloWorld {
@@ -36,4 +36,4 @@ class HelloWorld {
3636
```
3737
````
3838

39-
Visit the [Code Block page](/content/components/code) for more detailed docs.
39+
For more details, see the [Code Block page](/content/components/code).

0 commit comments

Comments
 (0)