diff options
Diffstat (limited to 'contrib')
| -rwxr-xr-x | contrib/checksums.sh | 9 | ||||
| -rwxr-xr-x | contrib/html.sh | 9 | ||||
| -rw-r--r-- | contrib/html.sh.d/head.html | 15 | 
3 files changed, 33 insertions, 0 deletions
| diff --git a/contrib/checksums.sh b/contrib/checksums.sh new file mode 100755 index 0000000..b472b49 --- /dev/null +++ b/contrib/checksums.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# generate a checksums file as used by $ScriptInstallUpdate + +set -e + +md5sum $(find -name '*.rsc' | sort) | \ +	sed -e "s| \./||" -e 's|.rsc$||' | \ +	jq --raw-input --null-input '[ inputs | split (" ") | { (.[1]): (.[0]) }] | add' > 'checksums.json' diff --git a/contrib/html.sh b/contrib/html.sh new file mode 100755 index 0000000..bbd8ba8 --- /dev/null +++ b/contrib/html.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +sed "s|__TITLE__|$(head -n1 "${1}")|" < "${0}.d/head.html" +markdown -f toc,idanchor "${1}" | sed \ +	-e 's/href="\([-_\./[:alnum:]]*\)\.md"/href="\1.html"/g' \ +	-e '/<h[1234] /s| id="\(.*\)">| id="\L\1">|' +printf '</body></html>' diff --git a/contrib/html.sh.d/head.html b/contrib/html.sh.d/head.html new file mode 100644 index 0000000..1b1dd03 --- /dev/null +++ b/contrib/html.sh.d/head.html @@ -0,0 +1,15 @@ +<!DOCTYPE html><html lang="en"> +<head><title>RouterOS Scripts :: __TITLE__</title> +<meta http-equiv="content-type" content="text/html; charset=UTF-8"> +<style> +  body { font-family: sans-serif; } +  h2 { border-bottom: 1px solid #ccc; color: #000; } +  a { text-decoration: none; } +  a:hover { text-decoration: underline; } +  blockquote { border-left: 4px solid #ccc; padding: 0 10px; color: #777; } +  code { margin: 0 2px; padding: 2px 5px; border: 1px solid #ccc; background-color: #f8f8f8; border-radius: 3px; } +  pre { background-color: #f8f8f8; border: 1px solid #ccc; overflow: auto; padding: 6px 10px; border-radius: 3px; } +  pre code { margin: 0; padding: 0; border: 0; } +</style> +<link rel="icon" href="/logo.png" type="image/png"> +</head><body> |