Now with windows support

This commit is contained in:
Dandaedre 2024-04-23 21:14:54 +02:00
parent e702393c0d
commit b141d4ea5f
3 changed files with 16 additions and 4 deletions

View File

@ -1,2 +1,2 @@
[build]
rustflags = ["-Clink-arg=-fuse-ld=mold", "-Ctarget-cpu=native"]
rustflags = ["-Clink-arg=-fuse-ld=lld", "-Ctarget-cpu=native"]

View File

@ -20,3 +20,14 @@ codegen-backend = "cranelift"
lto = true
codegen-units = 1
panic = "abort"
strip = "none"
[profile.windows]
inherits = "release"
opt-level = "z"
debug = false
strip = true
lto = true
codegen-units = 1
incremental = false
panic = "abort"

View File

@ -38,6 +38,7 @@ fn convert_file(f: &String, args: &Args) -> Result<(), Error> {
let converted = records_to_string(csv)?;
if args.export {
let path = f.replace(".tsv", ".tex");
println!("[Info] Writing to {}", path);
let mut file = File::create(path)?;
file.write_all(converted.as_bytes())?;
} else {
@ -70,7 +71,7 @@ fn replace_all(arg: &str) -> String {
let temp = arg
.replace('🩸', "\\blood")
.replace('⚡', "\\jauge")
.replace('⚡', "\\gauge")
.replace('&', "\\&");
let res = re.replace(&temp, |caps: &Captures| {
format!("\\dd{{{}}}", caps[0].chars().count())
@ -114,7 +115,7 @@ fn records_to_string(csv: Vec<Vec<Record>>) -> Result<String, Error> {
// EXSANGUINATION PROGRESSIVE & 1 & Actif, (Béhémoth) & 4\blood\vfill 1\gauge & Ces attaques infligent aussi un saignement de 1 dégât sur 4 tours (chaque attaque viens ajouter un point au saignement total).\\
let mut buffer = BufWriter::new(Vec::new());
for (lvl, tier) in csv.iter().skip(1).enumerate() {
write!(buffer, "\\subsubsection{{Tier {}}}", lvl)?;
write!(buffer, "\\subsubsection{{Tier {}}}", lvl + 1)?;
let open = r#"{\footnotesize
\rowcolors{2}{gray!25}{white}
\begin{tabularx}{\textwidth}{|p{0.17\linewidth\hyphenpenalty=9000}lp{0.13\linewidth}p{0.042\linewidth}X|}
@ -124,7 +125,7 @@ fn records_to_string(csv: Vec<Vec<Record>>) -> Result<String, Error> {
for elem in tier {
write!(
buffer,
" {}&{}&{}&{}&{}&{}",
" {}&{}&{}&{}{}&{} \\\\",
elem.technique,
elem.niveau,
elem.technique_type,