From 54f5e9fd883e207931baa9c87b6181ca724d6bab Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Thu, 25 Aug 2022 21:09:25 +1200 Subject: Initial commit --- src/block.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/block.rs (limited to 'src/block.rs') diff --git a/src/block.rs b/src/block.rs new file mode 100644 index 0000000..2a34fcf --- /dev/null +++ b/src/block.rs @@ -0,0 +1,26 @@ +use crate::{Line, Table}; + +pub enum Block { + Heading1(Line), + Heading2(Line), + Heading3(Line), + Paragraph(Line), + List(Vec), + Quote(Vec), + Code(String, Vec), + Table(Table), +} +impl std::fmt::Debug for Block { + fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { + f.write_str(match self { + Self::Heading1(_) => "Heading1", + Self::Heading2(_) => "Heading2", + Self::Heading3(_) => "Heading3", + Self::Paragraph(_) => "Paragraph", + Self::List(_) => "List", + Self::Quote(_) => "Quote", + Self::Code(_, _) => "Code", + Self::Table(_) => "Table", + }) + } +} -- cgit v1.2.3-70-g09d2