Skip to content

RFC 013 Output Projection Profiles & Scoped Context

Vyasa currently supports a single output target: HTML. This proposal introduces “Projection Profiles” to allow:

  1. Defining multiple output targets in vyasac.toml.
  2. Organizing templates and context per target.
  3. Keeping the global context.vy clean from target-specific configuration.

Currently, all configuration lives in a single context.vy. This leads to pollution when you have commands specific to HTML (e.g., span { class="..." }) vs Voice or JSON. We need a way to scope context and templates to a specific output projection.

Define projection targets in the project manifest:

[projections]
html = { path = "view/html" }
voice = { path = "view/voice" }
json = { path = "data/json" }

Instead of a flat templates/ folder, use scoped directories:

workspace/
├── vyasac.toml
├── content/ ...
└── view/
├── html/
│ ├── templates/ ... (HTML templates)
│ └── context.vy (HTML-only commands)
└── voice/
├── templates/ ... (Voice templates)
└── context.vy (Voice-only commands)

Allow users to select a projection at build time:

Terminal window
vyasac build --projection html # Uses view/html/context.vy + templates
vyasac build --projection voice # Uses view/voice/context.vy + templates

When building for html:

  1. Load Global context.vy.
  2. Load view/html/context.vy (This overrides or adds to global).
  3. Templates in view/html/templates override default templates.