-
Notifications
You must be signed in to change notification settings - Fork 207
Create AI optimization group #920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1c0fee1
update `docs.json`
ethanpalm 6a003e2
Merge branch 'main' into split-ai-ingestion
ethanpalm d12c101
add snippet
ethanpalm 6d9f63f
update nav
ethanpalm 1cb6365
add llms.txt page
ethanpalm 96a8771
update assistant title
ethanpalm 3a92d3f
add contextual menu page
ethanpalm 04d0a7a
add markdown export page
ethanpalm 0d5171d
remove ai-ingestion page
ethanpalm 23824e4
reviewer feedback
ethanpalm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| --- | ||
| title: "Contextual menu" | ||
| description: "Add one-click AI integrations to your docs" | ||
| icon: "square-menu" | ||
| --- | ||
|
|
||
| import { PreviewButton } from "/snippets/previewbutton.jsx" | ||
|
|
||
| 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. | ||
|
|
||
| ## Menu options | ||
|
|
||
| - **Copy page**: Copies the current page as Markdown for pasting as context into AI tools. | ||
| - **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. | ||
| - **Open in Perplexity**: Creates a Perplexity conversation with the current page as context. | ||
| - **[Your custom options](#adding-custom-options)**: Add your own options to the menu. | ||
|
|
||
| <Frame> | ||
| <img | ||
| src="/images/contextual-menu/contextual-menu.png" | ||
| alt="The expanded contextual menu showing the Copy page, View as Markdown, Open in ChatGPT, and Open in Claude menu items." | ||
| /> | ||
| </Frame> | ||
|
|
||
| ## Enabling the contextual menu | ||
|
|
||
| Add the `contextual` field to your `docs.json` file and specify which options you want to include. | ||
|
|
||
| ```json | ||
| { | ||
| "contextual": { | ||
| "options": [ | ||
| "copy", | ||
| "view", | ||
| "chatgpt", | ||
| "claude", | ||
| "perplexity" | ||
| ] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Adding custom options | ||
|
|
||
| Create custom options in the contextual menu by adding an object to the `options` array. Each custom option requires these properties: | ||
|
|
||
| <ResponseField name="title" type="string" required> | ||
| The title of the option. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="description" type="string" required> | ||
| The description of the option. Displayed beneath the title when the contextual menu is expanded. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="icon" type="string" required> | ||
| The icon of the option. Accepts any icon from the [Icons](/components/icons) collection. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="href" type="string | object" required> | ||
| The href of the option. Use a string for simple links or an object for dynamic links with query parameters. | ||
|
|
||
| <Expandable title="href object"> | ||
| <ResponseField name="base" type="string" required> | ||
| The base URL for the option. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="query" type="object" required> | ||
| The query parameters for the option. | ||
|
|
||
| <Expandable title="query object"> | ||
| <ResponseField name="key" type="string" required> | ||
| The query parameter key. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="value" type="string" required> | ||
| The query parameter value. Use `$page` to insert the current page content in Markdown or `$path` to insert the current page path. | ||
| </ResponseField> | ||
| </Expandable> | ||
| </ResponseField> | ||
| </Expandable> | ||
| </ResponseField> | ||
|
|
||
| Example custom option: | ||
|
|
||
| ```json {8-21} | ||
| "contextual": { | ||
| "options": [ | ||
| "copy", | ||
| "view", | ||
| "chatgpt", | ||
| "claude", | ||
| "perplexity", | ||
| { | ||
| "title": "Ask Gemini", | ||
| "description": "Ask Google Gemini about the current page", | ||
| "icon": "sparkle", | ||
| "href": { | ||
| "base": "https://gemini.google.com/app", | ||
| "query": [ | ||
| { | ||
| "key": "q", | ||
| "value": "Ask question about https://mintlify.com/docs$path.md" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| title: "llms.txt" | ||
| description: "Make your content easier for LLMs to understand" | ||
| icon: "file-code" | ||
| --- | ||
|
|
||
| import { PreviewButton } from "/snippets/previewbutton.jsx" | ||
|
|
||
| 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. | ||
|
|
||
| Every documentation site automatically hosts an `llms.txt` file at the root 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. | ||
ethanpalm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| View your `llms.txt` by appending `/llms.txt` to your site's URL. | ||
ethanpalm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <PreviewButton href="https://mintlify.com/docs/llms.txt">Open the llms.txt for this site</PreviewButton> | ||
|
|
||
| Your site's `llms.txt` is always up to date and requires zero maintenance. | ||
|
|
||
| ## llms.txt structure | ||
|
|
||
| An `llms.txt` file is a plain Markdown file that contains: | ||
|
|
||
| - **Site title** as an H1 heading. This is the only required section of an `llms.txt`. | ||
| - **Site summary** typically in a blockquote. | ||
ethanpalm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - **Structured content sections** with descriptive links to key pages. | ||
|
|
||
| ```mdx Example llms.txt | ||
| # Example product docs | ||
|
|
||
| > Learn how to get started, use the API, and explore tutorials. | ||
|
|
||
| ## Guides | ||
| - [Getting started](https://example.com/docs/start): Intro guide | ||
| - [Install](https://example.com/docs/install): Setup steps | ||
|
|
||
| ## Reference | ||
| - [API](https://example.com/docs/api): Endpoint list and usage | ||
| ``` | ||
|
|
||
| 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. | ||
|
|
||
| ## llms-full.txt | ||
|
|
||
| The `llms-full.txt` file combines your entire documentation site into a single file as context for AI tools. Users can paste a single URL as context for AI tools for more relevant and accurate responses. | ||
ethanpalm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Every documentation site automatically hosts an `llms-full.txt` file at the root. View your `llms-full.txt` by appending `/llms-full.txt` to your site's URL. | ||
|
|
||
| <PreviewButton href="https://mintlify.com/docs/llms-full.txt">Open the llms-full.txt for this site</PreviewButton> | ||
|
|
||
| Your site's `llms-full.txt` is always up to date and requires zero maintenance. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| title: "Markdown export" | ||
| description: "Quickly get Markdown versions of pages" | ||
| icon: "file-text" | ||
| --- | ||
|
|
||
| import { PreviewButton } from "/snippets/previewbutton.jsx" | ||
|
|
||
| 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. | ||
|
|
||
| Mintlify automatically generates Markdown versions of pages that are optimized for AI tools and external integrations. | ||
|
|
||
| ## .md URL extension | ||
|
|
||
| Add `.md` to any page's URL to view a Markdown version. | ||
|
|
||
| <PreviewButton href="https://mintlify.com/docs/ai/markdown-export.md">Open this page as Markdown</PreviewButton> | ||
|
|
||
| ## Keyboard shortcut | ||
|
|
||
| Press <kbd>Command</kbd> + <kbd>C</kbd> (<kbd>Ctrl</kbd> + <kbd>C</kbd> on Windows) to copy a page as Markdown to yourclipboard. | ||
|
Check warning on line 21 in ai/markdown-export.mdx
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.