pub struct DirectiveMark {
pub name: String,
pub attrs: Vec<(String, Option<String>)>,
pub label: String,
pub rows: usize,
}Expand description
The name and attributes a leaf directive’s placeholder row carries, so a
frontend that knows the host app’s vocabulary can paint the real thing —
an embedded page for diaryx’s ::embed{src=…}, a generated table of
contents for a ::toc, and the plain ⧉ name label for one it doesn’t
know. The peer of MediaMark, and plain strings for the same reason: they
survive the row shuffling of BlockCache reuse and build_spliced.
Fields§
§name: StringThe directive’s type — embed, toc, vis — with no leading colons.
Core is agnostic of what it means: the vocabulary is the host app’s.
attrs: Vec<(String, Option<String>)>Its {…} attributes as (key, value) pairs in source order. A bare
attribute ({public}) has a None value, the way twig reports it.
label: StringThe directive’s [label] text, flattened from its inline children, or
empty when it has none. Also what the placeholder label shows.
rows: usizeHow many visual rows this directive reserves — the label row plus blank
filler rows below it, so a frontend painting something real has the
vertical room. 1 is the bare placeholder, and the only value core
produces today: unlike an image (whose height a terminal frontend
measures and reports back), nothing has told core how tall an embed is.
A pixel-laid-out GUI sets its own height regardless.
Trait Implementations§
Source§impl Clone for DirectiveMark
impl Clone for DirectiveMark
Source§fn clone(&self) -> DirectiveMark
fn clone(&self) -> DirectiveMark
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more