]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: consistent placement of documentation sections
authorRobert Griesemer <gri@golang.org>
Thu, 23 Feb 2012 20:44:11 +0000 (12:44 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 23 Feb 2012 20:44:11 +0000 (12:44 -0800)
Fixes #1226.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5694052

lib/godoc/package.html

index 01043b05f29911961f1d736bbb67e8f14ff0375c..2e1be5104a6e938c2ac75a7a014f5795639d0575 100644 (file)
                {{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}}
                        {{$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}}