use std::num::NonZeroU8;
pub mod markup;
use pulldown_cmark::CowStr;
#[derive(Debug, PartialEq, Clone)]
pub enum Event<'a> {
Start(Tag<'a>),
End(Tag<'a>),
Text(CowStr<'a>),
Code(CowStr<'a>),
Linebreak,
Parbreak,
PageBreak,
Line(
Option<(CowStr<'a>, CowStr<'a>)>,
Option<(CowStr<'a>, CowStr<'a>)>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
),
Let(CowStr<'a>, CowStr<'a>),
FunctionCall(Option<CowStr<'a>>, CowStr<'a>, Vec<CowStr<'a>>),
DocumentFunctionCall(Vec<CowStr<'a>>),
Set(CowStr<'a>, CowStr<'a>, CowStr<'a>),
DocumentSet(CowStr<'a>, CowStr<'a>),
Raw(CowStr<'a>),
Label(CowStr<'a>),
}
#[derive(Clone, Debug, PartialEq)]
pub enum Tag<'a> {
Paragraph,
Show(
ShowType,
CowStr<'a>,
Option<(CowStr<'a>, CowStr<'a>, CowStr<'a>)>,
Option<CowStr<'a>>,
),
Heading(NonZeroU8, TableOfContents, Bookmarks, Option<CowStr<'a>>),
CodeBlock(Option<CowStr<'a>>, CodeBlockDisplay),
BulletList(Option<&'a str>, bool),
NumberedList(u64, Option<NumberingPattern<'a>>, bool),
Item,
Quote(QuoteType, QuoteQuotes, Option<CowStr<'a>>),
Emphasis,
Strong,
Strikethrough,
Link(LinkType, CowStr<'a>),
Image(
CowStr<'a>,
CowStr<'a>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
),
Table(Vec<TableCellAlignment>),
TableHead,
TableRow,
TableCell,
}
#[derive(Clone, Debug, PartialEq)]
pub enum CodeBlockDisplay {
Block,
Inline,
}
#[derive(Clone, Debug, PartialEq)]
pub enum Bookmarks {
Include,
Exclude,
}
#[derive(Clone, Debug, PartialEq)]
pub enum TableOfContents {
Include,
Exclude,
}
#[derive(Clone, Debug, PartialEq)]
pub struct NumberingPattern<'a>(&'a str);
#[derive(Clone, Debug, PartialEq, Copy)]
pub enum ShowType {
ShowSet,
Function,
}
#[derive(Clone, Debug, PartialEq, Copy)]
pub enum LinkType {
Url,
Content,
Autolink,
}
#[derive(Clone, Debug, PartialEq, Copy)]
pub enum QuoteType {
Block,
Inline,
}
#[derive(Clone, Debug, PartialEq, Copy)]
pub enum QuoteQuotes {
WrapInDoubleQuotes,
DoNotWrapInDoubleQuotes,
Auto,
}
#[derive(Clone, Debug, PartialEq, Copy)]
pub enum TableCellAlignment {
Left,
Center,
Right,
None,
}