Documentation
¶
Overview ¶
Package component provides GitLab CI component spec parsing and documentation generation for the `stagefreight component` command family.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDocs ¶
GenerateDocs renders markdown documentation for one or more parsed spec files. Each spec file gets its own section with grouped input tables.
func InjectIntoReadme ¶
InjectIntoReadme reads a README file and replaces the named sf:section with the provided content. Returns the updated README text.
Types ¶
type SpecFile ¶
type SpecFile struct {
Name string // display name (filename without extension)
Path string // original file path
Inputs []SpecInput // parsed inputs in order
}
SpecFile bundles a parsed component spec with its source filename.
func ParseSpec ¶
ParseSpec reads a GitLab CI component spec YAML file and extracts inputs with group metadata from custom comments.
The parser is line-oriented (not full YAML) to preserve comment-based group metadata that standard YAML parsers discard. It understands the custom comment conventions:
# input_section_name- Group Title # input_section_desc- Group description text
type SpecInput ¶
type SpecInput struct {
Name string // input key name
Type string // "string", "boolean", "number", "array" (default: "string")
Default string // default value; empty means required
Description string
Required bool // true if no default was specified
Group string // from # input_section_name- comment
GroupDesc string // from # input_section_desc- comment
}
SpecInput represents a single input extracted from a GitLab CI component spec file, including group metadata from custom comments.