mirror of https://github.com/docker/docs.git
cli: alternative alias rendering
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
36d3f62159
commit
56679aec98
|
@ -13,18 +13,39 @@
|
||||||
{{ .Scratch.Set "subheadings" slice }}
|
{{ .Scratch.Set "subheadings" slice }}
|
||||||
{{ partial "breadcrumbs.html" . }}
|
{{ partial "breadcrumbs.html" . }}
|
||||||
<article class="DocSearch-content prose max-w-none dark:prose-invert">
|
<article class="DocSearch-content prose max-w-none dark:prose-invert">
|
||||||
{{ if ne .LinkTitle .Title }}
|
|
||||||
{{/*
|
|
||||||
we use linkTitle for surfacing popular aliases like "docker run"
|
|
||||||
if linkTitle is set, use both alias and canonical cmd as title
|
|
||||||
*/}}
|
|
||||||
<h1 class="scroll-mt-36">{{ .LinkTitle }}<span
|
|
||||||
class="text-gray-light dark:text-gray-dark"> ({{ .Title }})</span>
|
|
||||||
</h1>
|
|
||||||
{{ else }}
|
|
||||||
<h1 class="scroll-mt-36">{{ .Title }}</h1>
|
<h1 class="scroll-mt-36">{{ .Title }}</h1>
|
||||||
{{ end }}
|
<table>
|
||||||
{{ $data.short | .RenderString (dict "display" "block") }}
|
<tbody>
|
||||||
|
{{ with $data.short }}
|
||||||
|
<tr>
|
||||||
|
<th class="text-left w-32">Description</th>
|
||||||
|
<td>{{ . }}</th>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
{{ with $data.usage }}
|
||||||
|
<tr>
|
||||||
|
<th class="text-left w-32">Usage</th>
|
||||||
|
<td><code>{{ . }}</code></td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
{{ with $data.aliases }}
|
||||||
|
{{ $aliases := strings.Replace . (fmt.Printf "%s, " page.Title) "" }}
|
||||||
|
<tr>
|
||||||
|
<th class="text-left w-32 flex items-center gap-2">
|
||||||
|
<span>Aliases</span>
|
||||||
|
{{ partial "tooltip.html" "An alias is a short or memorable alternative for a longer command." }}
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<div class="flex gap-3">
|
||||||
|
{{ range (strings.Split $aliases ", ") }}
|
||||||
|
<code>{{ . }}</code>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
{{ if $data.deprecated }}
|
{{ if $data.deprecated }}
|
||||||
<blockquote class="warning">
|
<blockquote class="warning">
|
||||||
|
@ -60,23 +81,6 @@
|
||||||
This command works with the Swarm orchestrator.
|
This command works with the Swarm orchestrator.
|
||||||
</p>
|
</p>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with $data.usage }}
|
|
||||||
{{ $heading := dict "level" 2 "text" "Usage" }}
|
|
||||||
{{ partial "heading.html" $heading }}
|
|
||||||
{{ $.Scratch.Add "headings" $heading }}
|
|
||||||
{{ highlight (strings.Replace . "\t" "") "console" }}
|
|
||||||
{{ end }}
|
|
||||||
{{ with $data.aliases }}
|
|
||||||
{{ $heading := dict "level" 2 "text" "Aliases" }}
|
|
||||||
{{ partial "heading.html" $heading }}
|
|
||||||
{{ $aliases := strings.Split . ", " }}
|
|
||||||
<p>The following commands are equivalent and redirect here:</p>
|
|
||||||
<ul>
|
|
||||||
{{ range $aliases }}
|
|
||||||
<li><code>{{ . }}</code></li>
|
|
||||||
{{ end }}
|
|
||||||
</ul>
|
|
||||||
{{ end }}
|
|
||||||
{{ with $data.long }}
|
{{ with $data.long }}
|
||||||
{{ $heading := dict "level" 2 "text" "Description" }}
|
{{ $heading := dict "level" 2 "text" "Description" }}
|
||||||
{{ partial "heading.html" $heading }}
|
{{ partial "heading.html" $heading }}
|
||||||
|
|
Loading…
Reference in New Issue