From f2c2588c60dfd091fbf661501f4c3ce8874814f4 Mon Sep 17 00:00:00 2001 From: Qrius Date: Tue, 22 Apr 2025 08:27:08 +0200 Subject: Approach malleable system --- src/skaldpress/macros.py | 47 +++++++++++++ src/skaldpress/main.py | 53 +++----------- src/smp/__init__.py | 2 - src/smp/builtins.py | 13 +++- src/smp/macro_processor.py | 171 +++++++++++++++++++++------------------------ 5 files changed, 146 insertions(+), 140 deletions(-) create mode 100644 src/skaldpress/macros.py (limited to 'src') diff --git a/src/skaldpress/macros.py b/src/skaldpress/macros.py new file mode 100644 index 0000000..33aac86 --- /dev/null +++ b/src/skaldpress/macros.py @@ -0,0 +1,47 @@ +from copy import deepcopy +from smp.builtins import ( + smp_builtin_read, +) + + +def sp_all_tagged_by( + macro_processor, tag: str, template: str, field=None, reversed="" +) -> str: + """ + SMP Macro for getting all files with specific tag, this is only _really_ effective the second run + + Usage in files: + all_tagged_by(,