Documentation
¶
Index ¶
- func Generate(structName, path string, w io.Writer, format OutputFormat) error
- func PrintDefaultYAML(docs []StructDoc, w io.Writer, withComments bool) error
- func PrintEnvFile(docs []StructDoc, w io.Writer) error
- func PrintEnvSummary(docs []StructDoc, w io.Writer) error
- type ASCIIPrinter
- type FieldInfo
- type MarkdownPrinter
- type OutputFormat
- type Parser
- type StructDoc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Generate ¶
func Generate(structName, path string, w io.Writer, format OutputFormat) error
Generate generates documentation for the specified struct in the given path.
func PrintDefaultYAML ¶
PrintDefaultYAML writes a plain YAML config file with default values for all fields across the given struct docs.
func PrintEnvFile ¶
PrintEnvFile writes a .env.example-style file with comments showing descriptions, types, and YAML paths for each env-tagged field.
Types ¶
type ASCIIPrinter ¶
type ASCIIPrinter struct {
// contains filtered or unexported fields
}
ASCIIPrinter generates terminal-friendly documentation with adaptive colors. Colors automatically adjust for light/dark backgrounds and degrade gracefully across TrueColor, ANSI 256, and basic ANSI color profiles via lipgloss CompleteAdaptiveColor.
func NewASCIIPrinter ¶
func NewASCIIPrinter(w io.Writer) *ASCIIPrinter
NewASCIIPrinter creates a new ASCIIPrinter.
type FieldInfo ¶
FieldInfo is an alias for docutil.FieldInfo provided for backwards compatibility so existing code in this package can use the unqualified name.
type MarkdownPrinter ¶
type MarkdownPrinter struct {
// contains filtered or unexported fields
}
MarkdownPrinter handles markdown output generation.
func NewMarkdownPrinter ¶
func NewMarkdownPrinter(w io.Writer) *MarkdownPrinter
NewMarkdownPrinter creates a new MarkdownPrinter that writes to the given writer.
type OutputFormat ¶
type OutputFormat int
OutputFormat specifies the documentation output format.
const ( // FormatMarkdown outputs Markdown documentation. FormatMarkdown OutputFormat = iota // FormatASCII outputs terminal-friendly documentation with ANSI colors. FormatASCII )
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser handles parsing of Go source files.
func (*Parser) FindAllStructs ¶
FindAllStructs returns all exported struct type declarations in the package. Doc comments are propagated from GenDecl to TypeSpec where needed.
func (*Parser) FindStruct ¶
FindStruct finds a struct definition by name in the package. It propagates doc comments from the enclosing GenDecl to the TypeSpec when the TypeSpec's own Doc field is nil (standard Go AST behaviour for top-level type declarations).
func (*Parser) ParsePackage ¶
ParsePackage parses the directory containing the Go files.