patchnotes

package
v0.93.0-rc.9 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 6 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, and "caution" marks the release as an update lich requires (internal/appupdate reads it out of the published notes). 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

View Source
const KindCaution = "caution"

KindCaution is the alert kind of a release whose update is required.

Variables

This section is empty.

Functions

func RequiresUpdate added in v0.87.0

func RequiresUpdate(notes string) bool

RequiresUpdate reports whether notes carry a caution block before their first group. notes is one release's changelog section, or the GitHub release body composed from it.

Types

type Group

type Group = api.PatchNotesGroup

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 = api.PatchNotesHighlight

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 = api.PatchNotes

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(_ context.Context, opts api.PatchNotesOptions) (Notes, error)

Current returns the running build's changelog section in opts.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