Skip to content

Commit 0b089ef

Browse files
committed
add custom option in context menu
1 parent ac7aa76 commit 0b089ef

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

ai-ingestion.mdx

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Provide quick access to AI-optimized content and direct integrations with popula
2222
* **View as Markdown**: Opens the current page as Markdown.
2323
* **Open in ChatGPT**: Creates a ChatGPT conversation with the current page as context.
2424
* **Open in Claude**: Creates a Claude conversation with the current page as context.
25+
* [**Your custom option**](#custom-option-in-contextual-menu): Add your own option to the contextual menu.
2526

2627
<Frame>
2728
<img
@@ -47,6 +48,75 @@ Add the `contextual` field to your `docs.json` and specify which options you wan
4748
}
4849
```
4950

51+
### Custom option in contextual menu
52+
53+
<Expandable title="Custom Option">
54+
<ResponseField name="title" type="string" required>
55+
the tilte of the option
56+
</ResponseField>
57+
58+
<ResponseField name="description" type="string" required>
59+
the description of the option
60+
</ResponseField>
61+
62+
<ResponseField name="icon" type="string" required>
63+
the icon of the option, you can use any icon from the [Icons](/components/icons) collection.
64+
</ResponseField>
65+
66+
<ResponseField name="href" type="string | object" required>
67+
the href of the option, you can use a string or an object with a `base` and `query` property.
68+
69+
<Expandable title="Href object">
70+
<ResponseField name="base" type="string" required>
71+
the base of the option
72+
</ResponseField>
73+
74+
<ResponseField name="query" type="object" required>
75+
the query of the option
76+
77+
<Expandable title="Query object">
78+
<ResponseField name="key" type="string" required>
79+
the key of the query
80+
</ResponseField>
81+
82+
<ResponseField name="value" type="string" required>
83+
the value of the query. Use `$page` to insert the current page content in markdown or `$path` to insert the current page path.
84+
</ResponseField>
85+
</Expandable>
86+
</ResponseField>
87+
</Expandable>
88+
</ResponseField>
89+
90+
Example:
91+
92+
```json {7-20} Example with Perplexity icon="search"
93+
"contextual": {
94+
"options": [
95+
"copy",
96+
"view",
97+
"chatgpt",
98+
"claude",
99+
{
100+
"title": "Ask Perplexity",
101+
"description": "Ask Perplexity about the current page",
102+
"icon": "search",
103+
"href": {
104+
"base": "https://www.perplexity.ai/search",
105+
"query": [
106+
{
107+
"key": "q",
108+
"value": "Ask question about https://mintlify.com/docs$path.md"
109+
}
110+
]
111+
}
112+
}
113+
]
114+
}
115+
```
116+
117+
</Expandable>
118+
119+
50120
## /llms.txt
51121

52122
The [/llms.txt file](https://llmstxt.org) is an industry standard that helps general-purpose LLMs index more efficiently, similar to how a sitemap helps search engines.

0 commit comments

Comments
 (0)