From e41ff94d4042870c29c5d5cb70fba6020b18fd0c Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 23 Feb 2024 21:29:56 +0200 Subject: (awk-edits) Added a MEL-based Presentation.awk alternative With slightly modified tag names --- awk-edits/MEL-Presentation.awk | 91 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 awk-edits/MEL-Presentation.awk diff --git a/awk-edits/MEL-Presentation.awk b/awk-edits/MEL-Presentation.awk new file mode 100644 index 0000000..849a8f8 --- /dev/null +++ b/awk-edits/MEL-Presentation.awk @@ -0,0 +1,91 @@ +# .*(slides|teaching)/.*html + +BEGIN { + # + # Elements, dependent (and semidependent) on available font size + # + + fontSizes[1] = "18" + fontSizes[2] = "20" + fontSizes[3] = "22" + fontSizes[4] = "25" + fontSizes[5] = "27" + fontSizes[6] = "35" + + # Certain tags can exist without explicitly defining the font size + # while others cannot + # fontSizes[0] is used for simpler code for the tags which don't + # require font size + fontSizes[0] = "" + + # Tags which can exist without specified font-size + for (ind in fontSizes) { + standardPresentationTag("centered" fontSizes[ind]) + + fontClass = (ind != 0) ? " font" fontSizes[ind] : "" + MEL["slide" fontSizes[ind], MELOPEN] = "
" + MEL["slide" fontSizes[ind], MELCLOSE] = "
" + MEL["vcen" fontSizes[ind], MELOPEN] = "
" + MEL["vcen" fontSizes[ind], MELCLOSE] = "
" + MEL["title" fontSizes[ind], MELOPEN] = "
" + MEL["title" fontSizes[ind], MELCLOSE] = "
" + } + + # refer to definition of fontSizes[0] + delete fontSizes[0] + + # Tags which cannot exist without specified font-size + for (ind in fontSizes) { + standardPresentationTag("font" fontSizes[ind]) + } + + # + # Special cases + # + + MEL["presentation", MELSINGLE] = ORS \ +"

" ORS \ +" " + + MEL["rows", MELOPEN] = "
" # (layout-row > * is td) + MEL["rows", MELCLOSE] = "" #
+ + MEL["eqrows", MELOPEN] = "
" #
(layout-row > * is td) + MEL["eqrows", MELCLOSE] = "" + + MEL["newrow", MELSINGLE] = "
" #
+ + # + # Generated tags + # + + for (i = 1; i <= 9; i++) { + MEL["br" i, MELSINGLE] = "
" + } + for (i = 5; i <= 95; i++) { + standardPresentationTag("width" i "%") + } + + # + # Ordinary + # + + standardPresentationTag("fright") + standardPresentationTag("cont") +} + +function standardPresentationTag(name) { + MEL[name, MELOPEN] = "
" + MEL[name, MELCLOSE] = "
" +} + +/\[SLIDEID\]/ { + sub(/\[SLIDEID\]/, slideIndex++) +} -- cgit v1.3.1-23-gd82d