Documentation
¶
Overview ¶
Package codocgen provides tools for generating code documentation from Go source code. This package analyzes Go packages and produces codoc.Package objects with documentation.
Package codocgen provides tools for generating code documentation from Go source code. This package analyzes Go packages and produces codoc.Package objects with documentation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromPath ¶
FromPath generates documentation for a package at the given path. It analyzes the Go source code in the specified path and returns a codoc.Package containing all the extracted documentation information. Options can be provided to filter what gets included in the documentation.
func RegisterPath ¶
RegisterPath registers a package at the given path with the codoc registry. It analyzes the package, generates documentation, and adds it to the global registry. Options can be provided to filter what gets included in the documentation.
Types ¶
type Option ¶
type Option func(*config)
Option is a function type that modifies a config. Options are used to customize the behavior of the documentation generator.
func Exported ¶
func Exported() Option
Exported returns an Option that filters to include only exported functions and structs. Exported items are those that start with an uppercase letter.
func FilterFuncs ¶
FilterFuncs adds a function filter to the configuration. The filter function takes a Function and returns true if it should be included in the documentation.
func FilterStructs ¶
FilterStructs adds a struct filter to the configuration. The filter function takes a Struct and returns true if it should be included in the documentation.
type PackageError ¶
PackageError represents errors encountered during package loading and analysis. It wraps a slice of packages.Error from the go/packages package.
func (PackageError) Error ¶
func (PackageError) Error() string
Error implements the error interface for PackageError.