1
0
mirror of https://github.com/golang/go synced 2024-11-25 23:17:58 -07:00
go/lib/godoc/search.html

97 lines
2.6 KiB
HTML
Raw Normal View History

<!--
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.
-->
{{$SearchResult := .}}
{{with .Alert}}
<p>
<span class="alert" style="font-size:120%">{{.}}</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 .}}
<h3 id="Global_{{url_pkg .Pak.Path}}">package <a href="/{{url_pkg .Pak.Path}}">{{html .Pak.Name}}</a></h3>
{{range .Files}}
{{$path := url_src .File.Path}}
{{range .Groups}}
{{range .Infos}}
<a href="/{{$path}}?h={{url $SearchResult.Query}}#L{{infoLine .}}">{{$path}}:{{infoLine .}}</a>
{{infoSnippet .}}
{{end}}
{{end}}
{{end}}
{{end}}
{{end}}
{{with .Others}}
<h2 id="Local">Local declarations and uses</h2>
{{range .}}
<h3 id="Local_{{url_pkg .Pak.Path}}">package <a href="/{{url_pkg .Pak.Path}}">{{html .Pak.Name}}</a></h3>
{{range .Files}}
{{$path := url_src .File.Path}}
<a href="/{{$path}}?h={{url $SearchResult.Query}}">{{$path}}</a>
<table class="layout">
{{range .Groups}}
<tr>
<td width="25"></td>
<th align="left" valign="top">{{infoKind .Kind}}</th>
<td align="left" width="4"></td>
<td>
{{range .Infos}}
<a href="/{{$path}}?h={{url $SearchResult.Query}}#L{{infoLine .}}">{{infoLine .}}</a>
{{end}}
</td>
</tr>
{{end}}
</table>
{{end}}
{{end}}
{{end}}
{{end}}
{{with .Textual}}
{{if $SearchResult.Complete}}
<h2 id="Textual">{{html $SearchResult.Found}} textual occurrences</h2>
{{else}}
<h2 id="Textual">More than {{html $SearchResult.Found}} textual occurrences</h2>
<p>
<span class="alert" style="font-size:120%">Not all files or lines containing "{{html $SearchResult.Query}}" are shown.</span>
</p>
{{end}}
<p>
<table class="layout">
{{range .}}
{{$path := url_src .Filename}}
<tr>
<td align="left" valign="top">
<a href="/{{$path}}?h={{url $SearchResult.Query}}">{{$path}}</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="/{{$path}}?h={{url $SearchResult.Query}}#L{{url .}}">{{html .}}</a>
{{end}}
{{if not $SearchResult.Complete}}
...
{{end}}
</td>
</tr>
{{end}}
{{if not $SearchResult.Complete}}
<tr><td align="left">...</td></tr>
{{end}}
</table>
</p>
{{end}}