Skip to main content

kopitiam_document/
block.rs

1use crate::{Figure, Heading, List, Paragraph, Table};
2
3#[derive(Debug, Clone, PartialEq)]
4pub enum Block {
5    Heading(Heading),
6    Paragraph(Paragraph),
7    List(List),
8    Table(Table),
9    Figure(Figure),
10    CodeBlock(CodeBlock),
11    Quote(Quote),
12}
13
14/// No reconstruction pass produces this yet -- code listings currently fall
15/// through to `Paragraph`. Kept in the AST so renderers and future
16/// reconstruction heuristics have a target to produce/consume.
17#[derive(Debug, Clone, PartialEq)]
18pub struct CodeBlock {
19    pub text: String,
20    pub language: Option<String>,
21}
22
23/// No reconstruction pass produces this yet -- block quotes currently fall
24/// through to `Paragraph`.
25#[derive(Debug, Clone, PartialEq)]
26pub struct Quote {
27    pub text: String,
28}