From 30b9669ea95e6b3b4f48a25c8045c2b4f551dacd Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 19 Jun 2022 21:48:10 +0200 Subject: convert img and template directives to shortcodes command: ``` find * -type f -name '*.md' -execdir perl -gpi -e 's/\[\[!img\s+([^\s\]"]+)(\s(?:[^\]]|"[^"]*")+?)?\s*\]\]/{{ img(path="$1"$2) }}/g; s/\[\[!template\s+id="?(columns|note|video)"?\s+([^\]]+?)\s*\]\]/{{ $1($2) }}/g;' '{}' + ``` --- test2/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test2') diff --git a/test2/index.md b/test2/index.md index 52f87b87..976e1b9a 100644 --- a/test2/index.md +++ b/test2/index.md @@ -1,9 +1,9 @@ [[!if test="included()" then=""" -[[!img tours/vindue_turliste.jpg class="solo" link="tours" size="480x"]] +{{ img(path="tours/vindue_turliste.jpg" class="solo" link="tours" size="480x") }} """ else=""" -[[!template id=columns content=''' -[[!toggle id="ipsum" text="Vis/skjul oversigt"]] +{{ columns(content=''' +[[!toggle id="ipsum" text="Vis/skjul oversigt") }} [[!toggleable id="ipsum" text="[[!inline pages=tagged(kvarter) and !tagged(historie) archive=yes]]"]] ''']] -- cgit v1.2.3