@@ -47,7 +47,9 @@ fn main() -> Result<(), DocError> {
4747
4848 fs :: write (
4949 & example ,
50- r # " /* Table storing user accounts */
50+ r # " -- Table storing user accounts
51+ -- Contains all user values
52+ /* Rows generated at registration */
5153CREATE TABLE users (
5254 /* Primary key for each user */
5355 id INTEGER PRIMARY KEY,
@@ -59,7 +61,13 @@ CREATE TABLE users (
5961 )? ;
6062
6163 // Extract documentation from a single file
62- let docs = SqlDoc :: from_path (& example ). build ()? ;
64+ let docs = SqlDoc :: from_path (& example )
65+ // Capture all valid comment lines preceding the statements directly
66+ . collect_all_leading ()
67+ // Replace `\n` with a `str`
68+ . flatten_multiline_with (" . " )
69+ // Finally build the `SqlDoc`
70+ . build ()? ;
6371 // Or extract recursively from a directory
6472 // let docs = SqlDoc::from_dir(&base).build()?;
6573
@@ -69,7 +77,7 @@ CREATE TABLE users (
6977 // Table name
7078 assert_eq! (users . name (), " users" );
7179 // Optional table-level documentation
72- assert_eq! (users . doc (), Some (" Table storing user accounts" ));
80+ assert_eq! (users . doc (), Some (" Table storing user accounts. Contains all user values. Rows generated at registration " ));
7381 // Path to the source file
7482 assert_eq! (users . path (), Some (example . as_ref ()));
7583
0 commit comments