Skip to content

Commit

Permalink
docs/*: use linkto/related/ shortcodes
Browse files Browse the repository at this point in the history
This modifies all "Related content" sections to use
linkto/related/{concept,howto,reference,tutorial} shortcodes where
appropriate.

Preview-Path: /docs/howto/combine-multiple-json-files-by-using-file-metadata/
Preview-Path: /docs/howto/combine-multiple-json-files-into-a-list/
Preview-Path: /docs/howto/combine-multiple-yaml-files-by-using-file-metadata/
Preview-Path: /docs/howto/combine-multiple-yaml-files-into-a-list/
Preview-Path: /docs/howto/export-fields-whose-names-are-not-valid-identifiers/
Preview-Path: /docs/howto/refer-to-fields-whose-names-are-not-valid-identifiers/
Preview-Path: /docs/howto/use-list-contains-as-a-field-validator/
Preview-Path: /docs/howto/use-list-contains-to-report-if-a-value-is-in-a-list/
Preview-Path: /docs/howto/use-list-issorted-as-a-field-validator/
Preview-Path: /docs/howto/use-list-issorted-to-report-if-lists-are-sorted/
Preview-Path: /docs/howto/use-list-issortedstrings-as-a-field-validator/
Preview-Path: /docs/howto/use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted/
Preview-Path: /docs/howto/use-list-sort-to-sort-lists/
Preview-Path: /docs/howto/use-list-sortstrings-to-sort-lists-of-strings/
Preview-Path: /docs/howto/use-net-ip-to-validate-ip-addresses/
Preview-Path: /docs/howto/use-net-ipcidr-to-validate-ip-cidr-ranges/
Preview-Path: /docs/howto/use-net-ipv4-to-validate-ipv4-addresses/
Preview-Path: /docs/howto/use-the-built-in-function-len/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: Id3e3c87e8e11b52cfcb7b5976437dfd6fb201296
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1176815
Reviewed-by: Paul Jolly <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
jpluscplusm committed Feb 13, 2024
1 parent 8017ed3 commit c23543d
Show file tree
Hide file tree
Showing 36 changed files with 74 additions and 212 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ output: {

## Related content

- [Combining multiple YAML files by using file metadata]({{< relref
"../combine-multiple-yaml-files-by-using-file-metadata"
>}})
- [cue help flags]({{< relref
"docs/reference/cli/cue-flags"
>}}) documents the `--with-context` and `-l` flags
- {{< linkto/related/howto "combine-multiple-yaml-files-by-using-file-metadata" >}}
- {{< linkto/related/reference "cli/cue-flags" >}}
documents the `--with-context` and `-l` flags
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ contents: [for _name in sortedInputs {

## Related content

- [Combining multiple YAML files into a list]({{< relref
"../combine-multiple-yaml-files-into-a-list"
>}})
- [cue help flags]({{< relref
"docs/reference/cli/cue-flags"
>}}) documents the `--with-context` and `-l` flags
- {{< linkto/related/howto "combine-multiple-yaml-files-into-a-list" >}}
- {{< linkto/related/reference "cli/cue-flags" >}}
documents the `--with-context` and `-l` flags
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ c.yaml:

## Related content

- [Combining multiple JSON files by using file metadata]({{< relref
"../combine-multiple-json-files-by-using-file-metadata"
>}})
- [cue help flags]({{< relref
"docs/reference/cli/cue-flags"
>}}) documents the `--with-context` and `-l` flags
- {{< linkto/related/howto "combine-multiple-json-files-by-using-file-metadata" >}}
- {{< linkto/related/reference "cli/cue-flags" >}}
documents the `--with-context` and `-l` flags
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ contents:

## Related content

- [Combining multiple YAML files into a list]({{< relref
"../combine-multiple-yaml-files-into-a-list"
>}})
- [cue help flags]({{< relref
"docs/reference/cli/cue-flags"
>}}) documents the `--with-context` and `-l` flags
- {{< linkto/related/howto "combine-multiple-yaml-files-into-a-list" >}}
- {{< linkto/related/reference "cli/cue-flags" >}}
documents the `--with-context` and `-l` flags
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,4 @@ cmp stdout out

## Related content

- How to use CUE's language features to
[refer to fields whose names are not valid identifiers]({{< relref
"../refer-to-fields-whose-names-are-not-valid-identifiers"
>}}).
- {{< linkto/related/howto "refer-to-fields-whose-names-are-not-valid-identifiers" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,4 @@ output: {

## Related content

- How to
[export fields whose names are not valid identifiers]({{< relref
"../export-fields-whose-names-are-not-valid-identifiers"
>}}), and where *a separate CUE file cannot be created*.
- {{< linkto/related/howto "export-fields-whose-names-are-not-valid-identifiers" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,5 @@ will be linked to from this guide.

## Related content

- `list.Contains` can also be used
[to report if a value is in a list]({{< relref
"../use-list-contains-to-report-if-a-value-is-in-a-list"
>}})
- {{< linkto/related/howto "use-list-contains-to-report-if-a-value-is-in-a-list" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,5 @@ will be linked to from this guide.

## Related content

- `list.Contains` can also be used
[as a field validator]({{< relref
"../use-list-contains-as-a-field-validator"
>}})
- {{< linkto/related/howto "use-list-contains-as-a-field-validator" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
12 changes: 3 additions & 9 deletions content/docs/howto/use-list-issorted-as-a-field-validator/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,7 @@ stringsCountDescending: invalid value ["@","@@","X"] (does not satisfy list.IsSo
## Related content

- [`list.Sort`](https://pkg.go.dev/cuelang.org/go/pkg/list#Sort) documents the
comparator schema and fields.
- `list.IsSorted` can also be used
[to return a list's sort status as a boolean]({{< relref
"../use-list-issorted-to-report-if-lists-are-sorted"
>}})
- Use `list.IsSortStrings`
[to validate that lists of strings are sorted alphabetically]({{< relref
"../use-list-issortedstrings-as-a-field-validator"
>}}) without needing to define a comparator
comparator schema and fields
- {{< linkto/related/howto "use-list-issorted-to-report-if-lists-are-sorted" >}}
- {{< linkto/related/howto "use-list-issortedstrings-as-a-field-validator" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,7 @@ stringsCountDescendingFalse: false
## Related content

- [`list.Sort`](https://pkg.go.dev/cuelang.org/go/pkg/list#Sort) documents the
comparator schema and fields.
- `list.IsSorted` can also be used [as a field validator]({{< relref
"../use-list-issorted-as-a-field-validator"
>}})
- Use `list.IsSortStrings`
[to test and report if lists of strings are sorted alphabetically]({{< relref
"../use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted"
>}}) without needing to define a comparator
comparator schema and fields
- {{< linkto/related/howto "use-list-issorted-as-a-field-validator" >}}
- {{< linkto/related/howto "use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ unsorted: invalid value ["B","C","A"] (does not satisfy list.IsSortedStrings):

## Related content

- `list.IsSortedStrings` can also be used
[to return a list's sort status as a boolean]({{< relref
"../use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted"
>}})
- `list.IsSortedStrings` only validates if lists of strings are sorted
alphabetically - use `list.IsSorted`
[to validate any other list type or sort order]({{< relref
"../use-list-issorted-as-a-field-validator"
>}})
- {{< linkto/related/howto "use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted" >}}
- {{< linkto/related/howto "use-list-issorted-as-a-field-validator" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ testSorted: true

## Related content

- `list.IsSortedStrings` can also be used
[as a field validator]({{< relref
"../use-list-issortedstrings-as-a-field-validator"
>}})
- `list.IsSortedStrings` only tests if lists of strings are sorted
alphabetically - use `list.Sort`
[to test any other list type or sort order]({{< relref
"../use-list-issorted-to-report-if-lists-are-sorted"
>}})
- {{< linkto/related/howto "use-list-issortedstrings-as-a-field-validator" >}}
- {{< linkto/related/howto "use-list-issorted-to-report-if-lists-are-sorted" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
5 changes: 1 addition & 4 deletions content/docs/howto/use-list-sort-to-sort-lists/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,5 @@ stringsCountDescending: ["@@", "@", "X"]

- [`list.Sort`](https://pkg.go.dev/cuelang.org/go/pkg/list#Sort) documents the
comparator schema and fields.
- Use `list.SortStrings`
[to sort lists of strings alphabetically]({{< relref
"../use-list-sortstrings-to-sort-lists-of-strings"
>}}) without needing to define a comparator
- {{< linkto/related/howto "use-list-sortstrings-to-sort-lists-of-strings" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,5 @@ sorted: ["A", "B", "C"]

## Related content

- `list.SortStrings` only sorts lists of strings alphabetically - use
`list.Sort`
[to apply any other sort order]({{< relref
"../use-list-sort-to-sort-lists"
>}})
- {{< linkto/related/howto "use-list-sort-to-sort-lists" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
8 changes: 2 additions & 6 deletions content/docs/howto/use-net-ip-to-validate-ip-addresses/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,5 @@ v6ByteTooLarge: invalid value [300,1,13,184,133,163,0,0,1,0,138,46,3,112,115,52]
## Related content

- The [`net`](https://pkg.go.dev/cuelang.org/go/pkg/net) built-in package
- [Using "net.IPv4" to validate IPv4 addresses]({{< relref
"use-net-ipv4-to-validate-ipv4-addresses"
>}})
- [Using "net.IPCIDR" to validate IP CIDR ranges]({{< relref
"use-net-ipcidr-to-validate-ip-cidr-ranges"
>}})
- {{< linkto/related/howto "use-net-ipv4-to-validate-ipv4-addresses" >}}
- {{< linkto/related/howto "use-net-ipcidr-to-validate-ip-cidr-ranges" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,5 @@ v6MalformedPrefix: invalid value ":::1/128" (does not satisfy net.IPCIDR): error
## Related content

- The [`net`](https://pkg.go.dev/cuelang.org/go/pkg/net) built-in package
- [Using "net.IP" to validate IP addresses]({{< relref
"use-net-ip-to-validate-ip-addresses"
>}})
- [Using "net.IPv4" to validate IPv4 addresses]({{< relref
"use-net-ipv4-to-validate-ipv4-addresses"
>}})
- {{< linkto/related/howto "use-net-ip-to-validate-ip-addresses" >}}
- {{< linkto/related/howto "use-net-ipv4-to-validate-ipv4-addresses" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,5 @@ v6NotV4: invalid value "2001:0db8:85a3::8a2e:0370:7334" (does not satisfy net.IP
## Related content

- The [`net`](https://pkg.go.dev/cuelang.org/go/pkg/net) built-in package
- [Using "net.IP" to validate IP addresses]({{< relref
"use-net-ip-to-validate-ip-addresses"
>}})
- [Using "net.IPCIDR" to validate IP CIDR ranges]({{< relref
"use-net-ipcidr-to-validate-ip-cidr-ranges"
>}})
- {{< linkto/related/howto "use-net-ip-to-validate-ip-addresses" >}}
- {{< linkto/related/howto "use-net-ipcidr-to-validate-ip-cidr-ranges" >}}
7 changes: 3 additions & 4 deletions content/docs/howto/use-the-built-in-function-len/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ b: len("😎abc123🥶")

## Related content

- Don't use the `len()` function on a string, for the reason mentioned above.\
Instead, learn
[how to constrain the length of a string]({{< relref "docs/howto/constrain-the-length-of-a-string" >}})
using functions from the CUE `strings` standard package.
- Don't use the `len` function on a string, for the reason mentioned above.\
{{< linkto/related/howto "constrain-the-length-of-a-string" >}}
demonstrates using functions from the built-in `strings` package instead
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ $ cue export --with-context -l 'inputs:' -l 'path.Base(filename)' -e output a.js

## Related content

- [Combining multiple YAML files by using file metadata]({{< relref
"../combine-multiple-yaml-files-by-using-file-metadata"
>}})
- [cue help flags]({{< relref
"docs/reference/cli/cue-flags"
>}}) documents the `--with-context` and `-l` flags
- {{< linkto/related/howto "combine-multiple-yaml-files-by-using-file-metadata" >}}
- {{< linkto/related/reference "cli/cue-flags" >}}
documents the `--with-context` and `-l` flags
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ $ cue export --with-context -l '_inputs:' -l filename a.json b.json c.json examp

## Related content

- [Combining multiple YAML files into a list]({{< relref
"../combine-multiple-yaml-files-into-a-list"
>}})
- [cue help flags]({{< relref
"docs/reference/cli/cue-flags"
>}}) documents the `--with-context` and `-l` flags
- {{< linkto/related/howto "combine-multiple-yaml-files-into-a-list" >}}
- {{< linkto/related/reference "cli/cue-flags" >}}
documents the `--with-context` and `-l` flags
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ c.yaml:

## Related content

- [Combining multiple JSON files by using file metadata]({{< relref
"../combine-multiple-json-files-by-using-file-metadata"
>}})
- [cue help flags]({{< relref
"docs/reference/cli/cue-flags"
>}}) documents the `--with-context` and `-l` flags
- {{< linkto/related/howto "combine-multiple-json-files-by-using-file-metadata" >}}
- {{< linkto/related/reference "cli/cue-flags" >}}
documents the `--with-context` and `-l` flags
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ contents:

## Related content

- [Combining multiple YAML files into a list]({{< relref
"../combine-multiple-yaml-files-into-a-list"
>}})
- [cue help flags]({{< relref
"docs/reference/cli/cue-flags"
>}}) documents the `--with-context` and `-l` flags
- {{< linkto/related/howto "combine-multiple-yaml-files-into-a-list" >}}
- {{< linkto/related/reference "cli/cue-flags" >}}
documents the `--with-context` and `-l` flags
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,4 @@ $ cue export -l input: data.yml -e 'input["top level field"]'

## Related content

- How to use CUE's language features to
[refer to fields whose names are not valid identifiers]({{< relref
"../refer-to-fields-whose-names-are-not-valid-identifiers"
>}}).
- {{< linkto/related/howto "refer-to-fields-whose-names-are-not-valid-identifiers" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,4 @@ $ cue export -e output

## Related content

- How to
[export fields whose names are not valid identifiers]({{< relref
"../export-fields-whose-names-are-not-valid-identifiers"
>}}), and where *a separate CUE file cannot be created*.
- {{< linkto/related/howto "export-fields-whose-names-are-not-valid-identifiers" >}}
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,5 @@ will be linked to from this guide.

## Related content

- `list.Contains` can also be used
[to report if a value is in a list]({{< relref
"../use-list-contains-to-report-if-a-value-is-in-a-list"
>}})
- {{< linkto/related/howto "use-list-contains-to-report-if-a-value-is-in-a-list" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,5 @@ will be linked to from this guide.

## Related content

- `list.Contains` can also be used
[as a field validator]({{< relref
"../use-list-contains-as-a-field-validator"
>}})
- {{< linkto/related/howto "use-list-contains-as-a-field-validator" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,7 @@ stringsCountDescending: invalid value ["@","@@","X"] (does not satisfy list.IsSo
## Related content

- [`list.Sort`](https://pkg.go.dev/cuelang.org/go/pkg/list#Sort) documents the
comparator schema and fields.
- `list.IsSorted` can also be used
[to return a list's sort status as a boolean]({{< relref
"../use-list-issorted-to-report-if-lists-are-sorted"
>}})
- Use `list.IsSortStrings`
[to validate that lists of strings are sorted alphabetically]({{< relref
"../use-list-issortedstrings-as-a-field-validator"
>}}) without needing to define a comparator
comparator schema and fields
- {{< linkto/related/howto "use-list-issorted-to-report-if-lists-are-sorted" >}}
- {{< linkto/related/howto "use-list-issortedstrings-as-a-field-validator" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,7 @@ stringsCountDescendingFalse: false
## Related content

- [`list.Sort`](https://pkg.go.dev/cuelang.org/go/pkg/list#Sort) documents the
comparator schema and fields.
- `list.IsSorted` can also be used [as a field validator]({{< relref
"../use-list-issorted-as-a-field-validator"
>}})
- Use `list.IsSortStrings`
[to test and report if lists of strings are sorted alphabetically]({{< relref
"../use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted"
>}}) without needing to define a comparator
comparator schema and fields
- {{< linkto/related/howto "use-list-issorted-as-a-field-validator" >}}
- {{< linkto/related/howto "use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ unsorted: invalid value ["B","C","A"] (does not satisfy list.IsSortedStrings):

## Related content

- `list.IsSortedStrings` can also be used
[to return a list's sort status as a boolean]({{< relref
"../use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted"
>}})
- `list.IsSortedStrings` only validates if lists of strings are sorted
alphabetically - use `list.IsSorted`
[to validate any other list type or sort order]({{< relref
"../use-list-issorted-as-a-field-validator"
>}})
- {{< linkto/related/howto "use-list-issortedstrings-to-report-if-lists-of-strings-are-sorted" >}}
- {{< linkto/related/howto "use-list-issorted-as-a-field-validator" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ testSorted: true

## Related content

- `list.IsSortedStrings` can also be used
[as a field validator]({{< relref
"../use-list-issortedstrings-as-a-field-validator"
>}})
- `list.IsSortedStrings` only tests if lists of strings are sorted
alphabetically - use `list.Sort`
[to test any other list type or sort order]({{< relref
"../use-list-issorted-to-report-if-lists-are-sorted"
>}})
- {{< linkto/related/howto "use-list-issortedstrings-as-a-field-validator" >}}
- {{< linkto/related/howto "use-list-issorted-to-report-if-lists-are-sorted" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,5 @@ stringsCountDescending: ["@@", "@", "X"]

- [`list.Sort`](https://pkg.go.dev/cuelang.org/go/pkg/list#Sort) documents the
comparator schema and fields.
- Use `list.SortStrings`
[to sort lists of strings alphabetically]({{< relref
"../use-list-sortstrings-to-sort-lists-of-strings"
>}}) without needing to define a comparator
- {{< linkto/related/howto "use-list-sortstrings-to-sort-lists-of-strings" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,5 @@ sorted: ["A", "B", "C"]

## Related content

- `list.SortStrings` only sorts lists of strings alphabetically - use
`list.Sort`
[to apply any other sort order]({{< relref
"../use-list-sort-to-sort-lists"
>}})
- {{< linkto/related/howto "use-list-sort-to-sort-lists" >}}
- The [`list`](https://pkg.go.dev/cuelang.org/go/pkg/list) built-in package
Loading

0 comments on commit c23543d

Please sign in to comment.