pub trait ArticleFormat {
// Required methods
fn format_plain(&self) -> String;
fn format_json(&self) -> Result<String>;
fn format_markdown(&self) -> String;
}Expand description
Output formatting for a collection of ArticleItems.
Required Methods§
Sourcefn format_plain(&self) -> String
fn format_plain(&self) -> String
Format as plain text.
Section headings are emitted as #/##/### lines. Images are rendered
as [Image: alt text] followed by caption. References are omitted.
Sourcefn format_json(&self) -> Result<String>
fn format_json(&self) -> Result<String>
Format as a semantic JSON section tree.
Structure:
{
"intro": ["..."], "intro_images": [...],
"sections": [{"heading":"...","level":2,"paragraphs":[...],"images":[...],"subsections":[...]}],
"references": {"cite_note-Foo-1": "Full citation text..."}
}Sourcefn format_markdown(&self) -> String
fn format_markdown(&self) -> String
Format as Markdown.
Inline: bold → **text**, italic → _text_, links → [text](href),
citation refs → [N]. Images →  with italic caption.
A ## References section with [N]: citation definitions is appended
when references are present.