@@ -13,10 +13,13 @@ use nom_locate::{position, LocatedSpan};
13
13
use serde_derive:: * ;
14
14
use std:: { collections:: HashMap , env, fs, fs:: File , path:: Path , process:: exit} ;
15
15
16
+ /// "Main" of bashdoc
16
17
pub mod runners {
17
18
use super :: * ;
18
19
use notify:: { DebouncedEvent , RecommendedWatcher , RecursiveMode , Watcher } ;
19
20
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.
20
23
pub fn generate < ' a > ( matches : & ' a ArgMatches < ' a > ) {
21
24
let delims = match matches. subcommand ( ) {
22
25
( "override" , Some ( sub_m) ) => Delimiters :: override_delims ( sub_m) ,
@@ -54,6 +57,7 @@ pub mod runners {
54
57
}
55
58
}
56
59
60
+ /// Given a request to watch files, Call `generate` on file write.
57
61
pub fn watcher < ' a > ( matches : & ' a ArgMatches < ' a > ) {
58
62
generate ( matches) ;
59
63
let ( tx, rx) = channel ( ) ;
@@ -91,6 +95,7 @@ pub mod runners {
91
95
}
92
96
}
93
97
98
+ /// Functions and declarations for general Key,Value Pair
94
99
mod kv {
95
100
use super :: * ;
96
101
/// Represents a simple Key, Value pair
@@ -140,6 +145,7 @@ mod kv {
140
145
}
141
146
}
142
147
148
+ /// Functions and declarations for Docs and parsing from strings
143
149
mod doc {
144
150
use super :: * ;
145
151
/// Represents a docstring
@@ -222,6 +228,7 @@ mod doc {
222
228
}
223
229
}
224
230
231
+ /// Functions and declarations for DocFile's and parsing
225
232
mod docfile {
226
233
use super :: * ;
227
234
use rayon:: prelude:: * ;
@@ -242,6 +249,7 @@ mod docfile {
242
249
}
243
250
244
251
pub type Span < ' a > = LocatedSpan < CompleteStr < ' a > > ;
252
+ /// Represents the string extracted from a file, including it's location in the file found.
245
253
pub struct Extracted < ' a > {
246
254
pub position : Span < ' a > ,
247
255
pub content : String ,
@@ -348,6 +356,7 @@ mod docfile {
348
356
}
349
357
}
350
358
359
+ /// Functions for presenting bashdocs to STDOUT, as JSON, or HTML
351
360
mod outputs {
352
361
use super :: * ;
353
362
use colored:: * ;
@@ -484,6 +493,7 @@ mod outputs {
484
493
}
485
494
}
486
495
496
+ /// Functions and declarations for generating/overriding delimiters
487
497
mod delims {
488
498
use super :: * ;
489
499
use std:: io:: prelude:: * ;
0 commit comments