github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/hack/docgen/api/template/type.tpl (about)

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