A modern AsciiDoc static site generator designed for technical documentation and books.
- 🚀 High Performance: Built with Rust, supports concurrent processing
- 📚 AsciiDoc Support: Full AsciiDoc format support including mathematical formulas and diagrams
- 🎨 Modern Theme: Responsive theme based on React + Tailwind CSS
- 🔍 Full-text Search: Built-in search functionality for quick content discovery
- 📊 Diagram Support: Supports multiple diagram formats (PlantUML, Mermaid, Graphviz, etc.)
- ⚡ Fast Build: Smart caching and incremental builds
- 🌐 SEO Friendly: Generates optimized HTML structure
git clone https://github.com/your-username/asphinx.git
cd asphinx
cargo build --release
- Rust 1.70+
- Node.js 18+ (for theme building)
- AsciiDoctor (for document processing)
-
Initialize project structure:
your-project/ ├── content/ │ ├── index.adoc │ ├── book1/ │ │ ├── index.adoc │ │ ├── ch1.adoc │ │ └── ch2.adoc │ └── book2/ │ ├── index.adoc │ ├── ch1.adoc │ └── ch2.adoc ├── theme/ └── asphinx.toml
-
Create your main index file (
content/index.adoc
):= My Documentation Welcome to my documentation site. - xref:book1/index.adoc[Book 1] - xref:book2/index.adoc[Book 2]
-
Configure Asphinx (
asphinx.toml
):[asciidoc] extensions = ["asciidoctor-mathematical", "asciidoctor-diagram"] [asciidoc.attributes] icons = "font" toc = 1 experimental = "" source-highlighter = "pygments"
-
Build the theme:
cd theme npm install npm run build
-
Generate the site:
./target/release/asphinx --theme theme
asphinx [OPTIONS] --theme <THEME>
Options:
--minify Enable HTML minification
--theme <THEME> Path to the theme directory
-h, --help Print help
The asphinx.toml
file contains the configuration for your site:
# Default configuration
no_default = false
[asciidoc]
extensions = ["asciidoctor-mathematical", "asciidoctor-diagram"]
[asciidoc.attributes]
icons = "font"
toc = 1
experimental = ""
source-highlighter = "pygments"
# Diagram formats
plantuml-format = "svg"
mermaid-format = "svg"
graphviz-format = "svg"
# ... more diagram formats
Asphinx supports a wide variety of diagram formats:
- PlantUML: Sequence diagrams, class diagrams, activity diagrams
- Mermaid: Flowcharts, sequence diagrams, Gantt charts
- Graphviz: DOT language graphs
- Ditaa: ASCII art diagrams
- BlockDiag: Block diagrams
- SeqDiag: Sequence diagrams
- ActDiag: Activity diagrams
- NwDiag: Network diagrams
- And many more...
The theme is built with modern web technologies:
- React 18: Component-based UI
- TypeScript: Type-safe development
- Tailwind CSS: Utility-first CSS framework
- Vite: Fast build tool
- Radix UI: Accessible component primitives
theme/
├── src/
│ ├── main.tsx # Main React entry point
│ ├── search-bar.tsx # Search functionality
│ ├── style.css # Global styles
│ └── components/ # UI components
├── layouts/
│ └── page.html # HTML template
└── assets/ # Static assets
- Modify the React components in
theme/src/
- Update styles in
theme/src/style.css
- Rebuild the theme:
npm run build
asphinx/
├── src/
│ ├── main.rs # Main application entry
│ ├── config.rs # Configuration handling
│ ├── generator.rs # HTML generation logic
│ ├── index.rs # Search index management
│ └── utils/ # Utility modules
├── content/ # Example content
├── theme/ # Default theme
└── asphinx.toml # Default configuration
cargo build
cargo test
- Built with Rust
- Powered by AsciiDoctor
- UI components from Radix UI
- Styling with Tailwind CSS