{"modulePath":"github.com/lichdotdev/lich","version":"v0.93.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package patchnotes\n\nPackage 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.\n\nA section is the groups (\"### Added / Changed / Fixed\") plus, optionally, GitHub alert blocks written between the version heading and the first group:\n\n\t## [0.45.0] - 2026-09-06\n\n\t\u003e [!IMPORTANT]\n\t\u003e **Linux users: lich now opens in its own window.** No browser needs\n\t\u003e to be installed.\n\n\t### Added\n\nEach 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.\n\nTranslations live in changelog/\\\u003clocale\u003e.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.\n\n## Constants\n\n```go\nconst KindCaution = \"caution\"\n```\nKindCaution is the alert kind of a release whose update is required.\n\n## Functions\n\n```go\nfunc RequiresUpdate(notes string) bool\n```\nRequiresUpdate 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.\n\n## Types\n\n```go\ntype Group = api.PatchNotesGroup\n```\n\n```go\nfunc Section(changelog, version string) []Group\n```\nSection returns the groups under the \"## \\[\\\u003cversion\u003e]\" 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.\n\n```go\ntype Highlight = api.PatchNotesHighlight\n```\n\n```go\nfunc Highlights(changelog, version string) []Highlight\n```\nHighlights returns the alert blocks under the \"## \\[\\\u003cversion\u003e]\" heading, in the order written, or nil when the heading is absent or carries none.\n\n```go\ntype Notes = api.PatchNotes\n```\n\n```go\ntype Service struct {\n\t// contains filtered or unexported fields\n}\n```\nService serves the notes for one fixed version — the running build.\n\n```go\nfunc New(version, changelog string, translations fs.FS) *Service\n```\nNew returns a service that parses changelog for version's section on demand. translations holds one changelog/\\\u003clocale\u003e.md per translated language.\n\n```go\nfunc (s *Service) Current(_ context.Context, opts api.PatchNotesOptions) (Notes, error)\n```\nCurrent 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.\n\n","path":"github.com/lichdotdev/lich/internal/patchnotes","name":"patchnotes","synopsis":"Package patchnotes serves the changelog section for the running build so the app can show a \"what's new\" popup after an update.","isRedistributable":true}
