1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:24:41 -07:00

cmd/godoc: add support for doc.Package.Notes

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
This commit is contained in:
Cosmos Nicolaou 2013-02-14 20:35:08 -08:00 committed by Robert Griesemer
parent d0f3475fda
commit c5b4292eb3
2 changed files with 19 additions and 1 deletions

View File

@ -73,6 +73,11 @@
{{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 -->
@ -168,6 +173,14 @@
{{comment_html .}}
{{end}}
{{end}}
{{with .Notes}}
{{range $marker, $content := .}}
<h2 id="pkg-{{$marker}}">{{$marker}}</h2>
{{range .}}
{{comment_html .}}
{{end}}
{{end}}
{{end}}
{{end}}
{{with .PAst}}

View 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}}{{/*
---------------------------------------