pub struct Header<'src> { /* private fields */ }Expand description
An AsciiDoc document may begin with a document header. The document header encapsulates the document title, author and revision information, document-wide attributes, and other document metadata.
Implementations§
Source§impl<'src> Header<'src>
impl<'src> Header<'src>
Sourcepub fn title_source(&'src self) -> Option<Span<'src>>
pub fn title_source(&'src self) -> Option<Span<'src>>
Return a Span describing the raw document title, if there was one.
Sourcepub fn title(&self) -> Option<&str>
pub fn title(&self) -> Option<&str>
Return the document’s title, if there was one, having applied header substitutions.
If the title contains a subtitle (see subtitle), this returns the
full, combined title. Use main_title to obtain only the portion
preceding the subtitle.
Sourcepub fn main_title(&self) -> Option<&str>
pub fn main_title(&self) -> Option<&str>
Return the main portion of the document title, if there was a title.
When the document title contains a subtitle separator (a colon followed
by a space, by default), the title is partitioned into a main title and
a subtitle. This returns the portion preceding the final separator.
When there is no subtitle, this is identical to title.
Sourcepub fn subtitle(&self) -> Option<&str>
pub fn subtitle(&self) -> Option<&str>
Return the document’s subtitle, if the title contained one.
A subtitle is the text following the final subtitle separator in the
document title. The separator defaults to a colon followed by a space
(:{sp}) and can be overridden with the title-separator document
attribute. Returns None when the title has no subtitle.
Sourcepub fn attributes(&'src self) -> Iter<'src, Attribute<'src>>
pub fn attributes(&'src self) -> Iter<'src, Attribute<'src>>
Return an iterator over the attributes in this header.
Returns the author line, if found.
Sourcepub fn revision_line(&self) -> Option<&RevisionLine<'src>>
pub fn revision_line(&self) -> Option<&RevisionLine<'src>>
Returns the revision line, if found.