prosaic-derive
Derive macros for the Prosaic natural language generation engine.
This crate provides compile-time helpers for turning Rust data structures into Prosaic template contexts and for validating template strings before they ship.
Install
[]
= "1.0.1"
= "1.0.1"
What It Provides
#[derive(IntoContext)]: converts supported struct fields intoprosaic_core::Contextvalues.prosaic_template!: validates template slot names and pipe names at compile time.prosaic_template_compiled!: emits a specialized renderer for simple bare-slot templates.
Example
use ;
let template = prosaic_template! ;
assert!;
Supported derive field types include String, &str, integer types,
Vec<String>, and Option<T> for those same value shapes. Unsupported fields
produce compile errors rather than silently disappearing from the context.
License
MIT OR Apache-2.0