2023-03-25 13:16:28 -04:00
|
|
|
use super::element::Element;
|
2023-04-19 22:09:53 -04:00
|
|
|
use super::lesser_element::TableCell;
|
2023-04-21 16:16:14 -04:00
|
|
|
use super::source::Source;
|
2023-03-25 13:16:28 -04:00
|
|
|
|
2023-03-23 17:26:07 -04:00
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct PlainList<'s> {
|
|
|
|
pub source: &'s str,
|
2023-03-25 13:16:28 -04:00
|
|
|
pub children: Vec<PlainListItem<'s>>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct PlainListItem<'s> {
|
|
|
|
pub source: &'s str,
|
2023-03-27 12:52:49 -04:00
|
|
|
pub indentation: usize,
|
2023-03-25 13:16:28 -04:00
|
|
|
pub bullet: &'s str,
|
2023-04-03 17:33:01 -04:00
|
|
|
pub children: Vec<Element<'s>>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct GreaterBlock<'s> {
|
|
|
|
pub source: &'s str,
|
|
|
|
pub name: &'s str,
|
|
|
|
pub parameters: Option<&'s str>,
|
|
|
|
pub children: Vec<Element<'s>>,
|
2023-03-23 17:26:07 -04:00
|
|
|
}
|
2023-04-07 17:14:44 -04:00
|
|
|
|
2023-04-19 13:30:15 -04:00
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct DynamicBlock<'s> {
|
|
|
|
pub source: &'s str,
|
|
|
|
pub name: &'s str,
|
|
|
|
pub parameters: Option<&'s str>,
|
|
|
|
pub children: Vec<Element<'s>>,
|
|
|
|
}
|
|
|
|
|
2023-04-07 17:14:44 -04:00
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct FootnoteDefinition<'s> {
|
|
|
|
pub source: &'s str,
|
|
|
|
pub label: &'s str,
|
|
|
|
pub children: Vec<Element<'s>>,
|
|
|
|
}
|
2023-04-15 17:36:07 -04:00
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct Drawer<'s> {
|
|
|
|
pub source: &'s str,
|
2023-04-15 17:56:07 -04:00
|
|
|
pub name: &'s str,
|
2023-04-15 17:36:07 -04:00
|
|
|
pub children: Vec<Element<'s>>,
|
|
|
|
}
|
2023-04-19 16:51:00 -04:00
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct PropertyDrawer<'s> {
|
|
|
|
pub source: &'s str,
|
2023-04-19 17:15:00 -04:00
|
|
|
pub children: Vec<NodeProperty<'s>>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct NodeProperty<'s> {
|
|
|
|
pub source: &'s str,
|
2023-04-19 18:10:29 -04:00
|
|
|
pub value: Option<&'s str>,
|
2023-04-19 16:51:00 -04:00
|
|
|
}
|
2023-04-19 20:59:58 -04:00
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct Table<'s> {
|
|
|
|
pub source: &'s str,
|
2023-04-19 21:19:49 -04:00
|
|
|
pub children: Vec<TableRow<'s>>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct TableRow<'s> {
|
|
|
|
pub source: &'s str,
|
2023-04-19 21:57:08 -04:00
|
|
|
pub children: Vec<TableCell<'s>>,
|
|
|
|
}
|
2023-04-21 16:16:14 -04:00
|
|
|
|
|
|
|
impl<'s> Source<'s> for PlainList<'s> {
|
|
|
|
fn get_source(&'s self) -> &'s str {
|
|
|
|
self.source
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'s> Source<'s> for PlainListItem<'s> {
|
|
|
|
fn get_source(&'s self) -> &'s str {
|
|
|
|
self.source
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'s> Source<'s> for GreaterBlock<'s> {
|
|
|
|
fn get_source(&'s self) -> &'s str {
|
|
|
|
self.source
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'s> Source<'s> for DynamicBlock<'s> {
|
|
|
|
fn get_source(&'s self) -> &'s str {
|
|
|
|
self.source
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'s> Source<'s> for FootnoteDefinition<'s> {
|
|
|
|
fn get_source(&'s self) -> &'s str {
|
|
|
|
self.source
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'s> Source<'s> for Drawer<'s> {
|
|
|
|
fn get_source(&'s self) -> &'s str {
|
|
|
|
self.source
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'s> Source<'s> for PropertyDrawer<'s> {
|
|
|
|
fn get_source(&'s self) -> &'s str {
|
|
|
|
self.source
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'s> Source<'s> for Table<'s> {
|
|
|
|
fn get_source(&'s self) -> &'s str {
|
|
|
|
self.source
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'s> Source<'s> for TableRow<'s> {
|
|
|
|
fn get_source(&'s self) -> &'s str {
|
|
|
|
self.source
|
|
|
|
}
|
|
|
|
}
|