#[derive(Debug, Clone, PartialEq)]
pub struct ReferenceInline {
pub raw: String,
pub reference_type: ReferenceType,
}
impl ReferenceInline {
pub fn new(raw: String) -> Self {
Self {
raw,
reference_type: ReferenceType::NotSure,
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum ReferenceType {
ToCome { identifier: Option<String> },
Citation(CitationData),
AnnotationReference { label: String },
FootnoteNumber { number: u32 },
Session { target: String },
Url { target: String },
File { target: String },
General { target: String },
NotSure,
}
#[derive(Debug, Clone, PartialEq)]
pub struct CitationData {
pub keys: Vec<String>,
pub locator: Option<CitationLocator>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct CitationLocator {
pub format: PageFormat,
pub ranges: Vec<PageRange>,
pub raw: String,
}
#[derive(Debug, Clone, PartialEq)]
pub enum PageFormat {
P,
Pp,
}
#[derive(Debug, Clone, PartialEq)]
pub struct PageRange {
pub start: u32,
pub end: Option<u32>,
}