aboutsummaryrefslogtreecommitdiffstats
path: root/src/token.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-15 12:34:23 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-07-15 12:36:36 +0200
commit66c70d1b917976c32b770e5d724fc4e47a2309c6 (patch)
treefaac63df2b0687d15f7de556d765f6c93a3d7dd1 /src/token.rs
parent21dbf42b5e5979fb30837bbb3b2638dcf5711249 (diff)
downloadmarkdown-rs-66c70d1b917976c32b770e5d724fc4e47a2309c6.tar.gz
markdown-rs-66c70d1b917976c32b770e5d724fc4e47a2309c6.tar.bz2
markdown-rs-66c70d1b917976c32b770e5d724fc4e47a2309c6.zip
Refactor to sort, document lists in token
Diffstat (limited to '')
-rw-r--r--src/token.rs139
1 files changed, 130 insertions, 9 deletions
diff --git a/src/token.rs b/src/token.rs
index 889c3ba..825b9cd 100644
--- a/src/token.rs
+++ b/src/token.rs
@@ -1386,6 +1386,136 @@ pub enum Token {
/// ^^^^^^
/// ```
Link,
+ /// List item.
+ ///
+ /// ## Info
+ ///
+ /// * **Context**:
+ /// [`ListOrdered`][Token::ListOrdered],
+ /// [`ListUnordered`][Token::ListUnordered],
+ /// * **Content model**:
+ /// [`ListItemPrefix`][Token::ListItemPrefix],
+ /// [flow content][crate::content::flow]
+ /// * **Construct**:
+ /// [`list`][crate::construct::list]
+ ///
+ /// ## Example
+ ///
+ /// ```markdown
+ /// > | * a
+ /// ^^^
+ /// > | 1. b
+ /// ^^^^
+ /// ```
+ ListItem,
+ /// List item (marker).
+ ///
+ /// ## Info
+ ///
+ /// * **Context**:
+ /// [`ListItemPrefix`][Token::ListItemPrefix]
+ /// * **Content model**:
+ /// void
+ /// * **Construct**:
+ /// [`list`][crate::construct::list]
+ ///
+ /// ## Example
+ ///
+ /// ```markdown
+ /// > | * a
+ /// ^
+ /// > | 1. b
+ /// ^
+ /// ```
+ ListItemMarker,
+ /// List item (prefix).
+ ///
+ /// ## Info
+ ///
+ /// * **Context**:
+ /// [`ListItem`][Token::ListItem]
+ /// * **Content model**:
+ /// [`ListItemMarker`][Token::ListItemMarker],
+ /// [`ListItemValue`][Token::ListItemValue],
+ /// [`SpaceOrTab`][Token::SpaceOrTab]
+ /// * **Construct**:
+ /// [`list`][crate::construct::list]
+ ///
+ /// ## Example
+ ///
+ /// ```markdown
+ /// > | * a
+ /// ^^
+ /// > | b
+ /// ^^
+ /// ```
+ ListItemPrefix,
+ /// List item (value).
+ ///
+ /// ## Info
+ ///
+ /// * **Context**:
+ /// [`ListItemPrefix`][Token::ListItemPrefix]
+ /// * **Content model**:
+ /// void
+ /// * **Construct**:
+ /// [`list`][crate::construct::list]
+ ///
+ /// ## Example
+ ///
+ /// ```markdown
+ /// > | 1. b
+ /// ^
+ /// ```
+ ListItemValue,
+ /// List (ordered).
+ ///
+ /// ## Info
+ ///
+ /// * **Context**:
+ /// [document content][crate::content::document]
+ /// * **Content model**:
+ /// [`BlankLineEnding`][Token::BlankLineEnding],
+ /// [`BlockQuotePrefix`][Token::BlockQuotePrefix],
+ /// [`ListItem`][Token::ListItem],
+ /// [`LineEnding`][Token::LineEnding],
+ /// [`SpaceOrTab`][Token::SpaceOrTab]
+ /// * **Construct**:
+ /// [`list`][crate::construct::list]
+ ///
+ /// ## Example
+ ///
+ /// ```markdown
+ /// > | 1. a
+ /// ^^^^
+ /// > | 2. b
+ /// ^^^^
+ /// ```
+ ListOrdered,
+ /// List (unordered).
+ ///
+ /// ## Info
+ ///
+ /// * **Context**:
+ /// [document content][crate::content::document]
+ /// * **Content model**:
+ /// [`BlankLineEnding`][Token::BlankLineEnding],
+ /// [`BlockQuotePrefix`][Token::BlockQuotePrefix],
+ /// [`ListItem`][Token::ListItem],
+ /// [`LineEnding`][Token::LineEnding],
+ /// [`SpaceOrTab`][Token::SpaceOrTab]
+ /// * **Construct**:
+ /// [`list`][crate::construct::list]
+ ///
+ /// ## Example
+ ///
+ /// ```markdown
+ /// > | * a
+ /// ^^^
+ /// > | * b
+ /// ^^^
+ /// ```
+ ListUnordered,
/// Whole paragraph.
///
/// ## Info
@@ -1765,13 +1895,4 @@ pub enum Token {
/// ^ ^ ^
/// ```
ThematicBreakSequence,
-
- // To do: sort.
- ListOrdered,
- ListUnordered,
- ListItem,
- ListItemPrefix,
- ListItemValue,
- ListItemMarker,
- // ListItemPrefixSpaceOrTab,
}