pub struct SectionBlock<'src> { /* private fields */ }Expand description
Sections partition the document into a content hierarchy. A section is an implicit enclosure. Each section begins with a title and ends at the next sibling section, ancestor section, or end of document. Nested section levels must be sequential.
Implementations§
Source§impl<'src> SectionBlock<'src>
impl<'src> SectionBlock<'src>
Sourcepub fn level(&self) -> usize
pub fn level(&self) -> usize
Return the section’s level.
The section title must be prefixed with a section marker, which indicates the section level. The number of equal signs in the marker represents the section level using a 0-based index (e.g., two equal signs represents level 1). A section marker can range from two to six equal signs and must be followed by a space.
This function will return an integer between 1 and 5.
Sourcepub fn section_title_source(&self) -> Span<'src>
pub fn section_title_source(&self) -> Span<'src>
Return a Span containing the section title source.
Sourcepub fn section_title(&'src self) -> &'src str
pub fn section_title(&'src self) -> &'src str
Return the processed section title after substitutions have been applied.
Sourcepub fn section_type(&'src self) -> SectionType
pub fn section_type(&'src self) -> SectionType
Return the type of this section (normal or appendix).
Sourcepub fn section_number(&'src self) -> Option<&'src SectionNumber>
pub fn section_number(&'src self) -> Option<&'src SectionNumber>
Return the section number assigned to this section, if any.
Trait Implementations§
Source§impl<'src> Clone for SectionBlock<'src>
impl<'src> Clone for SectionBlock<'src>
Source§fn clone(&self) -> SectionBlock<'src>
fn clone(&self) -> SectionBlock<'src>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SectionBlock<'_>
impl Debug for SectionBlock<'_>
Source§impl<'src> HasSpan<'src> for SectionBlock<'src>
impl<'src> HasSpan<'src> for SectionBlock<'src>
Source§impl<'src> IsBlock<'src> for SectionBlock<'src>
impl<'src> IsBlock<'src> for SectionBlock<'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 nested_blocks(&'src self) -> Iter<'src, Block<'src>>
fn nested_blocks(&'src self) -> Iter<'src, Block<'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 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