On this page
Generate a Markdown CHANGELOG.md from structured JSONL changelog entries, grouping them by version with configurable formatting.
#rlsbl.changelog.generate
#rlsbl.changelog.generate
Generate a Markdown CHANGELOG.md from structured JSONL changelog entries, grouping them by version with configurable formatting.
#generate_version_section
def generate_version_section(version: str, entries: list[ChangelogEntry], *, description: str='', context: str='') -> strGenerate markdown for one version section.
Only includes entries where user_facing=True. Groups by type under sub-headers (Breaking, Features, Fixes, Other). Empty groups are omitted. If no user-facing entries exist, emits a single "No user-facing changes." bullet.
If all entries share a release_type (e.g., "ota" or "build"), a marker is appended to the version heading.
When description is provided, it is added as a paragraph after the version heading and before the first type group. When context is provided, it is rendered as a collapsible block after the description.
#generate_version_file
def generate_version_file(changes_dir: str, version: str, write_to_disk: bool=True) -> strRead the JSONL file for a version, generate markdown, optionally write .md alongside it.
Returns the generated markdown text. When write_to_disk is False, computes the markdown without touching the filesystem (used to preview content before pre-checks).
#_read_changelog_format
def _read_changelog_format(project_path: str) -> strRead changelog_format from project config, defaulting to 'grouped'.
#generate_changelog
def generate_changelog(project_path: str, *, write_to_disk: bool=True, version_override: str | None=None, description: str='', context: str='') -> strGenerate the complete CHANGELOG.md from .rlsbl/changes/ JSONL files.
- Reads changelog_format from config (only "grouped" supported).
- Reads unreleased.jsonl (if non-empty) for an Unreleased section.
- Reads all versioned JSONL files sorted newest-first.
- Generates per-version .md files alongside the JSONL files (when write_to_disk).
- Writes CHANGELOG.md at project root (when write_to_disk).
- Returns the generated content.
When write_to_disk is False, computes and returns the markdown content without modifying the filesystem. This lets callers preview the changelog before pre-release checks run, so an aborted release leaves a clean working tree.
When version_override is provided AND unreleased entries exist, the section heading is "## {version_override}" instead of "## Unreleased". Versioned sections (from existing JSONL files) are unaffected. Default None preserves the original behaviour exactly.
description and context are applied to the unreleased section only (the current release being prepared). They are not applied to previously released version sections.