Documentation
¶
Overview ¶
Package doc prints declarations with their doc comments, as ant doc does (spec/doc.md).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Suggest ¶ added in v0.3.0
Suggest is what to look at instead when name names nothing among decls (spec/doc.md section 1): the declarations of other owners with its member name, else the names nearest to it, else, for Owner.name with a known owner, the owner's listing; "" when there is nothing to suggest.
Types ¶
type Printer ¶ added in v0.2.0
type Printer struct {
Color bool
}
Printer renders documentation, preserving source line breaks and spacing. Color highlights signatures and examples and emphasizes namespace headings; the zero value prints no escapes.
func (*Printer) Print ¶ added in v0.2.0
func (p *Printer) Print(w io.Writer, decls []ast.Decl, name string, namespaceDocs map[string]string) bool
Print prints what name names among decls: a declaration with its doc, a namespace's section label from namespaceDocs, and the signatures a namespace or a type holds. It reports whether name named anything. A name is matched without regard to case, and Owner.name names a member.
func (*Printer) PrintDoc ¶ added in v0.2.0
PrintDoc prints a declaration's signature and, indented, its doc.
func (*Printer) PrintIndented ¶ added in v0.2.0
PrintIndented prints a doc indented by four spaces, preserving source line breaks and spacing. Indented code is highlighted when Color is set.