package.html 3.18 KB
Newer Older
1 2 3 4 5
<!--
	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.
-->
6
{{with .PAst}}
7
	<pre>{{node_html . $.FSet}}</pre>
8 9
{{end}}
{{with .PDoc}}
10
	<!-- PackageName is printed as title by the top-level template -->
11 12
	{{if $.IsPkg}}
		<p><code>import "{{html .ImportPath}}"</code></p>
13
	{{end}}
14
	{{comment_html .Doc}}
15
	{{if $.IsPkg}}
16
		{{with .Filenames}}
17 18 19
			<p>
			<h4>Package files</h4>
			<span style="font-size:90%">
20
			{{range .}}
21
				<a href="/{{.|srcLink}}">{{.|filename|html}}</a>
22
			{{end}}
23 24
			</span>
			</p>
25 26 27
		{{end}}
	{{end}}
	{{with .Consts}}
28
		<h2 id="Constants">Constants</h2>
29
		{{range .}}
30 31
			{{comment_html .Doc}}
			<pre>{{node_html .Decl $.FSet}}</pre>
32 33 34
		{{end}}
	{{end}}
	{{with .Vars}}
35
		<h2 id="Variables">Variables</h2>
36
		{{range .}}
37 38
			{{comment_html .Doc}}
			<pre>{{node_html .Decl $.FSet}}</pre>
39 40 41 42 43
		{{end}}
	{{end}}
	{{with .Funcs}}
		{{range .}}
			{{/* Name is a string - no need for FSet */}}
44
			{{$name := html .Name}}
45
			<h2 id="{{$name}}">func <a href="/{{posLink_url .Decl $.FSet}}">{{$name}}</a></h2>
46 47
			<p><code>{{node_html .Decl $.FSet}}</code></p>
			{{comment_html .Doc}}
48 49 50
		{{end}}
	{{end}}
	{{with .Types}}
51
		{{range .}}
52
			{{$tname := node_html .Type.Name $.FSet}}
53
			<h2 id="{{$tname}}">type <a href="/{{posLink_url .Decl $.FSet}}">{{$tname}}</a></h2>
54 55
			{{comment_html .Doc}}
			<p><pre>{{node_html .Decl $.FSet}}</pre></p>
56
			{{range .Consts}}
57 58
				{{comment_html .Doc}}
				<pre>{{node_html .Decl $.FSet}}</pre>
59 60
			{{end}}
			{{range .Vars}}
61 62
				{{comment_html .Doc}}
				<pre>{{node_html .Decl $.FSet}}</pre>
63 64
			{{end}}
			{{range .Factories}}
65
				{{$name := html .Name}}
66
				<h3 id="{{$tname}}.{{$name}}">func <a href="/{{posLink_url .Decl $.FSet}}">{{$name}}</a></h3>
67 68
				<p><code>{{node_html .Decl $.FSet}}</code></p>
				{{comment_html .Doc}}
69 70
			{{end}}
			{{range .Methods}}
71
				{{$name := html .Name}}
72
				<h3 id="{{$tname}}.{{$name}}">func ({{node_html .Recv $.FSet}}) <a href="/{{posLink_url .Decl $.FSet}}">{{$name}}</a></h3>
73 74
				<p><code>{{node_html .Decl $.FSet}}</code></p>
				{{comment_html .Doc}}
75 76 77 78
			{{end}}
		{{end}}
	{{end}}
	{{with .Bugs}}
79
		<h2 id="Bugs">Bugs</h2>
80
		{{range .}}
81
		{{comment_html .}}
82 83 84 85
		{{end}}
	{{end}}
{{end}}
{{with .PList}}
86 87
	<h2>Other packages</h2>
	<p>
88 89
	{{/* PList entries are strings - no need for FSet */}}
	{{range .}}
90
	<a href="?p={{url .}}">{{html .}}</a><br />
91
	{{end}}
92
	</p>
93 94
{{end}}
{{with .Dirs}}
95 96 97 98 99
	<p class="detail">
	Need more packages? The
	<a href="http://godashboard.appspot.com/package">Package Dashboard</a>
	provides a list of <a href="/cmd/goinstall/">goinstallable</a> packages.
	</p>
100
	{{/* DirList entries are numbers and strings - no need for FSet */}}
101
	<h2 id="Subdirectories">Subdirectories</h2>
102 103 104
	<p>
	<table class="layout">
	<tr>
105
	<th align="left" colspan="{{html .MaxHeight}}">Name</th>
106 107 108
	<td width="25">&nbsp;</td>
	<th align="left">Synopsis</th>
	</tr>
109
	<tr>
Gustavo Niemeyer's avatar
Gustavo Niemeyer committed
110
	<th align="left"><a href="..">..</a></th>
111
	</tr>
112
	{{range .List}}
113
		<tr>
114
		{{repeat `<td width="25"></td>` .Depth}}
115
		<td align="left" colspan="{{html .Height}}"><a href="{{html .Path}}">{{html .Name}}</a></td>
116
		<td></td>
117
		<td align="left">{{html .Synopsis}}</td>
118
		</tr>
119
	{{end}}
120 121
	</table>
	</p>
122
{{end}}