2008-01-18 17:03:41 +00:00
#!/bin/sh
#
# convert_man_to_html.sh - ts A80118
#
# Generates a HTML version of man page xorriso.1
#
2008-01-26 00:26:57 +00:00
# To be executed in the libisoburn toplevel directory (eg. ./libisoburn-0.1.0)
2008-01-18 17:03:41 +00:00
#
# set -x
2008-01-26 00:26:57 +00:00
man_dir = $( pwd ) "/xorriso"
2008-01-18 17:03:41 +00:00
export MANPATH = " $man_dir "
manpage = "xorriso"
2008-01-26 00:26:57 +00:00
raw_html = $( pwd ) /"xorriso/raw_man_1_xorriso.html"
htmlpage = $( pwd ) /"xorriso/man_1_xorriso.html"
2008-01-18 17:03:41 +00:00
if test -r " $man_dir " /" $manpage " .1
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 \
-e 's/<meta name="generator" content="groff -Thtml, see www.gnu.org">/<meta name="generator" content="groff -Thtml, via man -H, via xorriso\/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 xorriso"><META NAME="keywords" CONTENT="man xorriso, manual, xorriso, CD, CD-RW, CD-R, burning, cdrecord, compatible"><META NAME="robots" CONTENT="follow">/' \
-e 's/<title>XORRISO<\/title>/<title>man 1 xorriso<\/title>/' \
-e 's/<h1 align=center>XORRISO<\/h1>/<h1 align=center>man 1 xorriso<\/h1>/' \
-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>/' \
-e 's/<b>General information paragraphs:<\/b>/\ <BR><b>General information paragraphs:<\/b>/' \
-e 's/have a look at section EXAMPLES/have a look at section <A HREF="#EXAMPLES">EXAMPLES<\/A>/' \
-e 's/<b>Session model:<\/b>/\ <BR><b>Session model:<\/b>/' \
-e 's/<b>Media types and states:<\/b>/\ <BR><b>Media types and states:<\/b>/' \
2008-07-14 17:39:12 +00:00
-e 's/<b>Creating, Growing, Modifying, Blind/\ <BR><b>Creating, Growing, Modifying, Blind/' \
2008-01-18 17:03:41 +00:00
-e 's/<b>Libburn drives:<\/b>/\ <BR><b>Libburn drives:<\/b>/' \
-e 's/^-dev /\ \ -dev /' \
-e 's/^-devices /\ \ -devices /' \
2009-02-12 07:26:49 +00:00
-e 's/<b>Rock Ridge, POSIX, X\/Open, El Torito, ACL,/\ <BR><b>Rock Ridge, POSIX, X\/Open, El Torito, ACL,/' \
2008-01-18 17:03:41 +00:00
-e 's/<b>Command processing:<\/b>/\ <BR><b>Command processing:<\/b>/' \
-e 's/<b>Dialog, Readline, Result pager:<\/b>/\ <BR><b>Dialog, Readline, Result pager:<\/b>/' \
-e 's/<b>Aquiring source and target drive:<\/b>/\ <BR><b>Aquiring source and target drive:<\/b><BR>\ <BR>/' \
2010-03-18 10:13:35 +00:00
-e 's/<b>Influencing the behavior of image/\ <BR><b>Influencing the behavior of image/' \
-e 's/<b>File manipulations:<\/b>/\ <BR><b>File manipulations:<\/b><BR>\ <BR>/' \
2008-01-18 17:03:41 +00:00
-e 's/^<p><b>−iso_rr_pattern/<p>\ <BR><b>\−iso_rr_pattern/' \
-e 's/EXAMPLES):<br>/<A HREF="#EXAMPLES">EXAMPLES<\/A>):<br>/' \
2010-03-18 10:13:35 +00:00
-e 's/<b>Writing the result, drive control:<\/b>/\ <BR><b>Writing the result, drive control:<\/b><BR>/' \
2008-01-18 17:03:41 +00:00
-e 's/^-find \/ /\ \ -find \/ /' \
2010-03-18 10:13:35 +00:00
-e 's/<b>Settings for file insertion:<\/b>/\ <BR><b>Settings for file insertion:<\/b><BR>\ <BR>/' \
2008-01-18 17:03:41 +00:00
-e 's/^$<\/b> ln -s/\ \ $<\/b> ln -s/' \
-e 's/<b>Settings for result writing:<\/b>/\ <BR><b>Settings for result writing:<\/b><BR>\ <BR>/' \
-e 's/^706k = 706kB/\ \ 706k = 706kB/' \
-e 's/^5540k = 5540kB/\ \ 5540k = 5540kB/' \
2008-11-03 11:57:57 +00:00
-e 's/<b>Character sets:<\/b>/\ <BR><b>Character sets:<\/b><BR>\ <BR>/' \
2008-01-18 17:03:41 +00:00
-e 's/<b>Exception processing:<\/b>/\ <BR><b>Exception processing:<\/b><BR>\ <BR>/' \
2008-09-28 11:33:47 +00:00
-e 's/<b>El Torito bootable ISO images:<\/b>/\ <BR><b>El Torito bootable ISO images:<\/b><BR>\ <BR>/' \
2008-01-18 17:03:41 +00:00
-e 's/<b>Dialog mode control:<\/b>/\ <BR><b>Dialog mode control:<\/b><BR>\ <BR>/' \
-e 's/<b>Drive and media related inquiry actions:<\/b>/\ <BR><b>Drive and media related inquiry actions:<\/b><BR>\ <BR>/' \
-e 's/<b>Navigation in ISO image/\ <BR><b>Navigation in ISO image/' \
-e 's/^filesystem:<\/b>/filesystem:<\/b><BR>\ <BR>/' \
2008-08-26 12:36:12 +00:00
-e 's/<b>Evaluation of readability and recovery:<\/b>/\ <BR><b>Evaluation of readability and recovery:<\/b><BR>\ <BR>/' \
2010-03-18 10:13:35 +00:00
-e 's/<b>osirrox ISO-to-disk restore options:<\/b>/\ <BR><b>osirrox ISO-to-disk restore options:<\/b><BR>\ <BR>/' \
2008-05-01 12:44:26 +00:00
-e 's/<b>Command compatibility emulations:<\/b>/\ <BR><b>Command compatibility emulations:<\/b><BR>\ <BR>/' \
-e 's/^<p><b>−as</<p>\ <BR><b>\−as</' \
2008-01-18 17:03:41 +00:00
-e 's/<b>Scripting, dialog and/\ <BR><b>Scripting, dialog and/' \
-e 's/^features:<\/b>/features:<\/b><BR>\ <BR>/' \
-e 's/<b>Support for frontend/\ <BR><b>Support for frontend/' \
-e 's/^listening at stdout:<\/b>/listening at stdout:<\/b><BR>\ <BR>/' \
-e 's/xorriso -outdev \/dev\/sr2 \\ -blank fast \\ -pathspecs on/xorriso -outdev \/dev\/sr2 -blank fast -pathspecs on/' \
-e 's/\\ -add \\ \/sounds=\/home\/me\/sounds \\ \/pictures \\ -- \\ -rm_r \\/ -add \/sounds=\/home\/me\/sounds \/pictures -- -rm_r /' \
-e 's/\/sounds\/indecent \\ \’\/pictures\/\*private\*\’ \\/\/sounds\/indecent \’\/pictures\/*private*\’ /' \
-e 's/\/pictures\/confidential \\ -- \\ -add \\/\/pictures\/confidential -- -add/' \
-e 's/xorriso -dev \/dev\/sr2 \\ -rm_r \/sounds -- \\ -mv \\/xorriso -dev \/dev\/sr2 -rm_r \/sounds -- -mv /' \
-e 's/\/pictures\/confidential \\ \/pictures\/restricted \\ -- \\ -chmod/\/pictures\/confidential \/pictures\/restricted -- -chmod/' \
-e 's/go-rwx \/pictures\/restricted -- \\ -pathsspecs on \\ -add \\/go-rwx \/pictures\/restricted -- -pathsspecs on -add /' \
-e 's/\/sounds=\/home\/me\/prepared_for_dvd\/sounds_dummy /\/sounds=\/home\/me\/prepared_for_dvd\/sounds_dummy/' \
-e 's/\/movies=\/home\/me\/prepared_for_dvd\/movies \\ -- \\ -commit/\/movies=\/home\/me\/prepared_for_dvd\/movies -- -commit/' \
-e 's/xorriso -indev \/dev\/sr2 \\ -rm_r \/sounds -- \\/xorriso -indev \/dev\/sr2 -rm_r \/sounds -- /' \
-e 's/-outdev \/dev\/sr0 -blank fast \\ -commit -eject all/-outdev \/dev\/sr0 -blank fast -commit -eject all/' \
-e 's/See section FILES/See section <A HREF="#FILES">FILES<\/A>/' \
-e 's/See section EXAMPLES/See section <A HREF="#EXAMPLES">EXAMPLES<\/A>/' \
2008-01-26 00:26:57 +00:00
-e 's/<\/body>/<BR><HR><FONT SIZE=-1><CENTER>(HTML generated from ' " $manpage " '.1 on ' " $( date) " ' by ' $( basename " $0 " ) ' )<\/CENTER><\/FONT><\/body>/' \
2008-01-18 17:03:41 +00:00
<" $2 " >" $htmlpage "
set +x
chmod u+rw,go+r,go-w " $htmlpage "
echo "Emerged file:"
ls -lL " $htmlpage "
else
export BROWSER = 'cp "%s" ' " $raw_html "
man -H " $manpage "
" $0 " -work_as_filter " $raw_html "
rm " $raw_html "
rm " $man_dir " /man1
fi