1
0
mirror of https://github.com/golang/go synced 2024-11-25 08:57:58 -07:00

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
This commit is contained in:
Robert Griesemer 2011-08-15 15:42:27 -07:00
parent 91fadbca17
commit e6ae13d35d

View File

@ -1,30 +1,22 @@
{{$FSet := .FSet}}{{$Info := .}}{{/* {{with .PAst}}{{node . $.FSet}}{{end}}{{/*
--------------------------------------- ---------------------------------------
*/}}{{with .PAst}}{{node . $FSet}}{{end}}{{/* */}}{{with .PDoc}}{{if $.IsPkg}}PACKAGE
---------------------------------------
*/}}{{with .PDoc}}{{if $Info.IsPkg}}PACKAGE
package {{.PackageName}} package {{.PackageName}}
import "{{.ImportPath}}" import "{{.ImportPath}}"
{{else}}COMMAND DOCUMENTATION {{else}}COMMAND DOCUMENTATION
{{end}}{{/*
--------------------------------------- {{end}}{{.Doc}}{{/*
*/}}{{with .Doc}}{{node . $FSet}}
{{end}}{{/*
--------------------------------------- ---------------------------------------
*/}}{{with .Consts}} */}}{{with .Consts}}
CONSTANTS CONSTANTS
{{range .}}{{node .Decl $FSet}} {{range .}}{{node .Decl $.FSet}}
{{.Doc}}{{end}} {{.Doc}}{{end}}
{{end}}{{/* {{end}}{{/*
@ -33,7 +25,7 @@ CONSTANTS
*/}}{{with .Vars}} */}}{{with .Vars}}
VARIABLES VARIABLES
{{range .}}{{node .Decl $FSet}} {{range .}}{{node .Decl $.FSet}}
{{.Doc}}{{end}} {{.Doc}}{{end}}
{{end}}{{/* {{end}}{{/*
@ -42,7 +34,7 @@ VARIABLES
*/}}{{with .Funcs}} */}}{{with .Funcs}}
FUNCTIONS FUNCTIONS
{{range .}}{{node .Decl $FSet}} {{range .}}{{node .Decl $.FSet}}
{{.Doc}} {{.Doc}}
{{end}}{{end}}{{/* {{end}}{{end}}{{/*
@ -51,15 +43,15 @@ FUNCTIONS
*/}}{{with .Types}} */}}{{with .Types}}
TYPES TYPES
{{range .}}{{node .Decl $FSet}} {{range .}}{{node .Decl $.FSet}}
{{.Doc}} {{.Doc}}
{{range .Consts}}{{node .Decl $FSet}} {{range .Consts}}{{node .Decl $.FSet}}
{{.Doc}} {{.Doc}}
{{end}}{{range .Vars}}{{node .Decl $FSet}} {{end}}{{range .Vars}}{{node .Decl $.FSet}}
{{.Doc}} {{.Doc}}
{{end}}{{range .Factories}}{{node .Decl $FSet}} {{end}}{{range .Factories}}{{node .Decl $.FSet}}
{{.Doc}} {{.Doc}}
{{end}}{{range .Methods}}{{node .Decl $FSet}} {{end}}{{range .Methods}}{{node .Decl $.FSet}}
{{.Doc}} {{.Doc}}
{{end}}{{end}}{{end}}{{/* {{end}}{{end}}{{end}}{{/*