From 504729a4a0c8f3e0d8fc9159e0273150b169e184 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 12 Aug 2022 14:21:53 +0200 Subject: Refactor to improve docs of each function --- src/content/document.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/content/document.rs') 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 { let mut tokenizer = Tokenizer::new(point, parse_state); @@ -66,9 +66,7 @@ pub fn document(parse_state: &mut ParseState, point: Point) -> Vec { 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 -- cgit