cleanup, docs
This commit is contained in:
@@ -21,32 +21,9 @@ Try the live example in the [YAML demo](../demo/yaml.uce).
|
||||
|
||||
Example:
|
||||
|
||||
```uce
|
||||
DValue cfg;
|
||||
cfg["app"]["name"] = "UCE Starter";
|
||||
cfg["app"]["debug"].set_bool(true);
|
||||
cfg["app"]["port"] = (f64)8080;
|
||||
|
||||
DValue path;
|
||||
path = "site";
|
||||
cfg["app"]["paths"].push(path);
|
||||
path = "cache";
|
||||
cfg["app"]["paths"].push(path);
|
||||
|
||||
String yaml = yaml_encode(cfg);
|
||||
```
|
||||
|
||||
Typical result:
|
||||
|
||||
```yaml
|
||||
app:
|
||||
debug: true
|
||||
name: UCE Starter
|
||||
paths:
|
||||
- site
|
||||
- cache
|
||||
port: 8080
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
@@ -55,3 +32,8 @@ Notes:
|
||||
- Multiline strings are emitted as literal block scalars with `|`.
|
||||
- Empty strings are emitted as `""` so they are not confused with YAML null.
|
||||
- Decoded numeric-looking config values are strings unless the original `DValue` value was explicitly numeric.
|
||||
|
||||
:example
|
||||
DValue value;
|
||||
value["name"] = "Ada";
|
||||
print(yaml_encode(value) != "" ? "yaml\n" : "empty\n");
|
||||
|
||||
Reference in New Issue
Block a user