Documentation ¶
Overview ¶
Package godoc provides the means of converting parsed Go source information into a documentation subset of it. This information is neessary to render documentation for a package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OneLineNodeDepth ¶
OneLineNodeDepth returns a one-line summary of the given input node. The depth specifies the current depth when traversing the AST and the function will stop traversing once depth reaches maxSynopsisNodeDepth.
Types ¶
type Assembler ¶
type Assembler struct { Linker Linker // Lexer used to highlight code blocks. Lexer highlight.Lexer // contains filtered or unexported fields }
Assembler assembles a Package from a go/doc.Package.
type CodeBuilder ¶
CodeBuilder builds highlight.Code blocks, using the provided linker to resolve links to entities.
func (*CodeBuilder) Build ¶
Build builds a highlight.Code containing the provided source, annotated with the provided regions.
Panics if regions are out of bounds in src, or an unknown region is encountered.
type DeclFormatter ¶
type DeclFormatter interface {
FormatDecl(ast.Decl) (src []byte, regions []gosrc.Region, err error)
}
DeclFormatter formats an AST declaration for rendering in documentation.
type Function ¶
type Function struct { Name string Doc *comment.Doc Decl *highlight.Code ShortDecl string Recv string // only set for methods RecvType string // name of the receiver type without '*' }
Function is a top-level function or method.
type Package ¶
type Package struct { Name string Doc *comment.Doc // package-level documentation // Empty if the package isn't a binary. BinName string ImportPath string Import *highlight.Code // code form of import path Synopsis string Constants []*Value Variables []*Value Types []*Type Functions []*Function }
Package holds documentation for a single Go package.