summaryrefslogtreecommitdiff
path: root/lib/godoc/package.html
diff options
context:
space:
mode:
Diffstat (limited to 'lib/godoc/package.html')
-rw-r--r--lib/godoc/package.html72
1 files changed, 38 insertions, 34 deletions
diff --git a/lib/godoc/package.html b/lib/godoc/package.html
index 1df1f9151..aefbef9fd 100644
--- a/lib/godoc/package.html
+++ b/lib/godoc/package.html
@@ -10,7 +10,11 @@
correspond to Go identifiers).
-->
{{with .PDoc}}
- {{if not $.IsMain}}
+ {{if $.IsMain}}
+ {{/* command documentation */}}
+ {{comment_html .Doc}}
+ {{else}}
+ {{/* package documentation */}}
<div id="short-nav">
<dl>
<dd><code>import "{{html .ImportPath}}"</code></dd>
@@ -36,7 +40,7 @@
{{comment_html .Doc}}
</div>
</div>
- {{example_html "" $.Examples $.FSet}}
+ {{example_html $ ""}}
<div id="pkg-index" class="toggleVisible">
<div class="collapsed">
@@ -56,24 +60,24 @@
{{end}}
{{range .Funcs}}
{{$name_html := html .Name}}
- <dd><a href="#{{$name_html}}">{{node_html .Decl $.FSet}}</a></dd>
+ <dd><a href="#{{$name_html}}">{{node_html $ .Decl false}}</a></dd>
{{end}}
{{range .Types}}
{{$tname_html := html .Name}}
<dd><a href="#{{$tname_html}}">type {{$tname_html}}</a></dd>
{{range .Funcs}}
{{$name_html := html .Name}}
- <dd>&nbsp; &nbsp; <a href="#{{$name_html}}">{{node_html .Decl $.FSet}}</a></dd>
+ <dd>&nbsp; &nbsp; <a href="#{{$name_html}}">{{node_html $ .Decl false}}</a></dd>
{{end}}
{{range .Methods}}
{{$name_html := html .Name}}
- <dd>&nbsp; &nbsp; <a href="#{{$tname_html}}.{{$name_html}}">{{node_html .Decl $.FSet}}</a></dd>
+ <dd>&nbsp; &nbsp; <a href="#{{$tname_html}}.{{$name_html}}">{{node_html $ .Decl false}}</a></dd>
{{end}}
{{end}}
{{if $.Notes}}
- {{range $marker, $item := $.Notes}}
+ {{range $marker, $item := $.Notes}}
<dd><a href="#pkg-note-{{$marker}}">{{noteTitle $marker | html}}s</a></dd>
- {{end}}
+ {{end}}
{{end}}
</dl>
</div><!-- #manual-nav -->
@@ -88,7 +92,7 @@
</dl>
</div>
{{end}}
-
+
{{with .Filenames}}
<h4>Package files</h4>
<p>
@@ -101,81 +105,81 @@
{{end}}
</div><!-- .expanded -->
</div><!-- #pkg-index -->
-
+
{{with .Consts}}
<h2 id="pkg-constants">Constants</h2>
{{range .}}
- <pre>{{node_html .Decl $.FSet}}</pre>
+ <pre>{{node_html $ .Decl true}}</pre>
{{comment_html .Doc}}
{{end}}
{{end}}
{{with .Vars}}
<h2 id="pkg-variables">Variables</h2>
{{range .}}
- <pre>{{node_html .Decl $.FSet}}</pre>
+ <pre>{{node_html $ .Decl true}}</pre>
{{comment_html .Doc}}
{{end}}
{{end}}
{{range .Funcs}}
{{/* Name is a string - no need for FSet */}}
{{$name_html := html .Name}}
- <h2 id="{{$name_html}}">func <a href="{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h2>
- <pre>{{node_html .Decl $.FSet}}</pre>
+ <h2 id="{{$name_html}}">func <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a></h2>
+ <pre>{{node_html $ .Decl true}}</pre>
{{comment_html .Doc}}
- {{example_html .Name $.Examples $.FSet}}
+ {{example_html $ .Name}}
{{end}}
{{range .Types}}
{{$tname := .Name}}
{{$tname_html := html .Name}}
- <h2 id="{{$tname_html}}">type <a href="{{posLink_url .Decl $.FSet}}">{{$tname_html}}</a></h2>
- <pre>{{node_html .Decl $.FSet}}</pre>
+ <h2 id="{{$tname_html}}">type <a href="{{posLink_url $ .Decl}}">{{$tname_html}}</a></h2>
+ <pre>{{node_html $ .Decl true}}</pre>
{{comment_html .Doc}}
{{range .Consts}}
- <pre>{{node_html .Decl $.FSet}}</pre>
+ <pre>{{node_html $ .Decl true}}</pre>
{{comment_html .Doc}}
{{end}}
{{range .Vars}}
- <pre>{{node_html .Decl $.FSet}}</pre>
+ <pre>{{node_html $ .Decl true}}</pre>
{{comment_html .Doc}}
{{end}}
- {{example_html $tname $.Examples $.FSet}}
+ {{example_html $ $tname}}
{{range .Funcs}}
{{$name_html := html .Name}}
- <h3 id="{{$name_html}}">func <a href="{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h3>
- <pre>{{node_html .Decl $.FSet}}</pre>
+ <h3 id="{{$name_html}}">func <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a></h3>
+ <pre>{{node_html $ .Decl true}}</pre>
{{comment_html .Doc}}
- {{example_html .Name $.Examples $.FSet}}
+ {{example_html $ .Name}}
{{end}}
{{range .Methods}}
{{$name_html := html .Name}}
- <h3 id="{{$tname_html}}.{{$name_html}}">func ({{html .Recv}}) <a href="{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h3>
- <pre>{{node_html .Decl $.FSet}}</pre>
+ <h3 id="{{$tname_html}}.{{$name_html}}">func ({{html .Recv}}) <a href="{{posLink_url $ .Decl}}">{{$name_html}}</a></h3>
+ <pre>{{node_html $ .Decl true}}</pre>
{{comment_html .Doc}}
{{$name := printf "%s_%s" $tname .Name}}
- {{example_html $name $.Examples $.FSet}}
+ {{example_html $ $name}}
{{end}}
{{end}}
- {{else}} {{/* not a package; is a command */}}
- {{comment_html .Doc}}
{{end}}
{{with $.Notes}}
- {{range $marker, $content := .}}
- <h2 id="pkg-note-{{$marker}}">{{noteTitle $marker | html}}s</h2>
- {{range .}}
- {{comment_html .}}
- {{end}}
+ {{range $marker, $content := .}}
+ <h2 id="pkg-note-{{$marker}}">{{noteTitle $marker | html}}s</h2>
+ <ul style="list-style: none; padding: 0;">
+ {{range .}}
+ <li><a href="{{posLink_url $ .}}">&#x261e;</a> {{html .Body}}</li>
+ {{end}}
+ </ul>
{{end}}
{{end}}
{{end}}
{{with .PAst}}
- <pre>{{node_html . $.FSet}}</pre>
+ <pre>{{node_html $ . false}}</pre>
{{end}}
{{with .Dirs}}
@@ -250,7 +254,7 @@ $(document).ready(function() {
var resize = function() {
code.height(0);
var h = code[0].scrollHeight;
- code.height(h+20); // minimize bouncing
+ code.height(h+20); // minimize bouncing.
code.closest('.input').height(h);
};
code.on('keydown', resize);