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 helpThe 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 formatsAsphinx 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 buildcargo test- Built with Rust
- Powered by AsciiDoctor
- UI components from Radix UI
- Styling with Tailwind CSS