Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellga committed Mar 6, 2024
1 parent aa52a0f commit f9153f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 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.19"
version = "0.1.20"
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.19
Version: 0.1.20
Authors@R:
person("Daniel", "Gurgel", , "[email protected]", role = c("aut", "cre"))
Description: Generate R documentation in Quarto format based on comments in R scripts.
Expand Down
9 changes: 4 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,14 @@ fn generate_r_docs(
fn output_file(hash: HashMap<String, Vec<String>>, folder_name_hidden: &str) {
for (key, value) in hash {
let key_lowercase = key.to_lowercase();
let contents_folder = Path::new(folder_name_hidden).join("contents");

// Construct the output file path as the input file path with a .qmd extension.
let docs_file_path = Path::new(folder_name_hidden)
.join("contents")
.join(&key_lowercase)
.with_extension("qmd");
let docs_file_path = contents_folder.join(&key_lowercase).with_extension("qmd");

// Create the folder if it doesn't exist.
// Create the folders if they don't exist.
std::fs::create_dir_all(folder_name_hidden).expect("directory could not be created");
std::fs::create_dir_all(contents_folder).expect("directory could not be created");

let title = format!("title: {}", key);
let text = ["---", &title, "---"].join("\n");
Expand Down

0 comments on commit f9153f3

Please sign in to comment.