Commit c1139549 authored by Robert Griesemer's avatar Robert Griesemer

godoc: consistent placement of documentation sections

Fixes #1226.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5694052
parent 1bddfb52
......@@ -76,22 +76,22 @@
{{with .Consts}}
<h2 id="constants">Constants</h2>
{{range .}}
{{comment_html .Doc}}
<pre>{{node_html .Decl $.FSet}}</pre>
{{comment_html .Doc}}
{{end}}
{{end}}
{{with .Vars}}
<h2 id="variables">Variables</h2>
{{range .}}
{{comment_html .Doc}}
<pre>{{node_html .Decl $.FSet}}</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>
<p><code>{{node_html .Decl $.FSet}}</code></p>
<pre>{{node_html .Decl $.FSet}}</pre>
{{comment_html .Doc}}
{{example_html .Name $.Examples $.FSet}}
{{end}}
......@@ -99,28 +99,33 @@
{{$tname := .Name}}
{{$tname_html := html .Name}}
<h2 id="{{$tname_html}}">type <a href="/{{posLink_url .Decl $.FSet}}">{{$tname_html}}</a></h2>
{{comment_html .Doc}}
<pre>{{node_html .Decl $.FSet}}</pre>
{{comment_html .Doc}}
{{range .Consts}}
{{comment_html .Doc}}
<pre>{{node_html .Decl $.FSet}}</pre>
{{comment_html .Doc}}
{{end}}
{{range .Vars}}
{{comment_html .Doc}}
<pre>{{node_html .Decl $.FSet}}</pre>
{{comment_html .Doc}}
{{end}}
{{example_html $tname $.Examples $.FSet}}
{{range .Funcs}}
{{$name_html := html .Name}}
<h3 id="{{$name_html}}">func <a href="/{{posLink_url .Decl $.FSet}}">{{$name_html}}</a></h3>
<p><code>{{node_html .Decl $.FSet}}</code></p>
<pre>{{node_html .Decl $.FSet}}</pre>
{{comment_html .Doc}}
{{example_html .Name $.Examples $.FSet}}
{{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>
<p><code>{{node_html .Decl $.FSet}}</code></p>
<pre>{{node_html .Decl $.FSet}}</pre>
{{comment_html .Doc}}
{{$name := printf "%s_%s" $tname .Name}}
{{example_html $name $.Examples $.FSet}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment