Commit c5b4292e authored by Cosmos Nicolaou's avatar Cosmos Nicolaou Committed by Robert Griesemer

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
parent d0f3475f
...@@ -73,6 +73,11 @@ ...@@ -73,6 +73,11 @@
{{if .Bugs}} {{if .Bugs}}
<dd><a href="#pkg-bugs">Bugs</a></dd> <dd><a href="#pkg-bugs">Bugs</a></dd>
{{end}} {{end}}
{{if .Notes}}
{{range $marker, $item := .Notes}}
<dd><a href="#pkg-{{$marker}}">{{$marker}}</a></dd>
{{end}}
{{end}}
</dl> </dl>
</div><!-- #manual-nav --> </div><!-- #manual-nav -->
...@@ -168,6 +173,14 @@ ...@@ -168,6 +173,14 @@
{{comment_html .}} {{comment_html .}}
{{end}} {{end}}
{{end}} {{end}}
{{with .Notes}}
{{range $marker, $content := .}}
<h2 id="pkg-{{$marker}}">{{$marker}}</h2>
{{range .}}
{{comment_html .}}
{{end}}
{{end}}
{{end}}
{{end}} {{end}}
{{with .PAst}} {{with .PAst}}
......
...@@ -61,7 +61,12 @@ TYPES ...@@ -61,7 +61,12 @@ TYPES
BUGS BUGS
{{range .}}{{comment_text . " " "\t"}} {{range .}}{{comment_text . " " "\t"}}
{{end}}{{end}}{{end}}{{/* {{end}}{{end}}{{with .Notes}}
{{range $marker, $content := .}}
{{$marker}}
{{range $content}}{{comment_text . " " "\t"}}
{{end}}{{end}}{{end}}{{end}}{{/*
--------------------------------------- ---------------------------------------
......
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