From f2c2588c60dfd091fbf661501f4c3ce8874814f4 Mon Sep 17 00:00:00 2001 From: Qrius Date: Tue, 22 Apr 2025 08:27:08 +0200 Subject: Approach malleable system --- Makefile | 4 +- 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 +++++++++++++++++++++------------------------ 6 files changed, 149 insertions(+), 141 deletions(-) create mode 100644 src/skaldpress/macros.py diff --git a/Makefile b/Makefile index dc25faa..8394bbf 100644 --- a/Makefile +++ b/Makefile @@ -34,5 +34,7 @@ test: mypy src/ && \ pyflakes src/ && \ ./tests/test_macro_processor.sh && \ - ./tests/test_skaldpress.sh + ./tests/test_skaldpress.sh && \ + ./tests/test_unittests.sh + 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(,