Crate changelog [] [src]

A generator for categorized change logs.

This crate generates change logs (a.k.a release notes) that are typically distributed at project release milestones. It looks for keywords in git commit messages and uses them to produce a presentable and categorized change log.

The associated crate git-changelog provides an executable wrapper around this crate.

Use

The crate functionality is also usable as a library as shown below:

extern crate changelog;
println!("{}", changelog::ChangeLog::new());

The configuration used in simple example shown above is picked from the repository configuration file (if one is found) or from built-in defaults. Advanced usage can programmatically manage these as follows:

use changelog::{Configuration, Keyword, ChangeLog};

// Create a custom configuration
let mut config = Configuration::new();

// Pick the category or scope keywords that match your project conventions
config.conventions.categories.push(Keyword::new("feature", "New Features"));
config.conventions.categories.push(Keyword::new("break", "Breaking Changes"));

// Pick the range of commits
let range = String::from("v0.1.1..v0.2.0");

// Generate a changelog for the range with the configuration
let changelog = ChangeLog::from_range(range, &config);

// Pick output preferences
config.output.json = true;

// Render
assert!(changelog::render(&changelog, &config.output).is_ok());

Structs

Category

Changes grouped by categories (e.g. "Fixes", "Breaking Changes", etc.).

ChangeLog

A categorized changelog

Commit

A single commit

CommitList

A list of commit revisions

CommitMessage

The commit message

Configuration

The tool configuration.

Conventions

The change categorization conventions used by a repository/project.

Keyword

A keyword used to categorize commit message lines.

OutputPreferences

The output preferences

PostProcessor

A post-processor definition.

Scope

Changes grouped by scope (e.g. "API", "Documentation", etc.).

Constants

CONFIG_FILE

The YAML configuration file name (.changelog.yml).

TEMPLATE_FILE

The Handlebars template file name (.changelog.hbs).

Functions

in_git_repository

Check if we're in an git repository?

render

Render the changelog with the given output preferences

Type Definitions

Result