X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=doc%2Fman2html.sh;fp=doc%2Fman2html.sh;h=0000000000000000000000000000000000000000;hp=49f6c7244c5b227d9612da28a3997a8cef45e250;hb=cf4c819df08e2ab6c06532d8a4467fa58b2792ae;hpb=705fbbaf9a8064c034d23119e912da028af7fac7 diff --git a/doc/man2html.sh b/doc/man2html.sh deleted file mode 100755 index 49f6c72..0000000 --- a/doc/man2html.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh - -# -# Yoink -# Run this script to convert the manual page to html. -# -# Requires groff. -# Have fun! -# - -function showhelp() -{ - echo "Create an html manual page." - echo "Usage: $0 [-Hfh] [-i manpage] [-o htmlfile]" - echo "" - echo " -H Hide email addresses in the manual page." - echo " -f Force overwrite of output file." - echo " -h Show this help an exit." - echo " -i Specify the manual page to convert." - echo " -o Specify output path of html file." -} - -INFILE="doc/yoink.6" -OUTFILE="yoink.html" - -while getopts ":Hfhi:o:" opt -do - case $opt in - H) - HIDE_EMAIL=yes - ;; - f) - FORCE=yes - ;; - h) - showhelp - exit 0 - ;; - i) - INFILE="$OPTARG" - ;; - o) - OUTFILE="$OPTARG" - ;; - \?) - echo "Invalid option: -$OPTARG" >&2 - showhelp - exit 1 - ;; - esac -done - -if test x$FORCE != xyes && test -e "$OUTFILE" -then - echo "Refusing to overwrite file: $OUTFILE. Use -f to override." >&2 - exit 1 -fi - -if test ! -f "$INFILE" -then - echo "Can't open file: $INFILE" >&2 - exit 1 -fi - -DATE=$(date +"%d %b %Y") - -# 1. Remove first two lines (comments about groff). -# 2. Edit page title. -# 3. Insert a footer before . -HTML=$(groff -t -e -mandoc -Thtml "$INFILE" | sed -e "1,2d" \ --e "s|.*|Yoink Manual|" -e "s||\ -

\\ -This manual page was generated on $DATE.\\ -For more information, go to the\\ -Yoink website.\\ -

\\ -|") - -if test x$HIDE_EMAIL = xyes -then -# 4. Replace email addresses with a placeholder. - echo "$HTML" \ - | sed -e "s|<.*@.*>|\<email address not shown\>|g" \ - >"$OUTFILE" -else - echo "$HTML" >"$OUTFILE" -fi -