2009-09-17 18:04:51 -06:00
|
|
|
<!--
|
|
|
|
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.
|
|
|
|
-->
|
2012-08-07 18:45:58 -06:00
|
|
|
<!--
|
|
|
|
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).
|
|
|
|
-->
|
2011-10-18 14:23:35 -06:00
|
|
|
{{with .PDoc}}
|
2013-03-11 14:38:59 -06:00
|
|
|
{{if $.IsMain}}
|
|
|
|
{{/* command documentation */}}
|
|
|
|
{{comment_html .Doc}}
|
|
|
|
{{else}}
|
|
|
|
{{/* package documentation */}}
|
2012-01-26 11:02:03 -07:00
|
|
|
<div id="short-nav">
|
|
|
|
<dl>
|
|
|
|
<dd><code>import "{{html .ImportPath}}"</code></dd>
|
|
|
|
</dl>
|
|
|
|
<dl>
|
2012-08-07 18:45:58 -06:00
|
|
|
<dd><a href="#pkg-overview" class="overviewLink">Overview</a></dd>
|
2012-12-10 18:20:00 -07:00
|
|
|
<dd><a href="#pkg-index" class="indexLink">Index</a></dd>
|
2012-02-27 22:05:12 -07:00
|
|
|
{{if $.Examples}}
|
2012-10-03 19:21:37 -06:00
|
|
|
<dd><a href="#pkg-examples" class="examplesLink">Examples</a></dd>
|
2012-08-07 18:45:58 -06:00
|
|
|
{{end}}
|
2012-02-03 11:17:37 -07:00
|
|
|
{{if $.Dirs}}
|
2012-08-07 18:45:58 -06:00
|
|
|
<dd><a href="#pkg-subdirectories">Subdirectories</a></dd>
|
2012-02-03 11:17:37 -07:00
|
|
|
{{end}}
|
2012-01-26 11:02:03 -07:00
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
<!-- The package's Name is printed as title by the top-level template -->
|
2012-08-07 18:45:58 -06:00
|
|
|
<div id="pkg-overview" class="toggleVisible">
|
2012-03-25 21:10:27 -06:00
|
|
|
<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_html .Doc}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2013-03-26 19:28:16 -06:00
|
|
|
{{example_html $ ""}}
|
2012-10-02 23:05:08 -06:00
|
|
|
|
|
|
|
<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>
|
|
|
|
|
2012-01-26 11:02:03 -07:00
|
|
|
<!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
|
2012-10-02 23:05:08 -06:00
|
|
|
<div id="manual-nav">
|
2012-01-26 11:02:03 -07:00
|
|
|
<dl>
|
|
|
|
{{if .Consts}}
|
2012-08-07 18:45:58 -06:00
|
|
|
<dd><a href="#pkg-constants">Constants</a></dd>
|
2012-01-26 11:02:03 -07:00
|
|
|
{{end}}
|
|
|
|
{{if .Vars}}
|
2012-08-07 18:45:58 -06:00
|
|
|
<dd><a href="#pkg-variables">Variables</a></dd>
|
2012-01-26 11:02:03 -07:00
|
|
|
{{end}}
|
|
|
|
{{range .Funcs}}
|
|
|
|
{{$name_html := html .Name}}
|
2013-04-02 13:05:14 -06:00
|
|
|
<dd><a href="#{{$name_html}}">{{node_html $ .Decl false}}</a></dd>
|
2012-01-26 11:02:03 -07:00
|
|
|
{{end}}
|
|
|
|
{{range .Types}}
|
|
|
|
{{$tname_html := html .Name}}
|
|
|
|
<dd><a href="#{{$tname_html}}">type {{$tname_html}}</a></dd>
|
|
|
|
{{range .Funcs}}
|
|
|
|
{{$name_html := html .Name}}
|
2013-04-02 13:05:14 -06:00
|
|
|
<dd> <a href="#{{$name_html}}">{{node_html $ .Decl false}}</a></dd>
|
2012-01-26 11:02:03 -07:00
|
|
|
{{end}}
|
|
|
|
{{range .Methods}}
|
|
|
|
{{$name_html := html .Name}}
|
2013-04-02 13:05:14 -06:00
|
|
|
<dd> <a href="#{{$tname_html}}.{{$name_html}}">{{node_html $ .Decl false}}</a></dd>
|
2012-01-26 11:02:03 -07:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2013-02-25 21:34:09 -07:00
|
|
|
{{if $.Notes}}
|
2013-03-19 07:40:57 -06:00
|
|
|
{{range $marker, $item := $.Notes}}
|
2013-02-25 21:34:09 -07:00
|
|
|
<dd><a href="#pkg-note-{{$marker}}">{{noteTitle $marker | html}}s</a></dd>
|
2013-03-19 07:40:57 -06:00
|
|
|
{{end}}
|
2013-02-14 21:35:08 -07:00
|
|
|
{{end}}
|
2012-02-13 20:52:00 -07:00
|
|
|
</dl>
|
2012-10-02 23:05:08 -06:00
|
|
|
</div><!-- #manual-nav -->
|
2012-02-13 20:52:00 -07:00
|
|
|
|
2012-12-10 18:20:00 -07:00
|
|
|
{{if $.Examples}}
|
|
|
|
<div id="pkg-examples">
|
|
|
|
<h4>Examples</h4>
|
|
|
|
<dl>
|
|
|
|
{{range $.Examples}}
|
|
|
|
<dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd>
|
|
|
|
{{end}}
|
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2013-03-19 07:40:57 -06:00
|
|
|
|
2012-02-13 03:22:36 -07:00
|
|
|
{{with .Filenames}}
|
|
|
|
<h4>Package files</h4>
|
|
|
|
<p>
|
|
|
|
<span style="font-size:90%">
|
|
|
|
{{range .}}
|
godoc: support $GOPATH, simplify file system code
The motivation for this CL is to support $GOPATH well.
Since we already have a FileSystem interface, implement a
Plan 9-style name space. Bind each of the $GOPATH src
directories onto the $GOROOT src/pkg directory: now
everything is laid out exactly like a normal $GOROOT and
needs very little special case code.
The filter files are no longer used (by us), so I think they
can just be deleted. Similarly, the Mapping code and the
FileSystem interface were two different ways to accomplish
the same end, so delete the Mapping code.
Within the implementation, since FileSystem is defined to be
slash-separated, use package path consistently, leaving
path/filepath only for manipulating operating system paths.
I kept the -path flag, but I think it can be deleted too.
Fixes #2234.
Fixes #3046.
R=gri, r, r, rsc
CC=golang-dev
https://golang.org/cl/5711058
2012-03-05 08:02:46 -07:00
|
|
|
<a href="{{.|srcLink|html}}">{{.|filename|html}}</a>
|
2012-02-13 03:22:36 -07:00
|
|
|
{{end}}
|
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
{{end}}
|
2012-10-02 23:05:08 -06:00
|
|
|
</div><!-- .expanded -->
|
|
|
|
</div><!-- #pkg-index -->
|
2013-03-19 07:40:57 -06:00
|
|
|
|
2012-01-26 11:02:03 -07:00
|
|
|
{{with .Consts}}
|
2012-08-07 18:45:58 -06:00
|
|
|
<h2 id="pkg-constants">Constants</h2>
|
2011-08-11 14:24:13 -06:00
|
|
|
{{range .}}
|
2013-04-02 13:05:14 -06:00
|
|
|
<pre>{{node_html $ .Decl true}}</pre>
|
2012-02-23 13:44:11 -07:00
|
|
|
{{comment_html .Doc}}
|
2011-08-11 14:24:13 -06:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2012-01-26 11:02:03 -07:00
|
|
|
{{with .Vars}}
|
2012-08-07 18:45:58 -06:00
|
|
|
<h2 id="pkg-variables">Variables</h2>
|
2012-01-26 11:02:03 -07:00
|
|
|
{{range .}}
|
2013-04-02 13:05:14 -06:00
|
|
|
<pre>{{node_html $ .Decl true}}</pre>
|
2012-02-23 13:44:11 -07:00
|
|
|
{{comment_html .Doc}}
|
2012-01-26 11:02:03 -07:00
|
|
|
{{end}}
|
2011-10-18 14:23:35 -06:00
|
|
|
{{end}}
|
2012-01-12 18:36:57 -07:00
|
|
|
{{range .Funcs}}
|
2012-01-26 11:02:03 -07:00
|
|
|
{{/* Name is a string - no need for FSet */}}
|
2011-08-17 17:38:58 -06:00
|
|
|
{{$name_html := html .Name}}
|
2013-03-26 19:28:16 -06:00
|
|
|
<h2 id="{{$name_html}}">func <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a></h2>
|
2013-04-02 13:05:14 -06:00
|
|
|
<pre>{{node_html $ .Decl true}}</pre>
|
2011-08-12 16:43:10 -06:00
|
|
|
{{comment_html .Doc}}
|
2013-03-26 19:28:16 -06:00
|
|
|
{{example_html $ .Name}}
|
2011-08-11 14:24:13 -06:00
|
|
|
{{end}}
|
2012-01-26 11:02:03 -07:00
|
|
|
{{range .Types}}
|
|
|
|
{{$tname := .Name}}
|
|
|
|
{{$tname_html := html .Name}}
|
2013-03-26 19:28:16 -06:00
|
|
|
<h2 id="{{$tname_html}}">type <a href="{{posLink_url $ .Decl}}">{{$tname_html}}</a></h2>
|
2013-04-02 13:05:14 -06:00
|
|
|
<pre>{{node_html $ .Decl true}}</pre>
|
2012-02-23 13:44:11 -07:00
|
|
|
{{comment_html .Doc}}
|
|
|
|
|
2012-01-26 11:02:03 -07:00
|
|
|
{{range .Consts}}
|
2013-04-02 13:05:14 -06:00
|
|
|
<pre>{{node_html $ .Decl true}}</pre>
|
2012-02-23 13:44:11 -07:00
|
|
|
{{comment_html .Doc}}
|
2012-01-26 11:02:03 -07:00
|
|
|
{{end}}
|
2012-02-23 13:44:11 -07:00
|
|
|
|
2012-01-26 11:02:03 -07:00
|
|
|
{{range .Vars}}
|
2013-04-02 13:05:14 -06:00
|
|
|
<pre>{{node_html $ .Decl true}}</pre>
|
2012-02-23 13:44:11 -07:00
|
|
|
{{comment_html .Doc}}
|
2012-01-26 11:02:03 -07:00
|
|
|
{{end}}
|
2012-02-23 13:44:11 -07:00
|
|
|
|
2013-03-26 19:28:16 -06:00
|
|
|
{{example_html $ $tname}}
|
2012-02-23 13:44:11 -07:00
|
|
|
|
2012-01-26 11:02:03 -07:00
|
|
|
{{range .Funcs}}
|
|
|
|
{{$name_html := html .Name}}
|
2013-03-26 19:28:16 -06:00
|
|
|
<h3 id="{{$name_html}}">func <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a></h3>
|
2013-04-02 13:05:14 -06:00
|
|
|
<pre>{{node_html $ .Decl true}}</pre>
|
2012-01-26 11:02:03 -07:00
|
|
|
{{comment_html .Doc}}
|
2013-03-26 19:28:16 -06:00
|
|
|
{{example_html $ .Name}}
|
2012-01-26 11:02:03 -07:00
|
|
|
{{end}}
|
2012-02-23 13:44:11 -07:00
|
|
|
|
2012-01-26 11:02:03 -07:00
|
|
|
{{range .Methods}}
|
|
|
|
{{$name_html := html .Name}}
|
2013-03-26 19:28:16 -06:00
|
|
|
<h3 id="{{$tname_html}}.{{$name_html}}">func ({{html .Recv}}) <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a></h3>
|
2013-04-02 13:05:14 -06:00
|
|
|
<pre>{{node_html $ .Decl true}}</pre>
|
2012-01-26 11:02:03 -07:00
|
|
|
{{comment_html .Doc}}
|
|
|
|
{{$name := printf "%s_%s" $tname .Name}}
|
2013-03-26 19:28:16 -06:00
|
|
|
{{example_html $ $name}}
|
2012-01-26 11:02:03 -07:00
|
|
|
{{end}}
|
2011-08-11 14:24:13 -06:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2012-01-26 11:02:03 -07:00
|
|
|
|
2013-02-25 21:34:09 -07:00
|
|
|
{{with $.Notes}}
|
2013-03-19 07:40:57 -06:00
|
|
|
{{range $marker, $content := .}}
|
|
|
|
<h2 id="pkg-note-{{$marker}}">{{noteTitle $marker | html}}s</h2>
|
2013-03-28 15:40:59 -06:00
|
|
|
<ul style="list-style: none; padding: 0;">
|
2013-03-19 07:40:57 -06:00
|
|
|
{{range .}}
|
2013-03-28 15:40:59 -06:00
|
|
|
<li><a href="{{posLink_url $ .}}">☞</a> {{html .Body}}</li>
|
2013-03-19 07:40:57 -06:00
|
|
|
{{end}}
|
2013-03-19 12:14:35 -06:00
|
|
|
</ul>
|
2013-02-14 21:35:08 -07:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
2011-08-11 14:24:13 -06:00
|
|
|
{{end}}
|
2012-01-26 11:02:03 -07:00
|
|
|
|
|
|
|
{{with .PAst}}
|
2013-04-02 13:05:14 -06:00
|
|
|
<pre>{{node_html $ . false}}</pre>
|
2012-01-26 11:02:03 -07:00
|
|
|
{{end}}
|
|
|
|
|
2011-08-11 14:24:13 -06:00
|
|
|
{{with .Dirs}}
|
|
|
|
{{/* DirList entries are numbers and strings - no need for FSet */}}
|
2012-03-05 18:50:52 -07:00
|
|
|
{{if $.PDoc}}
|
2012-08-07 18:45:58 -06:00
|
|
|
<h2 id="pkg-subdirectories">Subdirectories</h2>
|
2012-03-05 18:50:52 -07:00
|
|
|
{{else}}
|
|
|
|
<div class="pkgGopher">
|
|
|
|
<img class="gopher" src="/doc/gopher/pkg.png"/>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2012-02-13 03:22:36 -07:00
|
|
|
<table class="dir">
|
2009-11-08 17:47:32 -07:00
|
|
|
<tr>
|
2012-02-13 03:22:36 -07:00
|
|
|
<th>Name</th>
|
|
|
|
<th> </th>
|
|
|
|
<th style="text-align: left; width: auto">Synopsis</th>
|
2009-11-08 17:47:32 -07:00
|
|
|
</tr>
|
2012-02-27 12:18:00 -07:00
|
|
|
{{if not $.DirFlat}}
|
|
|
|
<tr>
|
|
|
|
<td><a href="..">..</a></td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
2011-08-11 14:24:13 -06:00
|
|
|
{{range .List}}
|
2012-02-21 15:25:56 -07:00
|
|
|
{{if $.DirFlat}}
|
2012-02-27 12:18:00 -07:00
|
|
|
{{if .HasPkg}}
|
|
|
|
<tr>
|
2012-07-11 10:41:08 -06:00
|
|
|
<td class="name"><a href="{{html .Path}}/">{{html .Path}}</a></td>
|
2012-02-27 12:18:00 -07:00
|
|
|
<td> </td>
|
|
|
|
<td style="width: auto">{{html .Synopsis}}</td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
2012-02-21 15:25:56 -07:00
|
|
|
{{else}}
|
2012-02-27 12:18:00 -07:00
|
|
|
<tr>
|
2012-07-11 10:41:08 -06:00
|
|
|
<td class="name">{{repeat ` ` .Depth}}<a href="{{html .Path}}/">{{html .Name}}</a></td>
|
2012-02-27 12:18:00 -07:00
|
|
|
<td> </td>
|
|
|
|
<td style="width: auto">{{html .Synopsis}}</td>
|
|
|
|
</tr>
|
2012-02-21 15:25:56 -07:00
|
|
|
{{end}}
|
2011-08-11 14:24:13 -06:00
|
|
|
{{end}}
|
2009-11-08 17:47:32 -07:00
|
|
|
</table>
|
2012-03-27 18:38:34 -06:00
|
|
|
{{if $.PDoc}}{{else}}
|
2013-01-18 01:25:45 -07:00
|
|
|
<p>Need more packages? Take a look at the <a href="http://code.google.com/p/go-wiki/wiki/Projects">Go Projects wiki page</a>.</p>
|
2012-03-27 18:38:34 -06:00
|
|
|
{{end}}
|
2011-08-11 14:24:13 -06:00
|
|
|
{{end}}
|
2012-10-04 00:53:05 -06:00
|
|
|
|
|
|
|
{{if $.Examples}}
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
'use strict';
|
|
|
|
// Set up playground when each element is toggled.
|
|
|
|
$('div.play').each(function (i, el) {
|
2013-07-01 16:44:25 -06:00
|
|
|
// Set up playground for this example.
|
|
|
|
var setup = function() {
|
2012-10-04 00:53:05 -06:00
|
|
|
var code = $('.code', el);
|
|
|
|
playground({
|
|
|
|
'codeEl': code,
|
|
|
|
'outputEl': $('.output', el),
|
|
|
|
'runEl': $('.run', el),
|
|
|
|
'fmtEl': $('.fmt', el),
|
|
|
|
'shareEl': $('.share', el),
|
|
|
|
'shareRedirect': 'http://play.golang.org/p/'
|
|
|
|
});
|
|
|
|
|
|
|
|
// Make the code textarea resize to fit content.
|
|
|
|
var resize = function() {
|
|
|
|
code.height(0);
|
|
|
|
var h = code[0].scrollHeight;
|
2013-03-19 07:40:57 -06:00
|
|
|
code.height(h+20); // minimize bouncing.
|
2012-10-04 00:53:05 -06:00
|
|
|
code.closest('.input').height(h);
|
|
|
|
};
|
|
|
|
code.on('keydown', resize);
|
|
|
|
code.on('keyup', resize);
|
|
|
|
code.keyup(); // resize now.
|
2013-07-01 16:44:25 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
// If example already visible, set up playground now.
|
|
|
|
if ($(el).is(':visible')) {
|
|
|
|
setup();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Otherwise, set up playground when example is expanded.
|
|
|
|
var built = false;
|
|
|
|
$(el).closest('.toggle').click(function() {
|
|
|
|
// Only set up once.
|
|
|
|
if (!built) {
|
|
|
|
setup();
|
|
|
|
built = true;
|
|
|
|
}
|
2012-10-04 00:53:05 -06:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{{end}}
|