use links_notation::{parse_lino, parse_lino_with_config, ParserConfig};
fn main() {
let documents = [
"# a note about the document\ndeploy: staging\n",
"deploy: staging # only staging, for now\n",
"issue#1047: open\n",
"\"# not a comment\": still a reference\n",
"parent\n # what the child is for\n child\n",
];
for document in documents {
match parse_lino(document) {
Ok(links) => println!("{document:?}\n parses as {links}"),
Err(error) => println!("{document:?}\n {error}"),
}
}
let config = ParserConfig::without_comments();
let document = "# a b\n";
match parse_lino_with_config(document, &config) {
Ok(links) => println!("\nwithout comments {document:?}\n parses as {links}"),
Err(error) => println!("\nwithout comments {document:?}\n {error}"),
}
}