diff options
author | Robert Griesemer <gri@golang.org> | 2011-08-15 15:42:27 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2011-08-15 15:42:27 -0700 |
commit | e6ae13d35d38a19e9a0031114714a351a0d3e888 (patch) | |
tree | 74f855959bdb945eb1c01ab12194d52601f60eba | |
parent | 91fadbca17ac7e79bc60684c9f4d64c3892398e1 (diff) | |
download | go-e6ae13d35d38a19e9a0031114714a351a0d3e888.tar.gz go-e6ae13d35d38a19e9a0031114714a351a0d3e888.zip |
godoc: fix lib/godoc/package.txt template
- show documentation in text mode; e.g.:
http://localhost:7777/cmd/godoc/?f=text
- simplify template by using $ variable
R=r, adg
CC=golang-dev
https://golang.org/cl/4873045
-rw-r--r-- | lib/godoc/package.txt | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/lib/godoc/package.txt b/lib/godoc/package.txt index 45c5566e8c..179b33493d 100644 --- a/lib/godoc/package.txt +++ b/lib/godoc/package.txt @@ -1,30 +1,22 @@ -{{$FSet := .FSet}}{{$Info := .}}{{/* +{{with .PAst}}{{node . $.FSet}}{{end}}{{/* --------------------------------------- -*/}}{{with .PAst}}{{node . $FSet}}{{end}}{{/* - ---------------------------------------- - -*/}}{{with .PDoc}}{{if $Info.IsPkg}}PACKAGE +*/}}{{with .PDoc}}{{if $.IsPkg}}PACKAGE package {{.PackageName}} import "{{.ImportPath}}" {{else}}COMMAND DOCUMENTATION -{{end}}{{/* ---------------------------------------- - -*/}}{{with .Doc}}{{node . $FSet}} -{{end}}{{/* +{{end}}{{.Doc}}{{/* --------------------------------------- */}}{{with .Consts}} CONSTANTS -{{range .}}{{node .Decl $FSet}} +{{range .}}{{node .Decl $.FSet}} {{.Doc}}{{end}} {{end}}{{/* @@ -33,7 +25,7 @@ CONSTANTS */}}{{with .Vars}} VARIABLES -{{range .}}{{node .Decl $FSet}} +{{range .}}{{node .Decl $.FSet}} {{.Doc}}{{end}} {{end}}{{/* @@ -42,7 +34,7 @@ VARIABLES */}}{{with .Funcs}} FUNCTIONS -{{range .}}{{node .Decl $FSet}} +{{range .}}{{node .Decl $.FSet}} {{.Doc}} {{end}}{{end}}{{/* @@ -51,15 +43,15 @@ FUNCTIONS */}}{{with .Types}} TYPES -{{range .}}{{node .Decl $FSet}} +{{range .}}{{node .Decl $.FSet}} {{.Doc}} -{{range .Consts}}{{node .Decl $FSet}} +{{range .Consts}}{{node .Decl $.FSet}} {{.Doc}} -{{end}}{{range .Vars}}{{node .Decl $FSet}} +{{end}}{{range .Vars}}{{node .Decl $.FSet}} {{.Doc}} -{{end}}{{range .Factories}}{{node .Decl $FSet}} +{{end}}{{range .Factories}}{{node .Decl $.FSet}} {{.Doc}} -{{end}}{{range .Methods}}{{node .Decl $FSet}} +{{end}}{{range .Methods}}{{node .Decl $.FSet}} {{.Doc}} {{end}}{{end}}{{end}}{{/* |