Migrate from GitBook
GitBook can sync each space to a Git repository as Markdown, which is the starting point for a migration to Theneo. This guide covers exporting from GitBook, turning the export into a Theneo project folder, and rewriting GitBook blocks into Theneo widgets.
At a glance
Markdown (headings, lists, links, tables, code fences) | Imports as is. |
Hints, tabs, steppers, expandable blocks, cards | Rewrite to Theneo widget syntax first (see the conversion table). Without it, |
OpenAPI specs | Import as your API reference once you export the spec file. |
| Recreate it as the |
Images in | Do not transfer automatically. Use absolute image URLs and paste included content into the page. |
Export from GitBook
1
Create an empty repository
Create an empty GitHub or GitLab repository (or an empty branch).
2
Set up Git Sync
In the GitBook space, choose Set up Git Sync, connect GitHub or GitLab, and select the empty repository and branch.
3
Sync from GitBook to Git
For the first sync, pick the direction GitBook to GitHub (or GitLab). Picking the other direction replaces your GitBook content with the empty repository.
4
Clone the repository
Repeat for every space or variant you want to move. Each export contains README.md (the space home page), SUMMARY.md (the navigation), .gitbook.yaml, .gitbook/assets/ (uploaded files) and .gitbook/includes/ (reusable content).
Double-check the sync direction before you start it. Syncing from an empty repository into GitBook overwrites the space.
Build the Theneo project folder
1
Create a project folder
Make an empty folder (for example theneo-docs/). Each page becomes its own folder with an index.md (the content) and a section.json (use the default from Project Folder Structure). Nested folders become nested pages.
2
Move your pages
Give every page its own folder with an index.md. A GitBook page file such as getting-started/install.md becomes getting-started/install/index.md. A README.md is the page of its folder in GitBook, so rename it to index.md; otherwise Theneo imports it as a separate page called "readme". Use SUMMARY.md as your guide to the page order and nesting.
3
Write theneo.json
Add a theneo.json at the root with your project name and a sections array that lists every page folder in sidebar order. Only sections listed here are imported, so add every page. The name you set here is the sidebar label.
4
Add your API spec (optional)
Put your OpenAPI file at the root of the folder and add "apiSpec": "openapi.yaml" to theneo.json. The same import then builds your API reference next to your guides.
Convert GitBook blocks
Rewrite these blocks in each index.md. Everything not listed here is plain Markdown and needs no change.
|
| Close it with |
|
| |
|
| |
|
| |
|
| Each tabTitle must match a name in the tabs list. |
|
| Move the step heading into the title attribute. |
|
| Imported as is, the content shows as plain text and is no longer collapsible. |
Cards ( |
| Two to four cards per group. |
| A Card with | |
| Remove the wrapper and keep the fence | |
| A plain link, or re-add the embed in the editor | |
| Paste the content into the page | Turn repeated blocks into Reusable Content after import. |
| Your OpenAPI reference | Export the spec and set |
For example, a GitBook hint:
{% hint style="warning" %}
Rotate keys every 90 days.
{% endhint %}
becomes:
<Callout attributes='{"dataType":"warning"}'>
<p>Rotate keys every 90 days.</p>
</Callout>
Fix images
GitBook exports images as files in .gitbook/assets/, usually referenced with relative paths such as <img src="../.gitbook/assets/setup.png">. The importer does not upload these files, so relative paths end up as broken images. Replace each one with a public absolute URL, for example . After importing, you can also drop images straight into the editor. Links between pages also keep their old paths, so update them to the new Theneo page URLs after import.
Bring your API reference
GitBook keeps OpenAPI specs at the organization level and shows them with {% openapi %} or {% swagger %} blocks, so they are not always part of the Markdown export. Download the spec file (or take it from your API repository), put it at the root of the Theneo project folder, and set apiSpec in theneo.json.
Import into Theneo
1
Create an empty project
npm install -g @theneo/cli
theneo login
theneo project create --name "Acme Docs" --empty
2
Validate the folder
theneo audit --dir ./theneo-docs
CLI audit checks the structure, theneo.json, and widget syntax (including Callout types and attributes JSON). Fix every error before importing.
3
Import
theneo import --project acme-docs --dir ./theneo-docs
Use the project slug from step 1. Importing into a project replaces its content, so import into a new project and review there.
4
Review and publish
Open the project in the editor, check pages that used components or images, then publish when you are ready.
Migrate with AI
theneo migrate does this conversion for you. Run it in the repository GitBook syncs to and choose your coding agent. The CLI installs Theneo's conversion skill, which already knows the GitBook blocks in the table above, and hands your agent a prompt. The agent builds the project folder in converted_for_theneo/, runs theneo audit until it is clean, and shows you a preview before anything is imported. See Migrate with an AI Agent.
cd ./your-gitbook-docs
theneo migrate
Prefer to drive the agent yourself? Give it this prompt instead:
Convert the GitBook docs in ./source into a Theneo project folder at ./theneo-docs.
- One folder per page with index.md and the default section.json.
- A theneo.json with "name" and a "sections" array in the same order as the GitBook navigation.
- Rewrite GitBook components into Theneo widgets using the conversion table on
https://docs.theneo.io/get-started/migrate-to-theneo/migrate-from-gitbook
- Replace relative image paths with absolute URLs and list any you could not resolve.
- Run "theneo audit --dir ./theneo-docs" and fix every error.
After the import, you can keep editing with AI by connecting the Theneo MCP server to Claude or another MCP client, so it can read and update sections in your project directly.
What does not transfer
- Comments, change requests, revision history and permissions.
- Integrations, custom fonts and site customization. Set branding, custom domain and analytics in Theneo after import.
Stuck on a component, a large project, or a custom setup? Email hello@theneo.io and the team will look at your project with you.
On this page
- Migrate from GitBook