]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/godoc: add support for doc.Package.Notes
authorCosmos Nicolaou <cnicolaou@google.com>
Fri, 15 Feb 2013 04:35:08 +0000 (20:35 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 15 Feb 2013 04:35:08 +0000 (20:35 -0800)
Add support for displaying the notes of the form 'MARKER(userid): comment' now collected by the go/doc package. Any two or more uppercase letters are recognised as a marker.

R=gri, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7334044

lib/godoc/package.html
lib/godoc/package.txt

index e67cf93bed381baae2f40c57d83c1186577af0cf..cff91fa22645cd66646f82ddf3c58fb03757371f 100644 (file)
                        {{if .Bugs}}
                                <dd><a href="#pkg-bugs">Bugs</a></dd>
                        {{end}}
+                       {{if .Notes}}
+                                {{range $marker, $item := .Notes}}
+                               <dd><a href="#pkg-{{$marker}}">{{$marker}}</a></dd>
+                                {{end}}
+                       {{end}}
                        </dl>
                        </div><!-- #manual-nav -->
 
                {{comment_html .}}
                {{end}}
        {{end}}
+       {{with .Notes}}
+                {{range $marker, $content := .}}
+                   <h2 id="pkg-{{$marker}}">{{$marker}}</h2>
+                   {{range .}}
+                   {{comment_html .}}
+                    {{end}}
+               {{end}}
+       {{end}}
 {{end}}
 
 {{with .PAst}}
index 8b9ec456bfb3eb10f6a55c64beb05197bab32160..12964b0010d5ef95d2e091b963d6130543f543b7 100644 (file)
@@ -61,7 +61,12 @@ TYPES
 BUGS
 
 {{range .}}{{comment_text . "    " "\t"}}
-{{end}}{{end}}{{end}}{{/*
+{{end}}{{end}}{{with .Notes}}
+{{range $marker, $content := .}}
+{{$marker}}
+
+{{range $content}}{{comment_text . "    " "\t"}}
+{{end}}{{end}}{{end}}{{end}}{{/*
 
 ---------------------------------------