diff options
Diffstat (limited to 'src/block.rs')
-rw-r--r-- | src/block.rs | 26 |
1 files changed, 26 insertions, 0 deletions
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<Line>), + Quote(Vec<Line>), + Code(String, Vec<String>), + 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", + }) + } +} |