pub enum InlineContent {
Empty,
Text(String),
FootnoteRef {
label: String,
},
Image {
name: String,
alt: String,
width: i64,
height: i64,
quality: i64,
},
}Expand description
Content type for an inline segment: text, image, footnote reference, or empty.
Variants§
Empty
Text(String)
FootnoteRef
A footnote reference — the marker in the prose that points at a note.
Carries only the label, never the number a reader sees. The number is a fact about document order and about which notes an export happens to include, so storing it would mean rewriting the author’s prose every time a note was inserted above it. Renderers derive it; the model never knows it.
The label need not resolve. A reference whose definition lives outside this document — which is the normal state for a host that owns note bodies itself — must survive a round trip unchanged, so nothing here requires a matching definition to exist.
Image
Fields
alt: StringAlternative text describing the image.
Carried on the model rather than derived from the resource name
because it is the image’s accessible description and its export
representation (HTML/EPUB alt, DOCX drawing description, Djot’s
![…] label) — a filename is none of those things.
#[serde(default)]: fragments are serialized onto the OS clipboard,
so a payload written by a build without this field must still
deserialize.
Trait Implementations§
Source§impl Clone for InlineContent
impl Clone for InlineContent
Source§fn clone(&self) -> InlineContent
fn clone(&self) -> InlineContent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more