2023-10-27 10:23:05 -04:00
|
|
|
use crate::error::CustomError;
|
|
|
|
|
|
|
|
use super::plain_text::PlainText;
|
|
|
|
|
2023-10-24 00:36:08 -04:00
|
|
|
#[derive(Debug)]
|
2023-10-27 10:23:05 -04:00
|
|
|
pub(crate) enum Object {
|
|
|
|
PlainText(PlainText),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Object {
|
|
|
|
pub(crate) fn new(obj: &organic::types::Object<'_>) -> Result<Object, CustomError> {
|
|
|
|
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) => {
|
|
|
|
Ok(Object::PlainText(PlainText::new(plain_text)?))
|
|
|
|
}
|
|
|
|
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!(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|