aboutsummaryrefslogtreecommitdiff
path: root/man/make-man.sh
diff options
context:
space:
mode:
authoremmett1 <emmett1.2miligrams@protonmail.com>2024-12-22 03:19:44 +0800
committeremmett1 <emmett1.2miligrams@protonmail.com>2024-12-22 03:19:44 +0800
commit7702b15c4ccd839932ad1378cacb7deec67c7d0c (patch)
tree8f3ca49e8c1daef47bc627c51f03f02d8deaa492 /man/make-man.sh
parentb4f8269c034d67612f3054e5cc7b4da30d3bd380 (diff)
downloadautils-7702b15c4ccd839932ad1378cacb7deec67c7d0c.tar.gz
autils-7702b15c4ccd839932ad1378cacb7deec67c7d0c.zip
updated some docs
Diffstat (limited to 'man/make-man.sh')
-rw-r--r--man/make-man.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/man/make-man.sh b/man/make-man.sh
new file mode 100644
index 0000000..dd0a8c5
--- /dev/null
+++ b/man/make-man.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# This script is derives from the original, written for Obarun Linux distribution by Eric Vidal.
+# The original is released under BSD Zero Clause licence (BSD0), and can be found at https://git.obarun.org/Obarun/66/-/blob/master/doc/make-man.sh?ref_type=heads.
+
+
+man8='apkg revdep'
+man5='apkg.conf'
+
+for i in 5 8;do
+ if [ ! -d man${i} ]; then
+ mkdir -p -m 0755 man"${i}" || exit 1
+ fi
+done
+
+for i in ${man5}; do
+ lowdown -s -Tman "${i}".md -o man5/"${i}".5 || exit 1
+ var=$( sed -n -e '/^.TH/p' < man5/"${i}".5)
+ var=$(printf '%s' "$var" | tr '7' '5')
+ sed -i "s!^.TH.*!${var}!" man5/"${i}".5 || exit 1
+ sed -i '4,8d' man5/"${i}".5 || exit 1
+done
+
+for i in ${man8}; do
+ lowdown -s -Tman "${i}".md -o man8/"${i}".8 || exit 1
+ var=$( sed -n -e '/^.TH/p' < man8/"${i}".8)
+ var=$(printf '%s' "$var" | tr '7' '8')
+ sed -i "s!^.TH.*!${var}!" man8/"${i}".8 || exit 1
+ sed -i '4,8d' man8/"${i}".8 || exit 1
+done
+
+exit 0