GitBook Sync Setup
Purpose: Automatically sync OASIS documentation to GitBook Date: November 6, 2025
Option 1: GitHub Integration (Recommended - Easiest)
GitBook can automatically sync with a GitHub repository.
Setup Steps:
1. Create GitBook Account:
Go to https://www.gitbook.com
Sign up (free for open-source projects)
2. Create New Space:
Click "New Space"
Choose "Import from GitHub"
Select your OASIS repository
Choose branch:
mainormaster
3. Configure Documentation Path: In GitBook settings, specify where docs are:
Primary docs:
/Docs/API docs:
/Docs/Devs/API Documentation/Guides: Root level
*.mdfiles
4. Auto-Sync: GitBook will automatically:
Pull latest commits every 10 minutes
Re-render documentation
Update live site
Every time you commit:
git add OASIS_PROVIDER_ARCHITECTURE_GUIDE.md
git commit -m "docs: update"
git push
# GitBook automatically syncs within 10 minutesOption 2: GitBook CLI (More Control)
Use the GitBook CLI for programmatic uploads.
Installation:
npm install -g gitbook-cliSetup:
1. Initialize GitBook in your repo:
cd /Volumes/Storage/OASIS_CLEAN
gitbook initThis creates:
SUMMARY.md- Table of contentsREADME.md- Home page
2. Create SUMMARY.md:
# Summary
## Getting Started
* [Introduction](README.md)
* [OASIS Provider Architecture](OASIS_PROVIDER_ARCHITECTURE_GUIDE.md)
## Core Documentation
* [HyperDrive Architecture](HYPERDRIVE_ARCHITECTURE_DIAGRAM.md)
* [Web4 Token System](WEB4_TOKEN_TECHNICAL_DEEP_DIVE_AND_VALUATION.md)
* [Web4 Ecosystem](WEB4_ECOSYSTEM_COMPLETE.md)
## Platform Guides
* [Web4 Token Platform](WEB4_TOKEN_PLATFORM_FINANCIAL_ANALYSIS.md)
* [HyperDrive Liquidity Pools](HYPERDRIVE_LIQUIDITY_POOLS_PLATFORM.md)
* [qUSDC Implementation](QUSDC_COMPLETE_ARCHITECTURE.md)
## API Documentation
* [API Endpoints Summary](OASIS_API_COMPLETE_ENDPOINTS_SUMMARY.md)
* [WEB4 OASIS API](Docs/Devs/API Documentation/WEB4_OASIS_API_Documentation_Comprehensive.md)
## Smart Contracts
* [Contract Generator](SmartContractGenerator/README.md)
* [Bridge Contracts](UniversalAssetBridge/contracts/BUILD_BRIDGE_CONTRACTS.md)
## Architecture Diagrams
* [Web4 HyperDrive Diagrams](WEB4_HYPERDRIVE_ARCHITECTURE_DIAGRAMS.md)
* [HyperDrive Q&A](WEB4_TOKENS_HYPERDRIVE_ARCHITECTURE_QUESTIONS.md)3. Build GitBook:
gitbook build
# Creates _book/ folder with HTML4. Serve Locally (Test):
gitbook serve
# View at http://localhost:4000Option 3: GitBook API (Full Automation)
Use GitBook's API to push docs programmatically.
Setup:
1. Get GitBook API Token:
GitBook β Settings β Developer Settings
Create new token
Save token securely
2. Create Upload Script:
#!/bin/bash
# upload-to-gitbook.sh
GITBOOK_TOKEN="your-token-here"
GITBOOK_SPACE_ID="your-space-id"
# Upload main provider guide
curl -X POST "https://api.gitbook.com/v1/spaces/${GITBOOK_SPACE_ID}/content" \
-H "Authorization: Bearer ${GITBOOK_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"path": "provider-architecture.md",
"content": "'$(cat OASIS_PROVIDER_ARCHITECTURE_GUIDE.md | jq -Rs .)'",
"message": "Update provider architecture guide"
}'
# Upload other docs
for doc in WEB4_*.md HYPERDRIVE_*.md QUSDC_*.md; do
curl -X POST "https://api.gitbook.com/v1/spaces/${GITBOOK_SPACE_ID}/content" \
-H "Authorization: Bearer ${GITBOOK_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"path": "'$doc'",
"content": "'$(cat $doc | jq -Rs .)'",
"message": "Update documentation"
}'
done
echo "β Documentation uploaded to GitBook"3. Make Executable:
chmod +x upload-to-gitbook.sh4. Run Manually or Add to CI/CD:
./upload-to-gitbook.shOption 4: GitHub Actions (Fully Automated)
Set up automatic sync on every push to main branch.
Create Workflow File:
File: .github/workflows/sync-gitbook.yml
name: Sync to GitBook
on:
push:
branches:
- main
paths:
- '**.md' # Only trigger on markdown changes
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Sync to GitBook
uses: gitbook/publish-action@v1
with:
gitbook_token: ${{ secrets.GITBOOK_TOKEN }}
space_id: ${{ secrets.GITBOOK_SPACE_ID }}
docs_path: '.' # Sync entire repo
- name: Notify on completion
run: echo "β Documentation synced to GitBook"Add Secrets to GitHub:
Go to GitHub repo β Settings β Secrets
Add
GITBOOK_TOKEN(from GitBook settings)Add
GITBOOK_SPACE_ID(from GitBook space URL)
Result: Every commit automatically syncs to GitBook within minutes.
Recommended Approach
For your use case, I recommend Option 1 (GitHub Integration):
Why:
β Zero configuration needed
β Automatic sync (no scripts to maintain)
β Works with your existing Git workflow
β Free for public repos
β No API tokens to manage
Setup Time: 5 minutes
Steps:
Create GitBook account
Click "Import from GitHub"
Select OASIS repository
Done - auto-syncs forever
Your workflow becomes:
# Edit documentation
vim OASIS_PROVIDER_ARCHITECTURE_GUIDE.md
# Commit as usual
git add .
git commit -m "docs: update"
git push
# GitBook automatically updates within 10 minutes
# Your friend sees updates at: https://yourspace.gitbook.ioGitBook Structure Recommendation
Create a clean docs structure:
/Volumes/Storage/OASIS_CLEAN/
βββ .gitbook.yaml (configuration)
βββ README.md (home page)
βββ docs/
βββ SUMMARY.md (table of contents)
βββ getting-started/
β βββ provider-architecture.md
β βββ quickstart.md
βββ api-reference/
β βββ avatar-api.md
β βββ data-api.md
β βββ wallet-api.md
βββ guides/
β βββ multi-chain-integration.md
β βββ hyperdrive-guide.md
βββ architecture/
βββ hyperdrive-diagrams.md
βββ web4-tokens.mdOr keep current structure and let GitBook organize automatically.
Quick Start (Option 1):
Right now, you can:
Go to https://www.gitbook.com/signup
Sign up with GitHub account
Click "New Space" β "Import from GitHub"
Select your OASIS repo
Choose "main" branch
Select docs to publish (or all
.mdfiles)Click "Import"
Done! Your docs are live and auto-syncing.
Share with your friend:
Documentation: https://oasis.gitbook.io
API Endpoint: https://api.oasisweb4.one
Contact: @maxgershfield on TelegramCost
GitBook Pricing:
Free: Public documentation (perfect for open-source)
Plus ($6.70/month): Private docs, custom domain
Pro ($12.50/month): Teams, advanced features
Enterprise: Custom pricing
For open-source projects like OASIS: FREE β
Want me to create the .gitbook.yaml and SUMMARY.md files to get you started?
Last updated