feat: convert command and module

This commit is contained in:
Gustavo "Guz" L. de Mello
2024-03-28 17:33:22 -03:00
parent 61601670c3
commit a9867f073b
3 changed files with 14 additions and 0 deletions

5
src/convert.rs Normal file
View File

@@ -0,0 +1,5 @@
#[derive(clap::ValueEnum, Clone, Debug)]
pub enum Formats {
TumblrNPF,
}

View File

@@ -1,3 +1,4 @@
pub mod convert;
pub mod frontmatter;
pub mod links;
pub mod utils;

View File

@@ -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,