2023-10-27 10:23:05 -04:00
|
|
|
use crate::error::CustomError;
|
|
|
|
|
2023-10-27 13:05:34 -04:00
|
|
|
use super::plain_text::IPlainText;
|
2023-10-27 14:43:06 -04:00
|
|
|
use super::registry::Registry;
|
2023-10-27 10:23:05 -04:00
|
|
|
|
2023-10-24 00:36:08 -04:00
|
|
|
#[derive(Debug)]
|
2023-10-27 13:05:34 -04:00
|
|
|
pub(crate) enum IObject {
|
|
|
|
PlainText(IPlainText),
|
2023-10-27 10:23:05 -04:00
|
|
|
}
|
|
|
|
|
2023-10-27 13:05:34 -04:00
|
|
|
impl IObject {
|
2023-10-27 14:43:06 -04:00
|
|
|
pub(crate) fn new(
|
|
|
|
registry: &mut Registry<'_>,
|
|
|
|
obj: &organic::types::Object<'_>,
|
|
|
|
) -> Result<IObject, CustomError> {
|
2023-10-27 10:23:05 -04:00
|
|
|
match obj {
|
|
|
|
organic::types::Object::Bold(_) => todo!(),
|
|
|
|
organic::types::Object::Italic(_) => todo!(),
|
|
|
|
organic::types::Object::Underline(_) => todo!(),
|
|
|
|
organic::types::Object::StrikeThrough(_) => todo!(),
|
|
|
|
organic::types::Object::Code(_) => todo!(),
|
|
|
|
organic::types::Object::Verbatim(_) => todo!(),
|
|
|
|
organic::types::Object::PlainText(plain_text) => {
|
2023-10-27 14:43:06 -04:00
|
|
|
Ok(IObject::PlainText(IPlainText::new(registry, plain_text)?))
|
2023-10-27 10:23:05 -04:00
|
|
|
}
|
|
|
|
organic::types::Object::RegularLink(_) => todo!(),
|
|
|
|
organic::types::Object::RadioLink(_) => todo!(),
|
|
|
|
organic::types::Object::RadioTarget(_) => todo!(),
|
|
|
|
organic::types::Object::PlainLink(_) => todo!(),
|
|
|
|
organic::types::Object::AngleLink(_) => todo!(),
|
|
|
|
organic::types::Object::OrgMacro(_) => todo!(),
|
|
|
|
organic::types::Object::Entity(_) => todo!(),
|
|
|
|
organic::types::Object::LatexFragment(_) => todo!(),
|
|
|
|
organic::types::Object::ExportSnippet(_) => todo!(),
|
|
|
|
organic::types::Object::FootnoteReference(_) => todo!(),
|
|
|
|
organic::types::Object::Citation(_) => todo!(),
|
|
|
|
organic::types::Object::CitationReference(_) => todo!(),
|
|
|
|
organic::types::Object::InlineBabelCall(_) => todo!(),
|
|
|
|
organic::types::Object::InlineSourceBlock(_) => todo!(),
|
|
|
|
organic::types::Object::LineBreak(_) => todo!(),
|
|
|
|
organic::types::Object::Target(_) => todo!(),
|
|
|
|
organic::types::Object::StatisticsCookie(_) => todo!(),
|
|
|
|
organic::types::Object::Subscript(_) => todo!(),
|
|
|
|
organic::types::Object::Superscript(_) => todo!(),
|
|
|
|
organic::types::Object::Timestamp(_) => todo!(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|