Struct clog::fmt::MarkdownWriter
[−]
[src]
pub struct MarkdownWriter<'a>(_);
Wraps a std::io::Write
object to write clog
output in a Markdown format
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(); });
Methods
impl<'a> MarkdownWriter<'a>
[src]
fn new<T: Write + 'a>(writer: &'a mut T) -> MarkdownWriter<'a>
Creates a new instance of the MarkdownWriter
struct using a std::io::Write
object.
Example
let clog = Clog::new().unwrap_or_else(|e| { e.exit(); }); // Create a MarkdownWriter to wrap stdout let out = stdout(); let mut out_buf = BufWriter::new(out.lock()); let mut writer = MarkdownWriter::new(&mut out_buf);
Trait Implementations
impl<'a> FormatWriter for MarkdownWriter<'a>
[src]
fn write_changelog(&mut self, options: &Clog, sm: &SectionMap) -> WriterResult
Writes a changelog from a given clog::SectionMap
which can be thought of as an "AST" of sorts Read more