Skip to content

Commit

Permalink
docs: make CUE example more exciting
Browse files Browse the repository at this point in the history
This updates the trivial CUE example on /docs so that it drops an early
breadcrumb around the concept of order irrelevance and also includes a
non-static constraint.

Preview-Path: /docs/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I974c7b259766beaf01bf247e224f23d30254d9e1
Dispatch-Trailer: {"type":"trybot","CL":1199560,"patchset":1,"ref":"refs/changes/60/1199560/1","targetBranch":"master"}
  • Loading branch information
jpluscplusm authored and cueckoo committed Aug 15, 2024
1 parent 1590a90 commit e00b86f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions content/docs/_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ enable data, schema, and policy constraints to coexist seamlessly:
! exec cue vet example.cue
cmp stderr out
-- example.cue --
length: 20 & int
width: 10.1 & >10 // Must be greater than 10
area: length * width
area: <=100 // Must be less than or equal to 100
area: <100 // Must be less than 100
width: 10.1 & >10 // Must be greater than 10
length: 20 & >width // Must be greater than width
-- out --
area: invalid value 202.0 (out of bound <=100):
./example.cue:4:9
./example.cue:3:9
area: invalid value 202.0 (out of bound <100):
./example.cue:2:9
./example.cue:1:9
{{{end}}}

CUE supports and simplifies a wide variety of applications, such as
Expand Down
2 changes: 1 addition & 1 deletion content/docs/gen_cache.cue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package site
page: {
cache: {
code: {
example: "Upd/bTuqJ3DDUc172utkfnh80U7Ks83RbeEMb/dwUAI="
example: "w+fEarQLesKpdGK1M/MIDRQFcO/RUUEZaKRYfrTMJls="
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions hugo/content/en/docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ enable data, schema, and policy constraints to coexist seamlessly:

{{< code-tabs >}}
{{< code-tab name="example.cue" language="cue" area="left" >}}
length: 20 & int
width: 10.1 & >10 // Must be greater than 10
area: length * width
area: <=100 // Must be less than or equal to 100
area: <100 // Must be less than 100
width: 10.1 & >10 // Must be greater than 10
length: 20 & >width // Must be greater than width
{{< /code-tab >}}
{{< code-tab name="TERMINAL" language="" area="right" type="terminal" codetocopy="Y3VlIHZldCBleGFtcGxlLmN1ZQ==" >}}
$ cue vet example.cue
area: invalid value 202.0 (out of bound <=100):
./example.cue:4:9
./example.cue:3:9
area: invalid value 202.0 (out of bound <100):
./example.cue:2:9
./example.cue:1:9
{{< /code-tab >}}
{{< /code-tabs >}}

Expand Down

0 comments on commit e00b86f

Please sign in to comment.