patchnotes

package
v0.73.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

A translation of the latest release lives in changelog/<locale>.md, written 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 release 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.

func Section

func Section(changelog, version string) []Group

Section returns the groups under the "## [<version>]" heading, or nil when that heading is absent. The heading may carry a trailing date ("## [0.11.0] - 2026-07-21"); only the bracketed version is matched.

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

func Highlights(changelog, version string) []Highlight

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

func New(version, changelog string, translations fs.FS) *Service

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

func (s *Service) Current(locale string) (Notes, error)

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.

Jump to

Keyboard shortcuts

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