46 lines
No EOL
1.1 KiB
Rust
46 lines
No EOL
1.1 KiB
Rust
|
|
#[derive(Debug)]
|
|
pub enum Item {
|
|
Ignore,
|
|
Text(String),
|
|
//text, links, formatting are all markdown
|
|
//arguably, for better control it will be best to turn markdown into its own set of items
|
|
Image(String),
|
|
Gif(String), //can't detect gif from image, has to be handled on front-end
|
|
Svg(String),// wont' support for a while I think.
|
|
Video(Video),
|
|
Audio(Audio),
|
|
Source(String),
|
|
BoldedText(Vec<Item>),
|
|
EmphasisText(Vec<Item>),
|
|
UnorderedList(Vec<Item>),
|
|
OrderedList(Vec<Item>),
|
|
ListItem(Vec<Item>),
|
|
Paragraph(Vec<Item>),//gotta replace this with specific items, needlessly flexible
|
|
Link(Link),
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct Link{
|
|
pub href: String,
|
|
pub children: Vec<Item>
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct Video{
|
|
pub children: Vec<Item>
|
|
//might have to do fancy things to detect autoplay...
|
|
}
|
|
#[derive(Debug)]
|
|
pub struct Audio{
|
|
pub children: Vec<Item>
|
|
//might have to do fancy things to detect autoplay...
|
|
}
|
|
#[derive(Debug)]
|
|
pub enum ContainerTag{
|
|
P,
|
|
Div,
|
|
Button,//arguably redundant
|
|
Table,
|
|
|
|
} |