changelog

package
v0.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package changelog parses the embedded CHANGELOG.md (see the top-level changelog package) into structured, filterable entries (ADR-0041).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Version string // e.g. "0.5.1", no leading "v"
	Date    string // YYYY-MM-DD
	Raw     string // the section text, header line through end of body
}

Entry is one version's changelog section.

func Load

func Load(fsys fs.FS) ([]Entry, error)

Load reads "CHANGELOG.md" from fsys and parses it. Mirrors catalog.Load(templates.FS). invariant: changelog-embed-decodes

func Parse

func Parse(raw []byte) ([]Entry, error)

Parse splits raw CHANGELOG.md content into ordered entries (newest first, matching file order). Content before the first header (the title and intro prose) is discarded — callers wanting the whole file read it directly instead. Parse errors if no version header is found.

func Range

func Range(entries []Entry, from, to string) ([]Entry, error)

Range returns every entry in [from, to] inclusive, newest first. from must be chronologically older than or equal to the to end (git range convention: from..to); a reversed pair errors rather than silently reordering. invariant: changelog-range-chronological

func Since

func Since(entries []Entry, v string) ([]Entry, error)

Since returns every entry strictly newer than v (exclusive), newest first. It errors if v does not match any entry; it returns an empty (non-nil-error) slice if v is already the newest entry.

func Version

func Version(entries []Entry, v string) (Entry, error)

Version returns the single entry matching v.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL