aboutsummaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-07-16 00:48:12 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-07-16 00:48:28 +0200
commit8671f50636c56a4a6a254ba5b27595379f49d059 (patch)
tree7efea006453951bd098cb0b6e6bc873b6cb2a651 /usr
parent4fe7cc6564549720f803de5e83c154c33250f9ba (diff)
downloadrbsd-8671f50636c56a4a6a254ba5b27595379f49d059.tar.gz
Add /usr/local/bin/aboutfilter
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/bin/aboutfilter7
-rw-r--r--usr/pkg/etc/cgitrc2
2 files changed, 8 insertions, 1 deletions
diff --git a/usr/local/bin/aboutfilter b/usr/local/bin/aboutfilter
new file mode 100755
index 0000000..6d4a24f
--- /dev/null
+++ b/usr/local/bin/aboutfilter
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+case "$1" in
+*.html) exec cat ;;
+*.[1-9]) mandoc -T html -O fragment | sed 's/<a class="permalink"/& style="color: black; text-decoration: none;"/;s/<td class="head-vol"/& style="text-align: center;"/;s/<td class="head-rtitle"/& style="text-align: right;"/;s/<table class="head"/& style="width: 100%;"/;s/<td class="foot-os"/& style="text-align: right;"/;s/<table class="foot"/& style="width: 100%;"/;s/<div class="Nd"/& style="display: inline;"/;s/<h2/<h3/;s/<h1/<h2/;s </h2 </h3 ;s </h1 </h2 ' ;;
+*) echo '<pre>'; sed "s|&|\\&amp;|g;s|'|\\&apos;|g;s|\"|\\&quot;|g;s|<|\\&lt;|g;s|>|\\&gt;|g"; echo '</pre>' ;;
+esac
diff --git a/usr/pkg/etc/cgitrc b/usr/pkg/etc/cgitrc
index 1c3a862..3b26898 100644
--- a/usr/pkg/etc/cgitrc
+++ b/usr/pkg/etc/cgitrc
@@ -11,7 +11,7 @@ readme=master:README.md
readme=master:README.txt
readme=master:README.1
readme=master:README
-about-filter=/usr/bin/aboutfilter
+about-filter=/usr/local/bin/aboutfilter
enable-http-clone=1
clone-url=http://$HTTP_HOST/$CGIT_REPO_URL