Documentation ¶
Overview ¶
Package lib generates starlark documentation from go code
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Doc ¶
type Doc struct { Name string Path string Description string Functions Functions Types Types // contains filtered or unexported fields }
Doc is is a documentation document
func ParseFirst ¶
ParseFirst consumes a reader of outline data, creating and returning the first outline document it encounters. ParseFirst consumes the entire reader TODO(b5): don't consume the entire reader. return after the first complete document
func (*Doc) MarshalIndent ¶
MarshalIndent writes doc to a string with depth & prefix
type Docs ¶
type Docs []*Doc
Docs is a sortable slice of Doc pointers
func Parse ¶
Parse consumes a reader of data that contains zero or more outlines creating and returning any documents it finds
type Function ¶
type Function struct { FuncName string Receiver string // should be set by parsing context Signature string Description string Params []*Param Return string Examples []*Example }
Function documents a starlark function
type Functions ¶
type Functions []*Function
Functions is a sortable slice of Function pointers
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func AlphaSortFuncs ¶
func AlphaSortFuncs() Option
func AlphaSortTypes ¶
func AlphaSortTypes() Option
type Position ¶
type Position struct {
Line, Col, Offset int
}
Position of a token within the scan stream
type TokenType ¶
type TokenType int
TokenType enumerates the different types of tokens
const ( // IllegalTok is the default for unrecognized tokens IllegalTok TokenType = iota // LiteralBegin marks the beginning of literal tokens in the token enumeration LiteralBegin // IndentTok is a tab character "\t" or two consecutive spaces" " IndentTok // NewlineTok is a line break NewlineTok // TextTok is a token for arbitrary text TextTok // LiteralEnd marks the end of literal tokens in the token enumeration LiteralEnd // KeywordBegin marks the end of keyword tokens in the token enumeration KeywordBegin // CodeTok is the "code:" token CodeTok // DocumentTok is the "document:" token DocumentTok // ExamplesTok is the "examples:" token ExamplesTok // PathTok is the "path:" token PathTok // FunctionsTok is the "functions:" token FunctionsTok // ParamsTok is the "params:" token ParamsTok // ReturnTok is the "return:" token ReturnTok // TypesTok is the "types:" token TypesTok // FieldsTok is the "fields:" token FieldsTok // MethodsTok is the "methods:" token MethodsTok // OperatorsTok is the "operators:" token OperatorsTok // KeywordEnd marks the end of keyword tokens in the token enumeration KeywordEnd )
type Type ¶
type Type struct { Name string Description string Methods Functions Fields []*Field Operators []*Operator }
Type documents a constructed type