diff --git a/api/introduction.mdx b/api/introduction.mdx index 5ebb15b73..091d606a0 100644 --- a/api/introduction.mdx +++ b/api/introduction.mdx @@ -26,6 +26,15 @@ The admin API key is used for the [Trigger update](/api-reference/update/trigger Admin API keys begin with the `mint_` prefix. Keep your admin API keys secret. +**Example request:** + +```bash +curl https://api.mintlify.com/v1/project/update/your-project-id \ + -H "Authorization: Bearer mint_your_api_key" \ + -H "Content-Type: application/json" \ + -X POST +``` + ### Assistant API key The assistant API key is used for the [Generate assistant message](/api-reference/assistant/create-assistant-message) and [Search documentation](/api-reference/assistant/search) endpoints. @@ -36,6 +45,216 @@ The assistant API **key** is a server-side token that should be kept secret. The assistant API **token** is a public token that can be referenced in your frontend code. +**Example request:** + +```bash +curl https://api.mintlify.com/v1/assistant/message \ + -H "Authorization: Bearer mint_dsc_your_api_key" \ + -H "Content-Type: application/json" \ + -d '{ + "domain": "docs.example.com", + "message": "How do I get started?" + }' \ + -X POST +``` + Calls using the assistant API token can incur costs: either using your AI assistant credits or incurring overages. + +## Rate limits + +API requests are rate limited to prevent abuse: + +| Endpoint Type | Rate Limit | +|--------------|------------| +| Admin endpoints | 100 requests per minute | +| Assistant endpoints | 1000 requests per minute | + +When you exceed the rate limit, you'll receive a `429 Too Many Requests` response. + +## Error handling + +The API uses standard HTTP status codes to indicate success or failure: + +| Status Code | Description | +|------------|-------------| +| `200` | Success | +| `400` | Bad request - check your request parameters | +| `401` | Unauthorized - invalid or missing API key | +| `403` | Forbidden - API key doesn't have access to this resource | +| `404` | Not found - resource doesn't exist | +| `429` | Too many requests - rate limit exceeded | +| `500` | Internal server error - contact support | + +**Error response format:** + +```json +{ + "error": { + "code": "invalid_request", + "message": "The project ID is invalid", + "details": { + "field": "projectId", + "reason": "Project not found" + } + } +} +``` + +**Handling errors in your code:** + + +```javascript JavaScript +try { + const response = await fetch('https://api.mintlify.com/v1/project/update/project-id', { + method: 'POST', + headers: { + 'Authorization': 'Bearer mint_your_api_key', + 'Content-Type': 'application/json' + } + }); + + if (!response.ok) { + const error = await response.json(); + console.error('API Error:', error.error.message); + + if (response.status === 429) { + // Handle rate limit - implement retry with backoff + console.log('Rate limited. Retrying after delay...'); + } + } + + const data = await response.json(); + console.log('Success:', data); +} catch (error) { + console.error('Network error:', error); +} +``` + +```python Python +import requests +import time + +def call_api_with_retry(url, headers, max_retries=3): + for attempt in range(max_retries): + try: + response = requests.post(url, headers=headers) + + if response.status_code == 429: + # Rate limited - wait and retry + wait_time = 2 ** attempt # Exponential backoff + print(f"Rate limited. Waiting {wait_time}s...") + time.sleep(wait_time) + continue + + response.raise_for_status() + return response.json() + + except requests.exceptions.HTTPError as e: + error_data = e.response.json() + print(f"API Error: {error_data['error']['message']}") + raise + except requests.exceptions.RequestException as e: + print(f"Network error: {e}") + raise + + raise Exception("Max retries exceeded") + +# Usage +headers = { + 'Authorization': 'Bearer mint_your_api_key', + 'Content-Type': 'application/json' +} +result = call_api_with_retry( + 'https://api.mintlify.com/v1/project/update/project-id', + headers +) +``` + +```go Go +package main + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "net/http" + "time" +) + +type APIError struct { + Error struct { + Code string `json:"code"` + Message string `json:"message"` + } `json:"error"` +} + +func callAPIWithRetry(url, apiKey string, maxRetries int) error { + client := &http.Client{Timeout: 10 * time.Second} + + for attempt := 0; attempt < maxRetries; attempt++ { + req, err := http.NewRequest("POST", url, nil) + if err != nil { + return err + } + + req.Header.Set("Authorization", "Bearer "+apiKey) + req.Header.Set("Content-Type", "application/json") + + resp, err := client.Do(req) + if err != nil { + return err + } + defer resp.Body.Close() + + if resp.StatusCode == 429 { + // Rate limited - exponential backoff + waitTime := time.Duration(1< + +## Best practices + +### Secure your API keys + +- Never commit API keys to version control +- Use environment variables to store keys +- Rotate keys regularly +- Use separate keys for development and production + +### Implement retry logic + +Network requests can fail. Implement exponential backoff for retries: + +1. Wait 1 second after first failure +2. Wait 2 seconds after second failure +3. Wait 4 seconds after third failure +4. Give up after 3-5 attempts + +### Monitor usage + +Track your API usage to: +- Identify performance issues +- Optimize request patterns +- Stay within rate limits +- Monitor costs (for assistant endpoints) diff --git a/docs.json b/docs.json index 89b194877..a05d7f07e 100644 --- a/docs.json +++ b/docs.json @@ -28,7 +28,8 @@ "index", "quickstart", "ai-native", - "migration" + "migration", + "troubleshooting" ] }, { @@ -63,56 +64,26 @@ ] }, { - "group": "Create content", + "group": "Web editor", "icon": "pen-line", "pages": [ - { - "group": "Web editor", - "pages": [ - "editor/index", - "editor/pages", - "editor/media", - "editor/navigation", - "editor/configurations", - "editor/collaborate", - "editor/publish", - "editor/keyboard-shortcuts" - ] - }, + "editor/index", + "editor/pages", + "editor/media", + "editor/navigation", + "editor/configurations", + "editor/collaborate", + "editor/publish", + "editor/keyboard-shortcuts" + ] + }, + { + "group": "Create content", + "icon": "file-text", + "pages": [ "installation", "create/text", "create/code", - "ai/agent", - "ai/suggestions", - { - "group": "Components", - "pages": [ - "components/index", - "components/accordions", - "components/badge", - "components/banner", - "components/callouts", - "components/cards", - "components/code-groups", - "components/color", - "components/columns", - "components/examples", - "components/expandables", - "components/fields", - "components/frames", - "components/icons", - "components/mermaid-diagrams", - "components/panel", - "components/responses", - "components/steps", - "components/tabs", - "components/tiles", - "components/tooltips", - "components/tree", - "components/update", - "components/view" - ] - }, "create/image-embeds", "create/files", "create/list-table", @@ -121,6 +92,36 @@ "create/changelogs" ] }, + { + "group": "Components", + "icon": "blocks", + "pages": [ + "components/index", + "components/accordions", + "components/badge", + "components/banner", + "components/callouts", + "components/cards", + "components/code-groups", + "components/color", + "components/columns", + "components/examples", + "components/expandables", + "components/fields", + "components/frames", + "components/icons", + "components/mermaid-diagrams", + "components/panel", + "components/responses", + "components/steps", + "components/tabs", + "components/tiles", + "components/tooltips", + "components/tree", + "components/update", + "components/view" + ] + }, { "group": "Document APIs", "icon": "file-json", @@ -137,11 +138,37 @@ ] }, { - "group": "Deploy", - "icon": "boxes", + "group": "AI features", + "icon": "bot", + "pages": [ + "ai/agent", + "ai/suggestions", + "ai/assistant", + "ai/discord", + "ai/slack-bot", + "ai/contextual-menu", + "ai/llmstxt", + "ai/model-context-protocol", + "ai/markdown-export" + ] + }, + { + "group": "Deployment", + "icon": "rocket", "pages": [ "deploy/deployments", "deploy/preview-deployments", + "deploy/ci", + "deploy/github", + "deploy/ghes", + "deploy/gitlab", + "deploy/monorepo" + ] + }, + { + "group": "Hosting", + "icon": "server", + "pages": [ { "group": "/docs subpath", "pages": [ @@ -155,22 +182,13 @@ }, "deploy/authentication-setup", "deploy/personalization-setup", - "deploy/monorepo", - "deploy/vercel-external-proxies", - "deploy/ci", - "deploy/github", - "deploy/ghes", - "deploy/gitlab" + "deploy/vercel-external-proxies" ] }, { "group": "Optimize", "icon": "wrench", "pages": [ - "ai/assistant", - "ai/discord", - "ai/slack-bot", - "ai/contextual-menu", { "group": "Insights", "pages": [ @@ -178,10 +196,7 @@ "insights/feedback" ] }, - "ai/llmstxt", - "ai/model-context-protocol", "optimize/seo", - "ai/markdown-export", "optimize/pdf-exports", { "group": "Integrations", @@ -258,9 +273,12 @@ ] }, { - "group": "API docs", - "icon": "file-json", + "group": "Migration", + "icon": "arrow-right-arrow-left", "pages": [ + "guides/migrate-from-gitbook", + "guides/migrate-from-readme", + "guides/migrate-from-docusaurus", "guides/migrating-from-mdx" ] }, @@ -275,10 +293,18 @@ "guides/media", "guides/navigation", "guides/seo", + "guides/search-optimization", "guides/style-and-tone", "guides/understand-your-audience" ] }, + { + "group": "Comparisons", + "icon": "scale-balanced", + "pages": [ + "guides/deployment-comparison" + ] + }, { "group": "Git", "icon": "git-merge", diff --git a/guides/deployment-comparison.mdx b/guides/deployment-comparison.mdx new file mode 100644 index 000000000..60c471399 --- /dev/null +++ b/guides/deployment-comparison.mdx @@ -0,0 +1,353 @@ +--- +title: Deployment options comparison +description: Compare different deployment and hosting options for your Mintlify documentation +--- + +This guide compares deployment methods and hosting configurations to help you choose the right setup. + +## Deployment methods + +### GitHub integration (recommended) + +**Best for**: Most teams + +Automatic deployments triggered by Git pushes. + +**Pros:** +- Automatic deployments on push +- Preview deployments for pull requests +- Full Git history and version control +- Team collaboration through PRs +- No manual deployment steps + +**Cons:** +- Requires GitHub account +- Deployment depends on GitHub availability + +**Setup:** +1. Connect repository in dashboard +2. Install GitHub App +3. Push changes to deploy + +### GitLab integration + +**Best for**: Teams using GitLab + +Similar to GitHub with GitLab-specific features. + +**Pros:** +- Automatic deployments on push +- Works with self-hosted GitLab +- GitLab CI/CD integration +- Team collaboration + +**Cons:** +- Requires GitLab account +- Fewer integrations than GitHub + +**Setup:** +1. Connect repository in dashboard +2. Configure GitLab integration +3. Push changes to deploy + +### CI/CD deployment + +**Best for**: Custom workflows, monorepos + +Deploy from any CI/CD system using the API. + +**Pros:** +- Works with any Git provider +- Custom deployment logic +- Integration with existing CI/CD +- Monorepo support + +**Cons:** +- Requires API key management +- Manual CI/CD configuration +- No automatic preview deployments + +**Setup:** +1. Generate API key in dashboard +2. Configure CI/CD pipeline +3. Call deployment API + +**Example (GitHub Actions):** +```yaml +name: Deploy Docs +on: + push: + branches: [main] +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Trigger deployment + run: | + curl -X POST https://api.mintlify.com/v1/project/update/${{ secrets.PROJECT_ID }} \ + -H "Authorization: Bearer ${{ secrets.MINTLIFY_API_KEY }}" +``` + +## Hosting configurations + +### Mintlify subdomain + +**Best for**: Quick setup, testing + +Your docs at `your-project.mintlify.app`. + +**Pros:** +- Instant setup +- Free SSL certificate +- No DNS configuration +- Automatic CDN + +**Cons:** +- Mintlify branding in URL +- Can't customize domain + +**Setup:** +Automatic during onboarding. + +### Custom domain + +**Best for**: Production documentation + +Your docs at `docs.yourcompany.com`. + +**Pros:** +- Professional appearance +- Your branding +- SEO benefits +- Custom SSL certificate + +**Cons:** +- Requires DNS configuration +- 24-48 hour DNS propagation + +**Setup:** +1. Add domain in dashboard +2. Update DNS records (CNAME) +3. Wait for SSL certificate + +### Subpath hosting + +**Best for**: Unified domain structure + +Your docs at `yourcompany.com/docs`. + +**Pros:** +- Unified domain +- Consistent branding +- SEO consolidation +- Existing domain authority + +**Cons:** +- More complex setup +- Requires reverse proxy or CDN +- Additional configuration + +**Options:** +- [Cloudflare](/deploy/cloudflare) +- [AWS CloudFront](/deploy/route53-cloudfront) +- [Vercel](/deploy/vercel) +- [Reverse proxy](/deploy/reverse-proxy) + +## Comparison table + +| Feature | GitHub | GitLab | CI/CD | Mintlify Domain | Custom Domain | Subpath | +|---------|--------|--------|-------|-----------------|---------------|---------| +| **Setup time** | 5 min | 5 min | 15 min | Instant | 24-48 hrs | 1-2 hrs | +| **Auto deploy** | ✓ | ✓ | ✓ | N/A | N/A | N/A | +| **Preview deploys** | ✓ | ✓ | Custom | N/A | N/A | N/A | +| **Custom domain** | N/A | N/A | N/A | ✗ | ✓ | ✓ | +| **SSL certificate** | Auto | Auto | Auto | Auto | Auto | Manual | +| **CDN** | ✓ | ✓ | ✓ | ✓ | ✓ | Depends | +| **Cost** | Free | Free | Free | Free | Free | Varies | + +## Choosing the right setup + +### For startups and small teams + +**Recommended:** +- GitHub integration +- Mintlify subdomain initially +- Custom domain when ready + +**Why:** +- Fastest setup +- Minimal configuration +- Easy to upgrade later + +### For enterprises + +**Recommended:** +- GitLab/GitHub integration +- Custom domain +- Subpath hosting (optional) + +**Why:** +- Professional appearance +- Brand consistency +- Advanced security options + +### For monorepos + +**Recommended:** +- CI/CD deployment +- Custom domain +- Monorepo configuration + +**Why:** +- Flexible deployment +- Works with existing setup +- Multiple docs in one repo + +### For agencies + +**Recommended:** +- GitHub integration +- Custom domains for each client +- Preview deployments + +**Why:** +- Client branding +- Easy client handoff +- Professional workflow + +## Migration paths + +### From Mintlify subdomain to custom domain + +1. Add custom domain in dashboard +2. Update DNS records +3. Wait for SSL certificate +4. Test custom domain +5. Update links (optional) + +**Downtime:** None (both domains work during transition) + +### From custom domain to subpath + +1. Set up reverse proxy/CDN +2. Configure subpath routing +3. Update DNS records +4. Test subpath access +5. Set up redirects + +**Downtime:** Minimal (during DNS propagation) + +### From one Git provider to another + +1. Push code to new repository +2. Connect new repository in dashboard +3. Disconnect old repository +4. Update team access + +**Downtime:** None (deployment continues) + +## Advanced configurations + +### Multiple environments + +Deploy different branches to different domains: + +| Branch | Domain | Purpose | +|--------|--------|---------| +| `main` | `docs.example.com` | Production | +| `staging` | `staging-docs.example.com` | Staging | +| `dev` | `dev-docs.example.com` | Development | + +### Geographic distribution + +Use CDN for global performance: + +- Automatic with Mintlify hosting +- Configure with custom CDN for subpath +- Edge caching for faster loads + +### Authentication + +Add authentication to protect docs: + +| Method | Best For | Setup | +|--------|----------|-------| +| Password | Simple protection | Dashboard config | +| JWT | Custom auth | API integration | +| OAuth | SSO integration | OAuth provider | + +## Performance considerations + +### Deployment speed + +| Method | Typical Deploy Time | +|--------|-------------------| +| GitHub | 2-3 minutes | +| GitLab | 2-3 minutes | +| CI/CD | 3-5 minutes | + +### Build optimization + +- Use preview deployments for testing +- Deploy only changed files +- Optimize images before committing +- Minimize custom scripts + +## Security best practices + +### For all deployments + +- Use HTTPS (automatic with Mintlify) +- Keep API keys secret +- Rotate keys regularly +- Use environment variables + +### For custom domains + +- Enable HSTS +- Configure CSP headers +- Use CAA DNS records +- Monitor SSL certificate expiration + +### For CI/CD + +- Store API keys in secrets +- Limit API key permissions +- Use separate keys per environment +- Audit deployment logs + +## Troubleshooting + +### Deployment not triggering + +**GitHub/GitLab:** +- Check webhook configuration +- Verify branch name matches +- Review GitHub App permissions + +**CI/CD:** +- Verify API key is valid +- Check CI/CD logs +- Ensure correct project ID + +### Custom domain not working + +- Verify DNS records +- Wait 24-48 hours for propagation +- Check SSL certificate status +- Clear browser cache + +### Slow deployments + +- Optimize image sizes +- Reduce number of pages +- Check for large files +- Review custom scripts + +## Getting help + +For deployment issues: +- Check [troubleshooting guide](/troubleshooting) +- Review [deployment documentation](/deploy/deployments) +- [Contact support](https://www.mintlify.com/docs/contact-support) diff --git a/guides/migrate-from-docusaurus.mdx b/guides/migrate-from-docusaurus.mdx new file mode 100644 index 000000000..af9b054f9 --- /dev/null +++ b/guides/migrate-from-docusaurus.mdx @@ -0,0 +1,520 @@ +--- +title: Migrate from Docusaurus +description: Step-by-step guide to migrate your documentation from Docusaurus to Mintlify +--- + +This guide walks you through migrating your documentation from Docusaurus to Mintlify. + +## Before you start + + + + Mintlify provides an automated scraper for Docusaurus: + + ```bash + npm install @mintlify/scraping@latest -g + mintlify-scrape section https://your-docs-site.com + ``` + + + + For more control, manually convert your Docusaurus project. Your content is already in Markdown/MDX format, making migration straightforward. + + + +## Migration process + +### 1. Understand Docusaurus structure + +Typical Docusaurus project: + +``` +docs/ +├── intro.md +├── getting-started/ +│ ├── installation.md +│ └── configuration.md +└── api/ + └── reference.md +docusaurus.config.js +sidebars.js +``` + +### 2. Convert navigation + +**Docusaurus `sidebars.js`:** +```javascript +module.exports = { + docs: [ + 'intro', + { + type: 'category', + label: 'Getting Started', + items: ['getting-started/installation', 'getting-started/configuration'], + }, + { + type: 'category', + label: 'API', + items: ['api/reference'], + }, + ], +}; +``` + +**Mintlify `docs.json`:** +```json +{ + "navigation": { + "pages": [ + "intro", + { + "group": "Getting started", + "pages": [ + "getting-started/installation", + "getting-started/configuration" + ] + }, + { + "group": "API", + "pages": ["api/reference"] + } + ] + } +} +``` + +### 3. Update frontmatter + +Docusaurus and Mintlify use similar frontmatter, but with some differences: + +**Docusaurus:** +```markdown +--- +id: my-doc +title: My Document +sidebar_label: My Doc +sidebar_position: 1 +--- +``` + +**Mintlify:** +```mdx +--- +title: My Document +sidebarTitle: My Doc +description: Brief description of the page +--- +``` + +Key changes: +- Remove `id` (use filename instead) +- Remove `sidebar_position` (use navigation order in `docs.json`) +- Add `description` for SEO +- Rename `sidebar_label` to `sidebarTitle` + +### 4. Convert Docusaurus-specific syntax + +#### Admonitions + +**Docusaurus:** +```markdown +:::note +This is a note +::: + +:::tip +This is a tip +::: + +:::warning +This is a warning +::: + +:::danger +This is dangerous +::: + +:::info +This is info +::: +``` + +**Mintlify:** +```mdx + +This is a note + + + +This is a tip + + + +This is a warning + + + +This is dangerous + + + +This is info + +``` + +#### Tabs + +**Docusaurus:** +```markdown +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + + + ```js + console.log('Hello'); + ``` + + + ```py + print('Hello') + ``` + + +``` + +**Mintlify:** +```mdx + + + ```javascript + console.log('Hello'); + ``` + + + ```python + print('Hello') + ``` + + +``` + +Or use CodeGroup for code-only tabs: + +```mdx + +```javascript JavaScript +console.log('Hello'); +``` + +```python Python +print('Hello') +``` + +``` + +#### Code blocks with titles + +**Docusaurus:** +```markdown +```jsx title="src/App.js" +function App() { + return
Hello
; +} +``` +``` + +**Mintlify:** +```mdx +```jsx src/App.js +function App() { + return
Hello
; +} +``` +``` + +#### Details/Summary + +**Docusaurus:** +```markdown +
+ Click to expand + Hidden content here +
+``` + +**Mintlify:** +```mdx + + Hidden content here + +``` + +#### MDX imports + +**Docusaurus:** +```mdx +import MyComponent from '@site/src/components/MyComponent'; + + +``` + +**Mintlify:** + +Create React components in your project and import them: + +```mdx +import MyComponent from '/snippets/MyComponent.mdx'; + + +``` + +### 5. Migrate assets + +Move static assets: + +```bash +# Copy from Docusaurus static folder +cp -r static/img images/ +``` + +Update image references: + +**Before:** +```markdown +![Alt text](/img/screenshot.png) +``` + +**After:** +```mdx +![Alt text](/images/screenshot.png) +``` + +### 6. Convert configuration + +**Docusaurus `docusaurus.config.js`:** +```javascript +module.exports = { + title: 'My Site', + tagline: 'My awesome site', + url: 'https://mysite.com', + baseUrl: '/', + favicon: 'img/favicon.ico', + themeConfig: { + navbar: { + logo: { + src: 'img/logo.svg', + }, + }, + colorMode: { + defaultMode: 'light', + }, + }, +}; +``` + +**Mintlify `docs.json`:** +```json +{ + "name": "My Site", + "logo": { + "light": "/logo/light.svg", + "dark": "/logo/dark.svg" + }, + "favicon": "/favicon.ico", + "colors": { + "primary": "#0D9373", + "light": "#07C983", + "dark": "#0D9373" + } +} +``` + +### 7. Handle Docusaurus plugins + +#### Search + +Docusaurus uses Algolia DocSearch. Mintlify has built-in search: + +- Remove Algolia configuration +- Search works automatically after deployment +- No additional setup needed + +#### Analytics + +**Docusaurus:** +```javascript +gtag: { + trackingID: 'G-XXXXXXXXXX', +} +``` + +**Mintlify:** +```json +{ + "integrations": { + "ga4": { + "measurementId": "G-XXXXXXXXXX" + } + } +} +``` + +#### Versioning + +**Docusaurus versions:** +``` +versions.json +versioned_docs/ +versioned_sidebars/ +``` + +**Mintlify versions:** +```json +{ + "versions": [ + { + "version": "2.0", + "navigation": { + "pages": ["v2/introduction"] + } + }, + { + "version": "1.0", + "navigation": { + "pages": ["v1/introduction"] + } + } + ] +} +``` + +### 8. Convert custom React components + +Docusaurus allows custom React components. In Mintlify: + +1. Create MDX snippet files +2. Use Mintlify's built-in components when possible +3. For custom components, use React components in MDX + +**Example:** + +Create `snippets/CustomCard.mdx`: +```mdx + + Custom content here + +``` + +Use in pages: +```mdx +import CustomCard from '/snippets/CustomCard.mdx'; + + +``` + +### 9. Update internal links + +**Docusaurus:** +```markdown +[Link](./other-page.md) +[Link with anchor](../category/page.md#section) +``` + +**Mintlify:** +```mdx +[Link](/other-page) +[Link with anchor](/category/page#section) +``` + +Remove `.md` extensions and use absolute paths. + +## Testing your migration + +Run locally: + +```bash +mintlify dev +``` + +Verify: +- All pages render +- Navigation works +- Components display correctly +- Images load +- Links resolve +- Code blocks have syntax highlighting + +## Common migration issues + +### Broken imports + +**Problem**: Docusaurus `@site` imports don't work. + +**Solution**: Use relative paths or Mintlify's snippet system. + +### Missing plugins + +**Problem**: Docusaurus plugins not available. + +**Solution**: +- Use Mintlify's built-in features +- Add custom scripts via `docs.json` +- Use integrations for analytics, etc. + +### Swizzled components + +**Problem**: Customized Docusaurus theme components. + +**Solution**: +- Use Mintlify's theming options +- Add custom CSS +- Use React components for custom UI + +### Base URL issues + +**Problem**: Site was hosted at `/docs` subpath. + +**Solution**: Configure subpath in Mintlify or use redirects. + +## Deployment + +After migration: + +1. Push to GitHub +2. Connect repository in Mintlify dashboard +3. Configure custom domain +4. Set up redirects from old URLs: + +```json +{ + "redirects": [ + { + "source": "/docs/:slug*", + "destination": "/:slug*" + } + ] +} +``` + +## Feature comparison + +| Docusaurus Feature | Mintlify Equivalent | +|-------------------|---------------------| +| Sidebars | Navigation in docs.json | +| Admonitions | Callout components | +| Tabs | Tabs/CodeGroup | +| Versioning | Versions in docs.json | +| i18n | Languages in docs.json | +| Algolia Search | Built-in search | +| Blog | Changelog | +| Custom CSS | Custom scripts | +| Plugins | Integrations | + +## Getting help + +Need assistance? + +- Check the [troubleshooting guide](/troubleshooting) +- Review [Mintlify components](/components/index) +- [Contact support](https://www.mintlify.com/docs/contact-support) diff --git a/guides/migrate-from-gitbook.mdx b/guides/migrate-from-gitbook.mdx new file mode 100644 index 000000000..21f034b97 --- /dev/null +++ b/guides/migrate-from-gitbook.mdx @@ -0,0 +1,341 @@ +--- +title: Migrate from GitBook +description: Step-by-step guide to migrate your documentation from GitBook to Mintlify +--- + +This guide walks you through migrating your documentation from GitBook to Mintlify. + +## Before you start + + + + GitBook stores content in Markdown format. Export your content: + + 1. Go to your GitBook space settings + 2. Navigate to **Advanced** → **Export** + 3. Choose **Markdown & Images** format + 4. Download the ZIP file + + + + If you haven't already, create a new Mintlify project: + + ```bash + npm i -g mintlify + mintlify init + ``` + + + +## Migration process + +### 1. Extract and organize content + +Extract your GitBook export and review the structure: + +``` +gitbook-export/ +├── README.md +├── SUMMARY.md +├── page-1.md +├── page-2.md +└── .gitbook/ + └── assets/ +``` + +GitBook uses `SUMMARY.md` for navigation. You'll convert this to Mintlify's `docs.json` format. + +### 2. Convert navigation structure + +GitBook's `SUMMARY.md` looks like this: + +```markdown +# Table of contents + +* [Introduction](README.md) +* [Getting Started](getting-started.md) + * [Installation](getting-started/installation.md) + * [Configuration](getting-started/configuration.md) +* [API Reference](api-reference/README.md) + * [Authentication](api-reference/authentication.md) +``` + +Convert this to Mintlify's `docs.json` navigation: + +```json +{ + "navigation": { + "pages": [ + "introduction", + { + "group": "Getting started", + "pages": [ + "getting-started/installation", + "getting-started/configuration" + ] + }, + { + "group": "API reference", + "pages": [ + "api-reference/overview", + "api-reference/authentication" + ] + } + ] + } +} +``` + +### 3. Update frontmatter + +GitBook files may have minimal or no frontmatter. Add Mintlify frontmatter to each file: + +**Before (GitBook):** +```markdown +# Page Title + +Content here... +``` + +**After (Mintlify):** +```mdx +--- +title: Page Title +description: Brief description of this page +--- + +Content here... +``` + +### 4. Convert GitBook-specific syntax + +#### Hints and callouts + +**GitBook syntax:** +```markdown +{% hint style="info" %} +This is an info hint +{% endhint %} + +{% hint style="warning" %} +This is a warning +{% endhint %} +``` + +**Mintlify syntax:** +```mdx + +This is an info hint + + + +This is a warning + +``` + +#### Tabs + +**GitBook syntax:** +```markdown +{% tabs %} +{% tab title="JavaScript" %} +```javascript +console.log('Hello'); +``` +{% endtab %} + +{% tab title="Python" %} +```python +print('Hello') +``` +{% endtab %} +{% endtabs %} +``` + +**Mintlify syntax:** +```mdx + +```javascript JavaScript +console.log('Hello'); +``` + +```python Python +print('Hello') +``` + +``` + +#### Page links + +**GitBook syntax:** +```markdown +[Link text](../other-page.md) +[Link with anchor](page.md#section) +``` + +**Mintlify syntax:** +```mdx +[Link text](/other-page) +[Link with anchor](/page#section) +``` + +Remove `.md` extensions and use absolute paths from the root. + +#### Embedded content + +**GitBook syntax:** +```markdown +{% embed url="https://www.youtube.com/watch?v=VIDEO_ID" %} +``` + +**Mintlify syntax:** +```mdx + + ", + "url": "https://example.com", + "title": "Example" +} +[/block] +``` + +**Mintlify syntax:** +```mdx + +