Skip to content

Commit

Permalink
docs/reference: add modules tag to cmd/cue texts
Browse files Browse the repository at this point in the history
This adds the "modules" tag to the appropriate cmd/cue help text pages.

Also: rename a "functional" regular field to be a hidden field in
/content/docs/reference/command/commands.cue so that

    cue {vet,export} content/docs/reference/command/commands.cue

can work without complaining about non-concrete values.

Preview-Path: /docs/reference/command/cue-help-mod-edit/
Preview-Path: /docs/reference/command/cue-help-mod-fix/
Preview-Path: /docs/reference/command/cue-help-mod-get/
Preview-Path: /docs/reference/command/cue-help-mod-init/
Preview-Path: /docs/reference/command/cue-help-mod-publish/
Preview-Path: /docs/reference/command/cue-help-mod-resolve/
Preview-Path: /docs/reference/command/cue-help-mod-tidy/
Preview-Path: /docs/reference/command/cue-help-mod/
Preview-Path: /docs/reference/command/cue-help-modules/
Preview-Path: /docs/reference/command/cue-help-registryconfig/
Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I234409c1f1a3b305a34a7cab39a3f4b510bf96b8
Dispatch-Trailer: {"type":"trybot","CL":1199971,"patchset":6,"ref":"refs/changes/71/1199971/6","targetBranch":"master"}
  • Loading branch information
jpluscplusm authored and cueckoo committed Aug 28, 2024
1 parent 6acf2a6 commit e08e52f
Show file tree
Hide file tree
Showing 24 changed files with 55 additions and 3 deletions.
33 changes: 31 additions & 2 deletions content/docs/reference/command/commands.cue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

