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 Parse(dir string) (*PackageDoc, error)
Parse parses the Go package in the given directory and returns a 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 (pkgDoc *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 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 }