diff --git a/src/table_types.rs b/src/table_types.rs index eb4569e..51b8b09 100644 --- a/src/table_types.rs +++ b/src/table_types.rs @@ -120,13 +120,10 @@ impl WriteTable for ClassesArray { let formatted_tier = SimpleCurlyFormat .format(&config.classes.tier, [lvl + 1]) .expect("Formatting of header failed"); - // vline{1,6} = {3-11}{solid}, - // vline{1,6} = {14-19}{solid}, - // vline{1,6} = {21-26}{solid}, - // vline{1,6} = {29-34}{solid}, - // let formatted_header = SimpleCurlyFormat - // .format(&config.classes.header, [lvl + 1]) - // .expect("Formatting failed"); + // TODO: FIX THIS ABOMINATION + if lvl > 3 { + continue; + } if lvl != 0 { writeln!(buffer, "{}", &config.classes.sep)?; } diff --git a/src/tablegen.rs b/src/tablegen.rs index afa79b7..99004f8 100644 --- a/src/tablegen.rs +++ b/src/tablegen.rs @@ -25,11 +25,11 @@ pub fn table_gen(args: &TableArgs, config: &Config) -> Result<()> { let list_files = match args.kind { TableGenerationTarget::Classes => { println!("Processing files in the Tables/ subdirectory"); - &mut list_dir("Tables/???-*.tsv") + &mut list_dir("Tables/??? - *.tsv") } TableGenerationTarget::Craft => { println!("Processing files in the Craft/ subdirectory"); - &mut list_dir("Craft/???-*.tsv") + &mut list_dir("Craft/??? - *.tsv") } // Add the use of glob to save the poor windows users TableGenerationTarget::Files => { @@ -38,8 +38,8 @@ pub fn table_gen(args: &TableArgs, config: &Config) -> Result<()> { } TableGenerationTarget::All => &mut { println!("Processing files in the Tables and Craft subdirectory"); - let mut targets = list_dir("Tables/???-*.tsv"); - targets.append(&mut list_dir("Craft/???-*.tsv")); + let mut targets = list_dir("Tables/??? - *.tsv"); + targets.append(&mut list_dir("Craft/??? - *.tsv")); targets }, }; @@ -88,7 +88,7 @@ fn extract_type(f: &Path) -> Result<&TableTargets> { .file_name() .context("The filename of can't be extracted...skipping")? .to_str() - .context("Can't convert filename to string")?[..3]; + .context("Can't convert filename to string")?[7..10]; STR_TO_TARGET_FULL.get(key).with_context(|| { format!( "Could not find the type of file given based on the prefix of your file ({})\n\ @@ -130,7 +130,8 @@ pub fn export_tsv( .file_name() .context("Extracting old name")? .to_str() - .context("Generating new name")?[4..]; + .context("Generating new name")?[12..]; + let name = format!("gen-{}", name); let path = f.with_file_name(name).with_extension("tex"); println!("[Info] Writing to {:?}", path); let mut file = File::create(path)?;