Import content from a CSV file into GitBook

Learn how to add data from Zendesk — or any other CSV file — into GitBook

This guide explains how to import HTML content stored in a CSV file into GitBook.

This process is useful for migrating content from various sources, such as help centers like Zendesk, documentation databases, or any application that exports HTML data to CSV.

Scroll to the bottom of this page to see a video version of this guide.

1

Connect GitBook to your Git repository

You can follow our import/migration guide to add your content from a GitHub or GitLab repository into to a new GitBook space. Read more about Git Sync in our documentation

2

Preparing your CSV file

Before you import your CSV content, you should first make sure it’s in the right format for import:

  • Open your CSV file in a spreadsheet editor (e.g., Google Sheets, Microsoft Excel).

  • Ensure your CSV file has the following essential columns:

    • Section: This column will determine the organization of your content in GitBook. It represents the section or category the HTML content belongs to. If your data does not contain sections, you can create a single section name for all rows.

    • Article Title: The title of each page.

    • Article Body: The HTML content itself.

  • Zendesk example: If you’re migrating from Zendesk, you’ll typically export a CSV that includes columns like “Section”, “Article Title”, and “Article Body” (which contains the HTML).

3

Converting CSV to Markdown

To import your CSV data into GitBook, you first need to convert it into Markdown so GitBook can interpret it correctly. Here’s how:

  • Upload your prepared CSV file.

  • Review the preview to ensure the data is displayed correctly.

  • Click the Convert to Markdown and Download button.

  • Download the resulting ZIP file. This file will contain Markdown files for each article and a SUMMARY.md file.

4

Adding files to your Git repository

  • Unzip the downloaded ZIP file.

  • If your upload is small (less than 100 pages) you can drag and drop the extracted Markdown files into your repository. Alternatively you can use the command line to push from your machine to GitHub and GitLab. If you are not familiar with the command line, GitHub’s desktop app is also a user friendly way to add large folders to your repository.

  • Commit and push the changes.

5

GitBook sync and verification

  • Because you’ve set up Git Sync, GitBook will automatically detect the changes in your Git repository and sync the content to your GitBook space.

  • Verify that your articles and sections are displayed correctly in your GitBook space.

A video guide explaining how to import a CSV file from Zendesk into GitBook

Last updated

Was this helpful?