Horrendously hardcodes the tier limit to 4 and changes the file naming scheme

This commit is contained in:
Dandaedre 2024-07-24 22:27:07 +02:00
parent c98b8f52d4
commit 82b9515a8e
2 changed files with 11 additions and 13 deletions

View File

@ -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)?;
}

View File

@ -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)?;