wahoo
This commit is contained in:
parent
4ae3e75ac3
commit
4b2c64dafd
9 changed files with 225 additions and 26 deletions
27
src/main.rs
27
src/main.rs
|
|
@ -1,8 +1,27 @@
|
|||
use markdown::to_html;
|
||||
use clap::Parser;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about, long_about = None)]
|
||||
struct Args {
|
||||
/// Name of the person to greet
|
||||
#[arg(short, long)]
|
||||
name: String,
|
||||
|
||||
/// Number of times to greet
|
||||
#[arg(short, long, default_value_t = 1)]
|
||||
count: u8,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// arg 1: src, arg 2: dest
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
let input: String = std::fs::read_to_string(&args[1]).unwrap();
|
||||
print!("{}", to_html(&input));
|
||||
let args = Args::parse();
|
||||
|
||||
// takes directory of markdown files as only argument, outputs
|
||||
// html output into stdout (TODO make )
|
||||
if let Some(dir) = std::env::args().skip(1).next() {
|
||||
// get files in dir
|
||||
}
|
||||
//let input: String = std::fs::read_to_string(&args[1]).unwrap();
|
||||
//print!("{}", to_html(&input));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue