diff --git a/Cargo.toml b/Cargo.toml index adfee1e..c1bc002 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rdocs" -version = "0.1.44" +version = "0.1.45" edition = "2021" repository = "https://github.com/daniellga/rdocs/" diff --git a/rdocs/DESCRIPTION b/rdocs/DESCRIPTION index ff77542..1494a08 100644 --- a/rdocs/DESCRIPTION +++ b/rdocs/DESCRIPTION @@ -1,6 +1,6 @@ Package: rdocs Title: Create Quarto documentation for R files from comments -Version: 0.1.44 +Version: 0.1.45 Authors@R: person("Daniel", "Gurgel", , "daniellga@gmail.com", role = c("aut", "cre")) Description: Generate R documentation in Quarto format based on comments in code files. diff --git a/src/main.rs b/src/main.rs index f35b407..71f3054 100644 --- a/src/main.rs +++ b/src/main.rs @@ -206,6 +206,9 @@ fn eval_examples(mut examples: Vec) { // Iterate for each example chunk in the file. for example in output_text.split("***end_of_example;") { + if example.is_empty() { + continue; + } let output = Command::new("Rscript") .args(["--vanilla", "-e", example]) .stdout(Stdio::null()) @@ -216,7 +219,7 @@ fn eval_examples(mut examples: Vec) { if !output.status.success() { let error_message = String::from_utf8_lossy(&output.stderr); panic!( - "Error running example:\n\n{}\n\n**********\n\nR code executed:\n\n{}", + "Error running R example:\n{}\nR code executed which generated error:\n{}", error_message, example ); }