Migrate from GitBook

Migration3 min read||

DocsLit can import documentation from a GitBook project. The import command reads your SUMMARY.md and auto-discovers all Markdown files.

Run the migration

npx docslit import {{GITBOOK_DIR}}

DocsLit detects GitBook projects by looking for a SUMMARY.md file in the source directory.

Preview the migration without writing files:

npx docslit import {{GITBOOK_DIR}} --dry-run

What gets converted

  • SUMMARY.md — Parsed to generate the sidebar structure in docslit.json
  • Markdown files — Copied with any MDX syntax cleaned up
  • Nested directories — Flattened into page slugs
  • Static assets — Images and files copied to the output directory

After migration

cd {{GITBOOK_DIR}}-docslit npx docslit dev npx docslit validate

Check for broken internal links — GitBook's linking style may need adjustment.

GitBook content is plain Markdown. After migration, enhance your pages with DocsLit components:

  • Add <wc-callout> for important notes
  • Use <wc-tabs> for platform-specific content
  • Add <wc-steps> for procedures
  • Use <wc-code-group> for multi-language code examples

Generic imports

If your source does not match Mintlify, Fern, or GitBook, DocsLit falls back to a generic import mode. It reads all .md and .mdx files, infers a sidebar from the folder structure, and converts any recognized MDX components.

npx docslit import ./any-markdown-folder

Custom output directory

npx docslit import {{GITBOOK_DIR}} --out my-new-docs