| <!-- |
| Copyright 2020 The Go Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style |
| license that can be found in the LICENSE file. |
| --> |
| |
| {{/* . is internal/godoc/dochtml.item */}} |
| {{- define "declaration" -}} |
| {{- $out := render_decl .Doc .Decl -}} |
| {{if $out.Decl}} |
| <div class="Documentation-declaration"> |
| <pre>{{- $out.Decl -}}</pre> |
| </div> |
| {{end}} |
| {{- $out.Doc -}} |
| {{"\n"}} |
| {{- end -}} |
| |
| {{- define "declaration-view-source" -}} |
| {{- $out := render_decl .Doc .Decl -}} |
| {{if $out.Decl}} |
| <div class="Documentation-declaration"> |
| <span class="Documentation-declarationLink">{{source_link "View Source" .Decl}}</span> |
| <pre>{{- $out.Decl -}}</pre> |
| </div> |
| {{end}} |
| {{- $out.Doc -}} |
| {{"\n"}} |
| {{- end -}} |
| |
| {{- define "since_version" -}} |
| {{$v := (since_version .)}} |
| <span class="Documentation-sinceVersion"> |
| {{if $v.String}} |
| <span class="Documentation-sinceVersionLabel">added in</span> |
| <span class="Documentation-sinceVersionVersion">{{$v}}</span> |
| {{end}} |
| </span> |
| {{end}} |