Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bashdoc"
version = "0.5.1"
version = "0.5.2"
authors = ["Dustin Knopoff <dustinknopoff@gmail.com>"]
description = """
A tool for generating documentation/help menu for user defined bash functions.
Expand Down
27 changes: 23 additions & 4 deletions src/docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,16 @@ mod doc {
take_until_and_consume!(delims.comm),
take_until_and_consume!("\n")
))
>> desc: opt!(many0!(complete!(map_res!(
>> par: opt!(many0!(complete!(map_res!(
preceded!(
take_until_and_consume!(delims.opt),
take_until_and_consume!(delims.params),
take_until_and_consume!("\n")
),
as_kv
))))
>> par: opt!(many0!(complete!(map_res!(
>> desc: opt!(many0!(complete!(map_res!(
preceded!(
take_until_and_consume!(delims.params),
take_until_and_consume!(delims.opt),
take_until_and_consume!("\n")
),
as_kv
Expand Down Expand Up @@ -663,4 +663,23 @@ mod tests {
);
}
}

#[test]
fn param_and_input() {
let sample = "#\"
# mp()
# Convert from markdown to docx
# @param input: markdown file to convert
# - MSG: the message to pass
#;
";
let delims = Delimiters::get_delims();
let x = Extracted {
content: sample.into(),
position: Span::new(CompleteStr(sample))
};

let val = generate_doc_file(&[x], Path::new("/example.txt"), delims);
println!("{:#?}", val);
}
}