go.bigb.es/curator
Index
Functions
func HighlightDecl(src string) string
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
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.
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.
func ParsePackage(gitCache *git.Cache, repoPath, rev, pkgDir, importPath string) (*PackageDoc, error)
ParsePackage reads Go source files from a git revision and produces documentation.
type SubPkgSummary struct { RelPath string // relative path from module root ImportPath string Synopsis string }
SubPkgSummary describes a sub-package for the module overview.
func ListSubPackages(gitCache *git.Cache, repoPath, rev, modulePath string) ([]SubPkgSummary, error)
ListSubPackages discovers sub-packages in a module.
HighlightDecl returns syntax-highlighted HTML for a Go declaration snippet. Unlike HighlightGo, this produces inline HTML without table/line-number wrapping.