Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions layouts/sbx-cli.markdown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{{- $data := index hugo.Data.sbx_cli .Params.datafile -}}
# {{ .Title }}

{{ with $data.synopsis }}**Description:** {{ strings.TrimSpace . }}{{ end }}

{{ with $data.usage }}**Usage:** `{{ . }}`{{ end }}

{{ if $data.experimental }}> [!NOTE]
> **Experimental**
>
> This command is experimental. Experimental features are intended for testing and feedback as their functionality or design may change between releases without warning or can be removed entirely in a future release.
{{ end }}

{{ with $data.description }}## Description

{{ . }}
Comment thread
dvdksn marked this conversation as resolved.
Resolved
{{ end }}

{{ if eq .Kind "section" }}## Commands

| Command | Description |
|---------|-------------|
{{ range .Pages }}{{ if .Params.datafile }}{{ $child := index hugo.Data.sbx_cli .Params.datafile }}| [`{{ .Title }}`]({{ .Permalink }}) | {{ if $child.experimental }}**experimental** {{ end }}{{ strings.TrimSpace $child.synopsis }} |
{{ end }}{{ end }}
{{ end }}

{{ with $data.options }}{{ $opts := where . "name" "ne" "help" }}{{ with $opts }}## Options

| Option | Default | Description |
|--------|---------|-------------|
{{ range . }}| {{ with .shorthand }}`-{{ . }}`, {{ end }}`--{{ .name }}` | {{ with .default_value }}{{ $skipDefault := `[],false,` }}{{ cond (in $skipDefault .) "" (printf "`%s`" .) }}{{ end }} | {{ if .experimental }}**experimental** {{ end }}{{ with .usage }}{{ strings.Replace (strings.Replace (strings.TrimSpace .) "\n" "<br>") "|" "\\|" }}{{ end }} |
{{ end }}
{{ end }}{{ end }}

{{ with $data.inherited_options }}{{ $opts := where . "name" "ne" "help" }}{{ with $opts }}## Global options

| Option | Default | Description |
|--------|---------|-------------|
{{ range . }}| {{ with .shorthand }}`-{{ . }}`, {{ end }}`--{{ .name }}` | {{ with .default_value }}{{ $skipDefault := `[],false,` }}{{ cond (in $skipDefault .) "" (printf "`%s`" .) }}{{ end }} | {{ if .experimental }}**experimental** {{ end }}{{ with .usage }}{{ strings.Replace (strings.Replace (strings.TrimSpace .) "\n" "<br>") "|" "\\|" }}{{ end }} |
Comment thread
dvdksn marked this conversation as resolved.
Resolved
{{ end }}
{{ end }}{{ end }}

{{ with $data.example }}## Examples

{{ $dedented := replaceRE `(?m)^ {2,6}` "" . }}{{ printf "```console\n%s\n```" (strings.TrimSpace $dedented) }}
{{ end }}