aboutsummaryrefslogtreecommitdiffstats
path: root/src/content/document.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-12 14:21:53 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-08-12 14:21:53 +0200
commit504729a4a0c8f3e0d8fc9159e0273150b169e184 (patch)
treea6bf291322decccd6011580337b1feed6151b554 /src/content/document.rs
parentdb5a491e6c2223d1db9b458307431a54db3c40f2 (diff)
downloadmarkdown-rs-504729a4a0c8f3e0d8fc9159e0273150b169e184.tar.gz
markdown-rs-504729a4a0c8f3e0d8fc9159e0273150b169e184.tar.bz2
markdown-rs-504729a4a0c8f3e0d8fc9159e0273150b169e184.zip
Refactor to improve docs of each function
Diffstat (limited to '')
-rw-r--r--src/content/document.rs20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/content/document.rs b/src/content/document.rs
index 04f9dc6..59e6e7c 100644
--- a/src/content/document.rs
+++ b/src/content/document.rs
@@ -46,7 +46,7 @@ enum Phase {
Eof,
}
-/// Turn `codes` as the document content type into events.
+/// Parse a document.
pub fn document(parse_state: &mut ParseState, point: Point) -> Vec<Event> {
let mut tokenizer = Tokenizer::new(point, parse_state);
@@ -66,9 +66,7 @@ pub fn document(parse_state: &mut ParseState, point: Point) -> Vec<Event> {
events
}
-/// At the beginning.
-///
-/// Perhaps a BOM?
+/// Start of document, at an optional BOM.
///
/// ```markdown
/// > | a
@@ -88,7 +86,7 @@ pub fn start(tokenizer: &mut Tokenizer) -> State {
State::Retry(StateName::BomStart)
}
-/// Before existing containers.
+/// At optional existing containers.
//
/// ```markdown
/// | * a
@@ -121,7 +119,7 @@ pub fn container_existing_before(tokenizer: &mut Tokenizer) -> State {
}
}
-/// After an existing container.
+/// After continued existing container.
//
/// ```markdown
/// | * a
@@ -133,7 +131,7 @@ pub fn container_existing_after(tokenizer: &mut Tokenizer) -> State {
State::Retry(StateName::DocumentContainerExistingBefore)
}
-/// Before a new container.
+/// At new containers.
//
/// ```markdown
/// > | * a
@@ -183,7 +181,7 @@ pub fn container_new_before(tokenizer: &mut Tokenizer) -> State {
State::Retry(StateName::BlockQuoteStart)
}
-/// Maybe before a new container, but not a block quote.
+/// At new container, but not a block quote.
//
/// ```markdown
/// > | * a
@@ -206,7 +204,7 @@ pub fn container_new_before_not_block_quote(tokenizer: &mut Tokenizer) -> State
State::Retry(StateName::ListStart)
}
-/// Maybe before a new container, but not a list.
+/// At new container, but not a list (or block quote).
//
/// ```markdown
/// > | a
@@ -224,7 +222,7 @@ pub fn container_new_before_not_list(tokenizer: &mut Tokenizer) -> State {
State::Retry(StateName::DocumentContainersAfter)
}
-/// After a new container.
+/// After new container.
///
/// ```markdown
/// > | * a
@@ -258,7 +256,7 @@ pub fn container_new_after(tokenizer: &mut Tokenizer) -> State {
State::Retry(StateName::DocumentContainerNewBefore)
}
-/// After containers, before flow.
+/// After containers, at flow.
//
/// ```markdown
/// > | * a