1
0
mirror of https://github.com/golang/go synced 2024-11-20 06:44:40 -07:00
go/lib/godoc/package.txt
Robert Griesemer eac31c67a8 go/doc: streamlined go/doc API
- the main changes are removing the Doc suffix
  from the exported types, so instead of
  doc.TypeDoc one will have doc.Type, etc.

- All exported types now have a Name (or Names) field.
  For Values, the Names field lists all declared variables
  or constants.

- Methods have additional information about where they are
  coming from.

- There's a mode field instead of a bool to
  control the package's operation, which makes
  it easier to extend w/o API changes.

Except for the partially implemented new Method type,
this is based on existing code. A clean rewrite is in
progress based on this new API.

R=rsc, kevlar
CC=golang-dev
https://golang.org/cl/5528060
2012-01-12 17:36:57 -08:00

84 lines
1.6 KiB
Plaintext

{{with .PAst}}{{node . $.FSet}}{{end}}{{/*
---------------------------------------
*/}}{{with .PDoc}}{{if $.IsPkg}}PACKAGE
package {{.PackageName}}
import "{{.ImportPath}}"
{{else}}COMMAND DOCUMENTATION
{{end}}{{comment_text .Doc " " "\t"}}{{/*
---------------------------------------
*/}}{{with .Consts}}
CONSTANTS
{{range .}}{{node .Decl $.FSet}}
{{comment_text .Doc " " "\t"}}{{end}}
{{end}}{{/*
---------------------------------------
*/}}{{with .Vars}}
VARIABLES
{{range .}}{{node .Decl $.FSet}}
{{comment_text .Doc " " "\t"}}{{end}}
{{end}}{{/*
---------------------------------------
*/}}{{with .Funcs}}
FUNCTIONS
{{range .}}{{node .Decl $.FSet}}
{{comment_text .Doc " " "\t"}}
{{end}}{{end}}{{/*
---------------------------------------
*/}}{{with .Types}}
TYPES
{{range .}}{{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}}
{{comment_text .Doc " " "\t"}}
{{end}}{{range .Methods}}{{node .Decl $.FSet}}
{{comment_text .Doc " " "\t"}}
{{end}}{{end}}{{end}}{{/*
---------------------------------------
*/}}{{with .Bugs}}
BUGS
{{range .}}{{comment_text . " " "\t"}}
{{end}}{{end}}{{end}}{{/*
---------------------------------------
*/}}{{with .PList}}
OTHER PACKAGES
{{range .}}
{{.}}{{end}}
{{end}}{{/*
---------------------------------------
*/}}{{with .Dirs}}
SUBDIRECTORIES
{{if $.DirFlat}}{{range .List}}
{{.Path}}{{end}}
{{else}}{{range .List}}
{{repeat `. ` .Depth}}{{.Name}}{{end}}
{{end}}{{end}}