pub trait CitationParser {
// Required method
fn parse_document(&self, content: &str, locale: &Locale) -> ParsedDocument;
// Provided methods
fn finalize_html_output(&self, rendered: &str) -> String { ... }
fn parse_citations(
&self,
content: &str,
locale: &Locale,
) -> Vec<(usize, usize, Citation)> { ... }
}Expand description
A trait for document parsers that can identify citations.
Each implementation is a format-specific adapter (Djot, Markdown, etc.).
Adapters are responsible for source-syntax citation parsing, note discovery,
frontmatter extraction, bibliography block detection, and HTML finalization.
The shared pipeline consumes the resulting ParsedDocument without
inspecting format-specific internals.
Required Methods§
Sourcefn parse_document(&self, content: &str, locale: &Locale) -> ParsedDocument
fn parse_document(&self, content: &str, locale: &Locale) -> ParsedDocument
Parse the document into citation placements and note metadata.
Provided Methods§
Sourcefn finalize_html_output(&self, rendered: &str) -> String
fn finalize_html_output(&self, rendered: &str) -> String
Finalize rendered document markup as HTML.
Called after citation strings have been spliced back into the source
markup and the result must be converted to HTML. The default
implementation is a pass-through: it returns the markup unchanged.
Format-specific adapters that require a markup-to-HTML conversion step
(e.g. Djot via jotdown) must override this method.