From 0b089ef5c77613c29ba1b02a244268e802bd622f Mon Sep 17 00:00:00 2001 From: dks333 Date: Wed, 9 Jul 2025 10:05:09 -0700 Subject: [PATCH 1/3] add custom option in context menu --- ai-ingestion.mdx | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/ai-ingestion.mdx b/ai-ingestion.mdx index 87d62ab5a..cdabbebf3 100644 --- a/ai-ingestion.mdx +++ b/ai-ingestion.mdx @@ -22,6 +22,7 @@ Provide quick access to AI-optimized content and direct integrations with popula * **View as Markdown**: Opens the current page as Markdown. * **Open in ChatGPT**: Creates a ChatGPT conversation with the current page as context. * **Open in Claude**: Creates a Claude conversation with the current page as context. +* [**Your custom option**](#custom-option-in-contextual-menu): Add your own option to the contextual menu. + + the tilte of the option + + + + the description of the option + + + + the icon of the option, you can use any icon from the [Icons](/components/icons) collection. + + + + the href of the option, you can use a string or an object with a `base` and `query` property. + + + + the base of the option + + + + the query of the option + + + + the key of the query + + + + the value of the query. Use `$page` to insert the current page content in markdown or `$path` to insert the current page path. + + + + + + + Example: + + ```json {7-20} Example with Perplexity icon="search" + "contextual": { + "options": [ + "copy", + "view", + "chatgpt", + "claude", + { + "title": "Ask Perplexity", + "description": "Ask Perplexity about the current page", + "icon": "search", + "href": { + "base": "https://www.perplexity.ai/search", + "query": [ + { + "key": "q", + "value": "Ask question about https://mintlify.com/docs$path.md" + } + ] + } + } + ] + } + ``` + + + + ## /llms.txt 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. From 11aa28d4a928e9df6cde7a40c6600aeed8761684 Mon Sep 17 00:00:00 2001 From: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> Date: Wed, 9 Jul 2025 11:24:00 -0700 Subject: [PATCH 2/3] review edits --- ai-ingestion.mdx | 136 +++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 69 deletions(-) diff --git a/ai-ingestion.mdx b/ai-ingestion.mdx index cdabbebf3..ee8c804c6 100644 --- a/ai-ingestion.mdx +++ b/ai-ingestion.mdx @@ -12,7 +12,7 @@ export const PreviewButton = ({ children, href }) => { ) } -Mintlify generates optimized formats and provides shortcuts that help users get faster, more accurate responses when using your documentation as context for LLMs and AI tools. +Generate optimized formats and provide shortcuts that help users get faster, more accurate responses when using your documentation as context for LLMs and AI tools. ## Contextual menu @@ -22,7 +22,7 @@ Provide quick access to AI-optimized content and direct integrations with popula * **View as Markdown**: Opens the current page as Markdown. * **Open in ChatGPT**: Creates a ChatGPT conversation with the current page as context. * **Open in Claude**: Creates a Claude conversation with the current page as context. -* [**Your custom option**](#custom-option-in-contextual-menu): Add your own option to the contextual menu. +* [**Your custom options**](#custom-option-in-contextual-menu): Add your own options to the contextual menu. - - the tilte of the option - - - - the description of the option - - - - the icon of the option, you can use any icon from the [Icons](/components/icons) collection. - - - - the href of the option, you can use a string or an object with a `base` and `query` property. - - - - the base of the option - - - - the query of the option - - - - the key of the query - - - - the value of the query. Use `$page` to insert the current page content in markdown or `$path` to insert the current page path. - - - - - - - Example: - - ```json {7-20} Example with Perplexity icon="search" - "contextual": { - "options": [ - "copy", - "view", - "chatgpt", - "claude", - { - "title": "Ask Perplexity", - "description": "Ask Perplexity about the current page", - "icon": "search", - "href": { - "base": "https://www.perplexity.ai/search", - "query": [ - { - "key": "q", - "value": "Ask question about https://mintlify.com/docs$path.md" - } - ] - } +### Adding custom options + +Create custom options in the contextual menu by adding an object to the `options` array. Each custom option requires these properties: + + + The title of the option. + + + + The description of the option. Displayed beneath the title when the contextual menu is expanded. + + + + The icon of the option. Accepts any icon from the [Icons](/components/icons) collection. + + + + The href of the option. Use a string for simple links or an object for dynamic links with query parameters. + + + + The base URL for the option. + + + + The query parameters for the option. + + + + The query parameter key. + + + + The query parameter value. Use `$page` to insert the current page content in Markdown or `$path` to insert the current page path. + + + + + + +Example custom option: + +```json {7-20} Example with Perplexity icon="search" +"contextual": { + "options": [ + "copy", + "view", + "chatgpt", + "claude", + { + "title": "Ask Perplexity", + "description": "Ask Perplexity about the current page", + "icon": "search", + "href": { + "base": "https://www.perplexity.ai/search", + "query": [ + { + "key": "q", + "value": "Ask question about https://mintlify.com/docs$path.md" + } + ] } - ] - } - ``` - - - + } + ] +} +``` ## /llms.txt From 470024facbdde5d5db1d6b4ea2bdc329fdea3562 Mon Sep 17 00:00:00 2001 From: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> Date: Wed, 9 Jul 2025 11:25:48 -0700 Subject: [PATCH 3/3] fix link --- ai-ingestion.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ai-ingestion.mdx b/ai-ingestion.mdx index ee8c804c6..f2348274d 100644 --- a/ai-ingestion.mdx +++ b/ai-ingestion.mdx @@ -22,7 +22,7 @@ Provide quick access to AI-optimized content and direct integrations with popula * **View as Markdown**: Opens the current page as Markdown. * **Open in ChatGPT**: Creates a ChatGPT conversation with the current page as context. * **Open in Claude**: Creates a Claude conversation with the current page as context. -* [**Your custom options**](#custom-option-in-contextual-menu): Add your own options to the contextual menu. +* [**Your custom options**](#adding-custom-options): Add your own options to the contextual menu.