blob: 3d6e8ba9a1e3fb59e32c42135baa3adf3f415e55 [file] [log] [blame]
<!--
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.
-->
<!--
Note: Static (i.e., not template-generated) href and id
attributes start with "pkg-" to make it impossible for
them to conflict with generated attributes (some of which
correspond to Go identifiers).
-->
{{$pkg := .Data}}
{{with $pkg.PDoc}}
{{if $pkg.IsMain}}
{{/* command documentation */}}
{{$.Comment .Doc}}
{{else}}
{{/* package documentation */}}
<div id="short-nav">
<dl>
<dd><code>import "{{.ImportPath}}"</code></dd>
</dl>
<dl>
<dd><a href="#pkg-overview" class="overviewLink">Overview</a></dd>
<dd><a href="#pkg-index" class="indexLink">Index</a></dd>
{{if $pkg.Examples}}
<dd><a href="#pkg-examples" class="examplesLink">Examples</a></dd>
{{end}}
{{if $pkg.Dirs}}
<dd><a href="#pkg-subdirectories">Subdirectories</a></dd>
{{end}}
</dl>
</div>
<!-- The package's Name is printed as title by the top-level template -->
<div id="pkg-overview" class="toggleVisible">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
{{$.Comment .Doc}}
{{$.Example ""}}
</div>
</div>
<div id="pkg-index" class="toggleVisible">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Index section">Index ▹</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Index section">Index ▾</h2>
<!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
<div id="manual-nav">
<dl>
{{if .Consts}}
<dd><a href="#pkg-constants">Constants</a></dd>
{{end}}
{{if .Vars}}
<dd><a href="#pkg-variables">Variables</a></dd>
{{end}}
{{range .Funcs}}
<dd><a href="#{{.Name}}">{{$.NodeTOC .Decl}}</a></dd>
{{end}}
{{range .Types}}
{{$typeName := .Name}}
<dd><a href="#{{.Name}}">type {{.Name}}</a></dd>
{{range .Funcs}}
<dd>&nbsp; &nbsp; <a href="#{{.Name}}">{{$.NodeTOC .Decl}}</a></dd>
{{end}}
{{range .Methods}}
<dd>&nbsp; &nbsp; <a href="#{{$typeName}}.{{.Name}}">{{$.NodeTOC .Decl}}</a></dd>
{{end}}
{{end}}
{{if $pkg.Bugs}}
<dd><a href="#pkg-note-BUG">Bugs</a></dd>
{{end}}
</dl>
</div><!-- #manual-nav -->
{{if $pkg.Examples}}
<div id="pkg-examples">
<h3>Examples</h3>
<div class="js-expandAll expandAll collapsed">(Expand All)</div>
<dl>
{{range $pkg.Examples}}
<dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd>
{{end}}
</dl>
</div>
{{end}}
{{with .Filenames}}
<h3>Package files</h3>
<p>
<span style="font-size:90%">
{{range .}}
<a href="/src/{{.}}">{{basename .}}</a>
{{end}}
</span>
</p>
{{end}}
</div><!-- .expanded -->
</div><!-- #pkg-index -->
{{with .Consts}}
<h2 id="pkg-constants">Constants</h2>
{{range .}}
{{$.Comment .Doc}}
<pre>{{$.Node .Decl}}</pre>
{{end}}
{{end}}
{{with .Vars}}
<h2 id="pkg-variables">Variables</h2>
{{range .}}
{{$.Comment .Doc}}
<pre>{{$.Node .Decl}}</pre>
{{end}}
{{end}}
{{range .Funcs}}
{{/* Name is a string - no need for FSet */}}
<h2 id="{{.Name}}">func <a href="{{$.SrcPosLink .Decl}}">{{.Name}}</a>
<a class="permalink" href="#{{.Name}}">&#xb6;</a>
{{$since := $.Since "func" "" .Name}}
{{if $since}}<span title="Added in Go {{$since}}">{{$since}}</span>{{end}}
</h2>
<pre>{{$.Node .Decl}}</pre>
{{$.Comment .Doc}}
{{$.Example .Name}}
{{end}}
{{range .Types}}
{{$typeName := .Name}}
<h2 id="{{.Name}}">type <a href="{{$.SrcPosLink .Decl}}">{{$typeName}}</a>
<a class="permalink" href="#{{.Name}}">&#xb6;</a>
{{$since := $.Since "type" "" .Name}}
{{if $since}}<span title="Added in Go {{$since}}">{{$since}}</span>{{end}}
</h2>
{{$.Comment .Doc}}
<pre>{{$.Node .Decl}}</pre>
{{range .Consts}}
{{$.Comment .Doc}}
<pre>{{$.Node .Decl}}</pre>
{{end}}
{{range .Vars}}
{{$.Comment .Doc}}
<pre>{{$.Node .Decl}}</pre>
{{end}}
{{$.Example .Name}}
{{range .Funcs}}
<h3 id="{{.Name}}">func <a href="{{$.SrcPosLink .Decl}}">{{.Name}}</a>
<a class="permalink" href="#{{.Name}}">&#xb6;</a>
{{$since := $.Since "func" "" .Name}}
{{if $since}}<span title="Added in Go {{$since}}">{{$since}}</span>{{end}}
</h3>
<pre>{{$.Node .Decl}}</pre>
{{$.Comment .Doc}}
{{$.Example .Name}}
{{end}}
{{range .Methods}}
<h3 id="{{$typeName}}.{{.Name}}">func ({{html .Recv}}) <a href="{{$.SrcPosLink .Decl}}">{{.Name}}</a>
<a class="permalink" href="#{{$typeName}}.{{.Name}}">&#xb6;</a>
{{$since := $.Since "method" .Recv .Name}}
{{if $since}}<span title="Added in Go {{$since}}">{{$since}}</span>{{end}}
</h3>
<pre>{{$.Node .Decl}}</pre>
{{$.Comment .Doc}}
{{$.Example (printf "%s_%s" $typeName .Name)}}
{{end}}
{{end}}
{{end}}
{{with $pkg.Bugs}}
<h2 id="pkg-note-BUG">Bugs</h2>
<ul style="list-style: none; padding: 0;">
{{range .}}
<li><a href="{{$.SrcPosLink .}}" style="float: left;">&#x261e;</a> {{$.Comment .Body}}</li>
{{end}}
</ul>
{{end}}
{{end}}
{{with $pkg.Dirs}}
{{/* DirList entries are numbers and strings - no need for FSet */}}
{{if $pkg.PDoc}}
<h2 id="pkg-subdirectories">Subdirectories</h2>
{{end}}
<div class="pkg-dir">
<table>
<tr>
<th class="pkg-name">Name</th>
<th class="pkg-synopsis">Synopsis</th>
</tr>
{{if not (or (eq $pkg.Dirname "/src/cmd") $pkg.DirFlat)}}
<tr>
<td colspan="2"><a href="..">..</a></td>
</tr>
{{end}}
{{range .List}}
<tr>
{{if $pkg.DirFlat}}
{{if .HasPkg}}
<td class="pkg-name">
<a href="{{.Path}}/{{$.ModeQuery}}">{{.Path}}</a>
</td>
{{end}}
{{else}}
<td class="pkg-name" style="padding-left: {{multiply .Depth 20}}px;">
<a href="{{.Path}}/{{$.ModeQuery}}">{{.Name}}</a>
</td>
{{end}}
<td class="pkg-synopsis">
{{.Synopsis}}
</td>
</tr>
{{end}}
</table>
</div>
{{end}}