pub struct ListBlock<'src> { /* private fields */ }Expand description
A list contains a sequence of items prefixed with symbol, such as a disc
(aka bullet). Each individual item in the list is represented by a
ListItem.
Implementations§
Source§impl<'src> ListBlock<'src>
impl<'src> ListBlock<'src>
Sourcepub fn is_checklist(&self) -> bool
pub fn is_checklist(&self) -> bool
Returns true if this list is a checklist (i.e. task list).
An unordered list becomes a checklist when at least one of its items
uses checkbox syntax ([ ], [x], or [*]). See
ListItem::checkbox.
Sourcepub fn is_bibliography(&self) -> bool
pub fn is_bibliography(&self) -> bool
Returns true if this list carries the bibliography style.
A list is a bibliography list when it is an unordered list that is
either explicitly marked [bibliography] or appears as a top-level
list within a section that carries the bibliography style (the
section implicitly adds the style to each of its unordered lists).
Each item of such a list may begin with a bibliography anchor
([[[id]]]).
Sourcepub fn marker_style(&self) -> Option<&'static str>
pub fn marker_style(&self) -> Option<&'static str>
Returns the style class for this list based on the marker length. For ordered lists, the style is determined by the number of dots:
- 1 dot: arabic (1, 2, 3, …)
- 2 dots: loweralpha (a, b, c, …)
- 3 dots: lowerroman (i, ii, iii, …)
- 4 dots: upperalpha (A, B, C, …)
- 5 dots: upperroman (I, II, III, …)
Sourcepub fn start(&self) -> Option<i64>
pub fn start(&self) -> Option<i64>
Returns the starting ordinal a converter should emit as the start
attribute of an HTML <ol>, if any.
An ordered list can begin at a value other than 1 in two ways (matching Asciidoctor):
- an explicit
[start=N]attribute, which takes precedence; or - the ordinal of an explicit first-item marker — for example
7.(arabic),c.(loweralpha, ⇒ 3), oriv)(lowerroman, ⇒ 4).
The result is None whenever the start resolves to the default of 1 —
whether from implicit markers (e.g. .), an explicit ordinal-1 marker
(1., a., i)), or [start=1] — because a converter emits a bare
<ol> in that case. It is likewise None for a list that is not
ordered. So start() is Some(n) exactly when a converter must emit a
non-default start="n", mirroring the ordinal != 1 guard in this
crate’s own reference renderer.
Trait Implementations§
impl<'src> Eq for ListBlock<'src>
Source§impl<'src> IsBlock<'src> for ListBlock<'src>
impl<'src> IsBlock<'src> for ListBlock<'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 nested_blocks_mut(&mut self) -> &mut [Block<'src>]
fn nested_blocks_mut(&mut self) -> &mut [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 rendered_content(&'src self) -> Option<&'src str>
fn rendered_content(&'src self) -> Option<&'src str>
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 content_mut(&mut self) -> Option<&mut Content<'src>>
fn content_mut(&mut self) -> Option<&mut Content<'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