contentRoot: "content/docs/reference/command"
cuePathBase: {
_cuePathBase: {
_input: string
// align this path's prefix with contentRoot
content: docs: reference: command: (_input): page: {}
Expand All @@ -17,6 +17,8 @@ cuePathBase: {
title!: string
execCmd!: string
cuePath!: string
tagSet!: [string]: true // true is chosen over top purely to produce concrete data.
tagList!: [...]

// oldDir is used to populate the page-level "aliases" front matter key,
// temporarily, until our logs show us that few enough inbound links reach
Expand All @@ -31,7 +33,9 @@ cue: [SubCommand=string]: #CueCommand & {
execCmd: *"cue help \(SubCommand)" | _
title: *"cue help \(SubCommand)" | _
oldDir: *"cue-\(_dirSuffix)" | _
cuePath: json.Marshal(cuePathBase & {
tagSet: *{} | _
tagList: [for tag, _ in tagSet {tag}]
cuePath: json.Marshal(_cuePathBase & {
_input: dir
})
}
Expand All @@ -46,6 +50,31 @@ cue: {
}
}

// Hugo page tags
cue: {
[_]: tagSet: "cue command": _
// This can't be reduced to a more general comprehension over the keys of the
// tags.cue field because https://cuelang.org/issues/2013 strikes.
[or(tags.cue.modules)]: tagSet: modules: _
}
// Ensure that all tagged pages exist as actual pages.
tags: "cue": [_]: [...or([for command, _ in cue {command}])]
tags: cue: {
modules: [
"login",
"mod",
"mod edit",
"mod fix",
"mod get",
"mod init",
"mod publish",
"mod resolve",
"mod tidy",
"modules",
"registryconfig",
]
}

// All commands
cue: {
cue: _
Expand Down
1 change: 1 addition & 0 deletions content/docs/reference/command/cue-help-login/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-login/"]
weight: 1000
tags:
- cue command
- modules
---

{{{with script "en" "cue cli help text"}}}
Expand Down
1 change: 1 addition & 0 deletions content/docs/reference/command/cue-help-mod-edit/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-edit/"]
weight: 1000
tags:
- cue command
- modules
---

{{{with script "en" "cue cli help text"}}}
Expand Down
1 change: 1 addition & 0 deletions content/docs/reference/command/cue-help-mod-fix/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-fix/"]
weight: 1000
tags:
- cue command
- modules
---

{{{with script "en" "cue cli help text"}}}
Expand Down
1 change: 1 addition & 0 deletions content/docs/reference/command/cue-help-mod-get/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-get/"]
weight: 1000
tags:
- cue command
- modules
---

{{{with script "en" "cue cli help text"}}}
Expand Down
1 change: 1 addition & 0 deletions content/docs/reference/command/cue-help-mod-init/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-init/"]
weight: 1000
tags:
- cue command
- modules
---

{{{with script "en" "cue cli help text"}}}
Expand Down
1 change: 1 addition & 0 deletions content/docs/reference/command/cue-help-mod-publish/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-publish/"]
weight: 1000
tags:
- cue command
- modules
---

{{{with script "en" "cue cli help text"}}}
Expand Down
1 change: 1 addition & 0 deletions content/docs/reference/command/cue-help-mod-resolve/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-resolve/"]
weight: 1000
tags:
- cue command
- modules
---

{{{with script "en" "cue cli help text"}}}
Expand Down
1 change: 1 addition & 0 deletions content/docs/reference/command/cue-help-mod-tidy/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-tidy/"]
weight: 1000
tags:
- cue command
- modules
---

{{{with script "en" "cue cli help text"}}}
Expand Down
1 change: 1 addition & 0 deletions content/docs/reference/command/cue-help-mod/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod/"]
weight: 1000
tags:
- cue command
- modules
---

{{{with script "en" "cue cli help text"}}}
Expand Down
1 change: 1 addition & 0 deletions content/docs/reference/command/cue-help-modules/en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-modules/"]
weight: 1000
tags:
- cue command
- modules
---

{{{with script "en" "cue cli help text"}}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-registryconfig/"]
weight: 1000
tags:
- cue command
- modules
---

{{{with script "en" "cue cli help text"}}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-login/"]
weight: 1000
tags:
- cue command
- modules
---

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgbG9naW4=" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-edit/"]
weight: 1000
tags:
- cue command
- modules
---

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgbW9kIGVkaXQ=" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-fix/"]
weight: 1000
tags:
- cue command
- modules
---

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgbW9kIGZpeA==" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-get/"]
weight: 1000
tags:
- cue command
- modules
---

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgbW9kIGdldA==" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-init/"]
weight: 1000
tags:
- cue command
- modules
---

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgbW9kIGluaXQ=" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-publish/"]
weight: 1000
tags:
- cue command
- modules
---

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgbW9kIHB1Ymxpc2g=" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-resolve/"]
weight: 1000
tags:
- cue command
- modules
---

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgbW9kIHJlc29sdmU=" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod-tidy/"]
weight: 1000
tags:
- cue command
- modules
---

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgbW9kIHRpZHk=" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-mod/"]
weight: 1000
tags:
- cue command
- modules
---

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgbW9k" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-modules/"]
weight: 1000
tags:
- cue command
- modules
---

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgbW9kdWxlcw==" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aliases: ["/docs/reference/cli/cue-registryconfig/"]
weight: 1000
tags:
- cue command
- modules
---

```text { title="TERMINAL" type="terminal" codeToCopy="Y3VlIGhlbHAgcmVnaXN0cnljb25maWc=" }
Expand Down
3 changes: 2 additions & 1 deletion site.cue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package site
import (
"list"
"strings"
"encoding/yaml"

"github.com/cue-lang/cuelang.org/internal/ci"
"github.com/cue-lang/cuelang.org/internal/ci/base"
Expand Down Expand Up @@ -337,7 +338,7 @@ template: ci.#writefs & {
aliases: ["/docs/reference/cli/\#(cmd.oldDir)/"]
weight: 1000
tags:
- cue command
\#(strings.TrimSuffix(yaml.Marshal(cmd.tagList), "\n"))
---
{{{with script "en" "cue cli help text"}}}
Expand Down

0 comments on commit e08e52f

Please sign in to comment.