diff options
Diffstat (limited to 'src/new/section.rs')
-rw-r--r-- | src/new/section.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/new/section.rs b/src/new/section.rs index a359fb0..86d347c 100644 --- a/src/new/section.rs +++ b/src/new/section.rs @@ -1,4 +1,8 @@ -use std::{fs, path::Path, time::SystemTime}; +use std::{ + fs, + path::Path, + time::{SystemTime, UNIX_EPOCH}, +}; use anyhow::Context; use chrono::{DateTime, Local}; @@ -8,6 +12,7 @@ use log::debug; use crate::{ config_file::Config, file_tree::{FileTree, GeneratedFile}, + new::MangledName, }; pub fn generate_new_section( @@ -37,7 +42,7 @@ pub fn generate_new_section( let new_section_file = GeneratedFile::new( chapter_root .join("sections") - .join(format!("{}.tex", name.to_case(Case::Snake))), + .join(format!("{}.tex", MangledName::new(&name))), new_section_text, ); file_tree.add_file(new_section_file); @@ -53,7 +58,7 @@ pub fn generate_new_section( chapter_file_text.push_str(&format!( "\\input{{content/{}/sections/{}}}\n", chapter_name, - &name.to_case(Case::Snake) + &MangledName::new(&name) )); let chapter_file = GeneratedFile::new(chapter_file_path, chapter_file_text); |