go.bigb.es/curator

v1.3.0
Doc Versions Source

Functions

f func HighlightGo

src
func HighlightGo(src []byte) string

HighlightGo returns syntax-highlighted HTML for Go source code. Uses go/scanner to tokenize and wraps tokens in <span> elements with CSS classes. The output includes line numbers with anchor targets for deep linking.

Types

T type FuncDoc

src
type FuncDoc struct {
	Name      string
	Doc       string // HTML
	Decl      string // signature
	Recv      string // receiver type, empty for top-level functions
	ShortDecl string // one-line signature for index
}

FuncDoc represents a function.

T type PackageDoc

src
type PackageDoc struct {
	ImportPath string
	Name       string
	Synopsis   string
	Doc        string // HTML-rendered doc comment
	Consts     []ValueDoc
	Vars       []ValueDoc
	Funcs      []FuncDoc
	Types      []TypeDoc
	Files      []string

	// Module-level info (populated by caller).
	Module      string
	Version     string
	Versions    []string
	SubPackages []SubPkgSummary
}

PackageDoc holds parsed documentation for a Go package.

f func ParsePackage

src
func ParsePackage(gitCache *git.Cache, repoPath, rev, pkgDir, importPath string) (*PackageDoc, error)

ParsePackage reads Go source files from a git revision and produces documentation.

T type SubPkgSummary

src
type SubPkgSummary struct {
	RelPath    string // relative path from module root
	ImportPath string
	Synopsis   string
}

SubPkgSummary describes a sub-package for the module overview.

f func ListSubPackages

src
func ListSubPackages(gitCache *git.Cache, repoPath, rev, modulePath string) ([]SubPkgSummary, error)

ListSubPackages discovers sub-packages in a module.

T type TypeDoc

src
type TypeDoc struct {
	Name    string
	Doc     string // HTML
	Decl    string // type declaration source
	Consts  []ValueDoc
	Vars    []ValueDoc
	Funcs   []FuncDoc // associated constructors
	Methods []FuncDoc
}

TypeDoc represents a type with its methods and associated functions.

T type ValueDoc

src
type ValueDoc struct {
	Names []string
	Doc   string // HTML
	Decl  string // source declaration
}

ValueDoc represents a const or var group.