From c1139549bc51ebb429f5322699c267f440b3f82b Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 23 Feb 2012 12:44:11 -0800 Subject: [PATCH] godoc: consistent placement of documentation sections Fixes #1226. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5694052 --- lib/godoc/package.html | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/godoc/package.html b/lib/godoc/package.html index 01043b05f2..2e1be5104a 100644 --- a/lib/godoc/package.html +++ b/lib/godoc/package.html @@ -76,22 +76,22 @@ {{with .Consts}}

Constants

{{range .}} - {{comment_html .Doc}}
{{node_html .Decl $.FSet}}
+ {{comment_html .Doc}} {{end}} {{end}} {{with .Vars}}

Variables

{{range .}} - {{comment_html .Doc}}
{{node_html .Decl $.FSet}}
+ {{comment_html .Doc}} {{end}} {{end}} {{range .Funcs}} {{/* Name is a string - no need for FSet */}} {{$name_html := html .Name}}

func {{$name_html}}

-

{{node_html .Decl $.FSet}}

+
{{node_html .Decl $.FSet}}
{{comment_html .Doc}} {{example_html .Name $.Examples $.FSet}} {{end}} @@ -99,28 +99,33 @@ {{$tname := .Name}} {{$tname_html := html .Name}}

type {{$tname_html}}

- {{comment_html .Doc}}
{{node_html .Decl $.FSet}}
+ {{comment_html .Doc}} + {{range .Consts}} - {{comment_html .Doc}}
{{node_html .Decl $.FSet}}
+ {{comment_html .Doc}} {{end}} + {{range .Vars}} - {{comment_html .Doc}}
{{node_html .Decl $.FSet}}
+ {{comment_html .Doc}} {{end}} + {{example_html $tname $.Examples $.FSet}} + {{range .Funcs}} {{$name_html := html .Name}}

func {{$name_html}}

-

{{node_html .Decl $.FSet}}

+
{{node_html .Decl $.FSet}}
{{comment_html .Doc}} {{example_html .Name $.Examples $.FSet}} {{end}} + {{range .Methods}} {{$name_html := html .Name}}

func ({{html .Recv}}) {{$name_html}}

-

{{node_html .Decl $.FSet}}

+
{{node_html .Decl $.FSet}}
{{comment_html .Doc}} {{$name := printf "%s_%s" $tname .Name}} {{example_html $name $.Examples $.FSet}}