Struct clog::SectionMap [] [src]

pub struct SectionMap {
    pub sections: HashMap<String, BTreeMap<String, Vec<Commit>>>,
}

A struct which holds sections to and components->commits map

Fields

The top level map of the changelog, i.e. sections -> components

Methods

impl SectionMap
[src]

Creates a section map from a vector of commits, which we can then iterate through and write

Example

let clog = Clog::new().unwrap_or_else(|e| {
    e.exit();
});

// Get the commits we're interested in...
let sm = SectionMap::from_commits(clog.get_commits());

// Create a file to hold our results, which the MardownWriter will wrap (note, .unwrap() is only
// used to keep the example short and concise)
let mut file = File::create("my_changelog.md").ok().unwrap();

// Create the MarkdownWriter
let mut writer = MarkdownWriter::new(&mut file);

// Use the MarkdownWriter to write the changelog
clog.write_changelog_with(&mut writer).unwrap_or_else(|e| {
    e.exit();
});