Documentation
¶
Overview ¶
Package changelog handles changelog fragment parsing and assembly.
Fragments live in changelog.d/<bead-id>.md (or <bead-id>.en.md for backwards compatibility). Each fragment has a "category: <Category>" header line followed by markdown bullet points describing changes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Categories = []string{
"Added",
"Changed",
"Deprecated",
"Removed",
"Fixed",
"Security",
}
Valid changelog categories, in the order they appear in the assembled output.
Functions ¶
func Assemble ¶
Assemble builds a changelog section from fragments, grouped by category. If version is empty, the heading is [Unreleased]. Otherwise it uses the version and today's date, e.g. ## [0.2.0] - 2026-03-09.
func ListBeadIDs ¶
ListBeadIDs returns the bead IDs from all fragments in the directory.
func UpdateChangelog ¶
UpdateChangelog reads an existing CHANGELOG.md, replaces the [Unreleased] section with assembled fragments, and returns the new content. If version is non-empty the section heading uses that version and today's date instead of [Unreleased]. If the file doesn't exist, a new one is created.
func ValidateFragmentExists ¶
ValidateFragmentExists checks if a changelog fragment exists for the given bead ID.
Types ¶
type Fragment ¶
Fragment represents a single changelog entry file.
func CollectFragments ¶
CollectFragments reads all fragment files from a changelog.d directory.
func ParseFragment ¶
ParseFragment reads a changelog fragment file and returns a Fragment.
type FragmentError ¶ added in v0.9.0
FragmentError describes a validation failure for a single fragment file.
func ValidateAllFragments ¶ added in v0.9.0
func ValidateAllFragments(dir string) (valid int, errs []FragmentError)
ValidateAllFragments checks every .md file in dir for correct format and returns a list of all validation errors. Unlike CollectFragments, it does not stop at the first error — it reports every malformed fragment so the user can fix them all in one pass.
func (*FragmentError) Error ¶ added in v0.9.0
func (e *FragmentError) Error() string