summary refs log tree commit diff stats
path: root/example
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-09-29 10:11:35 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-09-29 10:11:35 +0200
commitd0fe56f4e98fa552c5e271713a815d2382e614f7 (patch)
tree5564085c201fdac129e96fa6036c3da0b1c11a0b /example
parentfeat(bundle): Support bundling a document into one TeX file (diff)
downloadlpm-d0fe56f4e98fa552c5e271713a815d2382e614f7.tar.gz
lpm-d0fe56f4e98fa552c5e271713a815d2382e614f7.zip
feat(templates): Provide a consistent syntax for replacements
All replacements now start with `lpm::` and thus provide a future way to
extend them. This change also adds the ability to access the
chapter name in a new section and the current data in a new chapter.
Diffstat (limited to '')
-rw-r--r--example/example.tex (renamed from example/main.tex)0
-rw-r--r--example/lpm.toml12
2 files changed, 5 insertions, 7 deletions
diff --git a/example/main.tex b/example/example.tex
index d5f0d2f..d5f0d2f 100644
--- a/example/main.tex
+++ b/example/example.tex
diff --git a/example/lpm.toml b/example/lpm.toml
index 5a3565d..7c4aaad 100644
--- a/example/lpm.toml
+++ b/example/lpm.toml
@@ -1,19 +1,17 @@
-[last_chapter]
-user_name = "static"
-number = 0
+main_file = "example.tex"
 
 [templates]
 section = '''
-%! TEX root = ../../../main.tex
+%! TEX root = ../../../example.tex
 % LTeX: language=en-GB
 
-\section{REPLACMENT_SECTION_TITLE} % DATE
+\section{lpm::new_section_name} % lpm::current_date (lpm::current_chapter_name::title_case)
 This is some text
 '''
 
 chapter = '''
-%! TEX root = ../../main.tex
+%! TEX root = ../../example.tex
 % LTeX: language=en-GB
 
-\chapter{REPLACEMENT_CHAPTER}
+\chapter{lpm::new_chapter_name} % lpm::current_date
 '''