Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellga committed May 2, 2024
1 parent 12cdd3f commit db69db2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rdocs"
version = "0.1.36"
version = "0.1.37"
edition = "2021"
repository = "https://github.com/daniellga/rdocs/"

Expand Down
2 changes: 1 addition & 1 deletion rdocs/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rdocs
Title: Create Quarto documentation for R files from comments
Version: 0.1.36
Version: 0.1.37
Authors@R:
person("Daniel", "Gurgel", , "[email protected]", role = c("aut", "cre"))
Description: Generate R documentation in Quarto format based on comments in code files.
Expand Down
11 changes: 1 addition & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,7 @@ fn output_file(hash: HashMap<String, Vec<String>>, folder_name_hidden: &str) {

fn eval_examples(examples: Vec<String>) {
// Construct the output text.
let pkg_name_string = std::env::current_dir().unwrap();
let pkg_name = pkg_name_string
.as_path()
.file_name()
.unwrap()
.to_str()
.unwrap();
// Make a call to "library("pkg_name")" before the example block is run.
let pkg_call = ["library", pkg_name].join(" ");
let output_text = [pkg_call.as_str(), examples.join(";").as_str()].join(";");
let output_text = examples.join(";");

let output = Command::new("Rscript")
.args(["--vanilla", "-e", output_text.as_str()])
Expand Down

0 comments on commit db69db2

Please sign in to comment.