mirror of https://github.com/docker/docs.git
Merge pull request #19539 from dvdksn/cli-reference-tpl-fixups
cli reference template improvements
This commit is contained in:
commit
6a1bb3da95
|
@ -94,6 +94,8 @@
|
|||
{{ . | $.RenderString (dict "display" "block") }}
|
||||
{{ end }}
|
||||
{{ with $data.options }}
|
||||
{{ $opts := where . "hidden" false }}
|
||||
{{ with $opts }}
|
||||
{{ $heading := dict "level" 2 "text" "Options" }}
|
||||
{{ partial "heading.html" $heading }}
|
||||
{{ $.Scratch.Add "headings" $heading }}
|
||||
|
@ -106,7 +108,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range where . "hidden" false }}
|
||||
{{ range . }}
|
||||
<tr>
|
||||
{{ $short := .shorthand }}
|
||||
{{ $long := .option }}
|
||||
|
@ -154,6 +156,7 @@
|
|||
</tbody>
|
||||
</table>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with $data.examples }}
|
||||
{{ $heading := dict "level" 2 "text" "Examples" }}
|
||||
{{ partial "heading.html" $heading }}
|
||||
|
@ -166,6 +169,28 @@
|
|||
{{ end }}
|
||||
{{ $.RenderString (dict "display" "block") . }}
|
||||
{{ end }}
|
||||
{{ if eq .Kind "section" }}
|
||||
{{ $heading := dict "level" 2 "text" "Subcommands" }}
|
||||
{{ partial "heading.html" $heading }}
|
||||
{{ $.Scratch.Add "headings" $heading }}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left">Command</th>
|
||||
<th class="text-left">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range .Pages }}
|
||||
<tr>
|
||||
<td class="text-left"><a class="link" href="{{ .Permalink }}"><code>{{ .Title }}</code></a></th>
|
||||
{{ $data := index (index site.Data .Params.datafolder) .Params.datafile }}
|
||||
<td class="text-left">{{ $data.short }}</th>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
||||
|
|
Loading…
Reference in New Issue