Quick Start
High Contrast
Dark Mode
Light Mode
Sepia
Forest
1 min read157 words

Quick Start

Get your online book up and running in minutes.

Prerequisites

Step 1: Create Your Repository

Click "Use this template" on the GitHub repository page, or clone directly:

git clone https://github.com/tanghoong/gitbook-online-generator.git my-book
cd my-book

Step 2: Configure Your Book

Edit config.yml in the repository root:

title: "My Awesome Book"
author: "Your Name"
description: "A book about amazing things"
language: "en"

Step 3: Write Content

Create Markdown files inside the content/ folder:

content/
├── 01-introduction/
│   ├── 01-welcome.md
│   └── 02-overview.md
├── 02-chapters/
│   ├── 01-first-chapter.md
│   └── 02-second-chapter.md

Ordering Rules

Step 4: Push and Deploy

git add .
git commit -m "Add book content"
git push origin main

GitHub Actions will automatically build your book and deploy it to GitHub Pages.

Step 5: Enable GitHub Pages

  1. Go to your repository Settings
  2. Navigate to Pages
  3. Set source to GitHub Actions
  4. Your book will be live at https://username.github.io/repo-name/

本地预览

You can also build and preview locally:

# Install dependencies
pip install -r scripts/requirements.txt
# Build the book
python scripts/build.py
# Serve locally
cd dist
python -m http.server 8000

Then open http://localhost:8000 in your browser.


Next: Learn about Markdown formatting in the next chapter.