...

Text file src/sigs.k8s.io/gateway-api/hack/api-docs/type.tpl

Documentation: sigs.k8s.io/gateway-api/hack/api-docs

     1{{ define "type" }}
     2
     3<h3 id="{{ anchorIDForType . }}">
     4    {{- .Name.Name }}
     5    {{ if eq .Kind "Alias" }}(<code>{{.Underlying}}</code> alias)</p>{{ end -}}
     6    <a class="headerlink" href="#{{ anchorIDForType . }}" title="Permanent link">ΒΆ</a>
     7</h3>
     8{{ with (typeReferences .) }}
     9    <p>
    10        (<em>Appears on:</em>
    11        {{- $prev := "" -}}
    12        {{- range . -}}
    13            {{- if $prev -}}, {{ end -}}
    14            {{ $prev = . }}
    15            <a href="{{ linkForType . }}">{{ typeDisplayName . }}</a>
    16        {{- end -}}
    17        )
    18    </p>
    19{{ end }}
    20
    21
    22<p>
    23    {{ safe (renderComments .CommentLines) }}
    24</p>
    25
    26{{ with (constantsOfType .) }}
    27<table>
    28    <thead>
    29        <tr>
    30            <th>Value</th>
    31            <th>Description</th>
    32        </tr>
    33    </thead>
    34    <tbody>
    35      {{- range . -}}
    36      <tr>
    37        {{- /* renderComments implicitly creates a <p> element, so we do the
    38               same here to make the value line up nicely.  */ -}}
    39        <td><p>{{ typeDisplayName . }}</p></td>
    40        <td>{{ safe (renderComments .CommentLines) }}</td>
    41      </tr>
    42      {{- end -}}
    43    </tbody>
    44</table>
    45{{ end }}
    46
    47{{ if .Members }}
    48<table>
    49    <thead>
    50        <tr>
    51            <th>Field</th>
    52            <th>Description</th>
    53        </tr>
    54    </thead>
    55    <tbody>
    56        {{ if isExportedType . }}
    57        <tr>
    58            <td>
    59                <code>apiVersion</code></br>
    60                string</td>
    61            <td>
    62                <code>
    63                    {{apiGroup .}}
    64                </code>
    65            </td>
    66        </tr>
    67        <tr>
    68            <td>
    69                <code>kind</code></br>
    70                string
    71            </td>
    72            <td><code>{{.Name.Name}}</code></td>
    73        </tr>
    74        {{ end }}
    75        {{ template "members" .}}
    76    </tbody>
    77</table>
    78{{ end }}
    79
    80{{ end }}

View as plain text