Debian Codegraph @

docs/layouts/_shortcodes/quick-reference.html

raw
1 {{/* gotmplfmt-ignore-all */ -}}
2
3 {{/*
4 Renders the child sections of the given top-level section, listing each child's
5 immediate descendants.
6
7 @param {string} section The top-level section to render.
8
9 @example {{% quick-reference section="/functions" %}}
10 */}}
11
12 {{ $section := "" }}
13 {{ with .Get "section" }}
14 {{ $section = . }}
15 {{ else }}
16 {{ errorf "The %q shortcode requires a 'section' parameter. See %s" .Name .Position }}
17 {{ end }}
18
19 {{ with site.GetPage $section }}
20 {{ range .Sections }}
21 ## {{ .LinkTitle }}{{/* Do not indent. */}}
22 {{ .Description }}{{/* Do not indent. */}}
23 {{ .Content }}
24 {{ with .Pages }}
25 {{ range . }}
26 {{/* Use page Path as the link destination for render hook to resolve correctly. */}}
27 {{ if .Params.isFunctionOrMethod }}
28 [`{{ .LinkTitle }}`]({{ .Path }}){{/* Do not indent. */}}
29 {{ else }}
30 [{{ .LinkTitle }}]({{ .Path }}){{/* Do not indent. */}}
31 {{ end }}
32 : {{ .Description }}{{/* Do not indent. */}}
33 {{ end }}
34 {{ end }}
35 {{ end }}
36 {{ else }}
37 {{ errorf "The %q shortcodes was unable to find the %q section. See %s" .Name $section .Position }}
38 {{ end }}