From e00b86fe72766ceefe34ab0d5417d600d9622a48 Mon Sep 17 00:00:00 2001 From: Jonathan Matthews Date: Thu, 15 Aug 2024 17:24:20 +0100 Subject: [PATCH] docs: make CUE example more exciting 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 Change-Id: I974c7b259766beaf01bf247e224f23d30254d9e1 Dispatch-Trailer: {"type":"trybot","CL":1199560,"patchset":1,"ref":"refs/changes/60/1199560/1","targetBranch":"master"} --- content/docs/_en.md | 12 ++++++------ content/docs/gen_cache.cue | 2 +- hugo/content/en/docs/_index.md | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/content/docs/_en.md b/content/docs/_en.md index 0233b710d8..2ae9e8f4a3 100644 --- a/content/docs/_en.md +++ b/content/docs/_en.md @@ -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 diff --git a/content/docs/gen_cache.cue b/content/docs/gen_cache.cue index 5e1fe84469..42ad5e6318 100644 --- a/content/docs/gen_cache.cue +++ b/content/docs/gen_cache.cue @@ -5,7 +5,7 @@ package site page: { cache: { code: { - example: "Upd/bTuqJ3DDUc172utkfnh80U7Ks83RbeEMb/dwUAI=" + example: "w+fEarQLesKpdGK1M/MIDRQFcO/RUUEZaKRYfrTMJls=" } } } diff --git a/hugo/content/en/docs/_index.md b/hugo/content/en/docs/_index.md index 33e60ac7ad..d377d7e907 100644 --- a/hugo/content/en/docs/_index.md +++ b/hugo/content/en/docs/_index.md @@ -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 >}}