RFC 013 Output Projection Profiles & Scoped Context
RFC 013: Projection Profiles
Section titled “RFC 013: Projection Profiles”Status: Implemented
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.
5. Update (2026-07): Stream Vocabulary Localization
Section titled “5. Update (2026-07): Stream Vocabulary Localization”To support localized, domain-accurate terminology across interlinear streams, each stream’s scoped context.vy can declare a vocabulary block. This dictionary maps structural container labels, entity display names (graph_nodes), and relational action/role labels (graph_edges) for viewer UI rendering:
`vocabulary { structure = [ "skandha" = "स्कन्ध", "adhyaya" = "अध्याय", "shloka" = "श्लोक" ] leaf_default = "shloka"
entities = { "arjuna" = "अर्जुन" "dhritarashtra" = "धृतराष्ट्र" }
actions = { "uvacha" = "उवाच" "speaker" = "वक्ता" "note" = "टिप्पणी" "variant" = "पाठान्तर" }}During compilation (vyasac pack), these vocabulary maps are serialized into the publication manifest (under stream_vocabularies) and graph_dict, allowing breadcrumb navigation and graph badges to display localized labels without hardcoding.