From 5e86843d315994566d052a7da7d430d0f21a2c8b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Nov 2025 17:22:30 +0100 Subject: [PATCH 1/4] contrib/html: add a footer --- Makefile | 4 ++++ contrib/html.sh | 5 ++++- contrib/html.sh.d/foot.html | 4 ++++ general/style.css | 4 ++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 contrib/html.sh.d/foot.html diff --git a/Makefile b/Makefile index f841ca2b..a6098fb4 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,10 @@ GEN_RSC := $(wildcard *.capsman.rsc *.local.rsc *.wifi.rsc) MARKDOWN := $(wildcard *.md doc/*.md doc/mod/*.md) HTML := $(MARKDOWN:.md=.html) +DATE ?= $(shell date --rfc-email) +VERSION ?= $(shell git symbolic-ref --short HEAD 2>/dev/null)/$(shell git rev-list --count HEAD 2>/dev/null)/$(shell git rev-parse --short HEAD 2>/dev/null) +export DATE VERSION + .PHONY: all checksums docs rsc clean all: checksums docs rsc diff --git a/contrib/html.sh b/contrib/html.sh index da3873e3..24cc9b0d 100755 --- a/contrib/html.sh +++ b/contrib/html.sh @@ -15,4 +15,7 @@ markdown -f toc,idanchor "${1}" | sed \ -e '/| id="\L\1">|' \ -e '/' +sed \ + -e "s|__DATE__|${DATE:-$(date --rfc-email)}|" \ + -e "s|__VERSION__|${VERSION:-unknown}|" \ + < "${0}.d/foot.html" diff --git a/contrib/html.sh.d/foot.html b/contrib/html.sh.d/foot.html new file mode 100644 index 00000000..106c2bd0 --- /dev/null +++ b/contrib/html.sh.d/foot.html @@ -0,0 +1,4 @@ + +

RouterOS Scripts documentation generated on __DATE__ for __VERSION__

+ + diff --git a/general/style.css b/general/style.css index 4626093a..ea9b1118 100644 --- a/general/style.css +++ b/general/style.css @@ -43,6 +43,10 @@ img.logo { float: left; border-radius: 50%; } +p.foot { + color: #777; + text-align: center; +} p.heading { margin: 0px; font-weight: bold; From 1e0ccedac7d63ebc37b9e6abb359c98aaddd7338 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Nov 2025 18:18:36 +0100 Subject: [PATCH 2/4] contrib/template-capsman: split off from Makefile --- Makefile | 7 ++----- contrib/template-capsman.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100755 contrib/template-capsman.sh diff --git a/Makefile b/Makefile index a6098fb4..31bebf1a 100644 --- a/Makefile +++ b/Makefile @@ -28,11 +28,8 @@ docs: $(HTML) rsc: $(GEN_RSC) -%.capsman.rsc: %.template.rsc Makefile - sed -e '/\/interface\/wifi\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.capsman|' \ - -e '/^# NOT \/caps-man\/ #$$/,/^# NOT \/caps-man\/ #$$/d' \ - -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ - < $< > $@ +%.capsman.rsc: %.template.rsc contrib/template-capsman.sh + contrib/template-capsman.sh $< > $@ %.local.rsc: %.template.rsc Makefile sed -e '/\/caps-man\//d' -e '/\/interface\/wifi\//d' -e 's|%TEMPL%|.local|' \ diff --git a/contrib/template-capsman.sh b/contrib/template-capsman.sh new file mode 100755 index 00000000..3303472e --- /dev/null +++ b/contrib/template-capsman.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +sed -e '/\/interface\/wifi\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.capsman|' \ + -e '/^# NOT \/caps-man\/ #$/,/^# NOT \/caps-man\/ #$/d' \ + -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ + < "${1}" From a585dbc537b7b8e781594f03eb9d33bc769de3ba Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Nov 2025 18:21:39 +0100 Subject: [PATCH 3/4] contrib/template-local: split off from Makefile --- Makefile | 7 ++----- contrib/template-local.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100755 contrib/template-local.sh diff --git a/Makefile b/Makefile index 31bebf1a..6a566b33 100644 --- a/Makefile +++ b/Makefile @@ -31,11 +31,8 @@ rsc: $(GEN_RSC) %.capsman.rsc: %.template.rsc contrib/template-capsman.sh contrib/template-capsman.sh $< > $@ -%.local.rsc: %.template.rsc Makefile - sed -e '/\/caps-man\//d' -e '/\/interface\/wifi\//d' -e 's|%TEMPL%|.local|' \ - -e '/^# NOT \/interface\/wireless\/ #$$/,/^# NOT \/interface\/wireless\/ #$$/d' \ - -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ - < $< > $@ +%.local.rsc: %.template.rsc contrib/template-local.sh + contrib/template-local.sh $< > $@ %.wifi.rsc: %.template.rsc Makefile sed -e '/\/caps-man\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.wifi|' \ diff --git a/contrib/template-local.sh b/contrib/template-local.sh new file mode 100755 index 00000000..82120280 --- /dev/null +++ b/contrib/template-local.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +sed -e '/\/caps-man\//d' -e '/\/interface\/wifi\//d' -e 's|%TEMPL%|.local|' \ + -e '/^# NOT \/interface\/wireless\/ #$/,/^# NOT \/interface\/wireless\/ #$/d' \ + -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ + < "${1}" From b833fc36987e0b2fde4cf661319015acdbdca595 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 12 Nov 2025 18:22:35 +0100 Subject: [PATCH 4/4] contrib/template-wifi: split off from Makefile --- Makefile | 7 ++----- contrib/template-wifi.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100755 contrib/template-wifi.sh diff --git a/Makefile b/Makefile index 6a566b33..50ab9edc 100644 --- a/Makefile +++ b/Makefile @@ -34,11 +34,8 @@ rsc: $(GEN_RSC) %.local.rsc: %.template.rsc contrib/template-local.sh contrib/template-local.sh $< > $@ -%.wifi.rsc: %.template.rsc Makefile - sed -e '/\/caps-man\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.wifi|' \ - -e '/^# NOT \/interface\/wifi\/ #$$/,/^# NOT \/interface\/wifi\/ #$$/d' \ - -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ - < $< > $@ +%.wifi.rsc: %.template.rsc contrib/template-wifi.sh + contrib/template-wifi.sh $< > $@ clean: rm -f $(HTML) checksums.json diff --git a/contrib/template-wifi.sh b/contrib/template-wifi.sh new file mode 100755 index 00000000..8d48adaa --- /dev/null +++ b/contrib/template-wifi.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +sed -e '/\/caps-man\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.wifi|' \ + -e '/^# NOT \/interface\/wifi\/ #$/,/^# NOT \/interface\/wifi\/ #$/d' \ + -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ + < "${1}"