summaryrefslogtreecommitdiff
path: root/lib/godoc/package.txt
diff options
context:
space:
mode:
Diffstat (limited to 'lib/godoc/package.txt')
-rw-r--r--lib/godoc/package.txt31
1 files changed, 14 insertions, 17 deletions
diff --git a/lib/godoc/package.txt b/lib/godoc/package.txt
index 3f3c396f0..94239ca1a 100644
--- a/lib/godoc/package.txt
+++ b/lib/godoc/package.txt
@@ -2,14 +2,15 @@
---------------------------------------
-*/}}{{with .PDoc}}{{if $.IsPkg}}PACKAGE
+*/}}{{with .PDoc}}{{if not $.IsMain}}PACKAGE
package {{.Name}}
import "{{.ImportPath}}"
{{else}}COMMAND DOCUMENTATION
-{{end}}{{comment_text .Doc " " "\t"}}{{/*
+{{end}}{{comment_text .Doc " " "\t"}}
+{{example_text "" $.Examples $.FSet " "}}{{/*
---------------------------------------
@@ -36,6 +37,7 @@ FUNCTIONS
{{range .}}{{node .Decl $.FSet}}
{{comment_text .Doc " " "\t"}}
+{{example_text .Name $.Examples $.FSet " "}}
{{end}}{{end}}{{/*
---------------------------------------
@@ -43,34 +45,29 @@ FUNCTIONS
*/}}{{with .Types}}
TYPES
-{{range .}}{{node .Decl $.FSet}}
+{{range .}}{{$tname := .Name}}{{node .Decl $.FSet}}
{{comment_text .Doc " " "\t"}}
{{range .Consts}}{{node .Decl $.FSet}}
{{comment_text .Doc " " "\t"}}
{{end}}{{range .Vars}}{{node .Decl $.FSet}}
{{comment_text .Doc " " "\t"}}
-{{end}}{{range .Funcs}}{{node .Decl $.FSet}}
+{{end}}{{example_text .Name $.Examples $.FSet " "}}
+{{range .Funcs}}{{node .Decl $.FSet}}
{{comment_text .Doc " " "\t"}}
+{{example_text .Name $.Examples $.FSet " "}}
{{end}}{{range .Methods}}{{node .Decl $.FSet}}
{{comment_text .Doc " " "\t"}}
+{{$name := printf "%s_%s" $tname .Name}}{{example_text $name $.Examples $.FSet " "}}
{{end}}{{end}}{{end}}{{/*
---------------------------------------
-*/}}{{with .Bugs}}
-BUGS
-
-{{range .}}{{comment_text . " " "\t"}}
-{{end}}{{end}}{{end}}{{/*
+*/}}{{with $.Notes}}
+{{range $marker, $content := .}}
+{{noteTitle $marker}}s
----------------------------------------
-
-*/}}{{with .PList}}
-OTHER PACKAGES
-
-{{range .}}
-{{.}}{{end}}
-{{end}}{{/*
+{{range $content}}{{comment_text . " " "\t"}}
+{{end}}{{end}}{{end}}{{end}}{{/*
---------------------------------------