djr 0.0.1

Djot parser written in pure Rust
Documentation
use crate::attributes::Attributes;

pub enum Event<'a> {
    // Start/end of tags
    Start(Tag<'a>, Attributes<'a>),
    End(Tag<'a>),

    // Leaf content (cannot be nested)
    Str(&'a str),
    Verbatim(&'a str),
    Raw(&'a str),
    InlineMath(&'a str),
    DisplayMath(&'a str),

    // Other
    ThematicBreak,
    SoftBreak,
    HardBreak,
}

pub enum Tag<'a> {
    // Blocks
    Paragraph,
    Heading(usize),
    Blockquote,
    List(ListType),
    LisItem,
    CodeBlock,
    RawBlock,
    Div,
    Table,
    TableHead,
    TableRow,
    TableCell,
    FootnoteDef(&'a str),

    // Inlines
    Emphasis,
    Strong,
    Highlight,
    Sup,
    Sub,
    Ins,
    Del,
    Span,
    Link(LinkType, &'a str, &'a str),
    Image(LinkType, &'a str, &'a str),
}

pub enum ListType {
    Unordered,
    Ordered(ListIndexType),
    Definition,
}

pub enum ListIndexType {
    Numeric,
    Lower,
    Upper,
    LowerRoman,
    UpperRoman,
}

pub enum LinkType {
    Inline,
    Reference,
    Auto,
    Email,
}