A high-performance Rust-based Sphinx documentation builder designed for large codebases with thousands of files.
π§ This project is currently under active development and is NOT recommended for production usage.
Current Focus: The primary goal is validation and experimentation rather than producing perfectly matched Sphinx builds. We are:
- β Validating the core architecture and performance concepts
- β Testing parallel processing capabilities on large documentation sets
- β Experimenting with Rust-based parsing and rendering
β οΈ NOT aiming for 100% Sphinx compatibility yetβ οΈ NOT ready for production documentation workflows
Use Cases: Perfect for developers who want to experiment with high-performance documentation building or contribute to the development of next-generation documentation tools.
- π Blazing Fast: Parallel processing with Rust's performance
- π Scalable: Handle large documentation projects efficiently (tested with 50+ files in ~44ms)
- π Incremental Builds: Smart caching system for faster rebuilds
- π File Processing: Support for RST and Markdown files
- π§ Configuration: Multiple configuration formats (conf.py, YAML, JSON)
- π File Pattern Matching: 100% Sphinx-compatible
include_patternsandexclude_patternssupport - π Statistics: Project analysis and build metrics
β οΈ Validation: Document validation with warning/error reporting- ποΈ CLI Interface: Complete command-line interface (build, clean, stats)
- π¦ Static Assets: Automatic copying of static files and assets
- π― Domain System: Complete cross-reference validation with Python and RST domains
- π Reference Validation: Comprehensive validation of :func:, :class:, :doc:, :ref: references
- π‘ Smart Suggestions: Intelligent suggestions for broken references
- π Search Index: Framework exists but search functionality not active
- π οΈ Extensions: Basic extension system with limited Sphinx extension support
- π¨ Themes: Basic theme structure but no advanced theming
For detailed development roadmap, see Validation Features Plan which outlines our validation-focused approach.
Phase 1 (Next 2 months):
- ποΈ Domain System: Sphinx-compatible domain registration and cross-reference validation
- π Directive Validation: Complete directive/role validation system
- π Document Structure: TOC tree and hierarchy validation
Phase 2-4 (Months 3-8):
- π Content Constraints: Field validation and workflow checking
- οΏ½ Extension Framework: Plugin validation and compatibility
- π Code Documentation: Autodoc-style validation
- π Internationalization: Translation completeness validation
Advanced UI Features (search indexing, complex templating, etc.) are intentionally deferred until validation foundation is solid.
- π Live Server: Development server with live reload
- οΏ½οΈ File Watching: Automatic rebuilds on file changes
- π Plugin System: Full plugin architecture for custom functionality
- π± Mobile Friendly: Responsive design optimization
- πΌοΈ Image Optimization: Automatic image processing and optimization
- π¦ Asset Bundling: Advanced asset optimization and bundling
Note: This project is in active development. The core build functionality works reliably, but advanced features are still being developed.
- Rust 1.70+
- Cargo
# Clone and build from source
git clone https://github.com/salioglu/sphinx-ultra.git
cd sphinx-ultra
cargo build --release
# The binary will be available at target/release/sphinx-ultra# Build documentation
./target/release/sphinx-ultra build --source docs --output _build
# Clean build artifacts
./target/release/sphinx-ultra clean --output _build
# Show project statistics
./target/release/sphinx-ultra stats --source docs
# Get help
./target/release/sphinx-ultra --helpbuild: Build documentation from source filesclean: Remove build artifacts and output filesstats: Display project statistics and analysis
# Parallel processing
sphinx-ultra build --jobs 8 --source docs --output _build
# Incremental builds (faster rebuilds)
sphinx-ultra build --incremental --source docs --output _build
# Clean before build
sphinx-ultra build --clean --source docs --output _build
# Save warnings to file
sphinx-ultra build --warning-file warnings.log --source docs --output _build
# Fail on warnings (useful for CI)
sphinx-ultra build --fail-on-warning --source docs --output _buildSphinx Ultra supports multiple configuration formats and can auto-detect your setup:
- conf.py (Sphinx standard) - Automatically detected and parsed
- sphinx-ultra.yaml - Native YAML configuration
- sphinx-ultra.yml - Alternative YAML format
- sphinx-ultra.json - JSON configuration
- Default settings - Used if no config file found
Sphinx Ultra can read and parse existing Sphinx conf.py files:
# conf.py (existing Sphinx configuration works)
project = 'My Documentation'
version = '1.0'
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
html_theme = 'sphinx_rtd_theme'Create a sphinx-ultra.yaml file for native configuration:
# Project information
project: "My Documentation"
version: "1.0.0"
copyright: "2024, My Company"
# Build settings
parallel_jobs: 8
max_cache_size_mb: 500
cache_expiration_hours: 24
# Output configuration
output:
html_theme: "sphinx_rtd_theme"
syntax_highlighting: true
highlight_theme: "github"
search_index: true
minify_html: false
# File pattern matching (Sphinx-compatible)
include_patterns:
- "**/*.rst"
- "**/*.md"
exclude_patterns:
- "_build/**"
- "drafts/**"
# Extensions (limited support currently)
extensions:
- "sphinx.ext.autodoc"
- "sphinx.ext.viewcode"
- "sphinx.ext.intersphinx"
# Theme configuration
theme:
name: "sphinx_rtd_theme"
options: {}
custom_css: []
custom_js: []
# Optimization settings
optimization:
parallel_processing: true
incremental_builds: true
document_caching: trueMost standard Sphinx configuration options are supported including:
- Project metadata (project, version, copyright, author)
- HTML output options (theme, static paths, CSS/JS files)
- Extension configuration
- Template and static file paths
- File pattern matching (
include_patterns,exclude_patterns) - Full compatibility guide - Build optimization settings
Real performance test results on documentation projects:
| Files | Build Time | Processing Rate | Memory Usage |
|---|---|---|---|
| 2 files | 8ms | 250 files/sec | ~10MB |
| 51 files | 44ms | 1,159 files/sec | ~15MB |
| 100+ files | ~85ms* | 1,176 files/sec* | ~20MB* |
*Projected based on linear scaling
- Parallel Processing: Utilizes all CPU cores for maximum throughput
- Smart Caching: Incremental builds only process changed files
- Memory Efficient: Low memory footprint even for large projects
- Fast Parsing: Optimized RST and Markdown parsing
- Minimal I/O: Efficient file operations and batch processing
While we don't have direct Sphinx comparison benchmarks yet, the processing speeds above represent significant performance improvements for documentation builds. The actual performance gain depends on:
- Number of files and their complexity
- Available CPU cores
- Disk I/O speed
- Whether incremental builds are enabled
The Rust builder consists of several key components:
- Parser: Fast RST/Markdown parsing with syntax highlighting
- Cache: Intelligent caching system with LRU eviction
- Renderer: Template-based HTML generation with Handlebars
- Builder: Parallel processing engine with dependency tracking
Enable faster rebuilds by only processing changed files:
sphinx-ultra build --incremental --source docs --output _buildControl the number of parallel jobs:
# Use 16 parallel jobs for maximum performance on large projects
sphinx-ultra build --jobs 16 --source docs --output _build
# Use 1 job for debugging or memory-constrained environments
sphinx-ultra build --jobs 1 --source docs --output _build# Save all warnings and errors to a log file
sphinx-ultra build --warning-file build.log --source docs --output _build
# Treat warnings as errors (useful for CI/CD)
sphinx-ultra build --fail-on-warning --source docs --output _build
# Combine both for strict CI builds
sphinx-ultra build -w build.log -W --source docs --output _build# Use a specific configuration file
sphinx-ultra build --config my-config.yaml --source docs --output _build
# Configuration auto-detection order:
# 1. conf.py (if present)
# 2. sphinx-ultra.yaml
# 3. sphinx-ultra.yml
# 4. sphinx-ultra.json
# 5. Default configuration# Clean output directory before building
sphinx-ultra build --clean --source docs --output _build
# Or clean manually
sphinx-ultra clean --output _build# Get detailed project statistics
sphinx-ultra stats --source docsOutput includes:
- Number of source files discovered
- Total lines of documentation
- Average and largest file sizes
- Directory depth analysis
- Cross-reference count
# Debug-level logging for detailed build information
sphinx-ultra --verbose build --source docs --output _build
# Or set environment variable
RUST_LOG=debug sphinx-ultra build --source docs --output _buildConfiguration Loading Errors
- Ensure YAML/JSON syntax is valid
- Check that required fields are present
- Use
--configto specify config file explicitly
Build Failures
- Check file permissions in source and output directories
- Verify source files are valid RST/Markdown
- Review warning output for specific issues
Performance Issues
- Reduce parallel jobs if memory-constrained:
--jobs 1 - Enable incremental builds:
--incremental - Check for large files that may slow processing
- Use
sphinx-ultra --helpfor command overview - Use
sphinx-ultra build --helpfor build options - Check project issues on GitHub
- Enable verbose logging for debugging
We welcome contributors! This project is in active development and needs help with:
- π§ͺ Testing: Try the builder on various documentation projects
- π Bug Reports: Report issues with parsing, rendering, or performance
- π‘ Feature Ideas: Suggest improvements or new capabilities
- π Documentation: Help improve setup guides and usage examples
- π§ Code: Contribute to core features, optimizations, or new functionality
# Clone and build
git clone https://github.com/salioglu/sphinx-ultra.git
cd sphinx-ultra
./dev.sh setup
# Install git pre-commit hooks (recommended)
./dev.sh install-hooks
# Run development commands
./dev.sh fmt # Format code
./dev.sh clippy # Run linter
./dev.sh test # Run tests
./dev.sh pre-commit # Run all pre-commit checks
./dev.sh check # Run all checks including tests
# Build documentation
./dev.sh docsPlease see CONTRIBUTING.md for detailed guidelines.
Priority Areas: We need help with:
- π§ͺ Testing: Try the builder on various documentation projects and report results
- π Bug Reports: Report issues with parsing, rendering, or performance
- π‘ Feature Validation: Test existing features and suggest improvements
- π Documentation: Help improve setup guides and usage examples
- π§ Core Features: Contribute to parsing, theming, or search functionality
- π¨ Themes: Develop modern, responsive documentation themes
- π Extensions: Expand Sphinx extension compatibility
- Basic RST and Markdown processing
- Fast parallel builds
- Configuration auto-detection
- File validation and warning systems
- Incremental caching
- Advanced theming and templating
- Search index functionality
- Live development server
- Full Sphinx directive compatibility
This project uses an automated release system with version validation to ensure consistency.
Download pre-built binaries from the Releases page.
# Setup release environment (one-time)
./scripts/setup.sh
# Create a new patch release (0.1.2 β 0.1.3)
./scripts/release.sh --patch
# Create a new minor release (0.1.2 β 0.2.0)
./scripts/release.sh --minor
# Create a new major release (0.1.2 β 1.0.0)
./scripts/release.sh --major
# Preview what a release would do
./scripts/release.sh --dry-run --patchThe release script automatically:
- β Runs tests to ensure quality
- β
Updates
Cargo.tomlversion - β Creates and pushes git tags
- β Triggers GitHub Actions to build and publish
Version Safety: The system prevents version mismatches between git tags and Cargo.toml. See scripts/README.md for detailed documentation.
This project is licensed under the MIT License - see the LICENSE file for details.