good-morning
A tiny Rust crate that generates welcome messages.
Install
Add this crate to your Cargo.toml:
[]
= "0.1"
Usage
Basic usage: create GoodMorning, load a template, provide arguments, and execute.
use GoodMorning;
use HashMap;
Modifiers
Add a modifier after the variable name (e.g., uppercase / lowercase).
use GoodMorning;
use HashMap;
let mut gm = new;
gm.load_template?;
let args = from;
let msg = gm.execute?;
assert_eq!;
Load templates from file
Load multiple templates at once (lines starting with # are comments).
use GoodMorning;
let mut gm = new;
gm.load_templates_from_file?;
Choose template by required flags
When multiple templates exist, use execute_with_required to require specific flags (flags are derived from variable names).
use GoodMorning;
use HashMap;
let mut gm = new;
gm.load_template?;
let args = from;
let msg = gm.execute_with_required?;
Documentation
Full API docs on docs.rs: https://docs.rs/good-morning
More examples in src and the API example in examples/api_server.
License
MIT