Crates.io | clog |
lib.rs | clog |
version | 0.11.0 |
source | src |
created_at | 2015-03-31 09:32:38.101012 |
updated_at | 2024-07-08 23:22:14.089355 |
description | A conventional changelog for the rest of us |
homepage | |
repository | https://github.com/clog-tool/clog-lib |
max_upload_size | |
id | 1745 |
size | 66,986 |
clog
A library for generating a conventional changelog from git metadata, written in Rust
clog
creates a changelog automatically from your local git metadata. See the
clog
s changelog.md for an example.
The way this works, is every time you make a commit, you ensure your commit subject line follows the conventional format.
NOTE: clog
also supports empty components by making commit messages such as
alias: message
or alias(): message
(i.e. without the component)
There are two ways to use clog
, as a binary via the command line (See
clog-cli for details) or as a library in your applications.
See the documentation for information on using clog
in your
applications.
In order to see it in action, you'll need a repository that already has some of
those specially crafted commit messages in it's history. For this, we'll use
the clog
repository itself.
clog-lib
repository (we will clone to our home directory to
make things simple, feel free to change it)$ git clone https://github.com/clog-tool/clog-lib
clog
as a dependency in your Cargo.toml
[dependencies]
clog = "*"
src/main.rs
extern crate clog;
use clog::Clog;
fn main() {
// Create the struct
let mut clog = Clog::with_git_work_tree("~/clog")
.unwrap()
.repository("https://github.com/thoughtram/clog")
.subtitle("Crazy Dog")
.changelog("changelog.md")
.from("6d8183f")
.version("0.1.0");
// Write the changelog to the current working directory
//
// Alternatively we could have used .write_changelog_to("/somedir/some_file.md")
clog.write_changelog().unwrap();
}
$ vim changelog.md
clog
can also be configured using a configuration file in TOML.
See the examples/clog.toml
for available options.
clog-cli
- A command line tool
that uses this library to generate changelogs.clog is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.