2006-12-14 10:29:03 +00:00
#!/bin/sh
#
# convert_man_to_html.sh - ts A61214
#
# Generates a HTML version of man page cdrskin.1
#
# To be executed within the libburn toplevel directory (like ./libburn-0.2.7)
#
# set -x
man_dir = $( pwd ) "/cdrskin"
export MANPATH = " $man_dir "
manpage = "cdrskin"
raw_html = $( pwd ) /"cdrskin/raw_man_1_cdrskin.html"
htmlpage = $( pwd ) /"cdrskin/man_1_cdrskin.html"
2008-01-26 12:30:22 +00:00
if test -r " $man_dir " /" $manpage " .1
2006-12-14 10:29:03 +00:00
then
dummy = dummy
else
echo " Cannot find readable man page source $1 " >& 2
exit 1
fi
if test -e " $man_dir " /man1
then
dummy = dummy
else
ln -s . " $man_dir " /man1
fi
if test " $1 " = "-work_as_filter"
then
# set -x
sed \
2006-12-14 17:14:17 +00:00
-e 's/<meta name="generator" content="groff -Thtml, see www.gnu.org">/<meta name="generator" content="groff -Thtml, via man -H, via cdrskin\/convert_man_to_html.sh">/' \
-e 's/<meta name="Content-Style" content="text\/css">/<meta name="Content-Style" content="text\/css"><META NAME="description" CONTENT="man page of cdrskin"><META NAME="keywords" CONTENT="man cdrskin, manual, cdrskin, CD, CD-RW, CD-R, burning, cdrecord, compatible"><META NAME="robots" CONTENT="follow">/' \
-e 's/<title>CDRSKIN<\/title>/<title>man 1 cdrskin<\/title>/' \
-e 's/<h1 align=center>CDRSKIN<\/h1>/<h1 align=center>man 1 cdrskin<\/h1>/' \
2006-12-14 10:29:03 +00:00
-e 's/<body>/<body BGCOLOR="#F5DEB3" TEXT=#000000 LINK=#0000A0 VLINK=#800000>/' \
-e 's/<b>Overview of features:<\/b>/\ <BR><b>Overview of features:<\/b>/' \
2007-03-08 21:55:50 +00:00
-e 's/<b>General information paragraphs:<\/b>/\ <BR><b>General information paragraphs:<\/b>/' \
2006-12-14 10:29:03 +00:00
-e 's/<b>Track recording model:<\/b>/\ <BR><b>Track recording model:<\/b>/' \
2007-09-08 16:49:19 +00:00
-e 's/^In general there are two types of tracks: data and audio./\ <BR>In general there are two types of tracks: data and audio./' \
-e 's/^While audio tracks just contain a given/\ <BR>While audio tracks just contain a given/' \
2007-03-08 21:55:50 +00:00
-e 's/<b>Write mode selection:<\/b>/\ <BR><b>Write mode selection:<\/b>/' \
2006-12-14 10:29:03 +00:00
-e 's/<b>Recordable CD Media:<\/b>/\ <BR><b>Recordable CD Media:<\/b>/' \
2007-02-02 13:37:34 +00:00
-e 's/<b>Overwriteable DVD Media:<\/b>/\ <BR><b>Overwriteable DVD Media:<\/b>/' \
-e 's/<b>Sequentially Recordable DVD Media:<\/b>/\ <BR><b>Sequentially Recordable DVD Media:<\/b>/' \
2007-09-08 16:49:19 +00:00
-e 's/^The write modes for DVD+R/\ <BR>The write modes for DVD+R/' \
2006-12-15 10:27:08 +00:00
-e 's/<b>Drive preparation and addressing:<\/b>/\ <BR><b>Drive preparation and addressing:<\/b>/' \
2007-09-08 16:49:19 +00:00
-e 's/^If you only got one CD capable drive/\ <BR>If you only got one CD capable drive/' \
2007-09-27 08:34:26 +00:00
-e 's/<b>Emulated drives:<\/b>/\ <BR><b>Emulated drives:<\/b>/' \
2006-12-14 10:29:03 +00:00
-e 's/^Alphabetical list of options/\ <BR>Alphabetical list of options/' \
2008-01-26 12:30:22 +00:00
-e 's/<\/body>/<BR><HR><FONT SIZE=-1><CENTER>(HTML generated from ' " $manpage " '.1 on ' " $( date) " ' by ' $( basename " $0 " ) ' )<\/CENTER><\/FONT><\/body>/' \
2007-09-27 08:34:26 +00:00
-e 's/See section FILES/See section <A HREF="#FILES">FILES<\/A>/' \
2006-12-14 10:29:03 +00:00
-e 's/See section EXAMPLES/See section <A HREF="#EXAMPLES">EXAMPLES<\/A>/' \
2011-10-08 12:11:38 +00:00
-e 's/−/-/g' \
2006-12-14 10:29:03 +00:00
<" $2 " >" $htmlpage "
set +x
chmod u+rw,go+r,go-w " $htmlpage "
echo "Emerged file:"
2007-03-08 21:55:50 +00:00
ls -lL " $htmlpage "
2006-12-14 10:29:03 +00:00
else
export BROWSER = 'cp "%s" ' " $raw_html "
man -H " $manpage "
" $0 " -work_as_filter " $raw_html "
rm " $raw_html "
rm " $man_dir " /man1
fi