| Crates.io | litho-book |
| lib.rs | litho-book |
| version | 0.3.9 |
| created_at | 2025-09-13 01:42:12.983131+00 |
| updated_at | 2026-01-24 14:13:16.990666+00 |
| description | Litho Book is a modern web documentation reader specifically designed for the [**Litho (deepwiki-rs)**](https://github.com/sopaco/deepwiki-rs) documentation generation engine. It provides an elegant interface and powerful features that allow you to easily browse and read project architecture documentation generated by Litho. |
| homepage | |
| repository | https://github.com/sopaco/litho-book |
| max_upload_size | |
| id | 1837131 |
| size | 1,498,721 |
๐ ๏ธ A high-performance markdown reader built with Rust and Axum
๐ Modern web reading experience for documents generated by Litho (deepwiki-rs)
๐ If you like this project, please give it a โญ and consider supporting the development of Litho project!
Litho Book is a modern markdown reader specifically designed for the Litho (deepwiki-rs) documentation generation engine. It provides an elegant interface and powerful features that allow you to easily browse and read project architecture documentation generated by Litho.
Litho Book is completely free and open-source, built with a high-performance Rust technology stack to provide you with a smooth documentation reading experience.
โค๏ธ Like Litho Book? Star it ๐ and learn more about the Litho project! โค๏ธ
![]() |
![]() |
Litho Book serves as an important component of the Litho (deepwiki-rs) ecosystem, focusing on providing excellent documentation reading experience:
graph LR
subgraph "Litho Ecosystem"
A[Project Code] --> B[Litho Engine]
B --> C[Generated Docs]
C --> D[Litho Book]
D --> E[Elegant Reading Experience]
end
Clone the repository
git clone <repository-url>
cd litho-book
Build the project
cargo build --release
The compiled binary will be available in the target/release directory
Litho Book provides a clean command-line interface to quickly start the documentation server:
# Basic usage - specify documentation directory
cargo run -- --docs-dir ./sample-markdowns-docdir
# Specify port and auto-open browser
cargo run -- --docs-dir ./docs --port 8080 --open
# Enable verbose logging
cargo run -- --docs-dir ./docs --verbose
# 1. Generate project documentation with Litho
litho --project ./my-project --output ./docs
# 2. Read the generated documentation with Litho Book
cargo run -- --docs-dir ./docs --open
| Argument | Description | Default |
|---|---|---|
-d, --docs-dir <DIR> |
Specify markdown documentation directory path (required) | - |
-p, --port <PORT> |
Specify server port | 3000 |
--host <HOST> |
Specify bind host address | 127.0.0.1 |
-o, --open |
Auto-open browser after startup | false |
-v, --verbose |
Enable verbose logging output | false |
-h, --help |
Show help information | - |
Litho Book adopts a modern Rust technology stack to ensure high performance and reliability:
clap - Powerful command-line argument parsing and validationaxum - High-performance async web framework with modern HTTP featuresaskama - Compile-time template engine with zero runtime overheadpulldown-cmark - High-performance Markdown parser, fully CommonMark compatibletokio - The most mature async runtime in the Rust ecosystemserde - Efficient data serialization and deserializationflowchart TB
subgraph "CLI Layer"
A[Argument Parsing]
B[Config Validation]
C[Service Startup]
end
subgraph "Web Server Layer"
D[Axum Routing]
E[Static File Service]
F[API Endpoints]
G[Middleware]
end
subgraph "Frontend Layer"
H[Directory Tree Component]
I[Markdown Rendering]
J[Mermaid Charts]
K[Search Functionality]
end
subgraph "Data Layer"
L[File System]
M[Directory Scanning]
N[File Reading]
O[Tree Structure Building]
end
A --> D
B --> D
C --> D
D --> H
E --> I
F --> J
G --> K
D --> L
L --> M
M --> N
N --> O
sequenceDiagram
participant Developer as Developer
participant Litho as Litho Engine
participant LithoBook as Litho Book
participant Browser as Browser
Developer->>Litho : litho --project ./my-project --output ./docs
Litho-->>Developer : Documentation generation completed
Developer->>LithoBook : cargo run -- --docs-dir ./docs --open
LithoBook-->>Developer : Server started successfully
LithoBook->>Browser : Automatically opens http://127.0.0.1:3000
Browser->>LithoBook : Requests main page
LithoBook-->>Browser : Returns HTML page
Browser->>LithoBook : Requests document tree (/api/tree)
LithoBook-->>Browser : Returns JSON-formatted tree structure
Browser->>LithoBook : Requests file content (/api/file?file=...)
LithoBook-->>Browser : Returns rendered HTML content
litho-book/
โโโ src/
โ โโโ main.rs # Main program entry and server startup
โ โโโ cli.rs # CLI argument processing and configuration management
โ โโโ filesystem.rs # File system operations and directory scanning
โ โโโ server.rs # Web server and routing configuration
โ โโโ error.rs # Error handling and type definitions
โโโ templates/
โ โโโ index.html.tpl # Main page template (Askama)
โโโ static/ # Static resource files
โ โโโ css/ # Style files
โ โโโ js/ # JavaScript files
โ โโโ assets/ # Images and other resources
โโโ sample-markdowns-docdir/ # Sample documentation directory
โโโ Cargo.toml # Project configuration and dependencies
โโโ Cargo.lock # Dependency version lock
โโโ README.md # Project documentation
Litho Book provides the following API endpoints to support dynamic frontend functionality:
| Endpoint | Method | Description | Parameters |
|---|---|---|---|
/ |
GET | Main page | - |
/api/file |
GET | Retrieve the content and rendered HTML of a specified file | file=<path> |
/api/tree |
GET | Get the tree structure of the entire document directory | - |
/api/search |
GET | Search files based on a query keyword | q=<query> |
/api/stats |
GET | Get statistics of the document library (e.g., number of files, size, etc.) | - |
/health |
GET | Health check | - |
# Clone the project
git clone <repository-url>
cd litho-book
# Run development version
cargo run -- --docs-dir ./sample-markdowns-docdir --verbose
# Run test suite
cargo test
# Code quality check
cargo clippy
# Code formatting
cargo fmt
# Build release version
cargo build --release
| Endpoint | Method | Description | Parameters |
|---|---|---|---|
/ |
GET | Main page | - |
/api/file |
GET | Get file content | file=<path> |
/api/tree |
GET | Get directory tree structure | - |
/api/search |
GET | Search files | q=<query> |
/api/stats |
GET | Get statistics | - |
/health |
GET | Health check | - |
# 1. Generate project documentation with Litho
git clone https://github.com/sopaco/deepwiki-rs.git
cd deepwiki-rs
cargo build --release
./target/release/litho --project ./my-project --output ./project-docs
# 2. Read documentation with Litho Book
git clone <litho-book-repository>
cd litho-book
cargo run -- --docs-dir ./project-docs --open
# Use default settings
cargo run -- -d ./docs
# Custom port and auto-open browser
cargo run -- -d ./docs -p 8080 -o
# Bind to all network interfaces (for team sharing)
cargo run -- -d ./docs --host 0.0.0.0 -p 3000
# Enable verbose logging (for debugging)
cargo run -- -d ./docs --verbose
We welcome all forms of contributions! Report bugs or submit feature requests through GitHub Issues.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)MIT. A copy of the license is provided in the LICENSE file.
๐ก Recommendation: If you need to automatically generate project architecture documentation, try Litho (deepwiki-rs) - an AI-based intelligent documentation generation engine that can automatically analyze your project and generate professional C4 architecture documentation!
๐ Explore More Excellent Open Source Projects
Litho (deepwiki-rs) โข
Saga Reader
Mermaid Fixer