diff --git a/Makefile b/Makefile index bd6d302..2e3ba0d 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ commitinfo: global-functions.rsc docs: $(HTML) -%.html: %.md general/style.css contrib/html.sh contrib/html.sh.d/head.html +%.html: %.md general/style.css contrib/html.sh contrib/html.sh.d/head.html contrib/html.sh.d/foot.html contrib/html.sh $< > $@ rsc: $(GEN_RSC) diff --git a/README.d/04-import-scripts.avif b/README.d/04-import-scripts.avif index 53439e4..a5cfa7b 100644 Binary files a/README.d/04-import-scripts.avif and b/README.d/04-import-scripts.avif differ diff --git a/contrib/Makefile b/contrib/Makefile index cdb9f4c..f704378 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -6,8 +6,5 @@ HTML := $(wildcard *.html) all: docs -docs: $(HTML) - sed -i \ - -e '/href=/s|\.md|\.html|' \ - -e '/blockquote/s|/\*! display \*/|display: none;|' \ - $(HTML) +docs: static-html.sh $(HTML) + ./static-html.sh $(HTML) diff --git a/contrib/html.sh b/contrib/html.sh index cc83d63..5fbba45 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -6,17 +6,14 @@ RELTO="$(dirname "${1}")" sed \ -e "s|__TITLE__|$(head -n1 "${1}")|" \ - -e "s|__STYLE__|$(realpath --relative-to="${RELTO}" general/style.css)|" \ - -e "s|__LOGO__|$(realpath --relative-to="${RELTO}" logo.png)|" \ - -e "s|__EWORM__|$(realpath --relative-to="${RELTO}" general/eworm-meadow.avif)|" \ - -e "s|__QR_CODE__|$(realpath --relative-to="${RELTO}" general/qr-code.png)|" \ - -e "s|__CLIPBOARD__|$(realpath --relative-to="${RELTO}" general/clipboard.js)|" \ + -e "s|__GENERAL__|$(realpath --relative-to="${RELTO}" general/)|" \ + -e "s|__ROOT__|$(realpath --relative-to="${RELTO}" ./)|" \ < "${0}.d/head.html" markdown -f toc,idanchor "${1}" | sed \ -e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \ -e '/| id="\L\1">|' \ - -e '//s|pre|pre onclick="CopyToClipboard(this)"|g' \ -e '/The above link may be broken on code hosting sites/s|blockquote|blockquote style="display: none;"|' diff --git a/contrib/html.sh.d/head.html b/contrib/html.sh.d/head.html index 861a87b..656a63c 100644 --- a/contrib/html.sh.d/head.html +++ b/contrib/html.sh.d/head.html @@ -1,14 +1,14 @@ RouterOS Scripts :: __TITLE__ - - - + + + - - + +
eworm on meadowQR code: rsc.eworm.deeworm on meadowQR code: rsc.eworm.de RouterOS Scripts
a collection of scripts for MikroTik RouterOS
diff --git a/contrib/logo-color.html b/contrib/logo-color.html index 5516964..a45ea93 100644 --- a/contrib/logo-color.html +++ b/contrib/logo-color.html @@ -18,7 +18,7 @@

⬅️ Go back to main README

-

💡️ Hint: This site or links +

💡️ Hint: This site or links on it may be broken on code hosting sites. Use Logo Color Changer instead.

diff --git a/contrib/notification.html b/contrib/notification.html index 902d328..a618f22 100644 --- a/contrib/notification.html +++ b/contrib/notification.html @@ -18,7 +18,7 @@

⬅️ Go back to main README

-

💡️ Hint: This site or links +

💡️ Hint: This site or links on it may be broken on code hosting sites. Use Notification Generator instead.

diff --git a/contrib/static-html.sh b/contrib/static-html.sh new file mode 100755 index 0000000..2c6f595 --- /dev/null +++ b/contrib/static-html.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +sed -i \ + -e '/href=/s|\.md|\.html|' \ + -e '/blockquote/s|/\* display \*/|display: none;|' \ + "${@}" diff --git a/general/clipboard.js b/general/clipboard.js index c392df7..9324be8 100644 --- a/general/clipboard.js +++ b/general/clipboard.js @@ -1,4 +1,8 @@ /* copy code to clipboard */ function CopyToClipboard(pre) { + pre.style.filter = 'invert(1)'; navigator.clipboard.writeText(pre.firstElementChild.innerHTML); + setTimeout(function() { + pre.style.filter = 'invert(0)'; + }, 100); } diff --git a/general/style.css b/general/style.css index ea9b111..191c0f6 100644 --- a/general/style.css +++ b/general/style.css @@ -69,6 +69,12 @@ pre code { padding: 0; border: 0; } +pre::before { + content: "📋 Copy!"; + float: right; + border: 1px solid #ccc; + border-radius: 3px; +} span.link { color: #863600; } diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc index 7c3a6ff..668daba 100644 --- a/mod/notification-email.rsc +++ b/mod/notification-email.rsc @@ -132,7 +132,7 @@ } :if ($AllDone = true && $QueueLen = [ :len $EmailQueue ]) do={ - /system/scheduler/remove $Scheduler; + /system/scheduler/remove [ find where name="_FlushEmailQueue" ]; :set EmailQueue; :return true; }