generator.go highlight.go parser.go renderer.go types.go
func Generate(sourceDir, outputDir, repoUrl, version, importPath string) error
Generate creates HTML documentation for all packages within a Go module.
FuncDoc holds documentation for a single function or method.
type FuncDoc struct { Name string Doc string Signature template.HTML }
PackageDoc holds all the documentation for a single package.
type PackageDoc struct { Name string RepositoryUrl string Version string ImportPath string StyleSheetPath string Doc string Functions []FuncDoc Types []TypeDoc Variables []VarDoc Constants []VarDoc SubPackages []string }
func ParsePackageDoc(inputPath string) (*PackageDoc, error)
ParsePackageDoc parses the Go package in the given directory and returns an initialized PackageDoc. It does not populate metadata fields like RepositoryUrl or Version.
func (p *PackageDoc) IsEmpty() bool
IsEmpty reports whether the package documentation is empty (has no content).
func (p *PackageDoc) Render(outputPath string) error
Render generates the HTML documentation file using the embedded template.
TypeDoc holds documentation for a type definition and its methods.
type TypeDoc struct { Name string Doc string Definition template.HTML Constants []VarDoc // Constants grouped under this type Variables []VarDoc // Variables grouped under this type Functions []FuncDoc // Constructors/factory functions associated with this type. Methods []FuncDoc }
VarDoc holds documentation for a variable or constant declaration.
type VarDoc struct { Doc string Definition template.HTML }