Add keyword and as no-op.
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
use crate::error::CustomError;
|
||||
|
||||
use super::keyword::IKeyword;
|
||||
use super::registry::Registry;
|
||||
use super::IParagraph;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) enum IElement {
|
||||
Paragraph(IParagraph),
|
||||
Keyword(IKeyword),
|
||||
}
|
||||
|
||||
impl IElement {
|
||||
@@ -37,7 +39,9 @@ impl IElement {
|
||||
organic::types::Element::Planning(_) => todo!(),
|
||||
organic::types::Element::FixedWidthArea(_) => todo!(),
|
||||
organic::types::Element::HorizontalRule(_) => todo!(),
|
||||
organic::types::Element::Keyword(_) => todo!(),
|
||||
organic::types::Element::Keyword(inner) => {
|
||||
Ok(IElement::Keyword(IKeyword::new(registry, inner).await?))
|
||||
}
|
||||
organic::types::Element::BabelCall(_) => todo!(),
|
||||
organic::types::Element::LatexEnvironment(_) => todo!(),
|
||||
}
|
||||
|
||||
17
src/intermediate/keyword.rs
Normal file
17
src/intermediate/keyword.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use crate::error::CustomError;
|
||||
|
||||
use super::registry::Registry;
|
||||
use super::IObject;
|
||||
|
||||
/// Essentially a no-op since the keyword is not rendered and any relevant impact on other elements is pulled from the parsed form of keyword.
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct IKeyword {}
|
||||
|
||||
impl IKeyword {
|
||||
pub(crate) async fn new<'parse>(
|
||||
registry: &mut Registry<'parse>,
|
||||
keyword: &organic::types::Keyword<'parse>,
|
||||
) -> Result<IKeyword, CustomError> {
|
||||
Ok(IKeyword {})
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ mod definition;
|
||||
mod document_element;
|
||||
mod element;
|
||||
mod heading;
|
||||
mod keyword;
|
||||
mod object;
|
||||
mod page;
|
||||
mod paragraph;
|
||||
@@ -16,6 +17,7 @@ pub(crate) use definition::BlogPost;
|
||||
pub(crate) use document_element::IDocumentElement;
|
||||
pub(crate) use element::IElement;
|
||||
pub(crate) use heading::IHeading;
|
||||
pub(crate) use keyword::IKeyword;
|
||||
pub(crate) use object::IObject;
|
||||
pub(crate) use page::BlogPostPage;
|
||||
pub(crate) use paragraph::IParagraph;
|
||||
|
||||
Reference in New Issue
Block a user