pub struct Attribute<'src> { /* private fields */ }Expand description
Document attributes are effectively document-scoped variables for the AsciiDoc language. The AsciiDoc language defines a set of built-in attributes, and also allows the author (or extensions) to define additional document attributes, which may replace built-in attributes when permitted.
An attribute entry is most often declared in the document header. For attributes that allow it (which includes general purpose attributes), the attribute entry can alternately be declared between blocks in the document body (i.e., the portion of the document below the header).
When an attribute is defined in the document body using an attribute entry, that’s simply referred to as a document attribute. For any attribute defined in the body, the attribute is available from the point it is set until it is unset. Attributes defined in the body are not available via the document metadata.
An attribute declared between blocks (i.e. in the document body) is
represented in this using the same structure (Attribute) as a header
attribute. Since it lives between blocks, we treat it as though it was a
block (and thus implement IsBlock on this type) even though is not
technically a block.
Implementations§
Trait Implementations§
Source§impl<'src> IsBlock<'src> for Attribute<'src>
impl<'src> IsBlock<'src> for Attribute<'src>
Source§fn content_model(&self) -> ContentModel
fn content_model(&self) -> ContentModel
ContentModel for this block.Source§fn raw_context(&self) -> CowStr<'src>
fn raw_context(&self) -> CowStr<'src>
Source§fn title_source(&'src self) -> Option<Span<'src>>
fn title_source(&'src self) -> Option<Span<'src>>
Source§fn anchor_reftext(&'src self) -> Option<Span<'src>>
fn anchor_reftext(&'src self) -> Option<Span<'src>>
Source§fn attrlist(&'src self) -> Option<&'src Attrlist<'src>>
fn attrlist(&'src self) -> Option<&'src Attrlist<'src>>
Source§fn resolved_context(&'src self) -> CowStr<'src>
fn resolved_context(&'src self) -> CowStr<'src>
Source§fn declared_style(&'src self) -> Option<&'src str>
fn declared_style(&'src self) -> Option<&'src str>
Source§fn nested_blocks(&'src self) -> Iter<'src, Block<'src>>
fn nested_blocks(&'src self) -> Iter<'src, Block<'src>>
Source§fn options(&'src self) -> Vec<&'src str>
fn options(&'src self) -> Vec<&'src str>
Source§fn has_option<N: AsRef<str>>(&'src self, name: N) -> bool
fn has_option<N: AsRef<str>>(&'src self, name: N) -> bool
true if this block has the named option. Read more