Skip to content

TrinityStatic Site Generator with LLM Content and Self-Healing Layouts

Generate pages from structured data, apply themes, and auto-fix layout issues.

What Trinity Does

Trinity is a Python CLI tool that:

  1. Takes structured JSON input (or raw text for LLM-generated content)
  2. Renders HTML using Jinja2 templates and a selected Tailwind CSS theme
  3. Optionally validates the rendered layout using Guardian (Playwright DOM inspection)
  4. Applies progressive CSS fixes if overflow issues are detected
  5. Writes the output HTML file

Guardian and the ML predictor are disabled by default; they require explicit flags and setup.

Quick Start

bash
# Install dependencies
pip install -r requirements.txt

# Build with static JSON content
trinity build --input data/input_content.json --theme brutalist

# Build with LLM content generation (requires running LLM endpoint)
trinity build --input data/raw_portfolio.txt --llm --theme enterprise

# Enable Guardian layout validation
trinity build --input data/input_content.json --guardian --theme brutalist

Architecture

Trinity uses a layered pipeline:

Input → Brain (LLM) → Skeleton (Theme) → Healer (CSS Fixes) → Output
         ↓                                      ↑
      Caching                         Predictor (ML, optional)
         ↓                                      ↑
    Structured Logging              Guardian (DOM Validation, optional)

Learn More:

Testing

bash
make test
make test-cov
pytest tests/test_e2e_complete.py -v
pytest tests/test_multiclass_pipeline.py -v

Limitations

  • Guardian requires Playwright and browser binaries to be installed separately
  • The ML predictor requires training data collected via trinity mine-generate before it has a model to load
  • LLM content generation requires a running LLM endpoint (Ollama, LM Studio, or cloud API key)
  • Themes in config/themes.yaml are available for rendering; the default available_themes config lists only enterprise, brutalist, and editorial

Community

License

MIT License - see LICENSE for details.

Released under the MIT License.