API reference
Every declaration below is extracted from zig-changelog's source, with the doc comments as written there. A declaration listed without prose is public but undocumented in the source.
Root
types
const types = @import("types.zig")
git
const git = @import("git.zig")
parser
const parser = @import("parser.zig")
changelog
const changelog = @import("changelog.zig")
Commit
const Commit = types.Commit
CommitType
const CommitType = types.CommitType
Section
const Section = types.Section
Config
const Config = types.Config
ChangelogResult
const ChangelogResult = types.ChangelogResult
generateChangelog
const generateChangelog = changelog.generateChangelog
isGitRepository
const isGitRepository = git.isGitRepository
getLatestTag
const getLatestTag = git.getLatestTag
getRepositoryUrl
const getRepositoryUrl = git.getRepositoryUrl
types
CommitType
const CommitType = enum
Commit type based on conventional commits
toString
fn toString(self: CommitType) []const u8
fromString
fn fromString(str: []const u8) CommitType
getTitle
fn getTitle(self: CommitType) []const u8
Commit
const Commit = struct
Parsed commit information
deinit
fn deinit(self: *Commit, allocator: std.mem.Allocator) void
Section
const Section = struct
Section grouping commits by type
init
fn init(allocator: std.mem.Allocator, commit_type: CommitType) Section
deinit
fn deinit(self: *Section, allocator: std.mem.Allocator) void
Config
const Config = struct
Configuration options for changelog generation
ChangelogResult
const ChangelogResult = struct
Result of changelog generation
deinit
fn deinit(self: *ChangelogResult, allocator: std.mem.Allocator) void
git
isGitRepository
fn isGitRepository(allocator: std.mem.Allocator, io: Io, dir: []const u8) !bool
Check if directory is a git repository
getLatestTag
fn getLatestTag(allocator: std.mem.Allocator, io: Io, dir: []const u8) !?[]const u8
Get the latest git tag
getRepositoryUrl
fn getRepositoryUrl(allocator: std.mem.Allocator, io: Io, dir: []const u8) !?[]const u8
Get repository URL from git config
getCommits
fn getCommits(
Get git commits in a range
generateCompareUrl
fn generateCompareUrl(
Generate compare URL for a commit range
generateCommitUrl
fn generateCommitUrl(
Generate commit URL
parser
parseConventionalCommit
fn parseConventionalCommit(
Parse a conventional commit message
parseCommitLine
fn parseCommitLine(
Parse a commit line from git log output
changelog
groupCommits
fn groupCommits(
Group commits by type into sections
generateMarkdown
fn generateMarkdown(
Generate markdown changelog content
getContributors
fn getContributors(
Get unique contributors from commits
generateChangelog
fn generateChangelog(
Generate complete changelog