@@ -13,10 +13,13 @@ use nom_locate::{position, LocatedSpan};
1313use serde_derive:: * ;
1414use std:: { collections:: HashMap , env, fs, fs:: File , path:: Path , process:: exit} ;
1515
16+ /// "Main" of bashdoc
1617pub mod runners {
1718 use super :: * ;
1819 use notify:: { DebouncedEvent , RecommendedWatcher , RecursiveMode , Watcher } ;
1920 use std:: { sync:: mpsc:: channel, time:: Duration } ;
21+
22+ /// Given the arguments received via CLI from clap, setup and run with requested delimiters, file or directory, etc.
2023 pub fn generate < ' a > ( matches : & ' a ArgMatches < ' a > ) {
2124 let delims = match matches. subcommand ( ) {
2225 ( "override" , Some ( sub_m) ) => Delimiters :: override_delims ( sub_m) ,
@@ -54,6 +57,7 @@ pub mod runners {
5457 }
5558 }
5659
60+ /// Given a request to watch files, Call `generate` on file write.
5761 pub fn watcher < ' a > ( matches : & ' a ArgMatches < ' a > ) {
5862 generate ( matches) ;
5963 let ( tx, rx) = channel ( ) ;
@@ -91,6 +95,7 @@ pub mod runners {
9195 }
9296}
9397
98+ /// Functions and declarations for general Key,Value Pair
9499mod kv {
95100 use super :: * ;
96101 /// Represents a simple Key, Value pair
@@ -140,6 +145,7 @@ mod kv {
140145 }
141146}
142147
148+ /// Functions and declarations for Docs and parsing from strings
143149mod doc {
144150 use super :: * ;
145151 /// Represents a docstring
@@ -222,6 +228,7 @@ mod doc {
222228 }
223229}
224230
231+ /// Functions and declarations for DocFile's and parsing
225232mod docfile {
226233 use super :: * ;
227234 use rayon:: prelude:: * ;
@@ -242,6 +249,7 @@ mod docfile {
242249 }
243250
244251 pub type Span < ' a > = LocatedSpan < CompleteStr < ' a > > ;
252+ /// Represents the string extracted from a file, including it's location in the file found.
245253 pub struct Extracted < ' a > {
246254 pub position : Span < ' a > ,
247255 pub content : String ,
@@ -348,6 +356,7 @@ mod docfile {
348356 }
349357}
350358
359+ /// Functions for presenting bashdocs to STDOUT, as JSON, or HTML
351360mod outputs {
352361 use super :: * ;
353362 use colored:: * ;
@@ -484,6 +493,7 @@ mod outputs {
484493 }
485494}
486495
496+ /// Functions and declarations for generating/overriding delimiters
487497mod delims {
488498 use super :: * ;
489499 use std:: io:: prelude:: * ;
0 commit comments