Add basic templates for plain list.
This commit is contained in:
@@ -37,6 +37,7 @@ mod page;
|
||||
mod paragraph;
|
||||
mod plain_link;
|
||||
mod plain_list;
|
||||
mod plain_list_item;
|
||||
mod plain_text;
|
||||
mod planning;
|
||||
mod property_drawer;
|
||||
@@ -98,6 +99,7 @@ pub(crate) use page::BlogPostPage;
|
||||
pub(crate) use paragraph::IParagraph;
|
||||
pub(crate) use plain_link::IPlainLink;
|
||||
pub(crate) use plain_list::IPlainList;
|
||||
pub(crate) use plain_list_item::IPlainListItem;
|
||||
pub(crate) use plain_text::IPlainText;
|
||||
pub(crate) use planning::IPlanning;
|
||||
pub(crate) use property_drawer::IPropertyDrawer;
|
||||
|
||||
@@ -1,15 +1,30 @@
|
||||
use crate::error::CustomError;
|
||||
|
||||
use super::registry::Registry;
|
||||
use super::IPlainListItem;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct IPlainList {}
|
||||
pub(crate) struct IPlainList {
|
||||
pub(crate) list_type: organic::types::PlainListType,
|
||||
pub(crate) children: Vec<IPlainListItem>,
|
||||
}
|
||||
|
||||
impl IPlainList {
|
||||
pub(crate) async fn new<'parse>(
|
||||
registry: &mut Registry<'parse>,
|
||||
plain_list: &organic::types::PlainList<'parse>,
|
||||
) -> Result<IPlainList, CustomError> {
|
||||
Ok(IPlainList {})
|
||||
let children = {
|
||||
let mut ret = Vec::new();
|
||||
for obj in plain_list.children.iter() {
|
||||
ret.push(IPlainListItem::new(registry, obj).await?);
|
||||
}
|
||||
ret
|
||||
};
|
||||
|
||||
Ok(IPlainList {
|
||||
list_type: plain_list.list_type,
|
||||
children,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
15
src/intermediate/plain_list_item.rs
Normal file
15
src/intermediate/plain_list_item.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use crate::error::CustomError;
|
||||
|
||||
use super::registry::Registry;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct IPlainListItem {}
|
||||
|
||||
impl IPlainListItem {
|
||||
pub(crate) async fn new<'parse>(
|
||||
registry: &mut Registry<'parse>,
|
||||
plain_list_item: &organic::types::PlainListItem<'parse>,
|
||||
) -> Result<IPlainListItem, CustomError> {
|
||||
Ok(IPlainListItem {})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user