Create structure for footnote references.
This commit is contained in:
@@ -18,6 +18,7 @@ pub enum Object<'s> {
|
||||
Entity(Entity<'s>),
|
||||
LatexFragment(LatexFragment<'s>),
|
||||
ExportSnippet(ExportSnippet<'s>),
|
||||
FootnoteReference(FootnoteReference<'s>),
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
@@ -117,6 +118,13 @@ pub struct ExportSnippet<'s> {
|
||||
pub contents: Option<&'s str>,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct FootnoteReference<'s> {
|
||||
pub source: &'s str,
|
||||
pub label: &'s str,
|
||||
pub definition: Vec<Object<'s>>,
|
||||
}
|
||||
|
||||
impl<'s> Source<'s> for Object<'s> {
|
||||
fn get_source(&'s self) -> &'s str {
|
||||
match self {
|
||||
@@ -136,6 +144,7 @@ impl<'s> Source<'s> for Object<'s> {
|
||||
Object::Entity(obj) => obj.source,
|
||||
Object::LatexFragment(obj) => obj.source,
|
||||
Object::ExportSnippet(obj) => obj.source,
|
||||
Object::FootnoteReference(obj) => obj.source,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -229,3 +238,9 @@ impl<'s> Source<'s> for ExportSnippet<'s> {
|
||||
self.source
|
||||
}
|
||||
}
|
||||
|
||||
impl<'s> Source<'s> for FootnoteReference<'s> {
|
||||
fn get_source(&'s self) -> &'s str {
|
||||
self.source
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user