Skip to main content

A CLI tool to prepare AsciiDoc files for migration to DITA

Project description

Aditi - AsciiDoc DITA Integration Tool

PyPI version Python versions License: MIT

Aditi (Sanskrit: आदिति, "boundless") - A CLI tool that prepares AsciiDoc files for seamless migration to DITA.

Aditi helps technical writers identify and fix compatibility issues when migrating from AsciiDoc to DITA. It uses the Vale linter with comprehensive AsciiDocDITA rules to categorize issues as automatically fixable, partially fixable, or requiring manual review.

✨ Key Features

  • 🔍 Comprehensive Analysis: Detects all 27 AsciiDocDITA compatibility issues
  • 🔧 Smart Auto-Fixing: Automatically resolves deterministic issues (entities, content types)
  • 📊 Intelligent Categorization: Sorts issues by fix complexity and priority
  • 🚀 Performance Optimized: Parallel processing with container resource limits
  • 🛡️ Production Ready: Robust error handling and graceful interruption support
  • 📋 Clear Reporting: Visual progress indicators and actionable results

🚀 Installation

Quick Install

pip install --upgrade aditi

Note: If you encounter an installation error like [Errno 20] Not a directory: '/home/user/.local/bin/typer', see the troubleshooting guide.

System Requirements

  • Python: 3.11 or later
  • Container Runtime: Podman (preferred) or Docker
  • Platform: Linux, macOS, Windows (with WSL2)

Installation Verification

aditi --help

Container Setup

Aditi will automatically pull the Vale container image on first use. To pre-download:

# For Podman (default)
podman pull docker.io/jdkato/vale:latest

# For Docker  
docker pull docker.io/jdkato/vale:latest

🏁 Quick Start (5 minutes)

1. Initialize Your Project

cd /path/to/your/asciidoc-project
aditi init

What this does:

  • Downloads Vale container image
  • Installs AsciiDocDITA rules
  • Creates .vale.ini configuration
  • Sets up project for analysis

2. Configure Access Paths

# Interactive mode (default)
aditi journey

# Process specific files directly
aditi journey docs/guide.adoc docs/reference.adoc

# Process entire directories
aditi journey docs/ examples/

# Mix files and directories
aditi journey README.adoc docs/ examples/user-guide.adoc

Features:

  • Interactive directory selection when no paths provided
  • Direct file/directory processing when paths specified
  • Configure repository permissions
  • Set working preferences
  • Session continuity for interrupted workflows

3. Analyze Your Files

# Check all configured files
aditi check

# Check specific files/directories  
aditi check docs/ user-guide.adoc

# Focus on specific issues
aditi check --rule ContentType --verbose

4. Apply Automatic Fixes

# Preview changes (recommended first step)
aditi fix --dry-run

# Apply fixes interactively
aditi fix

# Apply fixes automatically (CI/CD)
aditi fix --non-interactive

📚 Complete Example

# Start fresh project
mkdir my-dita-migration && cd my-dita-migration

# Install and initialize
pip install --upgrade aditi
aditi init

# Set up paths (follow prompts)
aditi journey  

# Analyze current state
aditi check --verbose

# Fix obvious problems first
aditi fix --rule EntityReference  # Fix character entities
aditi fix --rule ContentType      # Add missing content types

# Review remaining issues  
aditi check

# Apply additional fixes as needed
aditi fix --dry-run               # Preview all remaining fixes
aditi fix                         # Apply interactively

📖 Documentation

Resource Description
Quick Start Guide Get up and running in under 5 minutes
Full Documentation Complete reference with examples
Example Files Sample AsciiDoc files demonstrating each rule
Troubleshooting Common issues and solutions

🎯 Rule Coverage

Aditi implements all 27 AsciiDocDITA rules with intelligent categorization:

🔴 Fully Deterministic (Auto-fixable)

  • EntityReference: Replaces unsupported character entities

🟡 Partially Deterministic (Partial auto-fix)

  • ContentType: Adds missing content type attributes with placeholders

🔵 Non-Deterministic (Manual review required)

  • Structure Rules: NestedSection, TaskSection, ExampleBlock
  • Content Rules: AdmonitionTitle, AuthorLine, BlockTitle
  • Format Rules: DiscreteHeading, ThematicBreak, PageBreak
  • Reference Rules: CrossReference, LinkAttribute, IncludeDirective
  • And 18 more covering all DITA compatibility concerns

⚠️ Known Limitations

  • Interactive Journey: The aditi journey command requires interactive input
  • Container Dependency: Requires Podman or Docker for Vale execution
  • Path Restrictions: Files must be within configured allowed directories
  • Large Files: Processing very large files (>10MB) may be slower
  • Windows: Best experience on Linux/macOS; Windows requires WSL2

🔮 Future Enhancements

  • Non-interactive mode for journey command (CI/CD support)
  • Direct DITA output generation
  • Custom rule configuration
  • Integration with popular documentation platforms
  • Batch processing optimizations for large repositories

Development

To contribute to Aditi:

# Clone the repository
git clone https://github.com/rolfedh/aditi.git
cd aditi

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linting
ruff check .
mypy .

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aditi-0.1.9.tar.gz (8.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aditi-0.1.9-py3-none-any.whl (93.7 kB view details)

Uploaded Python 3

File details

Details for the file aditi-0.1.9.tar.gz.

File metadata

  • Download URL: aditi-0.1.9.tar.gz
  • Upload date:
  • Size: 8.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aditi-0.1.9.tar.gz
Algorithm Hash digest
SHA256 31db413be0ca3ba7caddd3c7c64fcb33f3108184480997188cf77dc037dd4088
MD5 9f5242628096d6a0cdf8d1038e35c778
BLAKE2b-256 25f4c3da3e4544325f98ae7c8962e1cbab9cd540c4303d126e76c8f342f2cdf0

See more details on using hashes here.

File details

Details for the file aditi-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: aditi-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 93.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for aditi-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 18043a1e7d2959b38c2ef429dc81fbdc6e4455fba1d4fabd98b93e373ea00f7f
MD5 fd143258d753e4de2417bc6cee6be41b
BLAKE2b-256 dee09b8e96289ca6639bbc8be582ba8ffef6dc11ea2dc4aa700b88ebb718e52b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page