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 ¶
Types ¶
type Printer ¶
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 ¶
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) PrintIndented ¶
PrintIndented prints a doc indented by four spaces, preserving source line breaks and spacing. Indented code is highlighted when Color is set.