Skip to main content

Crate standard_changelog

Crate standard_changelog 

Source
Expand description

Changelog generation from conventional commits.

Groups parsed commits by type, renders markdown sections, and manages CHANGELOG.md files. Pure library — no I/O, no git operations, no terminal output.

§Main entry points

§Example

use standard_changelog::{build_release, render, ChangelogConfig, RepoHost};

let commits = vec![
    ("abc1234", "feat(auth): add OAuth2 PKCE flow"),
    ("def5678", "fix: handle expired tokens"),
];

let config = ChangelogConfig::default();
let mut release = build_release(&commits, "1.0.0", None, &config).unwrap();
release.date = "2026-03-14".to_string();

let host = RepoHost::Unknown;
let changelog = render(&[release], &config, &host);
assert!(changelog.contains("## 1.0.0 (2026-03-14)"));
assert!(changelog.contains("### Features"));
assert!(changelog.contains("### Bug Fixes"));

Structs§

ChangelogConfig
Configuration for changelog rendering.
ChangelogEntry
A commit entry ready for changelog rendering.
VersionRelease
A version release with grouped commits.

Enums§

RepoHost
Repo host for generating links.

Functions§

build_release
Build a VersionRelease from raw commit data.
days_to_date
Convert days since Unix epoch to (year, month, day).
detect_host
Parse a git remote URL to detect the repo host.
format_date
Format a Unix timestamp (seconds since epoch) as YYYY-MM-DD.
prepend_release
Prepend a release section to an existing changelog.
render
Render a full changelog from multiple releases.
render_version
Render a single version section as markdown.