1
0
mirror of https://github.com/golang/go synced 2024-11-18 22:14:56 -07:00
go/lib/godoc/search.html
Robert Griesemer 5c45e56898 godoc: remove last vestiges of old template system
- rename template funcs for better consistency and
  sort them into groups of related functionality
- try to be more consistent with html vs url escaping

R=r
CC=golang-dev
https://golang.org/cl/4887041
2011-08-12 15:43:10 -07:00

98 lines
2.5 KiB
HTML

<!--
Copyright 2009 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.
-->
{{with .Alert}}
<p>
<span class="alert" style="font-size:120%">{{html .}}</span>
</p>
{{end}}
{{with .Alt}}
<p>
<span class="alert" style="font-size:120%">Did you mean: </span>
{{range .Alts}}
<a href="search?q={{url .}}" style="font-size:120%">{{html .}}</a>
{{end}}
</p>
{{end}}
{{with .Hit}}
{{with .Decls}}
<h2 id="Global">Package-level declarations</h2>
{{range .}}
{{$pkg := pkgLink .Pak.Path}}
<h3 id="Global_{{html $pkg}}">package <a href="/{{url $pkg}}">{{html .Pak.Name}}</a></h3>
{{range .Files}}
{{$src := srcLink .File.Path}}
{{range .Groups}}
{{range .Infos}}
<a href="/{{url $src}}?h={{url $.Query}}#L{{infoLine .}}">{{html $src}}:{{infoLine .}}</a>
{{infoSnippet_html .}}
{{end}}
{{end}}
{{end}}
{{end}}
{{end}}
{{with .Others}}
<h2 id="Local">Local declarations and uses</h2>
{{range .}}
{{$pkg := pkgLink .Pak.Path}}
<h3 id="Local_{{html $pkg}}">package <a href="/{{url $pkg}}">{{html .Pak.Name}}</a></h3>
{{range .Files}}
{{$src := srcLink .File.Path}}
<a href="/{{url $src}}?h={{url $.Query}}">{{html $src}}</a>
<table class="layout">
{{range .Groups}}
<tr>
<td width="25"></td>
<th align="left" valign="top">{{infoKind_html .Kind}}</th>
<td align="left" width="4"></td>
<td>
{{range .Infos}}
<a href="/{{url $src}}?h={{url $.Query}}#L{{infoLine .}}">{{infoLine .}}</a>
{{end}}
</td>
</tr>
{{end}}
</table>
{{end}}
{{end}}
{{end}}
{{end}}
{{with .Textual}}
{{if $.Complete}}
<h2 id="Textual">{{html $.Found}} textual occurrences</h2>
{{else}}
<h2 id="Textual">More than {{html $.Found}} textual occurrences</h2>
<p>
<span class="alert" style="font-size:120%">Not all files or lines containing "{{html $.Query}}" are shown.</span>
</p>
{{end}}
<p>
<table class="layout">
{{range .}}
{{$src := srcLink .Filename}}
<tr>
<td align="left" valign="top">
<a href="/{{url $src}}?h={{url $.Query}}">{{html $src}}</a>:
</td>
<td align="left" width="4"></td>
<th align="left" valign="top">{{len .Lines}}</th>
<td align="left" width="4"></td>
<td align="left">
{{range .Lines}}
<a href="/{{url $src}}?h={{url $.Query}}#L{{url .}}">{{html .}}</a>
{{end}}
{{if not $.Complete}}
...
{{end}}
</td>
</tr>
{{end}}
{{if not $.Complete}}
<tr><td align="left">...</td></tr>
{{end}}
</table>
</p>
{{end}}