gitbook-notion
Integration with hosted documentation platforms GitBook and Notion. Manage spaces, synchronize content with Git, export/import between formats, configure webhooks, and retrieve analytics.
What this skill does
# GitBook/Notion Integration Skill
Integration with hosted documentation platforms.
## Capabilities
- GitBook space management
- Notion database integration for docs
- Content synchronization with Git
- Export/import between formats
- Embed and block management
- API documentation hosting
- Analytics retrieval
- Webhook configuration
## Usage
Invoke this skill when you need to:
- Sync documentation to GitBook or Notion
- Manage hosted documentation spaces
- Export content for migration
- Configure publishing workflows
- Retrieve documentation analytics
## Inputs
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| platform | string | Yes | gitbook, notion |
| action | string | Yes | sync, export, import, analytics |
| spaceId | string | No | GitBook space or Notion database ID |
| sourcePath | string | No | Path to source content |
| outputPath | string | No | Path for exported content |
### Input Example
```json
{
"platform": "gitbook",
"action": "sync",
"spaceId": "abc123",
"sourcePath": "./docs"
}
```
## GitBook Integration
### GitBook Configuration
```yaml
# .gitbook.yaml
root: ./docs
structure:
readme: README.md
summary: SUMMARY.md
redirects:
/old-page: /new-page
/api/v1: /api/v2
```
### SUMMARY.md Structure
```markdown
# Summary
## Getting Started
* [Introduction](README.md)
* [Installation](getting-started/installation.md)
* [Quick Start](getting-started/quickstart.md)
## User Guide
* [Configuration](user-guide/configuration.md)
* [Features](user-guide/features.md)
* [Authentication](user-guide/features/auth.md)
* [Data Management](user-guide/features/data.md)
## API Reference
* [Overview](api/README.md)
* [Authentication](api/authentication.md)
* [Endpoints](api/endpoints/README.md)
* [Users](api/endpoints/users.md)
* [Projects](api/endpoints/projects.md)
## Resources
* [FAQ](resources/faq.md)
* [Changelog](CHANGELOG.md)
```
### GitBook API Integration
```javascript
const GitBook = require('gitbook-api');
class GitBookManager {
constructor(token) {
this.client = new GitBook({ token });
}
// List spaces
async listSpaces(organizationId) {
return await this.client.spaces.list({
organizationId
});
}
// Get space content
async getContent(spaceId) {
const pages = await this.client.spaces.listPages(spaceId);
return pages;
}
// Update page
async updatePage(spaceId, pageId, content) {
return await this.client.pages.update(spaceId, pageId, {
document: {
markdown: content
}
});
}
// Create page
async createPage(spaceId, title, content, parentId = null) {
return await this.client.pages.create(spaceId, {
title,
parent: parentId,
document: {
markdown: content
}
});
}
// Sync from Git
async syncFromGit(spaceId, repoUrl, branch = 'main') {
return await this.client.spaces.sync(spaceId, {
source: 'github',
url: repoUrl,
branch
});
}
// Get analytics
async getAnalytics(spaceId, period = '30d') {
return await this.client.spaces.getAnalytics(spaceId, {
period
});
}
}
```
### GitBook CI/CD Sync
```yaml
# .github/workflows/gitbook-sync.yml
name: Sync to GitBook
on:
push:
branches: [main]
paths:
- 'docs/**'
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Sync to GitBook
uses: gitbook/github-action-sync@v1
with:
token: ${{ secrets.GITBOOK_TOKEN }}
space: ${{ secrets.GITBOOK_SPACE_ID }}
```
## Notion Integration
### Notion Database Schema
```javascript
const notionSchema = {
database_id: 'abc123',
properties: {
'Title': {
type: 'title',
title: {}
},
'Slug': {
type: 'rich_text',
rich_text: {}
},
'Category': {
type: 'select',
select: {
options: [
{ name: 'Guide', color: 'blue' },
{ name: 'Reference', color: 'green' },
{ name: 'Tutorial', color: 'purple' }
]
}
},
'Status': {
type: 'status',
status: {
options: [
{ name: 'Draft', color: 'gray' },
{ name: 'Review', color: 'yellow' },
{ name: 'Published', color: 'green' }
]
}
},
'Last Updated': {
type: 'last_edited_time',
last_edited_time: {}
},
'Author': {
type: 'people',
people: {}
},
'Tags': {
type: 'multi_select',
multi_select: {
options: []
}
}
}
};
```
### Notion API Integration
```javascript
const { Client } = require('@notionhq/client');
class NotionDocsManager {
constructor(token) {
this.notion = new Client({ auth: token });
}
// Query documentation pages
async queryDocs(databaseId, filter = {}) {
const response = await this.notion.databases.query({
database_id: databaseId,
filter: {
and: [
{ property: 'Status', status: { equals: 'Published' } },
...Object.entries(filter).map(([prop, value]) => ({
property: prop,
[typeof value === 'string' ? 'rich_text' : 'select']: {
equals: value
}
}))
]
},
sorts: [
{ property: 'Last Updated', direction: 'descending' }
]
});
return response.results;
}
// Get page content
async getPageContent(pageId) {
const blocks = await this.notion.blocks.children.list({
block_id: pageId
});
return this.blocksToMarkdown(blocks.results);
}
// Create documentation page
async createDocPage(databaseId, title, content, properties = {}) {
const blocks = this.markdownToBlocks(content);
return await this.notion.pages.create({
parent: { database_id: databaseId },
properties: {
'Title': {
title: [{ text: { content: title } }]
},
'Slug': {
rich_text: [{ text: { content: this.slugify(title) } }]
},
'Status': {
status: { name: 'Draft' }
},
...properties
},
children: blocks
});
}
// Update page
async updatePage(pageId, content) {
// Clear existing blocks
const existing = await this.notion.blocks.children.list({
block_id: pageId
});
for (const block of existing.results) {
await this.notion.blocks.delete({ block_id: block.id });
}
// Add new blocks
const blocks = this.markdownToBlocks(content);
await this.notion.blocks.children.append({
block_id: pageId,
children: blocks
});
}
// Convert Notion blocks to Markdown
blocksToMarkdown(blocks) {
let markdown = '';
for (const block of blocks) {
switch (block.type) {
case 'paragraph':
markdown += this.richTextToMarkdown(block.paragraph.rich_text) + '\n\n';
break;
case 'heading_1':
markdown += '# ' + this.richTextToMarkdown(block.heading_1.rich_text) + '\n\n';
break;
case 'heading_2':
markdown += '## ' + this.richTextToMarkdown(block.heading_2.rich_text) + '\n\n';
break;
case 'heading_3':
markdown += '### ' + this.richTextToMarkdown(block.heading_3.rich_text) + '\n\n';
break;
case 'bulleted_list_item':
markdown += '- ' + this.richTextToMarkdown(block.bulleted_list_item.rich_text) + '\n';
break;
case 'numbered_list_item':
markdown += '1. ' + this.richTextToMarkdown(block.numbered_list_item.rich_text) + '\n';
break;
case 'code':
markdown += '```' + block.code.language + '\n';
markdown += this.richTextToMarkdown(block.code.rich_text);
markdown += '\n```\n\n';
break;
case 'quote':
markdown += '> ' + this.richTextToMarkdown(block.quote.rich_text) + '\n\n';
break;
case 'callout':
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.