1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
pub use MarkdownWriter;
pub use JsonWriter;
use Clog;
use Error;
use SectionMap;
clog_enum!
/// Convienience type for returning results of writing a changelog with a `Clog` struct
///
/// # Example
///
/// ```no_run
/// # use clog::Clog;
/// # use clog::fmt::{FormatWriter, MarkdownWriter};
/// # use std::io;
/// let clog = Clog::new().unwrap_or_else(|e| {
/// e.exit();
/// });
///
/// // Create a MarkdownWriter that wraps stdout
/// let out = io::stdout();
/// let mut out_buf = io::BufWriter::new(out.lock());
/// let mut writer = MarkdownWriter::new(&mut out_buf);
///
/// clog.write_changelog_with(&mut writer).unwrap_or_else(|e| {
/// // Prints the WriterResult error and exits appropriately
/// e.exit();
/// });
/// ```
pub type WriterResult = ;
/// A trait that allows writing the results of a `clog` run which can then be written in an
/// arbitrary format. The single required function `write_changelog()` accepts a `clog::SectionMap`
/// which can be thought of similiar to a `clog` "AST" of sorts.
///
/// `clog` provides two default implementors of this traint, `clog::fmt::MarkdownWriter` and
/// `clog::fmt::JsonWriter` for writing Markdown and JSON respectively