Copperlace Examples
These standalone rule files show different ways to combine rules, random choices, bindings, context defaults, and processors. Random choices can produce different output on each render.
Run examples from rust-core/ with:
cargo run --bin copperlace -- render --config ../examples/character_scene.conf --rule origin
Files
character_scene.conf-
Short fiction or RPG flavor text. Demonstrates bindings, context defaults,
article,possessive,present_participle, andsentence. culture_names.conf-
Procedural culture and naming patterns. Demonstrates phonetic profiles, first names, family names, place names, accented vowels, and bindings.
item_card.conf-
Game item card copy. Demonstrates reusable item bindings,
titlecase,past_tense,pluralize, andpresent_participle. gendered_pronouns.conf-
Character text with consistent pronouns. Demonstrates bindings and male, female, and neutral lizard pronouns, plus
present_participle. item_json.conf-
JSON item data. Demonstrates JSON-safe quoted strings, bindings, scalar values,
slug,ordinal,article,past_tense,pluralize, andpresent_participle. structured_item.conf-
Structured item data. Demonstrates native object-valued structured rendering, nested objects, arrays, bindings, and processors without hand-assembling JSON as text.
product_blurb.conf-
Product or marketing microcopy. Demonstrates multiple render rules plus
titlecase,sentence,article,quote,pluralize, andslug. proverbs.conf-
Short proverb-style sayings. Demonstrates weighted templates, bindings, context defaults,
sentence, andarticle. release_note.conf-
Changelog-style output. Demonstrates
past_tense,article,ordinal,pluralize,possessive, and binding reuse. quest_log.conf-
Quest/task text. Demonstrates
singularize,article,possessive,present_participle,pluralize, and context defaults.
Try alternate rules where available:
cargo run --bin copperlace -- render --config ../examples/product_blurb.conf --rule headline
cargo run --bin copperlace -- render --config ../examples/product_blurb.conf --rule tagline
cargo run --bin copperlace -- render --config ../examples/product_blurb.conf --rule slug
cargo run --bin copperlace -- render --config ../examples/proverbs.conf --rule origin
cargo run --bin copperlace -- render --config ../examples/proverbs.conf --rule short
cargo run --bin copperlace -- render --config ../examples/gendered_pronouns.conf --rule origin
cargo run --bin copperlace -- render --config ../examples/gendered_pronouns.conf --rule profile
cargo run --bin copperlace -- render --config ../examples/item_json.conf --rule origin
cargo run --bin copperlace -- render --config ../examples/structured_item.conf --rule origin
cargo run --bin copperlace -- render --config ../examples/quest_log.conf --rule objective
cargo run --bin copperlace -- render --config ../examples/culture_names.conf --rule first_name
cargo run --bin copperlace -- render --config ../examples/culture_names.conf --rule family_name
cargo run --bin copperlace -- render --config ../examples/culture_names.conf --rule place_name
item_json.conf shows the older pattern of generating JSON as text with
explicit quoting. structured_item.conf uses an object-valued origin rule, so
the CLI infers structured output and writes formatted JSON by default. Shared
generated item values live in context defaults so object fields do not depend
on sibling field evaluation order:
cargo run --bin copperlace -- render --config ../examples/structured_item.conf
cargo run --bin copperlace -- render --config ../examples/structured_item.conf --compact-json
cargo run --bin copperlace -- render --config ../examples/structured_item.conf --count 2
cargo run --bin copperlace -- render --config ../examples/structured_item.conf --set itemRarity=mythic
Interactive Examples
Source config