Skip to content

Commit 573eaa5

Browse files
authored
Create AI optimization group (#920)
* update `docs.json` * add snippet * update nav * add llms.txt page * update assistant title * add contextual menu page * add markdown export page * remove ai-ingestion page * reviewer feedback
1 parent 8260517 commit 573eaa5

File tree

7 files changed

+206
-157
lines changed

7 files changed

+206
-157
lines changed

ai-ingestion.mdx

Lines changed: 0 additions & 148 deletions
This file was deleted.

ai/contextual-menu.mdx

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: "Contextual menu"
3+
description: "Add one-click AI integrations to your docs"
4+
icon: "square-menu"
5+
---
6+
7+
import { PreviewButton } from "/snippets/previewbutton.jsx"
8+
9+
The contextual menu provides quick access to AI-optimized content and direct integrations with popular AI tools. When users select the contextual menu on any page, they can copy content as context for AI tools or open conversations in ChatGPT, Claude, Perplexity, or a custom tool of your choice with your documentation already loaded as context.
10+
11+
## Menu options
12+
13+
- **Copy page**: Copies the current page as Markdown for pasting as context into AI tools.
14+
- **View as Markdown**: Opens the current page as Markdown.
15+
- **Open in ChatGPT**: Creates a ChatGPT conversation with the current page as context.
16+
- **Open in Claude**: Creates a Claude conversation with the current page as context.
17+
- **Open in Perplexity**: Creates a Perplexity conversation with the current page as context.
18+
- **[Your custom options](#adding-custom-options)**: Add your own options to the menu.
19+
20+
<Frame>
21+
<img
22+
src="/images/contextual-menu/contextual-menu.png"
23+
alt="The expanded contextual menu showing the Copy page, View as Markdown, Open in ChatGPT, and Open in Claude menu items."
24+
/>
25+
</Frame>
26+
27+
## Enabling the contextual menu
28+
29+
Add the `contextual` field to your `docs.json` file and specify which options you want to include.
30+
31+
```json
32+
{
33+
"contextual": {
34+
"options": [
35+
"copy",
36+
"view",
37+
"chatgpt",
38+
"claude",
39+
"perplexity"
40+
]
41+
}
42+
}
43+
```
44+
45+
## Adding custom options
46+
47+
Create custom options in the contextual menu by adding an object to the `options` array. Each custom option requires these properties:
48+
49+
<ResponseField name="title" type="string" required>
50+
The title of the option.
51+
</ResponseField>
52+
53+
<ResponseField name="description" type="string" required>
54+
The description of the option. Displayed beneath the title when the contextual menu is expanded.
55+
</ResponseField>
56+
57+
<ResponseField name="icon" type="string" required>
58+
The icon of the option. Accepts any icon from the [Icons](/components/icons) collection.
59+
</ResponseField>
60+
61+
<ResponseField name="href" type="string | object" required>
62+
The href of the option. Use a string for simple links or an object for dynamic links with query parameters.
63+
64+
<Expandable title="href object">
65+
<ResponseField name="base" type="string" required>
66+
The base URL for the option.
67+
</ResponseField>
68+
69+
<ResponseField name="query" type="object" required>
70+
The query parameters for the option.
71+
72+
<Expandable title="query object">
73+
<ResponseField name="key" type="string" required>
74+
The query parameter key.
75+
</ResponseField>
76+
77+
<ResponseField name="value" type="string" required>
78+
The query parameter value. Use `$page` to insert the current page content in Markdown or `$path` to insert the current page path.
79+
</ResponseField>
80+
</Expandable>
81+
</ResponseField>
82+
</Expandable>
83+
</ResponseField>
84+
85+
Example custom option:
86+
87+
```json {8-21}
88+
"contextual": {
89+
"options": [
90+
"copy",
91+
"view",
92+
"chatgpt",
93+
"claude",
94+
"perplexity",
95+
{
96+
"title": "Ask Gemini",
97+
"description": "Ask Google Gemini about the current page",
98+
"icon": "sparkle",
99+
"href": {
100+
"base": "https://gemini.google.com/app",
101+
"query": [
102+
{
103+
"key": "q",
104+
"value": "Ask question about https://mintlify.com/docs$path.md"
105+
}
106+
]
107+
}
108+
}
109+
]
110+
}
111+
```

ai/llmstxt.mdx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: "llms.txt"
3+
description: "Make your content easier for LLMs to read and index"
4+
icon: "file-code"
5+
---
6+
7+
import { PreviewButton } from "/snippets/previewbutton.jsx"
8+
9+
The [llms.txt file](https://llmstxt.org) is an industry standard that helps LLMs index content more efficiently, similar to how a sitemap helps search engines.
10+
11+
Mintlify automatically hosts an `llms.txt` file at the root of your project that lists all available pages in your documentation. AI tools can use this file to understand your documentation structure and find relevant content to user prompts.
12+
13+
View your `llms.txt` by appending `/llms.txt` to your documentation site's URL.
14+
15+
<PreviewButton href="https://mintlify.com/docs/llms.txt">Open the llms.txt for this site</PreviewButton>
16+
17+
Your site's `llms.txt` is always up to date and requires zero maintenance.
18+
19+
## llms.txt structure
20+
21+
An `llms.txt` file is a plain Markdown file that contains:
22+
23+
- **Site title** as an H1 heading. This is the only required section of an `llms.txt`.
24+
- **Structured content sections** with descriptive links to key pages.
25+
26+
```mdx Example llms.txt
27+
# Example product docs
28+
29+
## Guides
30+
- [Getting started](https://example.com/docs/start): Intro guide
31+
- [Install](https://example.com/docs/install): Setup steps
32+
33+
## Reference
34+
- [API](https://example.com/docs/api): Endpoint list and usage
35+
```
36+
37+
This structured approach allows LLMs to quickly process your documentation hierarchy and locate relevant content for user queries, improving the accuracy and speed of AI-assisted documentation searches.
38+
39+
## llms-full.txt
40+
41+
The `llms-full.txt` file combines your entire documentation site into a single file as context for AI tools and is indexed by LLM traffic. Users can paste a single URL as context for AI tools for more relevant and accurate responses.
42+
43+
Mintlify automatically hosts an `llms-full.txt` file at the root of your project. View your `llms-full.txt` by appending `/llms-full.txt` to your documentation site's URL.
44+
45+
<PreviewButton href="https://mintlify.com/docs/llms-full.txt">Open the llms-full.txt for this site</PreviewButton>
46+
47+
Your site's `llms-full.txt` is always up to date and requires zero maintenance.

ai/markdown-export.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: "Markdown export"
3+
description: "Quickly get Markdown versions of pages"
4+
icon: "file-text"
5+
---
6+
7+
import { PreviewButton } from "/snippets/previewbutton.jsx"
8+
9+
Markdown provides structured text that AI tools can process more efficiently than HTML, which results in better response accuracy, faster processing times, and lower token usage.
10+
11+
Mintlify automatically generates Markdown versions of pages that are optimized for AI tools and external integrations.
12+
13+
## .md URL extension
14+
15+
Add `.md` to any page's URL to view a Markdown version.
16+
17+
<PreviewButton href="https://mintlify.com/docs/ai/markdown-export.md">Open this page as Markdown</PreviewButton>
18+
19+
## Keyboard shortcut
20+
21+
Press <kbd>Command</kbd> + <kbd>C</kbd> (<kbd>Ctrl</kbd> + <kbd>C</kbd> on Windows) to copy a page as Markdown to your clipboard.

docs.json

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,20 @@
3434
"pages",
3535
"navigation",
3636
"themes",
37-
"settings/custom-domain",
38-
"ai-ingestion"
37+
"settings/custom-domain"
38+
]
39+
},
40+
{
41+
"group": "AI optimization",
42+
"pages": [
43+
"guides/assistant",
44+
"ai/llmstxt",
45+
"ai/contextual-menu",
46+
"ai/markdown-export",
47+
"mcp",
48+
"guides/claude-code",
49+
"guides/cursor",
50+
"guides/windsurf"
3951
]
4052
},
4153
{
@@ -113,11 +125,6 @@
113125
"pages": [
114126
"guides/migration",
115127
"guides/analytics",
116-
"guides/assistant",
117-
"mcp",
118-
"guides/claude-code",
119-
"guides/cursor",
120-
"guides/windsurf",
121128
"react-components",
122129
"settings/custom-scripts",
123130
"settings/seo",
@@ -487,6 +494,10 @@
487494
{
488495
"source": "settings/authentication-personalization/personalization-setup/shared-session",
489496
"destination": "authentication-personalization/personalization-setup"
497+
},
498+
{
499+
"source": "ai-ingestion",
500+
"destination": "ai/llmstxt"
490501
}
491502
],
492503
"integrations": {

guides/assistant.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: "AI assistant"
2+
title: "Assistant"
33
description: "Help users succeed with your product and find answers faster"
44
icon: "bot"
55
---
66

77
<Info>
8-
The AI assistant is automatically enabled on [Pro, Growth, and Enterprise plans](https://mintlify.com/pricing?ref=assistant).
8+
The assistant is automatically enabled on [Pro, Growth, and Enterprise plans](https://mintlify.com/pricing?ref=assistant).
99
</Info>
1010

1111
## About the assistant

snippets/previewbutton.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export const PreviewButton = ({ children, href }) => {
2+
return (
3+
<a href={href} className="text-sm font-medium text-white dark:!text-zinc-950 bg-zinc-900 hover:bg-zinc-700 dark:bg-zinc-100 hover:dark:bg-zinc-300 rounded-full px-3.5 py-1.5 not-prose">
4+
{children}
5+
</a>
6+
)
7+
}

0 commit comments

Comments
 (0)