Documentation
¶
Overview ¶
Package patchnotes serves the changelog section for the running build so the app can show a "what's new" popup after an update. CHANGELOG.md is embedded at the module root (see main.go) and parsed here — the window stays a dumb renderer.
A section is the groups ("### Added / Changed / Fixed") plus, optionally, GitHub alert blocks written between the version heading and the first group:
## [0.45.0] - 2026-09-06 > [!IMPORTANT] > **Linux users: lich now opens in its own window.** No browser needs > to be installed. ### Added
Each block is a Highlight. GitHub renders the same blocks as callouts on the release page, so a release announces itself in one place. The kind is the volume: "important" is the release's headline and opens the popup as its title, "warning" is something the reader must do or avoid, "note" a detail worth a line. The window decides how each kind looks.
Translations live in changelog/<locale>.md, newest release first, each added by the lich-changelog-i18n skill when a release is cut: the same section, headings, alert openers and code spans left in English. TestTranslations holds each file to the releases it translates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
Label string `json:"label"`
// Items keep their markdown bold/code markers; the window renders them.
Items []string `json:"items"`
}
Group is one "### Added / Changed / Fixed" block of a release's notes.
type Highlight ¶
type Highlight struct {
Kind string `json:"kind"`
// Text keeps its markdown bold/code markers; the window renders them.
Text string `json:"text"`
}
Highlight is one GitHub alert block ("> [!IMPORTANT]") written between a release's heading and its first group. Kind is the alert type, lowercased.
func Highlights ¶
Highlights returns the alert blocks under the "## [<version>]" heading, in the order written, or nil when the heading is absent or carries none.
type Notes ¶
type Notes struct {
Version string `json:"version"`
Highlights []Highlight `json:"highlights"`
Groups []Group `json:"groups"`
}
Notes is a release's changelog section, ready for the window to render.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service serves the notes for one fixed version — the running build.
func New ¶
New returns a service that parses changelog for version's section on demand. translations holds one changelog/<locale>.md per translated language.
func (*Service) Current ¶
Current returns the running build's changelog section in locale, the interface language's BCP 47 tag. A locale with no translation of this version (English, a dev build, a release cut without the skill) gets the English section. Groups is empty when no section matches (a dev build, or a version not yet in the changelog), and the window then shows nothing.