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
build_release— parse raw commits into aVersionReleaserender— render multiple releases into a fullCHANGELOG.mdrender_version— render a single version sectionprepend_release— splice a new release into an existing changelog
§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§
- Changelog
Config - Configuration for changelog rendering.
- Changelog
Entry - A commit entry ready for changelog rendering.
- Version
Release - A version release with grouped commits.
Enums§
- Repo
Host - Repo host for generating links.
Functions§
- build_
release - Build a
VersionReleasefrom 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.