RFC 013 Output Projection Profiles & Scoped Context
Summary
Section titled “Summary”Vyasa currently supports a single output target: HTML. This proposal introduces “Projection Profiles” to allow:
- Defining multiple output targets in
vyasac.toml. - Organizing templates and context per target.
- Keeping the global
context.vyclean from target-specific configuration.
Motivation
Section titled “Motivation”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.
Proposal
Section titled “Proposal”1. vyasac.toml Configuration
Section titled “1. vyasac.toml Configuration”Define projection targets in the project manifest:
[projections]html = { path = "view/html" }voice = { path = "view/voice" }json = { path = "data/json" }2. File Organization
Section titled “2. File Organization”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)3. Build Command syntax
Section titled “3. Build Command syntax”Allow users to select a projection at build time:
vyasac build --projection html # Uses view/html/context.vy + templatesvyasac build --projection voice # Uses view/voice/context.vy + templates4. Scoped Context Loading
Section titled “4. Scoped Context Loading”When building for html:
- Load Global
context.vy. - Load
view/html/context.vy(This overrides or adds to global). - Templates in
view/html/templatesoverride default templates.