to kdl for formats
Converts table data into KDL text.
Signature
> to kdl {flags}
Flags
--serialize, -s: Serialize nushell types that cannot be deserialized.
Input/output types:
| input | output |
|---|---|
| any | string |
Examples
Convert yaml file to kdl file
> {this: that list: [1 2 3 {bool: true} {this: should be: a-block}]} | to yaml | from yaml | to kdl
this that
list 1 2 3 bool=#true {
this should
be a-block
}Convert nu record to kdl
> {one: [{one: two, 1: 2} {three: 3} [1 2 3] 4 5 6 {bool: true}] } | to kdl
one three=3 1 2 3 4 5 6 bool=#true {
one two
"1" 2
}Convert nu list to kdl string
> [1 2 3] | to kdl
root 1 2 3Convert nu closure to kdl string
> {2: {|| 1 + 1} } | to kdl --serialize
"2" "{|| 1 + 1}"Round-trip KDL through canonical node rows.
> 'node one; node two' | from kdl | to kdl
node one
node two