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.
WARNING: This is a very preliminary implementation. There are many TO DO items in this code.
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(&'src self) -> &'src Span<'src>
pub fn section_title(&'src self) -> &'src Span<'src>
Return a Span
containing the section title.
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§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'src> Debug for SectionBlock<'src>
impl<'src> Debug for SectionBlock<'src>
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.