guidebook-0.1.20 is not a library.
guidebook
A fast, HonKit/GitBook-compatible static site generator written in Rust.
Features
- GitBook/HonKit Compatible - Drop-in replacement for GitBook/HonKit projects
- Fast - Built with Rust for maximum performance
- Hot Reload - Live preview server with automatic rebuild on file changes
- Multi-language Support - Build books in multiple languages with
LANGS.md - Mermaid Diagrams - Native support for Mermaid diagram rendering
- Collapsible Chapters - Sidebar with expandable/collapsible chapter navigation
- Page Navigation - Previous/Next page arrows for easy navigation
- SPA Navigation - Smooth page transitions without full page reloads
- Japanese Support - Proper handling of Japanese characters in heading IDs and anchors
- Full-width Space Tolerance - Automatically handles full-width spaces in Markdown headings
- Custom Styles - Load custom CSS from
styles/website.css - Auto-link URLs - Bare URLs are automatically converted to clickable links (except in code blocks)
- Sidebar State Persistence - Sidebar open/close state is saved in localStorage
Installation
Step 1: Install Rust
Mac / Linux:
|
Windows:
Download and run the installer from https://rustup.rs/
After installation, restart your terminal.
Step 2: Install guidebook
Step 3: Verify Installation
Quick Start
# Navigate to your book folder
# Start preview server with hot reload
# Open http://localhost:4000 in your browser
From Source (for developers)
The binary will be available at target/release/guidebook.
Usage
# Build a book
# Start development server with hot reload
# Examples
Serve Command (Hot Reload)
The serve command starts a local development server with hot reload:
๐ Serving book at http://localhost:4000/
๐ฅ Hot reload enabled - changes will auto-refresh
Press Ctrl+C to stop
Features:
- Watches source files (
.md,.json,.css,.js) for changes - Automatically rebuilds when files are modified
- Browser auto-refreshes after rebuild (1 second polling)
- Previous/Next navigation arrows on each page
Project Structure
guidebook expects a GitBook/HonKit-compatible project structure:
my-book/
โโโ book.json # Book configuration
โโโ README.md # Book introduction (becomes index.html)
โโโ SUMMARY.md # Table of contents
โโโ LANGS.md # (Optional) Multi-language configuration
โโโ chapter1.md
โโโ chapter2/
โ โโโ section1.md
โ โโโ section2.md
โโโ assets/
โโโ images/
book.json
Custom Styles (styles/website.css)
You can customize fonts and styles by creating styles/website.css:
/* Google Fonts for Japanese */
/* Apply Noto Sans JP to the book */
}
/* Custom heading styles */
}
/* Code font */
}
The CSS file path is configured in book.json under styles.website.
SUMMARY.md
* ** * *
LANGS.md (Multi-language)
* *
Supported Features
| Feature | Status |
|---|---|
| Markdown rendering | โ |
| Tables | โ |
| Code blocks with syntax highlighting | โ |
| Mermaid diagrams | โ |
| Task lists | โ |
| Footnotes | โ |
| Strikethrough | โ |
| Collapsible chapters | โ |
| Multi-language books | โ |
| Custom styles | โ |
| Anchor links with Japanese text | โ |
| SPA-like navigation | โ |
| Auto-link URLs | โ |
| Sidebar state persistence | โ |
| Image paths with spaces | โ |
| Hot reload (serve command) | โ |
| Page navigation (prev/next) | โ |
Development
# Run in development
# Run dev server with hot reload
# Run tests
# Build release
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.