]>
Dogcows Code - chaz/yoink/blob - doc/man2html.sh
5 # Run this script to convert the manual page to html.
13 echo "Create an html manual page."
14 echo "Usage: $0 [-Hfh] [-i manpage] [-o htmlfile]"
16 echo " -H Hide email addresses in the manual page."
17 echo " -f Force overwrite of output file."
18 echo " -h Show this help an exit."
19 echo " -i Specify the manual page to convert."
20 echo " -o Specify output path of html file."
26 while getopts ":Hfhi:o:" opt
46 echo "Invalid option: -$OPTARG" >&2
53 if test x
$FORCE != xyes
&& test -e "$OUTFILE"
55 echo "Refusing to overwrite file: $OUTFILE. Use -f to override." >&2
59 if test ! -f "$INFILE"
61 echo "Can't open file: $INFILE" >&2
65 DATE
=$(date +"%d %b %Y")
67 # 1. Remove first two lines (comments about groff).
69 # 3. Insert a footer before </body>.
70 HTML
=$
(groff -t -e -mandoc -Thtml "$INFILE" | sed -e "1,2d" \
71 -e "s|<title>.*</title>|<title>Yoink Manual</title>|" -e "s|</body>|\
72 <p style=\"font-size: 9px; text-align: center;\">\\
73 This manual page was generated on $DATE.\\
74 For more information, go to the\\
75 <a href=\"http://www.dogcows.com/yoink/\">Yoink website</a>.\\
79 if test x
$HIDE_EMAIL = xyes
81 # 4. Replace email addresses with a placeholder.
83 | sed -e "s|<.*@.*>|\<email address not shown\>|g" \
86 echo "$HTML" >"$OUTFILE"
This page took 0.037242 seconds and 5 git commands to generate.