Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
doc/tutorial/basics: some minor fixes
Browse files Browse the repository at this point in the history
preparing for transformation to Hugo, mostlyl

Change-Id: Iac74644a5e781912fd1e45cc39f60baa05d27683
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/3263
Reviewed-by: Marcel van Lohuizen <[email protected]>
  • Loading branch information
mpvl committed Sep 12, 2019
1 parent 92408e3 commit d44b092
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 24 deletions.
4 changes: 2 additions & 2 deletions doc/tutorial/basics/bytes.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Bytes are converted to base64 when emitting JSON.
Byte literals are defined with single quotes.
The following additional escape sequences are allowed in byte literals:

\xnn // arbitrary byte value defined as a 2-digit hexadecimal number
\xnn // arbitrary byte value defined as a 2-digit hexadecimal number
\nnn // arbitrary byte value defined as a 3-digit octal number
<!-- jba: this contradicts the spec, which has \nnn (no leading zero) -->

Expand All @@ -19,7 +19,7 @@ _bytes.cue:_
a: '\x03abc'
```

<!-- JSON result -->
<!-- result -->
`$ cue export bytes.cue`
```json
{
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/basics/commas.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ _commas.cue:_
```


<!-- JSON result -->
<!-- result -->
`$ cue export commas.cue`
```json
{
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/basics/commaslists.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ _commas2.cue:_
]
```

<!-- JSON result -->
<!-- result -->
`$ cue export commas2.cue`
```json
[
Expand Down
4 changes: 2 additions & 2 deletions doc/tutorial/basics/comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ one: 1
two: 2 // a line comment
```

<!-- JSON result -->
<!-- result -->
`$ cue export comments.cue`
```json
{
"one": 1,
"two": 2,
"two": 2
}
```
2 changes: 1 addition & 1 deletion doc/tutorial/basics/curly.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ two: 2
"two-and-a-half": 2.5
```

<!-- JSON result -->
<!-- result -->
`$ cue export curly.cue`
```json
{
Expand Down
1 change: 1 addition & 0 deletions doc/tutorial/basics/disjunctions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ It is an error for a concrete `conn`
to define anything else than these two values.

<!-- CUE editor -->
_disjunctions.cue_
```
conn: {
address: string
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/basics/fieldname.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ _fieldname.cue:_
}
```

<!-- JSON result -->
<!-- result -->
`$ cue export fieldname.cue`
```json
{
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/basics/fold.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ _fold.cue:_
outer middle inner: 3
```

<!-- JSON result -->
<!-- result -->
`$ cue export fold.cue`
```json
{
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/basics/foldany.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ outer middle1 inner: 3
outer middle2 inner: 7
```

<!-- JSON result -->
<!-- result -->
`$ cue export foldany.cue`
```json
{
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/basics/numberlit.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ _numlit.cue:_
]
```

<!-- JSON result -->
<!-- result -->
`$ cue export numlit.cue`
```json
[
Expand Down
2 changes: 1 addition & 1 deletion doc/tutorial/basics/stringlit.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ b: """
"""
```

<!-- JSON result -->
<!-- result -->
`$ cue export stringlit.cue`
```json
{
Expand Down
8 changes: 3 additions & 5 deletions doc/tutorial/basics/stringraw.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,16 @@ msg2: ##"""
"""##
```

<!-- JSON result -->
<!-- result -->
`$ cue eval stringraw.cue`
```
{
msg1: "The sequence \"\\U0001F604\" renders as 😄."
msg2: """
msg1: "The sequence \"\\U0001F604\" renders as 😄."
msg2: """
A regular expression can conveniently be written as:
#\"\\d{3}\"#
This construct works for bytes, strings and their
multi-line variants.
"""
}
```
2 changes: 1 addition & 1 deletion doc/tutorial/basics/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ job nginx: {
}
```

<!-- JSON result -->
<!-- result -->
`$ cue eval templates.cue`
```
job: {
Expand Down
7 changes: 1 addition & 6 deletions doc/tutorial/basics/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ _Types ~~and~~ are Values_
CUE defines the following basic types

```
null
bool
string
bytes
int
float
null bool string bytes int float
```
in addition to the error type mentioned in the previous section.

Expand Down

0 comments on commit d44b092

Please sign in to comment.