Container Setup for Aditi
This document explains how Aditi integrates with Vale using Podman/Docker containers.
Overview
Aditi uses the official Vale Docker image (jdkato/vale
) to run the Vale linter with AsciiDocDITA style rules. This approach ensures:
- Consistency: All users run the same version of Vale
- Isolation: No need to install Vale locally
- Simplicity: Automatic setup with
aditi init
Architecture
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Aditi CLI ββββββΆβ Podman/Docker ββββββΆβ Vale Container β
β β β Runtime β β (jdkato/vale) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β β
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β Project Files β β AsciiDocDITA β
β (.vale.ini, ββββββββββββββββββββββββββββββββ Styles β
β *.adoc) β βββββββββββββββββββ
βββββββββββββββββββ
Implementation Details
ValeContainer Class
The ValeContainer
class in src/aditi/vale_container.py
manages:
- Container runtime detection (prefers Podman over Docker)
- Image pulling and caching
- Volume mounting for project files
- Vale execution and output parsing
Initialization Process
When users run aditi init
:
- Runtime Check: Detects Podman or Docker availability
- Image Pull: Downloads
jdkato/vale:latest
if not present - Config Creation: Copies
.vale.ini
template to project - Style Download: Runs
vale sync
to fetch AsciiDocDITA rules
File Structure
After initialization, the project will have:
project-root/
βββ .vale.ini # Vale configuration
βββ .vale/
β βββ styles/
β βββ AsciiDocDITA/ # Downloaded style rules
βββ *.adoc # Your AsciiDoc files
Testing Container Setup
Run the test script to verify your container setup:
python test_vale_integration.py
This will:
- Check for Podman/Docker availability
- Pull the Vale image
- Run Vale on a test file
- Display the results
Troubleshooting
Neither Podman nor Docker found
Install Podman (recommended):
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install podman
# Fedora
sudo dnf install podman
# macOS
brew install podman
Or install Docker:
# Follow instructions at https://docs.docker.com/get-docker/
Permission denied errors
For Podman (rootless by default):
- No special permissions needed
For Docker:
- Add your user to the docker group:
sudo usermod -aG docker $USER
- Log out and back in
Vale sync fails
This might happen if:
- Network connectivity issues
- GitHub rate limiting
- Firewall blocking container network access
Try:
- Check internet connectivity
- Wait a few minutes and retry
- Manually download styles from https://github.com/jhradilek/asciidoctor-dita-vale
Next Steps
After successful setup:
- Run
aditi check
to validate your AsciiDoc files - Run
aditi fix
to apply automatic fixes - Run
aditi journey
for guided migration workflow