mirror of
https://gitlab.com/KenanZhu/AutoLibraryManuals.git
synced 2026-11-05 05:35:51 +08:00
Initial commit
This commit is contained in:
35 files changed
+2020
No files matched your search
@@ -0,0 +1,91 @@
|
||||
---
|
||||
title: 'Contextual menu'
|
||||
description: 'Give readers one-click access to AI tools and integrations'
|
||||
icon: 'bolt'
|
||||
---
|
||||
|
||||
The contextual toolbar is a floating action bar that appears on every page of your docs. It lets readers instantly copy page content, open it in an AI assistant, or add your docs as an MCP server — without leaving the page.
|
||||
|
||||
Configure it in `docs.json` under `contextual.options`:
|
||||
|
||||
```json docs.json
|
||||
{
|
||||
"contextual": {
|
||||
"options": ["copy", "view", "claude", "chatgpt", "mcp", "cursor", "vscode"]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Available options
|
||||
|
||||
### Content actions
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `copy` | Copies the page as Markdown to the clipboard |
|
||||
| `view` | Opens the raw Markdown version of the page (`.md` URL) |
|
||||
|
||||
### AI assistants
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `claude` | Opens the page in Claude |
|
||||
| `chatgpt` | Opens the page in ChatGPT |
|
||||
| `perplexity` | Opens the page in Perplexity |
|
||||
| `grok` | Opens the page in Grok |
|
||||
| `aistudio` | Opens the page in Google AI Studio |
|
||||
|
||||
### Editor integrations
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `cursor` | Adds the page to Cursor's context |
|
||||
| `vscode` | Adds the page to VS Code Copilot |
|
||||
| `windsurf` | Adds the page to Windsurf's Cascade |
|
||||
| `devin` | Opens the page in Devin |
|
||||
|
||||
### MCP
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `mcp` | Shows instructions for using your docs as an MCP server |
|
||||
| `add-mcp` | Provides a one-click prompt to add your docs MCP server to an AI tool |
|
||||
|
||||
<Tip>
|
||||
The `mcp` and `add-mcp` options are especially powerful — they let developers connect your entire docs site to any MCP-compatible AI assistant, so it can answer questions about your product directly.
|
||||
</Tip>
|
||||
|
||||
## Custom options
|
||||
|
||||
You can add custom entries to the toolbar with a title, description, icon, and link. The `href` supports dynamic placeholders:
|
||||
|
||||
| Placeholder | Resolves to |
|
||||
|-------------|-------------|
|
||||
| `$page` | The current page's full URL |
|
||||
| `$path` | The current page's path |
|
||||
| `$mcp` | Your docs MCP server URL |
|
||||
|
||||
```json docs.json
|
||||
{
|
||||
"contextual": {
|
||||
"options": [
|
||||
"copy",
|
||||
"claude",
|
||||
{
|
||||
"title": "Open issue",
|
||||
"description": "Report a problem with this page",
|
||||
"icon": "github",
|
||||
"href": "https://github.com/your-org/docs/issues/new?title=Issue+on+$path"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<Note>
|
||||
The contextual toolbar is only visible on preview and production deployments, not in `mint dev` local preview.
|
||||
</Note>
|
||||
|
||||
## Pairing with Visibility
|
||||
|
||||
The toolbar's `copy` and `view` options expose your page's Markdown content directly. If you use the [`Visibility`](/agent-ready/visibility) component, the `for="agents"` blocks will be included in that Markdown — giving AI assistants structured context that human readers don't see.
|
||||
@@ -0,0 +1,75 @@
|
||||
---
|
||||
title: 'Prompt component'
|
||||
description: 'Embed shareable AI prompts readers can copy or open in Cursor'
|
||||
icon: 'robot'
|
||||
---
|
||||
|
||||
The `Prompt` component displays a pre-built AI prompt with one-click actions to copy it to the clipboard or open it directly in Cursor. It's ideal for any docs page where you want to hand readers a ready-to-use prompt.
|
||||
|
||||
## Basic usage
|
||||
|
||||
<Prompt description="Summarize this API endpoint">
|
||||
You are a technical writer. Given the following API endpoint documentation, write a one-paragraph summary that explains what the endpoint does, what inputs it requires, and what it returns. Be concise and use plain language.
|
||||
</Prompt>
|
||||
|
||||
```mdx
|
||||
<Prompt description="Summarize this API endpoint">
|
||||
You are a technical writer. Given the following API endpoint documentation,
|
||||
write a one-paragraph summary that explains what the endpoint does, what
|
||||
inputs it requires, and what it returns. Be concise and use plain language.
|
||||
</Prompt>
|
||||
```
|
||||
|
||||
## With Cursor integration
|
||||
|
||||
Add `actions={["copy", "cursor"]}` to also surface an "Open in Cursor" button. This is especially useful for prompts readers will use in their editor.
|
||||
|
||||
<Prompt
|
||||
description="Generate a typed API client"
|
||||
icon="code"
|
||||
actions={["copy", "cursor"]}
|
||||
>
|
||||
You are an expert TypeScript developer. Given the following OpenAPI specification, generate a fully-typed API client using native fetch. Include:
|
||||
- A base client class with configurable baseUrl and auth headers
|
||||
- One method per endpoint, with typed request parameters and response types
|
||||
- JSDoc comments on each method
|
||||
Do not use any third-party HTTP libraries.
|
||||
</Prompt>
|
||||
|
||||
```mdx
|
||||
<Prompt
|
||||
description="Generate a typed API client"
|
||||
icon="code"
|
||||
actions={["copy", "cursor"]}
|
||||
>
|
||||
You are an expert TypeScript developer. Given the following OpenAPI
|
||||
specification, generate a fully-typed API client using native fetch...
|
||||
</Prompt>
|
||||
```
|
||||
|
||||
## Props
|
||||
|
||||
<ResponseField name="description" type="string" required>
|
||||
Heading text shown above the prompt content. Supports Markdown.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="children" type="string" required>
|
||||
The prompt text that gets copied or sent to Cursor.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="actions" type="array">
|
||||
Which action buttons to show. Options: `"copy"`, `"cursor"`. Defaults to `["copy"]`.
|
||||
</ResponseField>
|
||||
|
||||
<ResponseField name="icon" type="string">
|
||||
An icon displayed alongside the description. Supports Font Awesome, Lucide, and Tabler icon names, image URLs, or inline SVG.
|
||||
</ResponseField>
|
||||
|
||||
## When to use it
|
||||
|
||||
The `Prompt` component works well anywhere you're teaching readers to work with AI:
|
||||
|
||||
- **Quickstart guides** — give readers a prompt to generate their first integration
|
||||
- **API reference pages** — include a prompt for generating client code from the spec
|
||||
- **Troubleshooting guides** — embed a debugging prompt readers can run against their own error logs
|
||||
- **Conceptual pages** — add a prompt for exploring the topic further with an AI assistant
|
||||
@@ -0,0 +1,85 @@
|
||||
---
|
||||
title: 'Visibility'
|
||||
description: 'Show different content to humans and AI agents'
|
||||
icon: 'eye'
|
||||
---
|
||||
|
||||
The `Visibility` component lets a single page serve two audiences: humans reading on the web and AI agents processing the Markdown output. Content marked `for="humans"` appears on the rendered page but is excluded from Markdown exports. Content marked `for="agents"` is hidden on the web but included in Markdown.
|
||||
|
||||
This means you can write conversational, UI-centric instructions for humans and structured, machine-readable instructions for AI — without maintaining two separate pages.
|
||||
|
||||
## How it works
|
||||
|
||||
Mintlify serves every page at two URLs:
|
||||
|
||||
- `https://docs.example.com/page` — the rendered site, for humans
|
||||
- `https://docs.example.com/page.md` — the raw Markdown, for AI agents
|
||||
|
||||
`Visibility` controls what appears at each URL.
|
||||
|
||||
## Example
|
||||
|
||||
```mdx
|
||||
<Visibility for="humans">
|
||||
<Steps>
|
||||
<Step title="Open the dashboard">
|
||||
Navigate to [dashboard.example.com](https://dashboard.example.com) and sign in.
|
||||
</Step>
|
||||
<Step title="Create an API key">
|
||||
Go to **Settings → API Keys** and click **New key**.
|
||||
</Step>
|
||||
</Steps>
|
||||
</Visibility>
|
||||
|
||||
<Visibility for="agents">
|
||||
To authenticate, send a POST request to `/v1/auth/token` with the user's
|
||||
email and password in the request body. The response includes a bearer token
|
||||
valid for 24 hours. Pass this token as `Authorization: Bearer <token>` on
|
||||
all subsequent requests.
|
||||
</Visibility>
|
||||
```
|
||||
|
||||
Human readers see the step-by-step UI walkthrough. AI agents processing the Markdown get the direct API instructions instead.
|
||||
|
||||
## Props
|
||||
|
||||
<ResponseField name="for" type='"humans" | "agents"' required>
|
||||
- `"humans"` — visible on the rendered web page, excluded from `.md` export
|
||||
- `"agents"` — hidden on the rendered web page, included in `.md` export
|
||||
</ResponseField>
|
||||
|
||||
## When to use it
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Onboarding flows" icon="person-walking-arrow-right">
|
||||
Show UI screenshots and button clicks to humans. Give agents the equivalent API calls.
|
||||
</Card>
|
||||
<Card title="Configuration guides" icon="sliders">
|
||||
Show a visual settings panel to humans. Give agents the equivalent JSON or CLI flags.
|
||||
</Card>
|
||||
<Card title="Error messages" icon="triangle-exclamation">
|
||||
Show a friendly explanation to humans. Give agents structured error codes and remediation steps.
|
||||
</Card>
|
||||
<Card title="Conceptual pages" icon="lightbulb">
|
||||
Include rich diagrams and narrative for humans. Provide a concise structured summary for agents.
|
||||
</Card>
|
||||
</Columns>
|
||||
|
||||
## Combining with Prompt
|
||||
|
||||
`Visibility` and `Prompt` complement each other well. Use `Visibility` to give agents structured context, then use `Prompt` to give human readers a prompt they can use to ask an AI about that same content.
|
||||
|
||||
```mdx
|
||||
<Visibility for="agents">
|
||||
## Authentication schema
|
||||
- Method: Bearer token
|
||||
- Header: `Authorization: Bearer <token>`
|
||||
- Token TTL: 86400 seconds
|
||||
- Refresh endpoint: POST /v1/auth/refresh
|
||||
</Visibility>
|
||||
|
||||
<Prompt description="Ask about authentication" icon="lock">
|
||||
Explain how authentication works in this API and show me example code for
|
||||
getting a token and making an authenticated request.
|
||||
</Prompt>
|
||||
```
|
||||
Reference in new issue
Block a user