Summary Files Commits Branches @commit @diff @stats
path: root / awk-edits / MEL-Iconified.awk
diff options
context:
space:
mode:
Commit42815619367b9294d1b1c69f556a93f7c8693f1f (patch)
Author
 Kamen Mladenov <kamen@syndamia.com>
2024-02-26 08:33:26 +0000
Committer
 Kamen Mladenov <kamen@syndamia.com>
2024-02-26 08:33:26 +0000
Files7a55ac562669ca7c30cea980fd7135d1d82b65dd /awk-edits/MEL-Iconified.awk
syndamia.com-42815619367b9294d1b1c69f556a93f7c8693f1f.tar
syndamia.com-42815619367b9294d1b1c69f556a93f7c8693f1f.tar.gz
syndamia.com-42815619367b9294d1b1c69f556a93f7c8693f1f.zip
Parent795d04783d25c0ada4ca3a5a4b56dbc18ff34bd6 (diff)
Parent88bb1fbdfe8dbcb6a4f6490683627a229f873dfd (diff)
Merge branch 'MEL' into 'master'
MEL syntax overhaul See merge request Syndamia/syndamiadotcom!14
1 files changed, 42 insertions, 0 deletions
-rw-r--r--awk-edits/MEL-Iconified.awk42
diff --git a/awk-edits/MEL-Iconified.awk b/awk-edits/MEL-Iconified.awk
new file mode 100644
index 0000000..332be46
--- /dev/null
+++ b/awk-edits/MEL-Iconified.awk
@@ -0,0 +1,42 @@
+# .*html
+
+BEGIN {
+ usesMEL()
+ #
+ # Flags
+ #
+
+ melFlagTag("gb", "ENG")
+ melFlagTag("bg", "BGN")
+
+ #
+ # Noteworthy paragraphs
+ #
+
+ melParTag("question", "dialog-question.png")
+ melParTag("warn", "dialog-warning.png")
+ melParTag("important", "dialog-important.png")
+
+ #
+ # File type
+ #
+
+ melFiletypeTag("ft-photo", "&#xeb0a;")
+ melFiletypeTag("ft-text", "&#xeaa2;")
+ melFiletypeTag("ft-zip", "&#xed4e;")
+ melFiletypeTag("ft-movie", "&#xeafa;")
+ melFiletypeTag("ft-markdown", "&#xec41;")
+ melFiletypeTag("ft-browser", "&#xebb7;")
+}
+
+function melFlagTag(name, alt) {
+ MEL[name, MELINSERT] = "<img src=\"/img/" name ".svg\" class=\"flag unzoomable svg\" alt=\"" name "\" height=18>"
+}
+
+function melParTag(name, image) {
+ MEL[name, MELPARAGRAPH] = "class=\"special-par " name "-par\"><img src=\"/img/" image "\" class=\"special-par-icon borderless unzoomable\" alt=\"" name "\">"
+}
+
+function melFiletypeTag(name, repl) {
+ MEL[name, MELINSERT] = "<span class=\"file-type-icon\">" repl "</span>"
+}