#include "demo_guard.h" RENDER(Request& context) { String source = "# UCE app config\n" "app:\n" " name: UCE Starter\n" " debug: true\n" " port: 8080\n" " paths:\n" " - site\n" " - cache\n" "message: |\n" " Keep config files readable.\n" " Load them as DValue values.\n"; DValue cfg = yaml_decode(source); String encoded = yaml_encode(cfg); DValue roundtrip = yaml_decode(encoded); DValue generated; generated["database"]["host"] = "localhost"; generated["database"]["port"] = (f64)3306; generated["features"]["components"].set_bool(true); generated["features"]["markdown"].set_bool(true); DValue theme; theme = "clean"; generated["themes"].push(theme); theme = "compact"; generated["themes"].push(theme); <>

UCE Test: YAML

yaml_encode() and yaml_decode() convert concise config-style YAML to and from DValue values.

Config Source

Decoded DValue

Encoded Again

Generated Config

Round Trip Reads

yaml_encode() docs | yaml_decode() docs

}