use crate::highlights::Book;
use std::io::{BufWriter, Write};
pub mod markdown;
pub trait Render {
fn render<W>(&mut self, book: &Book, out: &mut W) -> std::io::Result<()>
where
W: Write;
fn as_string(&mut self, book: &Book) -> String {
let mut buf = BufWriter::new(Vec::new());
self.render(book, &mut buf).unwrap();
let bytes = buf.into_inner().unwrap();
String::from_utf8(bytes).unwrap()
}
}