FIX: Clearer list for the wiki

This commit is contained in:
Nicolás Hatcher
2024-03-16 17:34:43 +01:00
parent 0029901ca3
commit a38ba93724
3 changed files with 208 additions and 195 deletions

View File

@@ -8,10 +8,19 @@ use std::fs;
use ironcalc_base::model::Model;
fn main() {
let args: Vec<_> = std::env::args().collect();
let output_file = if args.len() == 3 {
&args[2]
} else if args.len() == 1 {
"functions.md"
} else {
panic!("Usage: {} -o <file.md>", args[0]);
};
let mut doc = Vec::new();
doc.push(r#"# List of Functions implemented in IronCalc\n"#.to_owned());
for function in Model::documentation() {
doc.push(function.name);
doc.push(format!("* {}\n", &function.name));
}
let data = doc.join("\n");
fs::write("functions.md", data).expect("Unable to write file");
let data = doc.join("");
fs::write(output_file, data).expect("Unable to write file");
}