diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-09-29 11:48:59 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-09-29 11:49:13 +0200 |
commit | 800ffaf658c3defe165dd24c3ecd65ceabc7096a (patch) | |
tree | b9b2e44ac8a73efecdba3ac65be4ebb0dd20e239 /src/new/replacement.rs | |
parent | fix(MangledName): Also replace `"` and `'` (diff) | |
download | lpm-800ffaf658c3defe165dd24c3ecd65ceabc7096a.tar.gz lpm-800ffaf658c3defe165dd24c3ecd65ceabc7096a.zip |
feat(new/figure)!: Init
BREAKING CHANGE: The config file now needs to contain an `templates.figure` key. You can simply add this.
Diffstat (limited to '')
-rw-r--r-- | src/new/replacement.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/new/replacement.rs b/src/new/replacement.rs index 6878e61..0e9f27f 100644 --- a/src/new/replacement.rs +++ b/src/new/replacement.rs @@ -4,7 +4,7 @@ use chrono::{Local, TimeDelta, TimeZone}; use log::debug; use crate::constants::{ - DATE, REPLACEMENT_CHAPTER, REPLACEMENT_CHAPTER_SECTION, REPLACMENT_SECTION_TITLE, + DATE, REPLACEMENT_CHAPTER, REPLACEMENT_CHAPTER_SECTION, REPLACEMENT_FIGURE, REPLACMENT_SECTION, }; fn get_current_date() -> String { @@ -36,7 +36,7 @@ fn get_current_date() -> String { pub fn untemplatize_section(input: &str, new_section_name: &str, new_chapter_name: &str) -> String { input .replace(REPLACEMENT_CHAPTER_SECTION, &new_chapter_name) - .replace(REPLACMENT_SECTION_TITLE, &new_section_name) + .replace(REPLACMENT_SECTION, &new_section_name) .replace(DATE, &get_current_date()) } @@ -45,3 +45,8 @@ pub fn untemplatize_chapter(input: &str, new_chapter_name: &str) -> String { .replace(REPLACEMENT_CHAPTER, &new_chapter_name) .replace(DATE, &get_current_date()) } +pub fn untemplatize_figure(input: &str, new_figure_name: &str) -> String { + input + .replace(REPLACEMENT_FIGURE, &new_figure_name) + .replace(DATE, &get_current_date()) +} |