diff --git a/hugo/content/en/docs/concept/alias-and-reference-scopes/index.md b/hugo/content/en/docs/concept/alias-and-reference-scopes/index.md index 7f27395e2..5312310f5 100644 --- a/hugo/content/en/docs/concept/alias-and-reference-scopes/index.md +++ b/hugo/content/en/docs/concept/alias-and-reference-scopes/index.md @@ -19,7 +19,7 @@ looks like expected.yaml, but instead I end up with these {{< /quote >}} {{< code-tabs >}} -{{< code-tab name="problem1.cue" language="cue" area="top-left" >}} +{{< code-tab name="problem1.cue" language="cue" area="top-left" >}} #Metadata: { name: string namespace: string @@ -48,7 +48,7 @@ config: #Config & { } } {{< /code-tab >}} -{{< code-tab name="expected.yaml" language="yaml" area="top-right" >}} +{{< code-tab name="expected.yaml" language="yaml" area="top-right" >}} config: metadata: name: test @@ -62,7 +62,7 @@ config: name: test namespace: dev {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCBwcm9ibGVtMS5jdWUgLS1vdXQgeWFtbA==" >}} $ cue export problem1.cue --out yaml config.serviceA.metadata.name: incomplete value string: ./problem1.cue:2:13 @@ -126,7 +126,7 @@ incomplete values! Can you tell me why? {{< /quote >}} {{< code-tabs >}} -{{< code-tab name="problem2.cue" language="cue" area="top-left" >}} +{{< code-tab name="problem2.cue" language="cue" area="top-left" >}} #Metadata: { name: string namespace: string @@ -155,7 +155,7 @@ config: #Config & { } } {{< /code-tab >}} -{{< code-tab name="expected.yaml" language="yaml" area="top-right" >}} +{{< code-tab name="expected.yaml" language="yaml" area="top-right" >}} config: metadata: name: test @@ -169,7 +169,7 @@ config: name: test namespace: dev {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCBwcm9ibGVtMi5jdWUgLS1vdXQgeWFtbA==" >}} $ cue export problem2.cue --out yaml config.serviceA.metadata.name: incomplete value string: ./problem2.cue:2:13 @@ -206,7 +206,7 @@ the concrete `metadata` values provided when `config` is declared? The solution is: **use an alias!** {{< code-tabs >}} -{{< code-tab name="solution.cue" language="cue" area="top-left" >}} +{{< code-tab name="solution.cue" language="cue" area="top-left" >}} #Metadata: { name: string namespace: string @@ -235,7 +235,7 @@ config: #Config & { } } {{< /code-tab >}} -{{< code-tab name="expected.yaml" language="yaml" area="top-right" >}} +{{< code-tab name="expected.yaml" language="yaml" area="top-right" >}} config: metadata: name: test @@ -249,7 +249,7 @@ config: name: test namespace: dev {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCBzb2x1dGlvbi5jdWUgLS1vdXQgeWFtbA==" >}} $ cue export solution.cue --out yaml config: metadata: diff --git a/hugo/content/en/docs/concept/data-validation-use-case/index.md b/hugo/content/en/docs/concept/data-validation-use-case/index.md index 0cf0d3662..9fbb9be08 100644 --- a/hugo/content/en/docs/concept/data-validation-use-case/index.md +++ b/hugo/content/en/docs/concept/data-validation-use-case/index.md @@ -30,20 +30,20 @@ Given these two files, the `cue vet` command can verify that the values in `ranges.yaml` are correct by just mentioning the two files on the command line. {{< code-tabs >}} -{{< code-tab name="check.cue" language="cue" area="top-left" >}} +{{< code-tab name="check.cue" language="cue" area="top-left" >}} min?: *0 | number // 0 if undefined // must be strictly greater than min if defined. max?: number & >min {{< /code-tab >}} -{{< code-tab name="ranges.yaml" language="yaml" area="top-right" >}} +{{< code-tab name="ranges.yaml" language="yaml" area="top-right" >}} min: 5 max: 10 --- min: 10 max: 5 {{< /code-tab >}} -{{< code-tab name="output" language="" area="bottom" >}} +{{< code-tab name="output" language="" area="bottom" >}} max: invalid value 5 (out of bound >10): ./check.cue:4:16 ./ranges.yaml:5:6 diff --git a/hugo/content/en/docs/concept/modules-packages-instances/index.md b/hugo/content/en/docs/concept/modules-packages-instances/index.md index 600a3f930..dd1a79d8b 100644 --- a/hugo/content/en/docs/concept/modules-packages-instances/index.md +++ b/hugo/content/en/docs/concept/modules-packages-instances/index.md @@ -262,12 +262,12 @@ and invoke the functions using its qualified identifier. For instance: {{< code-tabs >}} -{{< code-tab name="regexp.cue" language="cue" area="top" >}} +{{< code-tab name="regexp.cue" language="cue" area="top" >}} import "regexp" matches: regexp.FindSubmatch(#"^([^:]*):(\d+)$"#, "localhost:443") {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV2YWwgcmVnZXhwLmN1ZQ==" >}} $ cue eval regexp.cue matches: ["localhost:443", "localhost", "443"] {{< /code-tab >}} diff --git a/hugo/content/en/docs/concept/schema-definition-use-case/index.md b/hugo/content/en/docs/concept/schema-definition-use-case/index.md index 67725625c..a99d1dd4b 100644 --- a/hugo/content/en/docs/concept/schema-definition-use-case/index.md +++ b/hugo/content/en/docs/concept/schema-definition-use-case/index.md @@ -165,7 +165,7 @@ One disadvantage is that it is very verbose. Compare the following two equivalent schema definitions: {{< code-tabs >}} -{{< code-tab name="native.cue" language="cue" area="top-left" >}} +{{< code-tab name="native.cue" language="cue" area="top-left" >}} // Definitions. info: version: "v1beta1" @@ -181,7 +181,7 @@ info: version: "v1beta1" max?: uint & <100 } {{< /code-tab >}} -{{< code-tab name="openapi.json" language="json" area="top-right" >}} +{{< code-tab name="openapi.json" language="json" area="top-right" >}} { "openapi": "3.0.0", "info": { diff --git a/hugo/content/en/docs/howto/_index.md b/hugo/content/en/docs/howto/_index.md index 9a970caf2..964562e76 100644 --- a/hugo/content/en/docs/howto/_index.md +++ b/hugo/content/en/docs/howto/_index.md @@ -35,7 +35,7 @@ that `cue` has caught the deliberate mistakes in our example data. Here's an example: {{< code-tabs >}} -{{< code-tab name="example.cue" language="cue" area="top-left" >}} +{{< code-tab name="example.cue" language="cue" area="top-left" >}} package example // CUE comments start with "//" @@ -48,14 +48,14 @@ f1: string // integer over 10 f2!: int & >10 {{< /code-tab >}} -{{< code-tab name="data.yml" language="yml" area="top-right" >}} +{{< code-tab name="data.yml" language="yml" area="top-right" >}} # f1 is actually an integer f1: 123 # f2 is actually a string f2: "some string value" {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="err" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="err" area="bottom" type="terminal" codetocopy="Y3VlIHZldCAuOmV4YW1wbGUgZGF0YS55bWw=" >}} $ cue vet .:example data.yml f1: conflicting values 123 and string (mismatched types int and string): ./data.yml:2:5 diff --git a/hugo/content/en/docs/howto/combine-multiple-json-files-by-using-file-metadata/index.md b/hugo/content/en/docs/howto/combine-multiple-json-files-by-using-file-metadata/index.md index 4384d5c7a..e68695cca 100644 --- a/hugo/content/en/docs/howto/combine-multiple-json-files-by-using-file-metadata/index.md +++ b/hugo/content/en/docs/howto/combine-multiple-json-files-by-using-file-metadata/index.md @@ -20,7 +20,7 @@ The **`TERMINAL`** section shows the use of: evaluation space {{< code-tabs >}} -{{< code-tab name="example.cue" language="cue" area="top-right" >}} +{{< code-tab name="example.cue" language="cue" area="top-right" >}} package example // inputs is the location under which we place @@ -40,28 +40,28 @@ output: { } } {{< /code-tab >}} -{{< code-tab name="a.json" language="json" area="top-left" >}} +{{< code-tab name="a.json" language="json" area="top-left" >}} { "a": 1, "b": 2, "c": 3 } {{< /code-tab >}} -{{< code-tab name="b.json" language="json" area="top-left" >}} +{{< code-tab name="b.json" language="json" area="top-left" >}} { "a": "a string", "b": true, "c": 42 } {{< /code-tab >}} -{{< code-tab name="c.json" language="json" area="top-left" >}} +{{< code-tab name="c.json" language="json" area="top-left" >}} [ "a list element", "another element", "the last element" ] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtLXdpdGgtY29udGV4dCAtbCAnaW5wdXRzOicgLWwgJ3BhdGguQmFzZShmaWxlbmFtZSknIC1lIG91dHB1dCBhLmpzb24gYi5qc29uIGMuanNvbiBleGFtcGxlLmN1ZQ==" >}} $ cue export --with-context -l 'inputs:' -l 'path.Base(filename)' -e output a.json b.json c.json example.cue { "a.json": { diff --git a/hugo/content/en/docs/howto/combine-multiple-json-files-into-a-list/index.md b/hugo/content/en/docs/howto/combine-multiple-json-files-into-a-list/index.md index 402a2d2d4..04f3a929a 100644 --- a/hugo/content/en/docs/howto/combine-multiple-json-files-into-a-list/index.md +++ b/hugo/content/en/docs/howto/combine-multiple-json-files-into-a-list/index.md @@ -12,26 +12,26 @@ This [Commented CUE]({{< relref "docs/howto/#commented-cue" >}}) demonstrates how to use the `cue` command to combine multiple JSON files into a list. {{< code-tabs >}} -{{< code-tab name="a.json" language="json" area="top-left" >}} +{{< code-tab name="a.json" language="json" area="top-left" >}} { "a": 1, "b": "two", "c": 33.3 } {{< /code-tab >}} -{{< code-tab name="b.json" language="json" area="top-left" >}} +{{< code-tab name="b.json" language="json" area="top-left" >}} { "a": 22, "b": "some string" } {{< /code-tab >}} -{{< code-tab name="c.json" language="json" area="top-left" >}} +{{< code-tab name="c.json" language="json" area="top-left" >}} { "a": 333, "c": 42 } {{< /code-tab >}} -{{< code-tab name="example.cue" language="cue" area="top-right" >}} +{{< code-tab name="example.cue" language="cue" area="top-right" >}} package example import "list" @@ -68,7 +68,7 @@ contents: [for _name in sortedInputs { _inputs[_name] }] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtLXdpdGgtY29udGV4dCAtbCAnX2lucHV0czonIC1sIGZpbGVuYW1lIGEuanNvbiBiLmpzb24gYy5qc29uIGV4YW1wbGUuY3Vl" >}} $ cue export --with-context -l '_inputs:' -l filename a.json b.json c.json example.cue { "contents": [ diff --git a/hugo/content/en/docs/howto/combine-multiple-yaml-files-by-using-file-metadata/index.md b/hugo/content/en/docs/howto/combine-multiple-yaml-files-by-using-file-metadata/index.md index fd05668c3..c56f86f98 100644 --- a/hugo/content/en/docs/howto/combine-multiple-yaml-files-by-using-file-metadata/index.md +++ b/hugo/content/en/docs/howto/combine-multiple-yaml-files-by-using-file-metadata/index.md @@ -20,7 +20,7 @@ The **`TERMINAL`** section shows the use of: evaluation space {{< code-tabs >}} -{{< code-tab name="example.cue" language="cue" area="top-right" >}} +{{< code-tab name="example.cue" language="cue" area="top-right" >}} package example // inputs is the location under which we place @@ -40,22 +40,22 @@ output: { } } {{< /code-tab >}} -{{< code-tab name="a.yaml" language="yaml" area="top-left" >}} +{{< code-tab name="a.yaml" language="yaml" area="top-left" >}} a: 1 b: 2 c: 3 {{< /code-tab >}} -{{< code-tab name="b.yml" language="yml" area="top-left" >}} +{{< code-tab name="b.yml" language="yml" area="top-left" >}} a: a string b: true c: 42 {{< /code-tab >}} -{{< code-tab name="c.yaml" language="yaml" area="top-left" >}} +{{< code-tab name="c.yaml" language="yaml" area="top-left" >}} - a list element - another element - the last element {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtLXdpdGgtY29udGV4dCAtbCAnaW5wdXRzOicgLWwgJ3BhdGguQmFzZShmaWxlbmFtZSknIC1lIG91dHB1dCBhLnlhbWwgYi55bWwgYy55YW1sIGV4YW1wbGUuY3VlIC0tb3V0IHlhbWw=" >}} $ cue export --with-context -l 'inputs:' -l 'path.Base(filename)' -e output a.yaml b.yml c.yaml example.cue --out yaml a.yaml: filename: a.yaml diff --git a/hugo/content/en/docs/howto/combine-multiple-yaml-files-into-a-list/index.md b/hugo/content/en/docs/howto/combine-multiple-yaml-files-into-a-list/index.md index fe7f5130f..2f620a095 100644 --- a/hugo/content/en/docs/howto/combine-multiple-yaml-files-into-a-list/index.md +++ b/hugo/content/en/docs/howto/combine-multiple-yaml-files-into-a-list/index.md @@ -12,20 +12,20 @@ This [Commented CUE]({{< relref "docs/howto/#commented-cue" >}}) demonstrates how to use the `cue` command to combine multiple YAML files into a list. {{< code-tabs >}} -{{< code-tab name="a.yaml" language="yaml" area="top-left" >}} +{{< code-tab name="a.yaml" language="yaml" area="top-left" >}} a: 1 b: "two" c: 33.3 {{< /code-tab >}} -{{< code-tab name="b.yml" language="yml" area="top-left" >}} +{{< code-tab name="b.yml" language="yml" area="top-left" >}} a: 22 b: "some string" {{< /code-tab >}} -{{< code-tab name="c.yaml" language="yaml" area="top-left" >}} +{{< code-tab name="c.yaml" language="yaml" area="top-left" >}} a: 333 c: 42 {{< /code-tab >}} -{{< code-tab name="example.cue" language="cue" area="top-right" >}} +{{< code-tab name="example.cue" language="cue" area="top-right" >}} package example import "list" @@ -62,7 +62,7 @@ contents: [for _name in sortedInputs { _inputs[_name] }] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtLXdpdGgtY29udGV4dCAtbCAnX2lucHV0czonIC1sIGZpbGVuYW1lIGEueWFtbCBiLnltbCBjLnlhbWwgZXhhbXBsZS5jdWUgLS1vdXQgeWFtbA==" >}} $ cue export --with-context -l '_inputs:' -l filename a.yaml b.yml c.yaml example.cue --out yaml contents: - a: 1 diff --git a/hugo/content/en/docs/howto/constrain-string-as-valid-integer/index.md b/hugo/content/en/docs/howto/constrain-string-as-valid-integer/index.md index 733395074..df8210647 100644 --- a/hugo/content/en/docs/howto/constrain-string-as-valid-integer/index.md +++ b/hugo/content/en/docs/howto/constrain-string-as-valid-integer/index.md @@ -20,7 +20,7 @@ demonstrates how to constrain fields to contain string representations of integer values. {{< code-tabs >}} -{{< code-tab name="example.cue" language="cue" area="top-left" >}} +{{< code-tab name="example.cue" language="cue" area="top-left" >}} package example import "strconv" @@ -31,14 +31,14 @@ import "strconv" s1?: "\(strconv.Atoi(s1))" s2?: "\(strconv.Atoi(s2))" {{< /code-tab >}} -{{< code-tab name="data.yml" language="yml" area="top-right" >}} +{{< code-tab name="data.yml" language="yml" area="top-right" >}} # s1 is a valid integer s1: "137" # s2 is not a valid integer s2: "42.7" {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="err" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="err" area="bottom" type="terminal" codetocopy="Y3VlIHZldCAuOmV4YW1wbGUgZGF0YS55bWw=" >}} $ cue vet .:example data.yml s2: invalid interpolation: error in call to strconv.Atoi: strconv.Atoi: parsing "42.7": invalid syntax: ./example.cue:9:6 diff --git a/hugo/content/en/docs/howto/constrain-the-length-of-a-string/index.md b/hugo/content/en/docs/howto/constrain-the-length-of-a-string/index.md index f1dbea185..d6c86bf27 100644 --- a/hugo/content/en/docs/howto/constrain-the-length-of-a-string/index.md +++ b/hugo/content/en/docs/howto/constrain-the-length-of-a-string/index.md @@ -21,7 +21,7 @@ bytes, and also in runes, as introduced by [the Go programming language](https://go.dev/blog/strings#code-points-characters-and-runes). {{< code-tabs >}} -{{< code-tab name="example.cue" language="cue" area="top" >}} +{{< code-tab name="example.cue" language="cue" area="top" >}} package example import "strings" @@ -77,7 +77,7 @@ emoji_constrain_bytes: { #bytes: len(content) & >=10 } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="err" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="err" area="bottom" type="terminal" codetocopy="Y3VlIHZldCAuOmV4YW1wbGU=" >}} $ cue vet .:example ascii_constrain_runes: invalid value "only ASCII characters" (does not satisfy strings.MaxRunes(8)): ./example.cue:8:46 diff --git a/hugo/content/en/docs/howto/constrain-the-sum-of-a-list-of-numbers/index.md b/hugo/content/en/docs/howto/constrain-the-sum-of-a-list-of-numbers/index.md index b9a20b8a9..df84cf41d 100644 --- a/hugo/content/en/docs/howto/constrain-the-sum-of-a-list-of-numbers/index.md +++ b/hugo/content/en/docs/howto/constrain-the-sum-of-a-list-of-numbers/index.md @@ -18,7 +18,7 @@ This [Commented CUE]({{< relref "docs/howto#commented-cue-guides" >}}) demonstrates constraining the sum of a list of numbers. {{< code-tabs >}} -{{< code-tab name="schema.cue" language="cue" area="top-left" >}} +{{< code-tab name="schema.cue" language="cue" area="top-left" >}} package example import "list" @@ -34,11 +34,11 @@ bad_list: [...number] _good_sum: <=100 & list.Sum(good_list) _bad_sum: <=99.5 & list.Sum(bad_list) {{< /code-tab >}} -{{< code-tab name="data.yml" language="yml" area="top-right" >}} +{{< code-tab name="data.yml" language="yml" area="top-right" >}} good_list: [ 1,2,3,4 ] bad_list: [ 1,2,3,100.5 ] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="err" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="err" area="bottom" type="terminal" codetocopy="Y3VlIHZldCAuOmV4YW1wbGUgZGF0YS55bWw=" >}} $ cue vet .:example data.yml _bad_sum: invalid value 106.5 (out of bound <=99.5): ./schema.cue:14:12 diff --git a/hugo/content/en/docs/howto/export-fields-whose-names-are-not-valid-identifiers/index.md b/hugo/content/en/docs/howto/export-fields-whose-names-are-not-valid-identifiers/index.md index bf8d831ae..403cf6e0d 100644 --- a/hugo/content/en/docs/howto/export-fields-whose-names-are-not-valid-identifiers/index.md +++ b/hugo/content/en/docs/howto/export-fields-whose-names-are-not-valid-identifiers/index.md @@ -14,14 +14,14 @@ This [Commented CUE]({{< relref "docs/howto#commented-cue-guides" >}}) demonstrates how to export these fields using `cue export -e`. {{< code-tabs >}} -{{< code-tab name="data.yml" language="yml" area="top" >}} +{{< code-tab name="data.yml" language="yml" area="top" >}} # data.yml contains a field we want to export with # the "cue export" command's "-e" parameter "top level field": a: [ 1, 2, 3 ] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtbCBpbnB1dDogZGF0YS55bWwgLWUgJ2lucHV0WyJ0b3AgbGV2ZWwgZmllbGQiXSc=" >}} $ cue export -l input: data.yml -e 'input["top level field"]' { "a": [ diff --git a/hugo/content/en/docs/howto/mark-a-field-as-optional/index.md b/hugo/content/en/docs/howto/mark-a-field-as-optional/index.md index 03e39bb2f..5f46f03fa 100644 --- a/hugo/content/en/docs/howto/mark-a-field-as-optional/index.md +++ b/hugo/content/en/docs/howto/mark-a-field-as-optional/index.md @@ -17,7 +17,7 @@ demonstrates using an **optional field** marker to constrain a field's value - *but only if it is present*. {{< code-tabs >}} -{{< code-tab name="schema.cue" language="cue" area="top-left" >}} +{{< code-tab name="schema.cue" language="cue" area="top-left" >}} package example // CUE indicates optional fields with a question @@ -40,7 +40,7 @@ s1: { f3?: int & <10 } {{< /code-tab >}} -{{< code-tab name="data.yml" language="yml" area="top-right" >}} +{{< code-tab name="data.yml" language="yml" area="top-right" >}} # f1 is a nested struct f1: f1.1: @@ -53,7 +53,7 @@ f-2: 42.137 s1: x: some other string {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="err" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="err" area="bottom" type="terminal" codetocopy="Y3VlIHZldCAuOmV4YW1wbGUgZGF0YS55bWw=" >}} $ cue vet .:example data.yml "f-2": conflicting values 42.137 and string (mismatched types float and string): ./data.yml:7:6 diff --git a/hugo/content/en/docs/howto/mark-a-field-as-required/index.md b/hugo/content/en/docs/howto/mark-a-field-as-required/index.md index ad442d4bb..87f8f0c8a 100644 --- a/hugo/content/en/docs/howto/mark-a-field-as-required/index.md +++ b/hugo/content/en/docs/howto/mark-a-field-as-required/index.md @@ -17,7 +17,7 @@ demonstrates using the **required field** marker in a schema to make sure that a field is present in data. {{< code-tabs >}} -{{< code-tab name="schema.cue" language="cue" area="top-left" >}} +{{< code-tab name="schema.cue" language="cue" area="top-left" >}} package example // CUE indicates required fields with an @@ -35,13 +35,13 @@ s1: { f3!: int & <10 } {{< /code-tab >}} -{{< code-tab name="data.yml" language="yml" area="top-right" >}} +{{< code-tab name="data.yml" language="yml" area="top-right" >}} f1: "some string value" # f-2: field is missing s1: f3: 7 {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="err" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="err" area="bottom" type="terminal" codetocopy="Y3VlIHZldCAuOmV4YW1wbGUgZGF0YS55bWw=" >}} $ cue vet .:example data.yml "f-2": field is required but not present: ./schema.cue:10:1 diff --git a/hugo/content/en/docs/howto/refer-to-fields-whose-names-are-not-valid-identifiers/index.md b/hugo/content/en/docs/howto/refer-to-fields-whose-names-are-not-valid-identifiers/index.md index 58c1df94d..7f323c0eb 100644 --- a/hugo/content/en/docs/howto/refer-to-fields-whose-names-are-not-valid-identifiers/index.md +++ b/hugo/content/en/docs/howto/refer-to-fields-whose-names-are-not-valid-identifiers/index.md @@ -13,7 +13,7 @@ This [Commented CUE]({{< relref "docs/howto#commented-cue-guides" >}}) demonstrates how to refer to these fields, both at CUE's top level and elsewhere. {{< code-tabs >}} -{{< code-tab name="data.cue" language="cue" area="top-left" >}} +{{< code-tab name="data.cue" language="cue" area="top-left" >}} package example // data.cue contains fields we want to refer to @@ -23,7 +23,7 @@ package example aStruct: "nested field": "a nested value" {{< /code-tab >}} -{{< code-tab name="file.cue" language="cue" area="top-right" >}} +{{< code-tab name="file.cue" language="cue" area="top-right" >}} package example // Declare an alias @@ -39,7 +39,7 @@ output: { nestedField: aStruct["nested field"] } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtZSBvdXRwdXQ=" >}} $ cue export -e output { "topLevelField": "a top-level value", diff --git a/hugo/content/en/docs/howto/specify-a-default-value-for-a-field/index.md b/hugo/content/en/docs/howto/specify-a-default-value-for-a-field/index.md index 4eee6e620..35af8aa29 100644 --- a/hugo/content/en/docs/howto/specify-a-default-value-for-a-field/index.md +++ b/hugo/content/en/docs/howto/specify-a-default-value-for-a-field/index.md @@ -30,18 +30,18 @@ If a regular field has a value provided elsewhere, through unification, then that value is used instead: {{< code-tabs >}} -{{< code-tab name="policy.cue" language="cue" area="top-left" >}} +{{< code-tab name="policy.cue" language="cue" area="top-left" >}} package example a: *"A" | _ b: *"B" | _ {{< /code-tab >}} -{{< code-tab name="data.cue" language="cue" area="top-right" >}} +{{< code-tab name="data.cue" language="cue" area="top-right" >}} package example a: "some value" {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="txt" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="txt" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAuOmV4YW1wbGU=" >}} $ cue export .:example { "a": "some value", @@ -69,18 +69,18 @@ The concrete value provided through unification may be the same as the default value: {{< code-tabs >}} -{{< code-tab name="policy.cue" language="cue" area="top-left" >}} +{{< code-tab name="policy.cue" language="cue" area="top-left" >}} package example a: *"A" | string b: *5 | int {{< /code-tab >}} -{{< code-tab name="data.cue" language="cue" area="top-right" >}} +{{< code-tab name="data.cue" language="cue" area="top-right" >}} package example a: "A" {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="txt" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="txt" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAuOmV4YW1wbGU=" >}} $ cue export .:example { "a": "A", @@ -93,18 +93,18 @@ If no element unifies with the value that has been provided, a disjunction resolution error results: {{< code-tabs >}} -{{< code-tab name="policy.cue" language="cue" area="top-left" >}} +{{< code-tab name="policy.cue" language="cue" area="top-left" >}} package example a: *"A" | string b: *5 | int {{< /code-tab >}} -{{< code-tab name="data.cue" language="cue" area="top-right" >}} +{{< code-tab name="data.cue" language="cue" area="top-right" >}} package example b: "a string" {{< /code-tab >}} -{{< code-tab name="stderr.txt" language="txt" area="bottom" >}} +{{< code-tab name="stderr.txt" language="txt" area="bottom" >}} b: 2 errors in empty disjunction: b: conflicting values "a string" and 5 (mismatched types string and int): ./data.cue:3:4 @@ -126,13 +126,13 @@ value. If CUE needs to use a default but the value provided is not concrete, an error results: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} package example a: *"A" | _ b: *string | _ {{< /code-tab >}} -{{< code-tab name="ERR" language="err" type="terminal" area="top-right" >}} +{{< code-tab name="ERR" language="err" area="top-right" type="terminal" >}} b: incomplete value string: ./in.cue:4:5 {{< /code-tab >}} @@ -145,7 +145,7 @@ resolve a default to a concrete value via references then the result can be successfully used as a default: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} package example a: 5 @@ -154,7 +154,7 @@ b: *( a + 10) | int c: "hello" d: *( c + ", world!") | string {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "a": 5, "b": 15, @@ -174,7 +174,7 @@ These values can either be provided inline, or by reference. In this example, both defaults for the field `a` are equivalent: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} package example a: string | *_s @@ -193,7 +193,7 @@ _s: { ] } {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "a": { "x": "value", @@ -212,13 +212,13 @@ A single field may have multiple defaults specified in parallel, provided that *all* the defaults unify successfully: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} package example a: *"A" | _ a: *string | _ {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "a": "A" } @@ -232,13 +232,13 @@ information being provided to resolve the disjunction, then the result is an error: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} package example a: *"A" | _ a: *int | _ {{< /code-tab >}} -{{< code-tab name="ERR" language="err" type="terminal" area="top-right" >}} +{{< code-tab name="ERR" language="err" area="top-right" type="terminal" >}} a: incomplete value "A" | int | _ {{< /code-tab >}} {{< /code-tabs >}} @@ -254,24 +254,24 @@ example demonstrates, this has a higher change of leading to unclear CUE that could confuse the reader: {{< code-tabs >}} -{{< code-tab name="policy-upper-bound.cue" language="cue" area="top-left" >}} +{{< code-tab name="policy-upper-bound.cue" language="cue" area="top-left" >}} package example port_x: *<=8080 | string port_y: *<=8080 | string {{< /code-tab >}} -{{< code-tab name="policy-lower-bound.cue" language="cue" area="top-left" >}} +{{< code-tab name="policy-lower-bound.cue" language="cue" area="top-left" >}} package example port_x: *>=8080 | string port_y: *>=8080 | string {{< /code-tab >}} -{{< code-tab name="data.cue" language="cue" area="top-right" >}} +{{< code-tab name="data.cue" language="cue" area="top-right" >}} package example port_x: "a string, for some reason" {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAuOmV4YW1wbGU=" >}} $ cue export .:example { "port_x": "a string, for some reason", diff --git a/hugo/content/en/docs/howto/transform-json-with-cue/index.md b/hugo/content/en/docs/howto/transform-json-with-cue/index.md index 8cf581785..739e294da 100644 --- a/hugo/content/en/docs/howto/transform-json-with-cue/index.md +++ b/hugo/content/en/docs/howto/transform-json-with-cue/index.md @@ -13,7 +13,7 @@ demonstrates how to transform JSON by reshaping some input data into different output. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example // place the json input here with "-l" @@ -56,7 +56,7 @@ output: petsBySpecies: { ]} } {{< /code-tab >}} -{{< code-tab name="data.json" language="json" area="top-right" >}} +{{< code-tab name="data.json" language="json" area="top-right" >}} { "owner": { "name": "Dorothy Cartwright", @@ -86,7 +86,7 @@ output: petsBySpecies: { ] } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAuOmV4YW1wbGUgLWwgaW5wdXQ6IGRhdGEuanNvbiAtZSBvdXRwdXQgLS1vdXQganNvbg==" >}} $ cue export .:example -l input: data.json -e output --out json { "location": "Ripon, North Yorkshire, England", diff --git a/hugo/content/en/docs/howto/transform-yaml-with-cue/index.md b/hugo/content/en/docs/howto/transform-yaml-with-cue/index.md index e7c84dbae..814ee8766 100644 --- a/hugo/content/en/docs/howto/transform-yaml-with-cue/index.md +++ b/hugo/content/en/docs/howto/transform-yaml-with-cue/index.md @@ -13,7 +13,7 @@ demonstrates how to transform YAML by reshaping some input data into different output. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example // place the yaml input here with "-l" @@ -56,7 +56,7 @@ output: petsBySpecies: { ]} } {{< /code-tab >}} -{{< code-tab name="data.yml" language="yml" area="top-right" >}} +{{< code-tab name="data.yml" language="yml" area="top-right" >}} owner: name: Dorothy Cartwright address: Ripon, North Yorkshire, England @@ -74,7 +74,7 @@ pets: species: cat age: 5 {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAuOmV4YW1wbGUgLWwgaW5wdXQ6IGRhdGEueW1sIC1lIG91dHB1dCAtLW91dCB5YW1s" >}} $ cue export .:example -l input: data.yml -e output --out yaml location: Ripon, North Yorkshire, England petsBySpecies: diff --git a/hugo/content/en/docs/howto/use-encoding-base64-decode/index.md b/hugo/content/en/docs/howto/use-encoding-base64-decode/index.md index 2c89cb722..f91939e90 100644 --- a/hugo/content/en/docs/howto/use-encoding-base64-decode/index.md +++ b/hugo/content/en/docs/howto/use-encoding-base64-decode/index.md @@ -14,7 +14,7 @@ demonstrates how to use the built-in function to decode data that is encoded as Base64. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="left" >}} +{{< code-tab name="file.cue" language="cue" area="left" >}} package example import "encoding/base64" @@ -26,7 +26,7 @@ encoded: "c29tZSBCYXNlNjQtZW5jb2RlZCBkYXRh" // the byte array returned by base64.Decode decoded: "\(base64.Decode(null, encoded))" {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="right" >}} +{{< code-tab name="TERMINAL" language="" area="right" type="terminal" codetocopy="Y3VlIGV4cG9ydA==" >}} $ cue export { "encoded": "c29tZSBCYXNlNjQtZW5jb2RlZCBkYXRh", diff --git a/hugo/content/en/docs/howto/use-encoding-base64-encode/index.md b/hugo/content/en/docs/howto/use-encoding-base64-encode/index.md index 63b102b69..45110084b 100644 --- a/hugo/content/en/docs/howto/use-encoding-base64-encode/index.md +++ b/hugo/content/en/docs/howto/use-encoding-base64-encode/index.md @@ -14,7 +14,7 @@ demonstrates how to use the built-in function to encode a string as Base64. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="left" >}} +{{< code-tab name="file.cue" language="cue" area="left" >}} package example import "encoding/base64" @@ -22,7 +22,7 @@ import "encoding/base64" decoded: "some string" encoded: base64.Encode(null, decoded) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="right" >}} +{{< code-tab name="TERMINAL" language="" area="right" type="terminal" codetocopy="Y3VlIGV4cG9ydA==" >}} $ cue export { "decoded": "some string", diff --git a/hugo/content/en/docs/howto/use-encoding-csv-decode-to-access-csv-data-stored-as-a-string/index.md b/hugo/content/en/docs/howto/use-encoding-csv-decode-to-access-csv-data-stored-as-a-string/index.md index 4292bfd9c..275f9eb1a 100644 --- a/hugo/content/en/docs/howto/use-encoding-csv-decode-to-access-csv-data-stored-as-a-string/index.md +++ b/hugo/content/en/docs/howto/use-encoding-csv-decode-to-access-csv-data-stored-as-a-string/index.md @@ -15,7 +15,7 @@ to decode a string containing comma-separated values (CSV) into a list of lists. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example import "encoding/csv" @@ -30,7 +30,7 @@ data: """ output: csv.Decode(data) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtZSBvdXRwdXQ=" >}} $ cue export -e output [ [ diff --git a/hugo/content/en/docs/howto/use-encoding-csv-decode-to-access-data-stored-in-a-csv-file/index.md b/hugo/content/en/docs/howto/use-encoding-csv-decode-to-access-data-stored-in-a-csv-file/index.md index a8b1d9d83..9ab201575 100644 --- a/hugo/content/en/docs/howto/use-encoding-csv-decode-to-access-data-stored-in-a-csv-file/index.md +++ b/hugo/content/en/docs/howto/use-encoding-csv-decode-to-access-data-stored-in-a-csv-file/index.md @@ -14,14 +14,14 @@ demonstrates how to use the built-in function to decode a file containing comma-separated values (CSV) into a list of lists. {{< code-tabs >}} -{{< code-tab name="data.csv" language="csv" area="top-left" >}} +{{< code-tab name="data.csv" language="csv" area="top-left" >}} Id,Name,Location,Species 1,Charlie,"Ripon, North Yorkshire",cat 2,Fred,San Francisco,cat 3,Greyfriars Bobby,Edinburgh,dog 4,Nemo,???,fish {{< /code-tab >}} -{{< code-tab name="file.cue" language="cue" area="top-right" >}} +{{< code-tab name="file.cue" language="cue" area="top-right" >}} package example import "encoding/csv" @@ -29,7 +29,7 @@ import "encoding/csv" input: string output: csv.Decode(input) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCBmaWxlLmN1ZSAtbCBpbnB1dDogdGV4dDogZGF0YS5jc3YgLWUgb3V0cHV0" >}} $ cue export file.cue -l input: text: data.csv -e output [ [ diff --git a/hugo/content/en/docs/howto/use-encoding-csv-encode-to-emit-csv-data/index.md b/hugo/content/en/docs/howto/use-encoding-csv-encode-to-emit-csv-data/index.md index e5e214af9..9ed8e4685 100644 --- a/hugo/content/en/docs/howto/use-encoding-csv-encode-to-emit-csv-data/index.md +++ b/hugo/content/en/docs/howto/use-encoding-csv-encode-to-emit-csv-data/index.md @@ -14,7 +14,7 @@ demonstrates how to use the built-in function to encode a list of lists into a string as comma-separated values (CSV). {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example import "encoding/csv" @@ -29,7 +29,7 @@ data: [ output: csv.Encode(data) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtZSBvdXRwdXQgLS1vdXQgdGV4dA==" >}} $ cue export -e output --out text Id,Name,Location,Species 1,Charlie,"Ripon, North Yorkshire",cat diff --git a/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-a-file/index.md b/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-a-file/index.md index b3ff6fd7b..378d7a755 100644 --- a/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-a-file/index.md +++ b/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-a-file/index.md @@ -22,7 +22,7 @@ If so, we /could/ simply document --> {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example import "encoding/json" @@ -33,7 +33,7 @@ compact: json.Compact(json.Marshal(input)) // the -l parameter. input: _ {{< /code-tab >}} -{{< code-tab name="data.json" language="json" area="top-right" >}} +{{< code-tab name="data.json" language="json" area="top-right" >}} { "a": 1, "b": { @@ -48,7 +48,7 @@ input: _ ] } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCBmaWxlLmN1ZSAtbCBpbnB1dDogZGF0YS5qc29uIC1lIGNvbXBhY3QgLS1vdXQgdGV4dA==" >}} $ cue export file.cue -l input: data.json -e compact --out text {"a":1,"b":{"c":"two","d":3.0},"e":false,"f":[4,5.0,"A\nMulti\nLine\nString"]} {{< /code-tab >}} diff --git a/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-a-string/index.md b/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-a-string/index.md index fd53402f3..8156dc9f3 100644 --- a/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-a-string/index.md +++ b/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-a-string/index.md @@ -15,7 +15,7 @@ to transform JSON held in a string into a single line of JSON with all insignificant whitespace removed. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="left" >}} +{{< code-tab name="file.cue" language="cue" area="left" >}} package example import "encoding/json" @@ -40,7 +40,7 @@ jsonString: #""" } """# {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="right" >}} +{{< code-tab name="TERMINAL" language="" area="right" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtZSBjb21wYWN0IC0tb3V0IHRleHQ=" >}} $ cue export -e compact --out text {"a":1,"b":{"c":"two","d":3.0},"e":false,"f":[4,5.0,"A\nMulti\nLine\nString"]} {{< /code-tab >}} diff --git a/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-cue-data/index.md b/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-cue-data/index.md index e2902d1fa..c45ca7933 100644 --- a/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-cue-data/index.md +++ b/hugo/content/en/docs/howto/use-encoding-json-compact-to-produce-single-line-json-from-cue-data/index.md @@ -19,7 +19,7 @@ Right now it isn't, as the output of json.Marshal /seems/ to be compact by default - but is that /guaranteed/? --> {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="left" >}} +{{< code-tab name="file.cue" language="cue" area="left" >}} package example import "encoding/json" @@ -44,7 +44,7 @@ data: { ] } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="right" >}} +{{< code-tab name="TERMINAL" language="" area="right" type="terminal" codetocopy="Y3VlIGV4cG9ydCBmaWxlLmN1ZSAtZSBjb21wYWN0IC0tb3V0IHRleHQ=" >}} $ cue export file.cue -e compact --out text {"a":1,"b":{"c":"two","d":3.0},"e":false,"f":[4,5.0,"A\nMulti\nLine\nString"]} {{< /code-tab >}} diff --git a/hugo/content/en/docs/howto/use-encoding-json-indent-to-produce-human-readable-json-from-a-file/index.md b/hugo/content/en/docs/howto/use-encoding-json-indent-to-produce-human-readable-json-from-a-file/index.md index 63688ba95..037432b1f 100644 --- a/hugo/content/en/docs/howto/use-encoding-json-indent-to-produce-human-readable-json-from-a-file/index.md +++ b/hugo/content/en/docs/howto/use-encoding-json-indent-to-produce-human-readable-json-from-a-file/index.md @@ -15,7 +15,7 @@ to transform JSON from a compact, single-line form held in a file into JSON with insignificant whitespace added that makes it easier for humans to read. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example import "encoding/json" @@ -29,10 +29,10 @@ indent: json.Indent(json.Marshal(input), " ", " ") // the -l parameter. input: _ {{< /code-tab >}} -{{< code-tab name="data.json" language="json" area="top-right" >}} +{{< code-tab name="data.json" language="json" area="top-right" >}} {"a":1,"b":{"c":"two","d":3.0},"e":false,"f":[4,5.0,"A\nMulti\nLine\nString"]} {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCBmaWxlLmN1ZSAtbCBpbnB1dDogZGF0YS5qc29uIC1lIGluZGVudCAtLW91dCB0ZXh0" >}} $ cue export file.cue -l input: data.json -e indent --out text { "a": 1, diff --git a/hugo/content/en/docs/howto/use-encoding-json-indent-to-produce-human-readable-json-from-a-string/index.md b/hugo/content/en/docs/howto/use-encoding-json-indent-to-produce-human-readable-json-from-a-string/index.md index 4acadbbf9..f1822b47a 100644 --- a/hugo/content/en/docs/howto/use-encoding-json-indent-to-produce-human-readable-json-from-a-string/index.md +++ b/hugo/content/en/docs/howto/use-encoding-json-indent-to-produce-human-readable-json-from-a-string/index.md @@ -15,7 +15,7 @@ to transform JSON from a compact, single-line form held in a string into JSON with insignificant whitespace added that makes it easier for humans to read. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example import "encoding/json" @@ -26,7 +26,7 @@ import "encoding/json" indent: json.Indent(jsonString, " ", " ") jsonString: #"{"a":1,"b":{"c":"two","d":3.0},"e":false,"f":[4,5.0,"A\nMulti\nLine\nString"]}"# {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtZSBpbmRlbnQgLS1vdXQgdGV4dA==" >}} $ cue export -e indent --out text { "a": 1, diff --git a/hugo/content/en/docs/howto/use-encoding-json-validate-as-a-field-validator/index.md b/hugo/content/en/docs/howto/use-encoding-json-validate-as-a-field-validator/index.md index a834915b8..733680ec6 100644 --- a/hugo/content/en/docs/howto/use-encoding-json-validate-as-a-field-validator/index.md +++ b/hugo/content/en/docs/howto/use-encoding-json-validate-as-a-field-validator/index.md @@ -17,7 +17,7 @@ It asserts that properly-formed JSON, encoded in a string, adheres to specific constraints by checking that the data and schema unify successfully. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "encoding/json" @@ -44,7 +44,7 @@ _missingFieldSchema: { c!: bool // NOT a validation failure } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIHZldA==" >}} $ cue vet data: invalid value "{\n \"a\": 1,\n \"b\": \"two\"\n}" (does not satisfy encoding/json.Validate({a!:>99,b!:string})): error in call to encoding/json.Validate: invalid value 1 (out of bound >99): ./file.cue:14:7 diff --git a/hugo/content/en/docs/howto/use-encoding-yaml-validate-encoding-yaml-validatepartial-as-field-validators/index.md b/hugo/content/en/docs/howto/use-encoding-yaml-validate-encoding-yaml-validatepartial-as-field-validators/index.md index 9a92f7a8c..475247bbc 100644 --- a/hugo/content/en/docs/howto/use-encoding-yaml-validate-encoding-yaml-validatepartial-as-field-validators/index.md +++ b/hugo/content/en/docs/howto/use-encoding-yaml-validate-encoding-yaml-validatepartial-as-field-validators/index.md @@ -21,7 +21,7 @@ constraints by checking that the data and schema unify successfully. present. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "encoding/yaml" @@ -50,7 +50,7 @@ _missingFieldSchema: { c!: bool // validation failure for yaml.Validate only } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIHZldA==" >}} $ cue vet data: invalid value "a: 1\nb: \"two\"" (does not satisfy encoding/yaml.Validate({a!:>99,b!:string})): error in call to encoding/yaml.Validate: invalid value 1 (out of bound >99): ./file.cue:12:7 diff --git a/hugo/content/en/docs/howto/use-list-avg-list-max-list-min-list-sum-to-summarise-lists-of-numbers/index.md b/hugo/content/en/docs/howto/use-list-avg-list-max-list-min-list-sum-to-summarise-lists-of-numbers/index.md index ba76dc415..c4b5771cc 100644 --- a/hugo/content/en/docs/howto/use-list-avg-list-max-list-min-list-sum-to-summarise-lists-of-numbers/index.md +++ b/hugo/content/en/docs/howto/use-list-avg-list-max-list-min-list-sum-to-summarise-lists-of-numbers/index.md @@ -18,7 +18,7 @@ the list's arithmetic mean, its maximum and minimum values, and the sum of its values. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="left" >}} +{{< code-tab name="file.cue" language="cue" area="left" >}} package example import "list" @@ -38,7 +38,7 @@ _data: [ -999, ] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="right" >}} +{{< code-tab name="TERMINAL" language="" area="right" type="terminal" codetocopy="Y3VlIGV2YWw=" >}} $ cue eval sum: -941.00000000001 min: -999 diff --git a/hugo/content/en/docs/howto/use-list-concat-to-concatenate-lists/index.md b/hugo/content/en/docs/howto/use-list-concat-to-concatenate-lists/index.md index 0b033a0ab..1dea4dbe8 100644 --- a/hugo/content/en/docs/howto/use-list-concat-to-concatenate-lists/index.md +++ b/hugo/content/en/docs/howto/use-list-concat-to-concatenate-lists/index.md @@ -13,7 +13,7 @@ demonstrates how to use the built-in function to concatenate a list of lists. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example import "list" @@ -33,7 +33,7 @@ listC: [{ b: "12" }] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtZSBvdXRwdXQ=" >}} $ cue export -e output [ 1, diff --git a/hugo/content/en/docs/howto/use-list-contains-as-a-field-validator/index.md b/hugo/content/en/docs/howto/use-list-contains-as-a-field-validator/index.md index 2c3731164..1dbc4d9c5 100644 --- a/hugo/content/en/docs/howto/use-list-contains-as-a-field-validator/index.md +++ b/hugo/content/en/docs/howto/use-list-contains-as-a-field-validator/index.md @@ -14,7 +14,7 @@ as a validator that checks if a simple or composite value is contained in a list. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "list" @@ -40,7 +40,7 @@ aList: list.Contains({asInt: 3, asString: "three"}) aList: list.Contains([4, "four"]) aList: list.Contains(["four", 4, 4.0]) // validation failure {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIHZldA==" >}} $ cue vet aList: invalid value [1,"two",{asInt:3,asString:"three"},[4,"four"]] (does not satisfy list.Contains("TWO")): ./file.cue:15:8 diff --git a/hugo/content/en/docs/howto/use-list-contains-to-report-if-a-value-is-in-a-list/index.md b/hugo/content/en/docs/howto/use-list-contains-to-report-if-a-value-is-in-a-list/index.md index 6f4cb9a5f..1328520e0 100644 --- a/hugo/content/en/docs/howto/use-list-contains-to-report-if-a-value-is-in-a-list/index.md +++ b/hugo/content/en/docs/howto/use-list-contains-to-report-if-a-value-is-in-a-list/index.md @@ -13,7 +13,7 @@ demonstrates how to use the built-in function to report if a simple or composite value is contained in a list. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "list" @@ -42,7 +42,7 @@ containsStructTrue: list.Contains( _source, {asInt: 3, asString: "three"}) containsListTrue: list.Contains( _source, [4, "four"]) containsListFalse: list.Contains(_source, ["four", 4, 4.0]) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV2YWw=" >}} $ cue eval containsIntTrue: true containsIntFalse: false diff --git a/hugo/content/en/docs/howto/use-list-flattenn-to-flatten-lists/index.md b/hugo/content/en/docs/howto/use-list-flattenn-to-flatten-lists/index.md index 92eac7d9c..92589acb2 100644 --- a/hugo/content/en/docs/howto/use-list-flattenn-to-flatten-lists/index.md +++ b/hugo/content/en/docs/howto/use-list-flattenn-to-flatten-lists/index.md @@ -13,7 +13,7 @@ demonstrates how to use the built-in function to flatten a list by expanding its list elements by a specified depth. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "list" @@ -42,7 +42,7 @@ src: [ [[[[["g", "h", "i"]]]]], ] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV2YWw=" >}} $ cue eval src: [1, 2, 3, ["a", "b", "c"], [[4, 5, 6], [["d", "e", "f"], [[7, 8, 9]]]], [[[[["g", "h", "i"]]]]]] one: [1, 2, 3, "a", "b", "c", [4, 5, 6], [["d", "e", "f"], [[7, 8, 9]]], [[[["g", "h", "i"]]]]] diff --git a/hugo/content/en/docs/howto/use-list-issorted-as-a-field-validator/index.md b/hugo/content/en/docs/howto/use-list-issorted-as-a-field-validator/index.md index 8701b3f96..4f729bc56 100644 --- a/hugo/content/en/docs/howto/use-list-issorted-as-a-field-validator/index.md +++ b/hugo/content/en/docs/howto/use-list-issorted-as-a-field-validator/index.md @@ -14,7 +14,7 @@ as a field validator to assert that lists are sorted, using either a predefined or custom comparator. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import ( @@ -49,7 +49,7 @@ _sortAtSymbolCountDescending: { stringsCountDescending: ["@", "@@", "X"] stringsCountDescending: list.IsSorted(_sortAtSymbolCountDescending) // validation failure {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIHZldA==" >}} $ cue vet stringsDescending: invalid value ["A","B","C"] (does not satisfy list.IsSorted({T:number | string,x:number | string,y:number | string,less:_|_(Descending.less: unresolved disjunction number | string (type (string|number)) (and 1 more errors))})): ./file.cue:16:20 diff --git a/hugo/content/en/docs/howto/use-list-issorted-to-report-if-lists-are-sorted/index.md b/hugo/content/en/docs/howto/use-list-issorted-to-report-if-lists-are-sorted/index.md index 2b67d3d4e..51fcb7e9e 100644 --- a/hugo/content/en/docs/howto/use-list-issorted-to-report-if-lists-are-sorted/index.md +++ b/hugo/content/en/docs/howto/use-list-issorted-to-report-if-lists-are-sorted/index.md @@ -14,7 +14,7 @@ to test and report if lists are sorted, using either a predefined or custom comparator. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import ( @@ -48,7 +48,7 @@ _sortAtSymbolCountDescending: { stringsCountDescendingTrue: list.IsSorted( ["@@", "@", "X"], _sortAtSymbolCountDescending) stringsCountDescendingFalse: list.IsSorted(["X", "@", "@@"], _sortAtSymbolCountDescending) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV2YWw=" >}} $ cue eval isSorted: true stringsDescending: true diff --git a/hugo/content/en/docs/howto/use-list-issortedstrings-as-a-field-validator/index.md b/hugo/content/en/docs/howto/use-list-issortedstrings-as-a-field-validator/index.md index 0dd7f3bf9..508c091b0 100644 --- a/hugo/content/en/docs/howto/use-list-issortedstrings-as-a-field-validator/index.md +++ b/hugo/content/en/docs/howto/use-list-issortedstrings-as-a-field-validator/index.md @@ -13,7 +13,7 @@ demonstrates how to use the built-in function as a field validator to assert that lists of strings are sorted alphabetically. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "list" @@ -24,7 +24,7 @@ unsorted: ["B", "C", "A"] sorted: list.IsSortedStrings unsorted: list.IsSortedStrings // validation failure {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV2YWw=" >}} $ cue eval unsorted: invalid value ["B","C","A"] (does not satisfy list.IsSortedStrings): ./file.cue:6:11 diff --git a/hugo/content/en/docs/howto/use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted/index.md b/hugo/content/en/docs/howto/use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted/index.md index ee02fd78b..a204da5d0 100644 --- a/hugo/content/en/docs/howto/use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted/index.md +++ b/hugo/content/en/docs/howto/use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted/index.md @@ -13,7 +13,7 @@ demonstrates how to use the built-in function to test and report if lists of strings are sorted alphabetically. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="left" >}} +{{< code-tab name="file.cue" language="cue" area="left" >}} package example import "list" @@ -24,7 +24,7 @@ _sorted: ["A", "B", "C"] testUnsorted: list.IsSortedStrings(_unsorted) testSorted: list.IsSortedStrings(_sorted) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="right" >}} +{{< code-tab name="TERMINAL" language="" area="right" type="terminal" codetocopy="Y3VlIGV2YWw=" >}} $ cue eval testUnsorted: false testSorted: true diff --git a/hugo/content/en/docs/howto/use-list-maxitems-list-minitems-to-constrain-list-length/index.md b/hugo/content/en/docs/howto/use-list-maxitems-list-minitems-to-constrain-list-length/index.md index df1c39822..e50a96c8f 100644 --- a/hugo/content/en/docs/howto/use-list-maxitems-list-minitems-to-constrain-list-length/index.md +++ b/hugo/content/en/docs/howto/use-list-maxitems-list-minitems-to-constrain-list-length/index.md @@ -16,7 +16,7 @@ demonstrates how to use the built-in functions to require that a list contains a maximum and/or minimum number of items. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "list" @@ -34,7 +34,7 @@ b: list.MinItems(6) // c must contain at least 2 items, and no more than 6 items c: list.MinItems(2) & list.MaxItems(6) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIHZldA==" >}} $ cue vet a: invalid value [1,2,3,4,5] (does not satisfy list.MaxItems(2)): len(list) > MaxItems(2) (5 > 2): ./file.cue:10:4 @@ -53,7 +53,7 @@ If the number of required items is both small and known in advance, then this core language syntax might be preferred instead of `list.MinItems`: {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example // f must contain at least 3 elements @@ -61,7 +61,7 @@ f: [_, _, _, ...] f: [1, 2] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIHZldA==" >}} $ cue vet f: incompatible list lengths (2 and 3) {{< /code-tab >}} diff --git a/hugo/content/en/docs/howto/use-list-sort-to-sort-lists/index.md b/hugo/content/en/docs/howto/use-list-sort-to-sort-lists/index.md index 68f26c86a..501e27c7c 100644 --- a/hugo/content/en/docs/howto/use-list-sort-to-sort-lists/index.md +++ b/hugo/content/en/docs/howto/use-list-sort-to-sort-lists/index.md @@ -13,7 +13,7 @@ demonstrates how to use the built-in function to sort lists, using either a predefined or custom comparator. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import ( @@ -45,7 +45,7 @@ _sortAtSymbolCountDescending: { } stringsCountDescending: list.Sort( ["X", "@@", "@"], _sortAtSymbolCountDescending) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV2YWw=" >}} $ cue eval sort: [1, 2.2, 3] stringsDescending: ["C", "B", "A"] diff --git a/hugo/content/en/docs/howto/use-list-sortstrings-to-sort-lists-of-strings/index.md b/hugo/content/en/docs/howto/use-list-sortstrings-to-sort-lists-of-strings/index.md index ddf0baf4d..e2f7f63dd 100644 --- a/hugo/content/en/docs/howto/use-list-sortstrings-to-sort-lists-of-strings/index.md +++ b/hugo/content/en/docs/howto/use-list-sortstrings-to-sort-lists-of-strings/index.md @@ -13,7 +13,7 @@ demonstrates how to use the built-in function to sort lists of strings alphabetically. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="left" >}} +{{< code-tab name="file.cue" language="cue" area="left" >}} package example import "list" @@ -21,7 +21,7 @@ import "list" unsorted: ["B", "C", "A"] sorted: list.SortStrings(unsorted) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="right" >}} +{{< code-tab name="TERMINAL" language="" area="right" type="terminal" codetocopy="Y3VlIGV2YWw=" >}} $ cue eval unsorted: ["B", "C", "A"] sorted: ["A", "B", "C"] diff --git a/hugo/content/en/docs/howto/use-list-uniqueitems-as-a-field-validator/index.md b/hugo/content/en/docs/howto/use-list-uniqueitems-as-a-field-validator/index.md index cedeb9ec8..90cbe9b6a 100644 --- a/hugo/content/en/docs/howto/use-list-uniqueitems-as-a-field-validator/index.md +++ b/hugo/content/en/docs/howto/use-list-uniqueitems-as-a-field-validator/index.md @@ -13,7 +13,7 @@ demonstrates how to use the built-in function to ensure that a list's items are unique. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "list" @@ -26,7 +26,7 @@ aList: [1, 2.0, 3, "four", 5, 5.0, false, {a: 1, b: "2", c: false}, // validation error ] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIHZldA==" >}} $ cue vet aList: invalid value [1,2.0,3,"four",5,5.0,false,{a:1,b:"2",c:false},{a:1,b:"2",c:true},{a:1,b:2,c:false},{a:1,b:"2",c:false}] (does not satisfy list.UniqueItems): ./file.cue:5:8 diff --git a/hugo/content/en/docs/howto/use-net-ip-to-validate-ip-addresses/index.md b/hugo/content/en/docs/howto/use-net-ip-to-validate-ip-addresses/index.md index 4f0c6b67f..ac2dd14db 100644 --- a/hugo/content/en/docs/howto/use-net-ip-to-validate-ip-addresses/index.md +++ b/hugo/content/en/docs/howto/use-net-ip-to-validate-ip-addresses/index.md @@ -14,7 +14,7 @@ to check that values represent valid IPv4 or IPv6 addresses as strings or lists of bytes. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "net" @@ -36,7 +36,7 @@ v4TooManyOctets: "198.51.100.14.0" v4OctetTooLarge: [300, 51, 100, 14] v6ByteTooLarge: [300, 1, 13, 184, 133, 163, 0, 0, 1, 0, 138, 46, 3, 112, 115, 52] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIHZldA==" >}} $ cue vet v4OctetTooLarge: invalid value [300,51,100,14] (does not satisfy net.IP): ./file.cue:6:6 diff --git a/hugo/content/en/docs/howto/use-net-ipcidr-to-validate-ip-cidr-ranges/index.md b/hugo/content/en/docs/howto/use-net-ipcidr-to-validate-ip-cidr-ranges/index.md index 35505caa5..7376cead6 100644 --- a/hugo/content/en/docs/howto/use-net-ipcidr-to-validate-ip-cidr-ranges/index.md +++ b/hugo/content/en/docs/howto/use-net-ipcidr-to-validate-ip-cidr-ranges/index.md @@ -14,7 +14,7 @@ to check that values represent valid IPv4 or IPv6 addresses or subnets in [CIDR notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation). {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "net" @@ -32,7 +32,7 @@ v6Address: "::1/128" v4SubnetMaskTooLarge: "10.0.0.0/50" v6MalformedPrefix: ":::1/128" {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIHZldA==" >}} $ cue vet v4SubnetMaskTooLarge: invalid value "10.0.0.0/50" (does not satisfy net.IPCIDR): error in call to net.IPCIDR: netip.ParsePrefix("10.0.0.0/50"): prefix length out of range: ./file.cue:6:6 diff --git a/hugo/content/en/docs/howto/use-net-ipv4-to-validate-ipv4-addresses/index.md b/hugo/content/en/docs/howto/use-net-ipv4-to-validate-ipv4-addresses/index.md index 2b9ec158a..b2e4092fe 100644 --- a/hugo/content/en/docs/howto/use-net-ipv4-to-validate-ipv4-addresses/index.md +++ b/hugo/content/en/docs/howto/use-net-ipv4-to-validate-ipv4-addresses/index.md @@ -14,7 +14,7 @@ to check that values represent valid IPv4 addresses as strings or lists of bytes. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "net" @@ -31,7 +31,7 @@ tooManyOctets: "198.51.100.14.0" octetTooLarge: [300, 51, 100, 14] v6NotV4: "2001:0db8:85a3::8a2e:0370:7334" {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIHZldA==" >}} $ cue vet octetTooLarge: invalid value [300,51,100,14] (does not satisfy net.IPv4): ./file.cue:6:6 diff --git a/hugo/content/en/docs/howto/use-net-parseip-net-ipstring-to-convert-ip-address-representations/index.md b/hugo/content/en/docs/howto/use-net-parseip-net-ipstring-to-convert-ip-address-representations/index.md index b1fa5f19d..7887524d6 100644 --- a/hugo/content/en/docs/howto/use-net-parseip-net-ipstring-to-convert-ip-address-representations/index.md +++ b/hugo/content/en/docs/howto/use-net-parseip-net-ipstring-to-convert-ip-address-representations/index.md @@ -15,7 +15,7 @@ to convert IPv4 and IPv6 addresses between their canonical string and list-of-bytes representations. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "net" @@ -34,7 +34,7 @@ v6Bytes: net.ParseIP(v6String) v4String: net.IPString(v4Bytes) v6String: net.IPString(v6Bytes) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV2YWw=" >}} $ cue eval v4String: "198.51.100.14" v6String: "2001:db8:85a3::8a2e:370:7334" diff --git a/hugo/content/en/docs/howto/use-path-base-path-dir-path-ext-to-examine-path-filename-components/index.md b/hugo/content/en/docs/howto/use-path-base-path-dir-path-ext-to-examine-path-filename-components/index.md index c64a511bb..6606a9496 100644 --- a/hugo/content/en/docs/howto/use-path-base-path-dir-path-ext-to-examine-path-filename-components/index.md +++ b/hugo/content/en/docs/howto/use-path-base-path-dir-path-ext-to-examine-path-filename-components/index.md @@ -15,7 +15,7 @@ demonstrates how to use the built-in functions to access components of a file's name and its path. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example import "path" @@ -39,7 +39,7 @@ import "path" "/foo///bar////baz.js": _ #"C:\foo\\bar\\\baz.js"#: _OS: path.Windows {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIGV2YWw=" >}} $ cue eval "/foo/bar/baz.js": { Dir: "/foo/bar" diff --git a/hugo/content/en/docs/howto/use-path-join-to-construct-well-formed-paths/index.md b/hugo/content/en/docs/howto/use-path-join-to-construct-well-formed-paths/index.md index 751d007c2..ea174ed37 100644 --- a/hugo/content/en/docs/howto/use-path-join-to-construct-well-formed-paths/index.md +++ b/hugo/content/en/docs/howto/use-path-join-to-construct-well-formed-paths/index.md @@ -13,7 +13,7 @@ demonstrates how to use the built-in function to construct well-formed paths from their individual string components. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example import "path" @@ -31,7 +31,7 @@ _components: [ "quux", ] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydA==" >}} $ cue export { "join": "foo/bar/baz", diff --git a/hugo/content/en/docs/howto/use-regexp-replaceall-regexp-replaceallliteral-to-modify-strings/index.md b/hugo/content/en/docs/howto/use-regexp-replaceall-regexp-replaceallliteral-to-modify-strings/index.md index a6a631244..0be7bbfdf 100644 --- a/hugo/content/en/docs/howto/use-regexp-replaceall-regexp-replaceallliteral-to-modify-strings/index.md +++ b/hugo/content/en/docs/howto/use-regexp-replaceall-regexp-replaceallliteral-to-modify-strings/index.md @@ -15,7 +15,7 @@ and to modify strings using various features of regular expressions. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "regexp" @@ -51,7 +51,7 @@ oPairReplaceAllLiteral: regexp.ReplaceAllLiteral("o([uvwxyz])", _src, "$1") // named capture group that contains only the two trailing letters. regexReplaceAll: regexp.ReplaceAll("[aeiou](?P\\w{2}\\b)", _src, "$twoLetters") {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV2YWw=" >}} $ cue eval replaceAll: "thX qXXck brXwn fXx jXmps XvXr thX lXzy dXg" oPairReplaceAll: "the quick brwn fx jumps ver the lazy dog" diff --git a/hugo/content/en/docs/howto/use-strconv-atoi-to-convert-strings-to-ints/index.md b/hugo/content/en/docs/howto/use-strconv-atoi-to-convert-strings-to-ints/index.md index 21e212795..86419efac 100644 --- a/hugo/content/en/docs/howto/use-strconv-atoi-to-convert-strings-to-ints/index.md +++ b/hugo/content/en/docs/howto/use-strconv-atoi-to-convert-strings-to-ints/index.md @@ -15,7 +15,7 @@ to convert a string representation of an int to the number itself, using base 10. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top-left" >}} +{{< code-tab name="file.cue" language="cue" area="top-left" >}} package example import "strconv" @@ -29,7 +29,7 @@ import "strconv" "-050": strconv.Atoi("-050") "00012345": strconv.Atoi("00012345") {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydA==" >}} $ cue export { "0": 0, diff --git a/hugo/content/en/docs/howto/use-strings-contains-strings-hasprefix-strings-hassuffix-as-field-validators/index.md b/hugo/content/en/docs/howto/use-strings-contains-strings-hasprefix-strings-hassuffix-as-field-validators/index.md index 3c887a5c8..34bc3a05e 100644 --- a/hugo/content/en/docs/howto/use-strings-contains-strings-hasprefix-strings-hassuffix-as-field-validators/index.md +++ b/hugo/content/en/docs/howto/use-strings-contains-strings-hasprefix-strings-hassuffix-as-field-validators/index.md @@ -15,7 +15,7 @@ demonstrates how to use the built-in functions to validate fields by asserting that their values match specific strings. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "strings" @@ -36,7 +36,7 @@ suffix: strings.HasSuffix("incorrect suffix") // None of the built-in functions demonstrated here accept regular expressions. contains: strings.Contains(".*") {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIHZldA==" >}} $ cue vet prefix: invalid value "Some numbers (123) and letters" (does not satisfy strings.HasPrefix("incorrect prefix")): ./file.cue:10:9 diff --git a/hugo/content/en/docs/howto/use-strings-replace/index.md b/hugo/content/en/docs/howto/use-strings-replace/index.md index 89aac074d..de03797af 100644 --- a/hugo/content/en/docs/howto/use-strings-replace/index.md +++ b/hugo/content/en/docs/howto/use-strings-replace/index.md @@ -14,7 +14,7 @@ to make copies of strings with specific substring replacements, *without* using regular expressions. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "strings" @@ -28,7 +28,7 @@ replaceAll: strings.Replace("one one one one one one one", "one", "two", -1) // The old and new parameters are fixed values, not regular expressions. fixed: strings.Replace("Parameters are fixed strings values.", ".*", "REPLACED", -1) {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydA==" >}} $ cue export { "replace": "This string repeats the word 'YAML': YAML, YAML, JSON.", diff --git a/hugo/content/en/docs/howto/use-text-template-execute-to-generate-text-from-data/index.md b/hugo/content/en/docs/howto/use-text-template-execute-to-generate-text-from-data/index.md index 4c8d611a0..6c7e1317b 100644 --- a/hugo/content/en/docs/howto/use-text-template-execute-to-generate-text-from-data/index.md +++ b/hugo/content/en/docs/howto/use-text-template-execute-to-generate-text-from-data/index.md @@ -14,7 +14,7 @@ with data-driven templates to generate text output, using Go's [template format](https://pkg.go.dev/text/template). {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example import "text/template" @@ -62,7 +62,7 @@ data: { incomplete: [for t in tasks if !t.complete {t}] } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCAtZSB0YXNrbGlzdCAtLW91dCB0ZXh0" >}} $ cue export -e tasklist --out text Hello, Alex. diff --git a/hugo/content/en/docs/howto/use-the-built-in-function-and/index.md b/hugo/content/en/docs/howto/use-the-built-in-function-and/index.md index e01768a37..602ed855e 100644 --- a/hugo/content/en/docs/howto/use-the-built-in-function-and/index.md +++ b/hugo/content/en/docs/howto/use-the-built-in-function-and/index.md @@ -16,7 +16,7 @@ function to unify all the elements of a list. {{< code-tabs >}} -{{< code-tab name="example.cue" language="cue" area="top-left" >}} +{{< code-tab name="example.cue" language="cue" area="top-left" >}} package example // c is a list of constraints @@ -32,7 +32,7 @@ data: { d: 1001 } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIHZldCAuOmV4YW1wbGU=" >}} $ cue vet .:example data.a: conflicting values 4.2 and int & >99 & <1000 (mismatched types float and int): ./example.cue:8:17 diff --git a/hugo/content/en/docs/howto/use-the-built-in-function-close/index.md b/hugo/content/en/docs/howto/use-the-built-in-function-close/index.md index e313dbfa5..3475dcaaf 100644 --- a/hugo/content/en/docs/howto/use-the-built-in-function-close/index.md +++ b/hugo/content/en/docs/howto/use-the-built-in-function-close/index.md @@ -17,7 +17,7 @@ to close a [struct]({{< relref "docs/reference/glossary#struct" >}}). {{< code-tabs >}} -{{< code-tab name="example.cue" language="cue" area="top-left" >}} +{{< code-tab name="example.cue" language="cue" area="top-left" >}} package example // _x is an open struct @@ -45,7 +45,7 @@ notOk: close(_x) & { d: "an additional field" } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIGV2YWwgLWk=" >}} $ cue eval -i ok: { a: 42 diff --git a/hugo/content/en/docs/howto/use-the-built-in-function-len/index.md b/hugo/content/en/docs/howto/use-the-built-in-function-len/index.md index 621682b5a..fd2fd01d6 100644 --- a/hugo/content/en/docs/howto/use-the-built-in-function-len/index.md +++ b/hugo/content/en/docs/howto/use-the-built-in-function-len/index.md @@ -16,7 +16,7 @@ function to calculate the lengths of different CUE types. {{< code-tabs >}} -{{< code-tab name="example.cue" language="cue" area="top-left" >}} +{{< code-tab name="example.cue" language="cue" area="top-left" >}} package example a: len([5, 4, 3, 2]) @@ -31,7 +31,7 @@ b: len('😎abc123🥶') // This input is of type string b: len("😎abc123🥶") {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydA==" >}} $ cue export { "a": 4, diff --git a/hugo/content/en/docs/howto/use-the-built-in-function-or/index.md b/hugo/content/en/docs/howto/use-the-built-in-function-or/index.md index a65c7f3a7..583094a35 100644 --- a/hugo/content/en/docs/howto/use-the-built-in-function-or/index.md +++ b/hugo/content/en/docs/howto/use-the-built-in-function-or/index.md @@ -18,7 +18,7 @@ to create a from a list. {{< code-tabs >}} -{{< code-tab name="example.cue" language="cue" area="top-left" >}} +{{< code-tab name="example.cue" language="cue" area="top-left" >}} package example source: ["a", "b", "c"] @@ -36,7 +36,7 @@ test: { four: "X" // invalid value } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIHZldCAuOmV4YW1wbGU=" >}} $ cue vet .:example test.four: 3 errors in empty disjunction: test.four: conflicting values "a" and "X": diff --git a/hugo/content/en/docs/howto/use-the-built-in-functions-div-mod-quo-rem/index.md b/hugo/content/en/docs/howto/use-the-built-in-functions-div-mod-quo-rem/index.md index 3a7e8d1d3..2408bf7f9 100644 --- a/hugo/content/en/docs/howto/use-the-built-in-functions-div-mod-quo-rem/index.md +++ b/hugo/content/en/docs/howto/use-the-built-in-functions-div-mod-quo-rem/index.md @@ -27,7 +27,7 @@ The behaviours of these functions are defined in [the CUE language specification]({{< relref "docs/reference/spec#div-mod-quo-and-rem" >}}). {{< code-tabs >}} -{{< code-tab name="example.cue" language="cue" area="top-left" >}} +{{< code-tab name="example.cue" language="cue" area="top-left" >}} package example // div returns Euclidean division's @@ -66,7 +66,7 @@ truncated: remainder: { d: rem(-15, -4) } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydA==" >}} $ cue export { "euclidean": { diff --git a/hugo/content/en/docs/howto/write-a-type-switch/index.md b/hugo/content/en/docs/howto/write-a-type-switch/index.md index 2f949bb6b..2728790ce 100644 --- a/hugo/content/en/docs/howto/write-a-type-switch/index.md +++ b/hugo/content/en/docs/howto/write-a-type-switch/index.md @@ -14,7 +14,7 @@ a switch statement, a mechanism is shown that *behaves* like a switch statement in some other languages. {{< code-tabs >}} -{{< code-tab name="file.cue" language="cue" area="top" >}} +{{< code-tab name="file.cue" language="cue" area="top" >}} package example input: [ @@ -56,7 +56,7 @@ output: [for v in input { ][0] }] {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV2YWwgLXMgLWUgb3V0cHV0" >}} $ cue eval -s -e output [{ source: 42 diff --git a/hugo/content/en/docs/integration/json/index.md b/hugo/content/en/docs/integration/json/index.md index e3d686b5f..a180ad953 100644 --- a/hugo/content/en/docs/integration/json/index.md +++ b/hugo/content/en/docs/integration/json/index.md @@ -59,7 +59,7 @@ JSON from within CUE. The builtin `encoding/json.Marshal` generates JSON from within CUE. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} import "encoding/json" configMap: data: "point.json": @@ -68,7 +68,7 @@ configMap: data: "point.json": y: 2.34 }) {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "configMap": { "data": { @@ -84,13 +84,13 @@ configMap: data: "point.json": The reverse is also possible. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} import "encoding/json" data: #"{"x":4.5,"y":2.34}"# point: json.Unmarshal(data) {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "data": "{\"x\":4.5,\"y\":2.34}", "point": { @@ -104,7 +104,7 @@ point: json.Unmarshal(data) ### Validate {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} import "encoding/json" #Dimensions: { @@ -120,7 +120,7 @@ configs: bed: #"{ "width": 2, "height": 0.1, "depth": 2 }"# configs: table: #"{ "width": "34", "height": 23, "depth": 0.2 }"# configs: painting: #"{ "width": 34, "height": 12, "depht": 0.2 }"# {{< /code-tab >}} -{{< code-tab name="ERR" language="err" type="terminal" area="top-right" >}} +{{< code-tab name="ERR" language="err" area="top-right" type="terminal" >}} configs.painting: invalid value "{ \"width\": 34, \"height\": 12, \"depht\": 0.2 }" (does not satisfy encoding/json.Validate({width:number,depth:number,height:number})): error in call to encoding/json.Validate: field not allowed: ./in.cue:10:20 ./in.cue:3:14 diff --git a/hugo/content/en/docs/integration/yaml/index.md b/hugo/content/en/docs/integration/yaml/index.md index 736b03c8f..c93c81f3f 100644 --- a/hugo/content/en/docs/integration/yaml/index.md +++ b/hugo/content/en/docs/integration/yaml/index.md @@ -45,20 +45,20 @@ Given these two files, the `cue vet` command can verify that the values in `ranges.yaml` are correct by just mentioning the two files on the command line. {{< code-tabs >}} -{{< code-tab name="check.cue" language="cue" area="top-left" >}} +{{< code-tab name="check.cue" language="cue" area="top-left" >}} min?: *0 | number // 0 if undefined // must be strictly greater than min if defined max?: number & >min {{< /code-tab >}} -{{< code-tab name="ranges.yaml" language="yaml" area="top-right" >}} +{{< code-tab name="ranges.yaml" language="yaml" area="top-right" >}} min: 5 max: 10 --- min: 10 max: 5 {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="err" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="err" area="bottom" type="terminal" codetocopy="Y3VlIHZldCByYW5nZXMueWFtbCBjaGVjay5jdWU=" >}} $ cue vet ranges.yaml check.cue max: invalid value 5 (out of bound >10): ./check.cue:4:16 @@ -137,7 +137,7 @@ LanguageTag (mismatched types bool and string): The builtin `encoding/yaml.Marshal` generates YAML from within CUE. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} import "encoding/yaml" configMap: data: "point.yaml": @@ -146,7 +146,7 @@ configMap: data: "point.yaml": y: 2.34 }) {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "configMap": { "data": { @@ -162,7 +162,7 @@ configMap: data: "point.yaml": The inverse is also possible {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} import "encoding/yaml" data: """ @@ -171,7 +171,7 @@ data: """ """ point: yaml.Unmarshal(data) {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "data": "x: 4.5\ny: 2.34", "point": { diff --git a/hugo/content/en/docs/language-guide/data/bytes-values/index.md b/hugo/content/en/docs/language-guide/data/bytes-values/index.md index c84d08dfb..10b3d2c2e 100644 --- a/hugo/content/en/docs/language-guide/data/bytes-values/index.md +++ b/hugo/content/en/docs/language-guide/data/bytes-values/index.md @@ -17,13 +17,13 @@ JSON does not natively support binary data. When exporting to JSON, CUE translates it to base64. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a: #’A newline is written as \n.’# b: ''' sfsf ‘’’ {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} {{< /code-tab >}} {{< /code-tabs >}} @@ -33,13 +33,13 @@ b: ''' CUE translates bytes to the corresponding YAML binary type. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a: #’A newline is written as \n.’# b: ''' sfsf ‘’’ {{< /code-tab >}} -{{< code-tab name="YAML" language="yaml" type="terminal" area="top-right" >}} +{{< code-tab name="YAML" language="yaml" area="top-right" type="terminal" >}} {{< /code-tab >}} {{< /code-tabs >}} diff --git a/hugo/content/en/docs/language-guide/data/json-superset/index.md b/hugo/content/en/docs/language-guide/data/json-superset/index.md index ed4f60d1b..27f698f31 100644 --- a/hugo/content/en/docs/language-guide/data/json-superset/index.md +++ b/hugo/content/en/docs/language-guide/data/json-superset/index.md @@ -14,14 +14,14 @@ configurations in general: - the outermost curly braces are optional. {{{TODO "note on embedding"}}} {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} // A doc comment map: { member1: 3 // a line comment member2: 4 } {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "map": { "member1": 3, @@ -40,14 +40,14 @@ map: { CUE supports `//`-style comments. Comments are first-class citizens in CUE. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} // A doc comment map: { member1: 3 // a line comment member2: 4 } {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "map": { "member1": 3, diff --git a/hugo/content/en/docs/language-guide/data/lists/index.md b/hugo/content/en/docs/language-guide/data/lists/index.md index 2503bf123..7c545d839 100644 --- a/hugo/content/en/docs/language-guide/data/lists/index.md +++ b/hugo/content/en/docs/language-guide/data/lists/index.md @@ -10,11 +10,11 @@ List elements are considered to be a special kind of data field, with elements indexed by their position. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a: [1, 2] "a": [1, 2, 3] {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} a: [1, 2, 3] {{< /code-tab >}} {{< /code-tabs >}} diff --git a/hugo/content/en/docs/language-guide/data/maps-and-fields/index.md b/hugo/content/en/docs/language-guide/data/maps-and-fields/index.md index 5e8cfb1fd..4c0bf810c 100644 --- a/hugo/content/en/docs/language-guide/data/maps-and-fields/index.md +++ b/hugo/content/en/docs/language-guide/data/maps-and-fields/index.md @@ -17,12 +17,12 @@ Identifiers may also start with `#` or `_`, in which case the field is a [helper field]({{< relref "#helper-field" >}}) with special meaning. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a1: 1 "a-b": 2 // quotes are needed here $id: "yipee" {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "a1": 1, "a-b": 2, @@ -40,11 +40,11 @@ Names of regular fields are considered equal if their string values are equal, regardless of whether the strings are quoted or not. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a: x: 1 "a": y: 2 {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} a: { x: 1 y: 2 @@ -75,7 +75,7 @@ More on this in the [Templating]({{< relref "docs/language-guide/templating" >}}) section. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} one: { value: 1 #typeName: "int" @@ -84,7 +84,7 @@ one: { two: value: "two" two: _typeName: "string" {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "one": { "value": 1 @@ -102,7 +102,7 @@ It is possible to associate helper fields with scalar types by placing both in curly braces (`{}`). {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} one: { 1 #typeName: "int" @@ -116,7 +116,7 @@ three: { #typeName: "map" } {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} one: { 1 #typeName: "int" diff --git a/hugo/content/en/docs/language-guide/data/numeric-values/index.md b/hugo/content/en/docs/language-guide/data/numeric-values/index.md index a03dcee18..0534d6dc4 100644 --- a/hugo/content/en/docs/language-guide/data/numeric-values/index.md +++ b/hugo/content/en/docs/language-guide/data/numeric-values/index.md @@ -29,12 +29,12 @@ gets rounded down to the nearest whole number. Note that `k` is written as `K` instead. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a: 1_000_000 b: 1M c: 1Mi {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "a": 1000000, "b": 1000000, @@ -54,12 +54,12 @@ CUE can represent numbers in bases other than decimal. | Binary | 0b | 0b1111_1111 | 255 | {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} o: 0o755 h: 0x00Dec0de b: 0b0101_0001 {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "o": 493, "h": 14598366, diff --git a/hugo/content/en/docs/language-guide/data/organizing-configuration/index.md b/hugo/content/en/docs/language-guide/data/organizing-configuration/index.md index 5f681d3a4..8c956dc6c 100644 --- a/hugo/content/en/docs/language-guide/data/organizing-configuration/index.md +++ b/hugo/content/en/docs/language-guide/data/organizing-configuration/index.md @@ -19,11 +19,11 @@ CUE allows duplicate fields to exist as long as their values are consistent. This is allowed: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a: 1 a: 1 {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} a: 1 {{< /code-tab >}} {{< /code-tabs >}} @@ -31,11 +31,11 @@ a: 1 This is not: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} b: 1 b: 2 {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} b: conflicting values 2 and 1: in.cue: 1:4 in.cue: 2:4 @@ -46,7 +46,7 @@ Two maps or lists are consistent if the values with the same key or index are consistent. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} point: { x: 1 } @@ -59,7 +59,7 @@ point: { list: [1, 2, 3, 4] {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} point: { x: 1 y: 2 @@ -80,11 +80,11 @@ More on this in For single-field maps, the curly braces can be omitted: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} point2: x: 1 point2: y: 2 {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} point2: { x: 1 y: 2 @@ -95,10 +95,10 @@ point2: { One can also combine values with the `&` operator: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} point3: {x: 1} & {y: 2} {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} point3: { x: 1 y: 2 @@ -121,7 +121,7 @@ makes it easier to separate human written versus machine generated content, among other things. {{< code-tabs >}} -{{< code-tab name="fruit.cue" language="cue" area="top-left" >}} +{{< code-tab name="fruit.cue" language="cue" area="top-left" >}} package food cart: { @@ -129,12 +129,12 @@ cart: { oranges: 3 } {{< /code-tab >}} -{{< code-tab name="vegetables.cue" language="cue" area="top-right" >}} +{{< code-tab name="vegetables.cue" language="cue" area="top-right" >}} package food cart: spinach: 4 {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="cue" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="cue" area="bottom" type="terminal" codetocopy="Y3VlIGV2YWwgOmZvb2Q=" >}} $ cue eval :food cart: { apples: 1 diff --git a/hugo/content/en/docs/language-guide/data/string-values/index.md b/hugo/content/en/docs/language-guide/data/string-values/index.md index 6a5e4abeb..9064505f8 100644 --- a/hugo/content/en/docs/language-guide/data/string-values/index.md +++ b/hugo/content/en/docs/language-guide/data/string-values/index.md @@ -18,7 +18,7 @@ The whitespace preceding the last `"""` must prefix each non-empty line of the string contents and is stripped from all lines. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} msg: """ Hello World! @@ -26,7 +26,7 @@ msg: """ real treat. """ {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "msg": "Hello World!\n\nThis is a real treat." } @@ -69,12 +69,12 @@ single pair of hashes uses `\#` as the escape character, instead of `\`. A string enclosed in two hashes uses `\##`, and so on. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a: #"A newline is\#nwritten as "\n"."# b: ##"Use \#n to write a newline in that case.”## {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "a": "A newline is\nwritten as "\\n"." "b": "Use \#n to write a newline in that case." diff --git a/hugo/content/en/docs/language-guide/schemas-and-validation/composite-schemas/index.md b/hugo/content/en/docs/language-guide/schemas-and-validation/composite-schemas/index.md index 7d35b7452..934ff3e0d 100644 --- a/hugo/content/en/docs/language-guide/schemas-and-validation/composite-schemas/index.md +++ b/hugo/content/en/docs/language-guide/schemas-and-validation/composite-schemas/index.md @@ -42,12 +42,12 @@ You can write `[a, b, ...]` to allow more items. or closed, map or list. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} c: close({a: 1}) a: c & {b: 2} {{< /code-tab >}} -{{< code-tab name="ERR" language="err" type="terminal" area="top-right" >}} +{{< code-tab name="ERR" language="err" area="top-right" type="terminal" >}} a.b: field not allowed: ./in.cue:1:10 ./in.cue:3:4 @@ -64,7 +64,7 @@ This circumvents the usual limitation that no new fields can be added to a definition. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} #Base: {} #Animal: { kind!: string @@ -80,7 +80,7 @@ definition. house: string } {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} #Base: {} #Animal: { kind!: string @@ -114,10 +114,10 @@ Schemas are often composed of other schemas. You can embed schemas in another to extend them: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} {{< /code-tab >}} {{< /code-tabs >}} diff --git a/hugo/content/en/docs/language-guide/schemas-and-validation/data-validation/index.md b/hugo/content/en/docs/language-guide/schemas-and-validation/data-validation/index.md index 751db9e74..50897849f 100644 --- a/hugo/content/en/docs/language-guide/schemas-and-validation/data-validation/index.md +++ b/hugo/content/en/docs/language-guide/schemas-and-validation/data-validation/index.md @@ -8,11 +8,11 @@ Schema can compose with data, for instance to validate data. For instance, this is valid: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a: 1 a?: int {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} a: 1 {{< /code-tab >}} {{< /code-tabs >}} @@ -20,11 +20,11 @@ a: 1 This is not {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a: 1 a?: string {{< /code-tab >}} -{{< code-tab name="ERR" language="err" type="terminal" area="top-right" >}} +{{< code-tab name="ERR" language="err" area="top-right" type="terminal" >}} a: conflicting values 1 and string (mismatched types int and string): ./in.cue:1:5 ./in.cue:2:5 @@ -35,10 +35,10 @@ It is also possible to combine schemas. For instance, the following CUE defines restrictions on what values are allowed for another schema. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} {{< /code-tab >}} {{< /code-tabs >}} diff --git a/hugo/content/en/docs/language-guide/schemas-and-validation/disjunctions/index.md b/hugo/content/en/docs/language-guide/schemas-and-validation/disjunctions/index.md index cdffb057f..e141030a2 100644 --- a/hugo/content/en/docs/language-guide/schemas-and-validation/disjunctions/index.md +++ b/hugo/content/en/docs/language-guide/schemas-and-validation/disjunctions/index.md @@ -30,7 +30,7 @@ or([]) _|_ ``` {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a: or([1, 2, 3, 4, 5]) b: or([2]) c: or(empty) @@ -40,7 +40,7 @@ empty: [] withDefault: *2 | or([1, 2, 3, 4]) x: withDefault & 3 {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} a: 1 | 2 | 3 | 4 | 5 b: 2 c: or(empty) diff --git a/hugo/content/en/docs/language-guide/schemas-and-validation/field-constraints/index.md b/hugo/content/en/docs/language-guide/schemas-and-validation/field-constraints/index.md index fe2f02013..d596618fe 100644 --- a/hugo/content/en/docs/language-guide/schemas-and-validation/field-constraints/index.md +++ b/hugo/content/en/docs/language-guide/schemas-and-validation/field-constraints/index.md @@ -26,13 +26,13 @@ without actually declaring these fields. Since in CUE data and schema is mixed, we explicitly mark schema fields with a question mark (`?`): {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} Feedback: { all?: string committee?: string } {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} Feedback: {} {{< /code-tab >}} {{< /code-tabs >}} @@ -43,14 +43,14 @@ We use `!` instead of `?` to additionally specify that this field _*must_* be defined for an instance of this map to be valid. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} Name: { first!: string middle?: string last!: string } {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} Name: { first!: string last!: string diff --git a/hugo/content/en/docs/language-guide/schemas-and-validation/patterns/index.md b/hugo/content/en/docs/language-guide/schemas-and-validation/patterns/index.md index 4d953de6f..bcf9ee798 100644 --- a/hugo/content/en/docs/language-guide/schemas-and-validation/patterns/index.md +++ b/hugo/content/en/docs/language-guide/schemas-and-validation/patterns/index.md @@ -17,7 +17,7 @@ In programming languages this is called a *sum type*. {{{end}}} {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} #Base: kind!: string #A: { kind!: "a" @@ -32,7 +32,7 @@ In programming languages this is called a *sum type*. fooInt: #X fooInt: {kind: "a", a: 43} {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} #Base: { kind!: string } @@ -63,12 +63,12 @@ This following approach accepts all implementations of `#Base`, retaining all additional fields. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} #Base: kind!: string #X: {#Base, ...} // anyof(#Base) {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} #Base: { kind!: string } @@ -81,7 +81,7 @@ all additional fields. The following approach allows all implementations of `#Base` while discarding excess fields. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} #Base: kind!: string #X: #Base @@ -92,7 +92,7 @@ a: { fooInt: #X fooInt: a.{#Base} {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} {{< /code-tab >}} {{< /code-tabs >}} @@ -105,7 +105,7 @@ In general, this is not recommended, as it removes the ability for that schema t A package that provides schemas with required discriminator fields could provide a convenience variant, though, with those already filled out: {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} #Schema: { kind!: "a" name: string @@ -114,7 +114,7 @@ A package that provides schemas with required discriminator fields could provide // provide ‘kind’ by default Schema: #Schema & {kind: _} {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} #Schema: { kind!: "a" name: string diff --git a/hugo/content/en/docs/language-guide/schemas-and-validation/value-constraints/index.md b/hugo/content/en/docs/language-guide/schemas-and-validation/value-constraints/index.md index 8acf47d0e..c4889c1f6 100644 --- a/hugo/content/en/docs/language-guide/schemas-and-validation/value-constraints/index.md +++ b/hugo/content/en/docs/language-guide/schemas-and-validation/value-constraints/index.md @@ -29,7 +29,7 @@ More specifically, for any concrete `x`, `x & ⊗y` is an error if not `x ⊗ y` {{{end}}} {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} a: >10 a: 11 @@ -41,7 +41,7 @@ b: <=10 s: =~#"^\p{Lu}"# s: "Cat" {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} a: 11 b: 10 s: "Cat" @@ -51,11 +51,11 @@ s: "Cat" A bound that fails results in an error. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} e: =~"foo" e: "bar" {{< /code-tab >}} -{{< code-tab name="ERR" language="err" type="terminal" area="top-right" >}} +{{< code-tab name="ERR" language="err" area="top-right" type="terminal" >}} e: invalid value "bar" (out of bound =~"foo"): ./in.cue:1:4 ./in.cue:2:4 @@ -70,13 +70,13 @@ In this case the first argument in the Go documentation is the type of the validated value and must be omitted. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} import "list" a: [1, 2, 3] a: list.MinItems(4) {{< /code-tab >}} -{{< code-tab name="ERR" language="err" type="terminal" area="top-right" >}} +{{< code-tab name="ERR" language="err" area="top-right" type="terminal" >}} a: invalid value [1,2,3] (does not satisfy list.MinItems(4)): len(list) < MinItems(4) (3 < 4): ./in.cue:4:4 ./in.cue:3:4 @@ -91,13 +91,13 @@ CUE does not support timestamps in the language, but its standard library provides validators to interpret strings as such. {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} import "time" valid: time.Time valid: "2006-01-02T15:04:05Z" {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} valid: "2006-01-02T15:04:05Z" {{< /code-tab >}} {{< /code-tabs >}} @@ -108,7 +108,7 @@ types. {{< code-tabs >}} -{{< code-tab name="dup.cue" language="cue" area="top-left" >}} +{{< code-tab name="dup.cue" language="cue" area="top-left" >}} a: 4 a: 4 @@ -23,7 +23,7 @@ s: {c: 2} l: [1, 2] l: [1, 2] {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} a: 4 s: { b: 2 diff --git a/hugo/content/en/docs/tour/basics/folding-structs/index.md b/hugo/content/en/docs/tour/basics/folding-structs/index.md index f31870600..24591f495 100644 --- a/hugo/content/en/docs/tour/basics/folding-structs/index.md +++ b/hugo/content/en/docs/tour/basics/folding-structs/index.md @@ -19,7 +19,7 @@ members. --> {{< code-tabs >}} -{{< code-tab name="fold.cue" language="cue" area="top-left" >}} +{{< code-tab name="fold.cue" language="cue" area="top-left" >}} // path-value pairs outer: middle1: inner: 3 outer: middle2: inner: 7 @@ -27,7 +27,7 @@ outer: middle2: inner: 7 // collection-constraint pair outer: [string]: inner: int {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} { "outer": { "middle1": { diff --git a/hugo/content/en/docs/tour/basics/json-superset/index.md b/hugo/content/en/docs/tour/basics/json-superset/index.md index c683db7b0..336465cfd 100644 --- a/hugo/content/en/docs/tour/basics/json-superset/index.md +++ b/hugo/content/en/docs/tour/basics/json-superset/index.md @@ -16,7 +16,7 @@ JSON objects are called structs in CUE. An object member is called a field. {{< code-tabs >}} -{{< code-tab name="json.cue" language="cue" area="top-left" >}} +{{< code-tab name="json.cue" language="cue" area="top-left" >}} one: 1 two: 2 @@ -29,7 +29,7 @@ list: [ 3, ] {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} { "one": 1, "two": 2, diff --git a/hugo/content/en/docs/tour/basics/order-irrelevance/index.md b/hugo/content/en/docs/tour/basics/order-irrelevance/index.md index 05aa7659e..529c0bb3e 100644 --- a/hugo/content/en/docs/tour/basics/order-irrelevance/index.md +++ b/hugo/content/en/docs/tour/basics/order-irrelevance/index.md @@ -11,14 +11,14 @@ that makes it easy for humans _and_ machines to reason over values and makes advanced tooling and automation possible. {{< code-tabs >}} -{{< code-tab name="order.cue" language="cue" area="top-left" >}} +{{< code-tab name="order.cue" language="cue" area="top-left" >}} a: {x: 1, y: int} a: {x: int, y: 2} b: {x: int, y: 2} b: {x: 1, y: int} {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} a: { x: 1 y: 2 diff --git a/hugo/content/en/docs/tour/basics/validation/index.md b/hugo/content/en/docs/tour/basics/validation/index.md index df64862ec..8a21d8319 100644 --- a/hugo/content/en/docs/tour/basics/validation/index.md +++ b/hugo/content/en/docs/tour/basics/validation/index.md @@ -11,7 +11,7 @@ an uppercase letter, specified in`schema.cue`. The constraint is validated with `cue vet`. {{< code-tabs >}} -{{< code-tab name="schema.cue" language="cue" area="top-left" >}} +{{< code-tab name="schema.cue" language="cue" area="top-left" >}} #Language: { tag: string // name must start with an uppercase @@ -20,7 +20,7 @@ The constraint is validated with `cue vet`. } languages: [...#Language] {{< /code-tab >}} -{{< code-tab name="data.yaml" language="yaml" area="top-right" >}} +{{< code-tab name="data.yaml" language="yaml" area="top-right" >}} languages: - tag: en name: English @@ -29,7 +29,7 @@ languages: - tag: "no" name: Norwegian {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="bottom" >}} +{{< code-tab name="result.txt" language="txt" area="bottom" >}} languages.1.name: invalid value "dutch" (out of bound =~"^\\p{Lu}"): ./schema.cue:5:8 ./data.yaml:5:11 diff --git a/hugo/content/en/docs/tour/expressions/coalesce/index.md b/hugo/content/en/docs/tour/expressions/coalesce/index.md index 169a25a03..feec305e8 100644 --- a/hugo/content/en/docs/tour/expressions/coalesce/index.md +++ b/hugo/content/en/docs/tour/expressions/coalesce/index.md @@ -25,7 +25,7 @@ In that case the default will be used if either the lookup fails or the result is not of the desired type. {{< code-tabs >}} -{{< code-tab name="coalesce.cue" language="cue" area="top-left" >}} +{{< code-tab name="coalesce.cue" language="cue" area="top-left" >}} list: ["Cat", "Mouse", "Dog"] a: *list[0] | "None" @@ -34,7 +34,7 @@ b: *list[5] | "None" n: [null] v: *(n[0] & string) | "default" {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} list: ["Cat", "Mouse", "Dog"] a: "Cat" b: "None" diff --git a/hugo/content/en/docs/tour/expressions/conditional/index.md b/hugo/content/en/docs/tour/expressions/conditional/index.md index cee04629f..3c044be7e 100644 --- a/hugo/content/en/docs/tour/expressions/conditional/index.md +++ b/hugo/content/en/docs/tour/expressions/conditional/index.md @@ -10,7 +10,7 @@ Converting the resulting configuration to JSON results in an error as `justification` is required yet no concrete value is given. {{< code-tabs >}} -{{< code-tab name="conditional.cue" language="cue" area="top-left" >}} +{{< code-tab name="conditional.cue" language="cue" area="top-left" >}} price: number // Require a justification if price is too high @@ -20,7 +20,7 @@ if price > 100 { price: 200 {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} justification: string price: 200 {{< /code-tab >}} diff --git a/hugo/content/en/docs/tour/expressions/fieldcomp/index.md b/hugo/content/en/docs/tour/expressions/fieldcomp/index.md index 37808064e..c26464394 100644 --- a/hugo/content/en/docs/tour/expressions/fieldcomp/index.md +++ b/hugo/content/en/docs/tour/expressions/fieldcomp/index.md @@ -9,7 +9,7 @@ One cannot refer to generated fields with references. Instead, one must use indexing. {{< code-tabs >}} -{{< code-tab name="fieldcomp.cue" language="cue" area="top-left" >}} +{{< code-tab name="fieldcomp.cue" language="cue" area="top-left" >}} import "strings" #a: ["Barcelona", "Shanghai", "Munich"] @@ -22,7 +22,7 @@ for k, v in #a { } } {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} barcelona: { pos: 1 name: "Barcelona" diff --git a/hugo/content/en/docs/tour/expressions/interpolation/index.md b/hugo/content/en/docs/tour/expressions/interpolation/index.md index 3bffb5558..149b20a29 100644 --- a/hugo/content/en/docs/tour/expressions/interpolation/index.md +++ b/hugo/content/en/docs/tour/expressions/interpolation/index.md @@ -9,13 +9,13 @@ Any valid CUE expression may be used inside the escaped parentheses. Interpolation may also be used in multiline string and byte literals. {{< code-tabs >}} -{{< code-tab name="interpolation.cue" language="cue" area="top-left" >}} +{{< code-tab name="interpolation.cue" language="cue" area="top-left" >}} "You are \( #cost-#budget ) dollars over budget!" #cost: 102 #budget: 88 {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} "You are 14 dollars over budget!" #cost: 102 #budget: 88 diff --git a/hugo/content/en/docs/tour/expressions/interpolfield/index.md b/hugo/content/en/docs/tour/expressions/interpolfield/index.md index 5163d2d5d..139c2e403 100644 --- a/hugo/content/en/docs/tour/expressions/interpolfield/index.md +++ b/hugo/content/en/docs/tour/expressions/interpolfield/index.md @@ -8,7 +8,7 @@ String interpolations may also be used in field names. One cannot refer to generated fields with references. {{< code-tabs >}} -{{< code-tab name="genfield.cue" language="cue" area="top-left" >}} +{{< code-tab name="genfield.cue" language="cue" area="top-left" >}} sandwich: { type: "Cheese" "has\(type)": true @@ -16,7 +16,7 @@ sandwich: { butterAndCheese: hasButter && hasCheese } {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} sandwich.butterAndCheese: reference "hasCheese" not found: ./genfield.cue:5:32 {{< /code-tab >}} diff --git a/hugo/content/en/docs/tour/expressions/listcomp/index.md b/hugo/content/en/docs/tour/expressions/listcomp/index.md index 49283d45c..cb67f009d 100644 --- a/hugo/content/en/docs/tour/expressions/listcomp/index.md +++ b/hugo/content/en/docs/tour/expressions/listcomp/index.md @@ -8,12 +8,12 @@ Lists can be created with list comprehensions. The example shows the use of `for` loops and `if` guards. {{< code-tabs >}} -{{< code-tab name="listcomp.cue" language="cue" area="top-left" >}} +{{< code-tab name="listcomp.cue" language="cue" area="top-left" >}} [for x in #items if __rem(x, 2) == 0 {x * x}] #items: [1, 2, 3, 4, 5, 6, 7, 8, 9] {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} [ 4, 16, diff --git a/hugo/content/en/docs/tour/expressions/operators/index.md b/hugo/content/en/docs/tour/expressions/operators/index.md index a8c5987ab..467545252 100644 --- a/hugo/content/en/docs/tour/expressions/operators/index.md +++ b/hugo/content/en/docs/tour/expressions/operators/index.md @@ -11,7 +11,7 @@ For `int` CUE supports both Euclidean division (`div` and `mod`) and truncated division (`quo` and `rem`). {{< code-tabs >}} -{{< code-tab name="op.cue" language="cue" area="top-left" >}} +{{< code-tab name="op.cue" language="cue" area="top-left" >}} a: 3 / 2 // type float b: __div(3, 2) // type int: Euclidean division @@ -20,7 +20,7 @@ d: 3 * [1, 2, 3] e: 8 < 10 {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} a: 1.5 b: 1 c: "blahblahblah" diff --git a/hugo/content/en/docs/tour/expressions/regexp/index.md b/hugo/content/en/docs/tour/expressions/regexp/index.md index 7c41e362d..e9c0d898f 100644 --- a/hugo/content/en/docs/tour/expressions/regexp/index.md +++ b/hugo/content/en/docs/tour/expressions/regexp/index.md @@ -12,7 +12,7 @@ Just as with comparison operators, these operators may be used as unary versions to define a set of strings. {{< code-tabs >}} -{{< code-tab name="regexp.cue" language="cue" area="top-left" >}} +{{< code-tab name="regexp.cue" language="cue" area="top-left" >}} a: "foo bar" =~ "foo [a-z]{3}" b: "maze" !~ "^[a-z]{3}$" @@ -25,7 +25,7 @@ d: "foo" e: c e: "foo bar" {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} a: true b: true c: =~"^[a-z]{3}$" diff --git a/hugo/content/en/docs/tour/packages/imports/index.md b/hugo/content/en/docs/tour/packages/imports/index.md index 07669c407..b68c2a8f8 100644 --- a/hugo/content/en/docs/tour/packages/imports/index.md +++ b/hugo/content/en/docs/tour/packages/imports/index.md @@ -21,7 +21,7 @@ import "math" But it is good style to use the factored import statement. {{< code-tabs >}} -{{< code-tab name="imports.cue" language="cue" area="top-left" >}} +{{< code-tab name="imports.cue" language="cue" area="top-left" >}} import ( "encoding/json" "math" @@ -29,7 +29,7 @@ import ( data: json.Marshal({a: math.Sqrt(7)}) {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} data: "{\"a\":2.6457513110645907}" {{< /code-tab >}} {{< /code-tabs >}} diff --git a/hugo/content/en/docs/tour/packages/packages/index.md b/hugo/content/en/docs/tour/packages/packages/index.md index 4f53281d5..16be11ccb 100644 --- a/hugo/content/en/docs/tour/packages/packages/index.md +++ b/hugo/content/en/docs/tour/packages/packages/index.md @@ -16,18 +16,18 @@ The order in which files are loaded is undefined, but any order will result in the same outcome, given that order does not matter. {{< code-tabs >}} -{{< code-tab name="a.cue" language="cue" area="top-left" >}} +{{< code-tab name="a.cue" language="cue" area="top-left" >}} package config foo: 100 bar: int {{< /code-tab >}} -{{< code-tab name="b.cue" language="cue" area="top-right" >}} +{{< code-tab name="b.cue" language="cue" area="top-right" >}} package config bar: 200 {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="bottom" >}} +{{< code-tab name="result.txt" language="txt" area="bottom" >}} foo: 100 bar: 200 {{< /code-tab >}} diff --git a/hugo/content/en/docs/tour/references/aliases/index.md b/hugo/content/en/docs/tour/references/aliases/index.md index 8814e7f90..bfecf01d8 100644 --- a/hugo/content/en/docs/tour/references/aliases/index.md +++ b/hugo/content/en/docs/tour/references/aliases/index.md @@ -11,7 +11,7 @@ Aliases are not members of a struct. They can be referred to only within the struct, and they do not appear in the output. {{< code-tabs >}} -{{< code-tab name="alias.cue" language="cue" area="top-left" >}} +{{< code-tab name="alias.cue" language="cue" area="top-left" >}} let A = a // A is an alias for a a: { d: 3 @@ -25,7 +25,7 @@ b: { } } {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} a: { d: 3 } diff --git a/hugo/content/en/docs/tour/references/cycle/index.md b/hugo/content/en/docs/tour/references/cycle/index.md index 4c17e97c6..f5dbefe54 100644 --- a/hugo/content/en/docs/tour/references/cycle/index.md +++ b/hugo/content/en/docs/tour/references/cycle/index.md @@ -14,7 +14,7 @@ This is very useful for template writers that may not know what fields a user will want to fill out. {{< code-tabs >}} -{{< code-tab name="cycle.cue" language="cue" area="top-left" >}} +{{< code-tab name="cycle.cue" language="cue" area="top-left" >}} // CUE knows how to resolve the following: x: 200 x: y + 100 @@ -25,7 +25,7 @@ y: x - 100 a: b + 100 b: a - 100 {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} x: 200 y: 100 a: b + 100 diff --git a/hugo/content/en/docs/tour/references/emit/index.md b/hugo/content/en/docs/tour/references/emit/index.md index a3e447d0f..f757ae807 100644 --- a/hugo/content/en/docs/tour/references/emit/index.md +++ b/hugo/content/en/docs/tour/references/emit/index.md @@ -11,12 +11,12 @@ to define any type, instead of just structs, while keeping the common case of defining structs light. {{< code-tabs >}} -{{< code-tab name="emit.cue" language="cue" area="top-left" >}} +{{< code-tab name="emit.cue" language="cue" area="top-left" >}} "Hello \(#who)!" #who: "world" {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} "Hello world!" {{< /code-tab >}} {{< /code-tabs >}} diff --git a/hugo/content/en/docs/tour/references/hidden/index.md b/hugo/content/en/docs/tour/references/hidden/index.md index aa9f72fe0..8c182f71e 100644 --- a/hugo/content/en/docs/tour/references/hidden/index.md +++ b/hugo/content/en/docs/tour/references/hidden/index.md @@ -12,13 +12,13 @@ Quoted and non-quoted fields share the same namespace unless they start with an underscore. {{< code-tabs >}} -{{< code-tab name="hidden.cue" language="cue" area="top-left" >}} +{{< code-tab name="hidden.cue" language="cue" area="top-left" >}} "_foo": 2 _foo: 3 foo: 4 _#foo: 5 {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} { "_foo": 2, "foo": 4 diff --git a/hugo/content/en/docs/tour/references/scopes/index.md b/hugo/content/en/docs/tour/references/scopes/index.md index 1e304aa2e..602684c7e 100644 --- a/hugo/content/en/docs/tour/references/scopes/index.md +++ b/hugo/content/en/docs/tour/references/scopes/index.md @@ -12,7 +12,7 @@ field defined in any other file of the same package. If there is still no match, it may match a predefined value. {{< code-tabs >}} -{{< code-tab name="scopes.cue" language="cue" area="top-left" >}} +{{< code-tab name="scopes.cue" language="cue" area="top-left" >}} v: 1 a: { v: 2 @@ -23,7 +23,7 @@ a: { } b: v {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} v: 1 a: { v: 2 diff --git a/hugo/content/en/docs/tour/references/selectors/index.md b/hugo/content/en/docs/tour/references/selectors/index.md index 6a5d16cef..8d734a5e2 100644 --- a/hugo/content/en/docs/tour/references/selectors/index.md +++ b/hugo/content/en/docs/tour/references/selectors/index.md @@ -8,7 +8,7 @@ This only works if a field name is a valid identifier and it is not computed. For other cases one can use the indexing notation. {{< code-tabs >}} -{{< code-tab name="selectors.cue" language="cue" area="top-left" >}} +{{< code-tab name="selectors.cue" language="cue" area="top-left" >}} a: { b: 2 "c-e": 5 @@ -16,7 +16,7 @@ a: { v: a.b w: a["c-e"] {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} a: { b: 2 "c-e": 5 diff --git a/hugo/content/en/docs/tour/types/bottom/index.md b/hugo/content/en/docs/tour/types/bottom/index.md index d83cbc3d7..b32bd5e7e 100644 --- a/hugo/content/en/docs/tour/types/bottom/index.md +++ b/hugo/content/en/docs/tour/types/bottom/index.md @@ -15,7 +15,7 @@ Note that an error is different from `null`: `null` is a valid value, whereas `_|_` is not. {{< code-tabs >}} -{{< code-tab name="bottom.cue" language="cue" area="top-left" >}} +{{< code-tab name="bottom.cue" language="cue" area="top-left" >}} a: 4 a: 5 @@ -25,7 +25,7 @@ l: [1, 3] list: [0, 1, 2] val: list[3] {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} a: _|_ // a: conflicting values 5 and 4 l: [1, _|_, // l.1: conflicting values 3 and 2 ] diff --git a/hugo/content/en/docs/tour/types/bounddef/index.md b/hugo/content/en/docs/tour/types/bounddef/index.md index 5367bc188..f9dcb2368 100644 --- a/hugo/content/en/docs/tour/types/bounddef/index.md +++ b/hugo/content/en/docs/tour/types/bounddef/index.md @@ -26,7 +26,7 @@ uint128: >=0 & <=340_282_366_920_938_463_463_374_607_431_768_211_455 ``` {{< code-tabs >}} -{{< code-tab name="bound.cue" language="cue" area="top-left" >}} +{{< code-tab name="bound.cue" language="cue" area="top-left" >}} #positive: uint #byte: uint8 #word: int32 @@ -35,7 +35,7 @@ a: #positive & -1 b: #byte & 128 c: #word & 2_000_000_000 {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} a: _|_ // a: invalid value -1 (out of bound >=0) b: 128 c: 2000000000 diff --git a/hugo/content/en/docs/tour/types/bounds/index.md b/hugo/content/en/docs/tour/types/bounds/index.md index 0d490559c..070795e4a 100644 --- a/hugo/content/en/docs/tour/types/bounds/index.md +++ b/hugo/content/en/docs/tour/types/bounds/index.md @@ -13,7 +13,7 @@ whereas `<0` allows all negative numbers (int or float). {{< code-tabs >}} -{{< code-tab name="bounds.cue" language="cue" area="top-left" >}} +{{< code-tab name="bounds.cue" language="cue" area="top-left" >}} #rn: >=3 & <8 // type int | float #ri: >=3 & <8 & int // type int @@ -29,7 +29,7 @@ e: #rs & "mu" r1: #rn & >=5 & <10 {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} a: 3.5 b: _|_ // b: conflicting values int and 3.5 (mismatched types int and float) c: 3 diff --git a/hugo/content/en/docs/tour/types/bytes/index.md b/hugo/content/en/docs/tour/types/bytes/index.md index 22255a732..73861e302 100644 --- a/hugo/content/en/docs/tour/types/bytes/index.md +++ b/hugo/content/en/docs/tour/types/bytes/index.md @@ -15,10 +15,10 @@ The following additional escape sequences are allowed in byte literals: {{< code-tabs >}} -{{< code-tab name="bytes.cue" language="cue" area="top-left" >}} +{{< code-tab name="bytes.cue" language="cue" area="top-left" >}} a: '\x03abc' {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} { "a": "A2FiYw==" } diff --git a/hugo/content/en/docs/tour/types/closed/index.md b/hugo/content/en/docs/tour/types/closed/index.md index fbf667247..9f32abb2e 100644 --- a/hugo/content/en/docs/tour/types/closed/index.md +++ b/hugo/content/en/docs/tour/types/closed/index.md @@ -15,7 +15,7 @@ A closed struct can be created using the `close` builtin, but are more commonly defined using a _definition_, defined next. {{< code-tabs >}} -{{< code-tab name="structs.cue" language="cue" area="top-left" >}} +{{< code-tab name="structs.cue" language="cue" area="top-left" >}} a: close({ field: int }) @@ -24,7 +24,7 @@ b: a & { feild: 3 } {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} a: { field: int } diff --git a/hugo/content/en/docs/tour/types/defaults/index.md b/hugo/content/en/docs/tour/types/defaults/index.md index ed31de7a0..28b69b2d0 100644 --- a/hugo/content/en/docs/tour/types/defaults/index.md +++ b/hugo/content/en/docs/tour/types/defaults/index.md @@ -14,7 +14,7 @@ In that case, both `"tcp"` and `"udp"` are preferred and one must explicitly specify either `"tcp"` or `"udp"` as if no marks were given. {{< code-tabs >}} -{{< code-tab name="defaults.cue" language="cue" area="top-left" >}} +{{< code-tab name="defaults.cue" language="cue" area="top-left" >}} // any positive number, 1 is the default replicas: uint | *1 @@ -22,7 +22,7 @@ replicas: uint | *1 protocol: *"tcp" | "udp" protocol: *"udp" | "tcp" {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} replicas: 1 protocol: "tcp" | "udp" {{< /code-tab >}} diff --git a/hugo/content/en/docs/tour/types/defs/index.md b/hugo/content/en/docs/tour/types/defs/index.md index 7ebf9aa51..ee6082465 100644 --- a/hugo/content/en/docs/tour/types/defs/index.md +++ b/hugo/content/en/docs/tour/types/defs/index.md @@ -12,7 +12,7 @@ be validated. Structs defined by definitions are implicitly closed. {{< code-tabs >}} -{{< code-tab name="defs.cue" language="cue" area="top-left" >}} +{{< code-tab name="defs.cue" language="cue" area="top-left" >}} msg: "Hello \(#Name)!" #Name: "world" @@ -24,7 +24,7 @@ msg: "Hello \(#Name)!" a: #A & {field: 3} err: #A & {feild: 3} {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} msg: "Hello world!" a: { field: 3 diff --git a/hugo/content/en/docs/tour/types/disjunctions/index.md b/hugo/content/en/docs/tour/types/disjunctions/index.md index 43ef7699c..a260b80ca 100644 --- a/hugo/content/en/docs/tour/types/disjunctions/index.md +++ b/hugo/content/en/docs/tour/types/disjunctions/index.md @@ -11,7 +11,7 @@ It is an error for a concrete `Conn` to define anything else than these two values. {{< code-tabs >}} -{{< code-tab name="disjunctions.cue" language="cue" area="top-left" >}} +{{< code-tab name="disjunctions.cue" language="cue" area="top-left" >}} #Conn: { address: string port: int @@ -24,7 +24,7 @@ lossy: #Conn & { protocol: "udp" } {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} #Conn: { address: string port: int diff --git a/hugo/content/en/docs/tour/types/lists/index.md b/hugo/content/en/docs/tour/types/lists/index.md index f912501ae..e7804cf80 100644 --- a/hugo/content/en/docs/tour/types/lists/index.md +++ b/hugo/content/en/docs/tour/types/lists/index.md @@ -20,7 +20,7 @@ The output contains a valid private IP address (`myIP`) and an invalid one (`yourIP`). {{< code-tabs >}} -{{< code-tab name="lists.cue" language="cue" area="top-left" >}} +{{< code-tab name="lists.cue" language="cue" area="top-left" >}} import "list" IP: list.Repeat([uint8], 4) @@ -36,7 +36,7 @@ myIP: [10, 2, 3, 4] yourIP: PrivateIP yourIP: [11, 1, 2, 3] {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} IP: [uint8, uint8, uint8, uint8] PrivateIP: [10, uint8, uint8, uint8] | [192, 168, uint8, uint8] | [172, uint & >=16 & <=32, uint8, uint8] myIP: [10, 2, 3, 4] diff --git a/hugo/content/en/docs/tour/types/numbers/index.md b/hugo/content/en/docs/tour/types/numbers/index.md index d6f2da558..ee6f7829e 100644 --- a/hugo/content/en/docs/tour/types/numbers/index.md +++ b/hugo/content/en/docs/tour/types/numbers/index.md @@ -16,7 +16,7 @@ used as an `int` without conversion. CUE also adds a variety of sugar for writing numbers. {{< code-tabs >}} -{{< code-tab name="numbers.cue" language="cue" area="top-left" >}} +{{< code-tab name="numbers.cue" language="cue" area="top-left" >}} a: int a: 4 // type int @@ -35,7 +35,7 @@ e: [ 0x1000_0000, // 268_435_456 ] {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} a: 4 b: 4.0 c: _|_ // c: conflicting values int and 4.0 (mismatched types int and float) diff --git a/hugo/content/en/docs/tour/types/optional/index.md b/hugo/content/en/docs/tour/types/optional/index.md index c1eb57c47..cbb3e99bc 100644 --- a/hugo/content/en/docs/tour/types/optional/index.md +++ b/hugo/content/en/docs/tour/types/optional/index.md @@ -16,7 +16,7 @@ It is okay for an optional field to be bottom (`_|_`). This just means that field may not be specified. {{< code-tabs >}} -{{< code-tab name="structs.cue" language="cue" area="top-left" >}} +{{< code-tab name="structs.cue" language="cue" area="top-left" >}} #a: { foo?: int bar?: string @@ -27,7 +27,7 @@ b: #a & { baz?: 2 // baz?: _|_ } {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} b: { foo: 3 } diff --git a/hugo/content/en/docs/tour/types/stringlit/index.md b/hugo/content/en/docs/tour/types/stringlit/index.md index 1fa3bc2d4..4f3e897ea 100644 --- a/hugo/content/en/docs/tour/types/stringlit/index.md +++ b/hugo/content/en/docs/tour/types/stringlit/index.md @@ -16,7 +16,7 @@ Strings may also contain {{< code-tabs >}} -{{< code-tab name="stringlit.cue" language="cue" area="top-left" >}} +{{< code-tab name="stringlit.cue" language="cue" area="top-left" >}} // 21-bit unicode characters a: "\U0001F60E" // 😎 @@ -26,7 +26,7 @@ b: """ World! """ {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} { "a": "😎", "b": "Hello\nWorld!" diff --git a/hugo/content/en/docs/tour/types/stringraw/index.md b/hugo/content/en/docs/tour/types/stringraw/index.md index 669d3b5a3..d5c7a35eb 100644 --- a/hugo/content/en/docs/tour/types/stringraw/index.md +++ b/hugo/content/en/docs/tour/types/stringraw/index.md @@ -12,7 +12,7 @@ This works for normal and interpolated strings. Quotes do not have to be escaped in such strings. {{< code-tabs >}} -{{< code-tab name="stringraw.cue" language="cue" area="top" >}} +{{< code-tab name="stringraw.cue" language="cue" area="top" >}} msg1: #"The sequence "\U0001F604" renders as \#U0001F604."# msg2: ##""" @@ -23,7 +23,7 @@ msg2: ##""" This construct works for bytes, strings and their multi-line variants. """## {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="bottom" >}} +{{< code-tab name="result.txt" language="txt" area="bottom" >}} msg1: "The sequence \"\\U0001F604\" renders as 😄." msg2: """ A regular expression can conveniently be written as: diff --git a/hugo/content/en/docs/tour/types/templates/index.md b/hugo/content/en/docs/tour/types/templates/index.md index e89eac505..41a92f5c0 100644 --- a/hugo/content/en/docs/tour/types/templates/index.md +++ b/hugo/content/en/docs/tour/types/templates/index.md @@ -18,7 +18,7 @@ which can then be used within the template. {{< code-tabs >}} -{{< code-tab name="templates.cue" language="cue" area="top-left" >}} +{{< code-tab name="templates.cue" language="cue" area="top-left" >}} // The following struct is unified with all // elements in job. The name of each element is // bound to Name and visible in the struct. @@ -35,7 +35,7 @@ job: nginx: { replicas: 2 } {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} job: { list: { name: "list" diff --git a/hugo/content/en/docs/tour/types/types/index.md b/hugo/content/en/docs/tour/types/types/index.md index 19678c3e6..f3da5d50c 100644 --- a/hugo/content/en/docs/tour/types/types/index.md +++ b/hugo/content/en/docs/tour/types/types/index.md @@ -36,7 +36,7 @@ Here we see constraints in action: explicitly. {{< code-tabs >}} -{{< code-tab name="types.cue" language="cue" area="top-left" >}} +{{< code-tab name="types.cue" language="cue" area="top-left" >}} point: { x: number y: number @@ -50,7 +50,7 @@ yaxis: x: 0 origin: xaxis & yaxis {{< /code-tab >}} -{{< code-tab name="result.txt" language="txt" area="top-right" >}} +{{< code-tab name="result.txt" language="txt" area="top-right" >}} point: { x: number y: number diff --git a/internal/cmd/preprocessor/cmd/code_node.go b/internal/cmd/preprocessor/cmd/code_node.go index 7fdc94ef8..34d7bbe7b 100644 --- a/internal/cmd/preprocessor/cmd/code_node.go +++ b/internal/cmd/preprocessor/cmd/code_node.go @@ -16,6 +16,7 @@ package cmd import ( "bytes" + "encoding/base64" "fmt" "html/template" "os" @@ -373,6 +374,11 @@ func (s *codeNode) writeTransformTo(b *bytes.Buffer) error { // We need to improve the rules and logic around this with time. if !s.analysis.isInOut { tp.ContentPrefix = fmt.Sprintf("$ %s\n", s.analysis.cmd) + + // TODO: in its current state, this also includes any trailing + // line comment. This should be fixed as part of reworking the + // code node, but is a hack too far for now. + tp.ToCopy = s.analysis.cmd } } } @@ -381,11 +387,28 @@ func (s *codeNode) writeTransformTo(b *bytes.Buffer) error { p("{{< code-tabs >}}\n") for i, f := range s.effectiveArchive.Files { t := tabs[i] - var typ string + args := []string{ + fmt.Sprintf("name=%q", t.Name), + fmt.Sprintf("language=%q", t.Language), + fmt.Sprintf("area=%q", locations[i]), + } + if t.Type != "" { - typ = fmt.Sprintf("type=%q", t.Type) + args = append(args, fmt.Sprintf("type=%q", t.Type)) } - p("{{< code-tab name=%q language=%q %v area=%q >}}\n", t.Name, t.Language, typ, locations[i]) + + if t.ToCopy != "" { + // Build up a base64 encoded script that will be copied. This is necessary + // because the rendered window will include the output... which won't work + // if copy-pasted. + var copyCmdStr strings.Builder + enc := base64.NewEncoder(base64.StdEncoding, ©CmdStr) + fmt.Fprintf(enc, "%s", t.ToCopy) + enc.Close() + args = append(args, fmt.Sprintf("codetocopy=%q", copyCmdStr.String())) + } + + p("{{< code-tab %s >}}\n", strings.Join(args, " ")) p(t.ContentPrefix) // Need to be sure we write a trailing newline because we always want to diff --git a/internal/cmd/preprocessor/cmd/hugo.go b/internal/cmd/preprocessor/cmd/hugo.go index b64ac28bd..0e481e610 100644 --- a/internal/cmd/preprocessor/cmd/hugo.go +++ b/internal/cmd/preprocessor/cmd/hugo.go @@ -6,6 +6,7 @@ type tabProps struct { Language string Type string ContentPrefix string + ToCopy string } type codeTabLocation string diff --git a/internal/cmd/preprocessor/cmd/testdata/execute_code_3_file.txtar b/internal/cmd/preprocessor/cmd/testdata/execute_code_3_file.txtar index 7335ee64e..2fce054e2 100644 --- a/internal/cmd/preprocessor/cmd/testdata/execute_code_3_file.txtar +++ b/internal/cmd/preprocessor/cmd/testdata/execute_code_3_file.txtar @@ -84,15 +84,15 @@ title: JSON Superset Some text before {{< code-tabs >}} -{{< code-tab name="a.cue" language="cue" area="top-left" >}} +{{< code-tab name="a.cue" language="cue" area="top-left" >}} x?: int {{< /code-tab >}} -{{< code-tab name="b.json" language="json" area="top-right" >}} +{{< code-tab name="b.json" language="json" area="top-right" >}} { "x": 5 } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCBhLmN1ZSBiLmpzb24=" >}} $ cue export a.cue b.json { "x": 5 @@ -100,13 +100,13 @@ $ cue export a.cue b.json {{< /code-tab >}} {{< /code-tabs >}} {{< code-tabs >}} -{{< code-tab name="example1.cue" language="cue" area="top-left" >}} +{{< code-tab name="example1.cue" language="cue" area="top-left" >}} foo {{< /code-tab >}} -{{< code-tab name="example2.cue" language="cue" area="bottom-left" >}} +{{< code-tab name="example2.cue" language="cue" area="bottom-left" >}} foo {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="err" type="terminal" area="right" >}} +{{< code-tab name="TERMINAL" language="err" area="right" type="terminal" codetocopy="Y3VlIHZldCAuOmV4YW1wbGU=" >}} $ cue vet .:example build constraints exclude all CUE files in .: example1.cue: no package name diff --git a/internal/cmd/preprocessor/cmd/testdata/execute_code_4_file.txtar b/internal/cmd/preprocessor/cmd/testdata/execute_code_4_file.txtar index 243fec796..ee5baf7a4 100644 --- a/internal/cmd/preprocessor/cmd/testdata/execute_code_4_file.txtar +++ b/internal/cmd/preprocessor/cmd/testdata/execute_code_4_file.txtar @@ -69,20 +69,20 @@ title: JSON Superset Some text before {{< code-tabs >}} -{{< code-tab name="a.cue" language="cue" area="top-left" >}} +{{< code-tab name="a.cue" language="cue" area="top-left" >}} x?: int {{< /code-tab >}} -{{< code-tab name="b.json" language="json" area="top-right" >}} +{{< code-tab name="b.json" language="json" area="top-right" >}} { "x": 5 } {{< /code-tab >}} -{{< code-tab name="c.json" language="json" area="top-right" >}} +{{< code-tab name="c.json" language="json" area="top-right" >}} { "x": 5 } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="" type="terminal" area="bottom" >}} +{{< code-tab name="TERMINAL" language="" area="bottom" type="terminal" codetocopy="Y3VlIGV4cG9ydCBhLmN1ZSBiLmpzb24gYy5qc29u" >}} $ cue export a.cue b.json c.json { "x": 5 diff --git a/internal/cmd/preprocessor/cmd/testdata/execute_format_input_cue.txtar b/internal/cmd/preprocessor/cmd/testdata/execute_format_input_cue.txtar index 877bda122..cdb6bb591 100644 --- a/internal/cmd/preprocessor/cmd/testdata/execute_format_input_cue.txtar +++ b/internal/cmd/preprocessor/cmd/testdata/execute_format_input_cue.txtar @@ -50,12 +50,12 @@ content: dir1: page: { title: title --- {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} { x: 5 } {{< /code-tab >}} -{{< code-tab name="CUE" language="cue" type="terminal" area="top-right" >}} +{{< code-tab name="CUE" language="cue" area="top-right" type="terminal" >}} x: 5 {{< /code-tab >}} {{< /code-tabs >}} diff --git a/internal/cmd/preprocessor/cmd/testdata/execute_format_input_json.txtar b/internal/cmd/preprocessor/cmd/testdata/execute_format_input_json.txtar index 63ca78b1e..d69be16db 100644 --- a/internal/cmd/preprocessor/cmd/testdata/execute_format_input_json.txtar +++ b/internal/cmd/preprocessor/cmd/testdata/execute_format_input_json.txtar @@ -52,12 +52,12 @@ content: dir1: page: { title: title --- {{< code-tabs >}} -{{< code-tab name="JSON" language="json" area="top-left" >}} +{{< code-tab name="JSON" language="json" area="top-left" >}} { "x": 5 } {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "x": 5 } diff --git a/internal/cmd/preprocessor/cmd/testdata/execute_format_input_yaml.txtar b/internal/cmd/preprocessor/cmd/testdata/execute_format_input_yaml.txtar index 23edde8ce..b01d813d6 100644 --- a/internal/cmd/preprocessor/cmd/testdata/execute_format_input_yaml.txtar +++ b/internal/cmd/preprocessor/cmd/testdata/execute_format_input_yaml.txtar @@ -46,10 +46,10 @@ content: dir1: page: { title: title --- {{< code-tabs >}} -{{< code-tab name="YAML" language="yaml" area="top-left" >}} +{{< code-tab name="YAML" language="yaml" area="top-left" >}} {"x": 5} {{< /code-tab >}} -{{< code-tab name="YAML" language="yaml" type="terminal" area="top-right" >}} +{{< code-tab name="YAML" language="yaml" area="top-right" type="terminal" >}} x: 5 {{< /code-tab >}} {{< /code-tabs >}} diff --git a/internal/cmd/preprocessor/cmd/testdata/execute_in_out_pattern.txtar b/internal/cmd/preprocessor/cmd/testdata/execute_in_out_pattern.txtar index 87c89ddc4..6f63b1162 100644 --- a/internal/cmd/preprocessor/cmd/testdata/execute_in_out_pattern.txtar +++ b/internal/cmd/preprocessor/cmd/testdata/execute_in_out_pattern.txtar @@ -76,14 +76,14 @@ title: JSON Superset Some text before {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} // A doc comment map: { member1: 3 // a line comment member2: 4 } {{< /code-tab >}} -{{< code-tab name="JSON" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="JSON" language="json" area="top-right" type="terminal" >}} { "map": { "member1": 3, diff --git a/internal/cmd/preprocessor/cmd/testdata/execute_multiple.txtar b/internal/cmd/preprocessor/cmd/testdata/execute_multiple.txtar index 60a54f0af..06c2a0097 100644 --- a/internal/cmd/preprocessor/cmd/testdata/execute_multiple.txtar +++ b/internal/cmd/preprocessor/cmd/testdata/execute_multiple.txtar @@ -86,14 +86,14 @@ title: JSON Superset Some text before {{< code-tabs >}} -{{< code-tab name="in.cue" language="cue" area="top-left" >}} +{{< code-tab name="in.cue" language="cue" area="top-left" >}} // A doc comment map: { member1: 3 // a line comment member2: 4 } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="json" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydCBpbi5jdWU=" >}} $ cue export in.cue { "map": { @@ -107,14 +107,14 @@ $ cue export in.cue Some text after {{< code-tabs >}} -{{< code-tab name="in.cue" language="cue" area="top-left" >}} +{{< code-tab name="in.cue" language="cue" area="top-left" >}} // A doc comment map: { member1: 3 // a line comment member2: 4 } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="json" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydCBpbi5jdWU=" >}} $ cue export in.cue { "map": { @@ -183,14 +183,14 @@ title: JSON Superset Some text before {{< code-tabs >}} -{{< code-tab name="in.cue" language="cue" area="top-left" >}} +{{< code-tab name="in.cue" language="cue" area="top-left" >}} // A doc comment map: { member1: 3 // a line comment member2: 4 } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="json" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydCBpbi5jdWU=" >}} $ cue export in.cue { "map": { @@ -204,14 +204,14 @@ $ cue export in.cue Some text after {{< code-tabs >}} -{{< code-tab name="in.cue" language="cue" area="top-left" >}} +{{< code-tab name="in.cue" language="cue" area="top-left" >}} // A doc comment map: { member1: 3 // a line comment member2: 4 } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="json" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydCBpbi5jdWU=" >}} $ cue export in.cue { "map": { diff --git a/internal/cmd/preprocessor/cmd/testdata/execute_transform.txtar b/internal/cmd/preprocessor/cmd/testdata/execute_transform.txtar index 4574f412b..6a04b6e81 100644 --- a/internal/cmd/preprocessor/cmd/testdata/execute_transform.txtar +++ b/internal/cmd/preprocessor/cmd/testdata/execute_transform.txtar @@ -91,14 +91,14 @@ Some text before {{< step stepNumber="1" >}} {{< code-tabs >}} -{{< code-tab name="in.cue" language="cue" area="top-left" >}} +{{< code-tab name="in.cue" language="cue" area="top-left" >}} // A doc comment map: { member1: 3 // a line comment member2: 4 } {{< /code-tab >}} -{{< code-tab name="TERMINAL" language="json" type="terminal" area="top-right" >}} +{{< code-tab name="TERMINAL" language="json" area="top-right" type="terminal" codetocopy="Y3VlIGV4cG9ydCBpbi5jdWU=" >}} $ cue export in.cue { "map": { diff --git a/internal/cmd/preprocessor/cmd/testdata/execute_transform_error_output.txtar b/internal/cmd/preprocessor/cmd/testdata/execute_transform_error_output.txtar index 5259e5183..09192e9bb 100644 --- a/internal/cmd/preprocessor/cmd/testdata/execute_transform_error_output.txtar +++ b/internal/cmd/preprocessor/cmd/testdata/execute_transform_error_output.txtar @@ -55,11 +55,11 @@ title: JSON Superset Some text before {{< code-tabs >}} -{{< code-tab name="CUE" language="cue" area="top-left" >}} +{{< code-tab name="CUE" language="cue" area="top-left" >}} e: =~"foo" e: "bar" {{< /code-tab >}} -{{< code-tab name="ERR" language="err" type="terminal" area="top-right" >}} +{{< code-tab name="ERR" language="err" area="top-right" type="terminal" >}} e: invalid value "bar" (out of bound =~"foo"): ./in.cue:1:4 ./in.cue:2:4