diff --git a/src/convert.rs b/src/convert.rs new file mode 100644 index 0000000..d7bf5a8 --- /dev/null +++ b/src/convert.rs @@ -0,0 +1,5 @@ +#[derive(clap::ValueEnum, Clone, Debug)] +pub enum Formats { + TumblrNPF, +} + diff --git a/src/lib.rs b/src/lib.rs index 2fcb630..4986262 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +pub mod convert; pub mod frontmatter; pub mod links; pub mod utils; diff --git a/src/main.rs b/src/main.rs index 39852de..64eefbf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ use clio::*; use comrak::nodes::NodeValue; use mdparser::{ + convert, frontmatter::{self, Frontmatter}, links, utils, }; @@ -48,6 +49,10 @@ enum Commands { command: FrontmatterCommands, }, Not {}, + Convert { + #[arg(short, long)] + format: convert::Formats, + }, } #[derive(Debug, Subcommand)] @@ -81,6 +86,9 @@ fn main() { let arena = comrak::Arena::new(); let ast = comrak::parse_document(&arena, &file, &mdparser::utils::default_options()); + if let Commands::Convert { format } = &cli.command { + return; + } match &cli.command { Commands::Links { path_root,