Add boxquote.filter file. - tgtimes - The Gopher Times
(HTM) git clone git://bitreich.org/tgtimes git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/tgtimes
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit 3f45fceee6067b32c58ffa2aa0ae659847ee6002
(DIR) parent 1adbfcd6847504a84c7e0c7a0312ea56fd24a744
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Thu, 10 Aug 2023 09:19:17 +0200
Add boxquote.filter file.
Diffstat:
A filters/boxquote.filter | 46 +++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/filters/boxquote.filter b/filters/boxquote.filter
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+export TERM=linux
+
+reset="$(tput sgr0)"
+italicformat="$(tput sitm)"
+italicreset="$(tput ritm)"
+boldformat="$(tput bold)"
+boldreset="$(echo -ne "\033[22m")"
+underlineformat="$(tput smul)"
+underlinereset="$(tput rmul)"
+reverseformat="$(tput rev)"
+reversereset="$(echo -ne "\033[27m")"
+
+redcolor="$(tput setaf 1)"
+greencolor="$(tput setaf 2)"
+yellowcolor="$(tput setaf 3)"
+bluecolor="$(tput setaf 4)"
+purplecolor="$(tput setaf 5)"
+cyancolor="$(tput setaf 6)"
+whitecolor="$(tput setaf 7)"
+darkgreycolor="$(tput setaf 8)"
+brightredcolor="$(tput setaf 9)"
+brightgreencolor="$(tput setaf 10)"
+brightyellowcolor="$(tput setaf 11)"
+brightbluecolor="$(tput setaf 12)"
+brightpurplecolor="$(tput setaf 13)"
+brightcyancolor="$(tput setaf 14)"
+brightwhitecolor="$(tput setaf 14)"
+
+while IFS= read -r line;
+do
+ if [ -z "${line0}" ];
+ then
+ line0="$(printf "%s\n" "${line}" \
+ | sed 's,^[# ]*\(.*\)$,\1,')"
+ printf ",---- [${underlineformat} %s ${reset}]\n" \
+ "${line0}"
+ else
+ printf "| %s\n" "${line}"
+ fi
+done
+
+printf "| \n"
+printf "\`----\n"
+