Skip to main content

max / balanced_breakfast

667 B · 22 lines History Blame Raw
1 //! Render a Balanced Breakfast article body (HTML) to a PDF suitable
2 //! for reading on a Supernote e-ink tablet.
3 //!
4 //! Pipeline: HTML -> `pter` markdown -> `pulldown-cmark` events -> a small
5 //! hand-rolled `printpdf` layout. A5 portrait, Helvetica, three levels of
6 //! headings, bold, italic, bulleted / ordered lists, blockquotes. Images
7 //! and tables are dropped for v1; code blocks render as monospace inline
8 //! text with no syntax highlighting.
9
10 mod layout;
11 mod render;
12
13 pub use render::render_article;
14
15 #[derive(Debug, thiserror::Error)]
16 pub enum Error {
17 #[error("printpdf: {0}")]
18 PrintPdf(String),
19 #[error("empty article body")]
20 Empty,
21 }
22