Made a generator for HTML man page

This commit is contained in:
Thomas Schmitt 2008-01-18 17:03:41 +00:00
parent ad69fc9e9a
commit 44da0e47b6
3 changed files with 144 additions and 10 deletions

View File

@ -0,0 +1,106 @@
#!/bin/sh
#
# convert_man_to_html.sh - ts A80118
#
# Generates a HTML version of man page xorriso.1
#
# To be executed within the libburn toplevel directory (eg. ./libisoburn-0.1.0)
#
# set -x
man_dir=$(pwd)"/test"
export MANPATH="$man_dir"
manpage="xorriso"
raw_html=$(pwd)/"test/raw_man_1_xorriso.html"
htmlpage=$(pwd)/"test/man_1_xorriso.html"
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>/\&nbsp;<BR><b>Overview of features:<\/b>/' \
-e 's/<b>General information paragraphs:<\/b>/\&nbsp;<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>/\&nbsp;<BR><b>Session model:<\/b>/' \
-e 's/<b>Media types and states:<\/b>/\&nbsp;<BR><b>Media types and states:<\/b>/' \
-e 's/<b>Creating, Growing, Modifying:<\/b>/\&nbsp;<BR><b>Creating, Growing, Modifying:<\/b>/' \
-e 's/<b>Libburn drives:<\/b>/\&nbsp;<BR><b>Libburn drives:<\/b>/' \
-e 's/^-dev /\&nbsp;\&nbsp;-dev /' \
-e 's/^-devices /\&nbsp;\&nbsp;-devices /' \
-e 's/<b>Rock Ridge, POSIX, X\/Open:<\/b>/\&nbsp;<BR><b>Rock Ridge, POSIX, X\/Open:<\/b>/' \
-e 's/<b>Command processing:<\/b>/\&nbsp;<BR><b>Command processing:<\/b>/' \
-e 's/<b>Dialog, Readline, Result pager:<\/b>/\&nbsp;<BR><b>Dialog, Readline, Result pager:<\/b>/' \
-e 's/<b>Aquiring source and target drive:<\/b>/\&nbsp;<BR><b>Aquiring source and target drive:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Data manipulations:<\/b>/\&nbsp;<BR><b>Data manipulations:<\/b><BR>\&nbsp;<BR>/' \
-e 's/^<p><b>&minus;iso_rr_pattern/<p>\&nbsp;<BR><b>\&minus;iso_rr_pattern/' \
-e 's/EXAMPLES):<br>/<A HREF="#EXAMPLES">EXAMPLES<\/A>):<br>/' \
-e 's/<b>Writing the result:<\/b>/\&nbsp;<BR><b>Writing the result:<\/b><BR>/' \
-e 's/^-find \/ /\&nbsp;\&nbsp;-find \/ /' \
-e 's/<b>Settings for data insertion:<\/b>/\&nbsp;<BR><b>Settings for data insertion:<\/b><BR>\&nbsp;<BR>/' \
-e 's/^$<\/b> ln -s/\&nbsp;\&nbsp;$<\/b> ln -s/' \
-e 's/<b>Settings for result writing:<\/b>/\&nbsp;<BR><b>Settings for result writing:<\/b><BR>\&nbsp;<BR>/' \
-e 's/^706k = 706kB/\&nbsp;\&nbsp;706k = 706kB/' \
-e 's/^5540k = 5540kB/\&nbsp;\&nbsp;5540k = 5540kB/' \
-e 's/<b>Exception processing:<\/b>/\&nbsp;<BR><b>Exception processing:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Dialog mode control:<\/b>/\&nbsp;<BR><b>Dialog mode control:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Drive and media related inquiry actions:<\/b>/\&nbsp;<BR><b>Drive and media related inquiry actions:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Navigation in ISO image/\&nbsp;<BR><b>Navigation in ISO image/' \
-e 's/^filesystem:<\/b>/filesystem:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Scripting, dialog and/\&nbsp;<BR><b>Scripting, dialog and/' \
-e 's/^features:<\/b>/features:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Support for frontend/\&nbsp;<BR><b>Support for frontend/' \
-e 's/^listening at stdout:<\/b>/listening at stdout:<\/b><BR>\&nbsp;<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 \\ \&rsquo;\/pictures\/\*private\*\&rsquo; \\/\/sounds\/indecent \&rsquo;\/pictures\/*private*\&rsquo; /' \
-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>/' \
<"$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

View File

@ -98,6 +98,8 @@ copy_files \
ng_src/*.[ch] \ ng_src/*.[ch] \
"$lone_dir"/libisoburn "$lone_dir"/libisoburn
test/convert_man_to_html.sh
create_dir "$lone_dir"/xorriso create_dir "$lone_dir"/xorriso
copy_files \ copy_files \
test/ng_xorrisoburn.[ch] \ test/ng_xorrisoburn.[ch] \
@ -105,10 +107,10 @@ copy_files \
test/xorriso_private.h \ test/xorriso_private.h \
test/xorriso_timestamp.h \ test/xorriso_timestamp.h \
test/changelog.txt \ test/changelog.txt \
test/xorriso_eng.html \
test/man_1_xorriso.html \
"$lone_dir"/xorriso "$lone_dir"/xorriso
copy_files test/xorriso_eng.html "$lone_dir"/xorriso/xorriso_eng.html
mv "$lone_dir"/xorriso/ng_xorrisoburn.h "$lone_dir"/xorriso/xorrisoburn.h mv "$lone_dir"/xorriso/ng_xorrisoburn.h "$lone_dir"/xorriso/xorrisoburn.h
mv "$lone_dir"/xorriso/ng_xorrisoburn.c "$lone_dir"/xorriso/xorrisoburn.c mv "$lone_dir"/xorriso/ng_xorrisoburn.c "$lone_dir"/xorriso/xorrisoburn.c

View File

@ -235,11 +235,15 @@ Even those which will not be useable for reading an ISO image.
.PP .PP
MMC compliant (i.e. optical) drives on Linux usually get addressed by MMC compliant (i.e. optical) drives on Linux usually get addressed by
the path of their block device or of their generic character device. E.g. the path of their block device or of their generic character device. E.g.
.br
-dev /dev/sr0 -dev /dev/sr0
.br
-dev /dev/hdc -dev /dev/hdc
.br
-dev /dev/sg2 -dev /dev/sg2
.br .br
Get a list of accessible drives by command Get a list of accessible drives by command
.br
-devices -devices
.br .br
It might be necessary to do this as It might be necessary to do this as
@ -249,6 +253,7 @@ Consider to bundle the authorized users in a group like old "floppy".
.PP .PP
Filesystem objects of nearly any type can be addressed by prefix "stdio:" and Filesystem objects of nearly any type can be addressed by prefix "stdio:" and
their path in the filesystem. E.g.: their path in the filesystem. E.g.:
.br
-dev stdio:/tmp/pseudo_drive -dev stdio:/tmp/pseudo_drive
.br .br
If path leads to a regular file or to a block device then the emulated drive If path leads to a regular file or to a block device then the emulated drive
@ -325,7 +330,8 @@ them as commands with their parameters. It provides assisting services
to make dialog more comfortable. to make dialog more comfortable.
.PP .PP
Readline is an enhancement for the input line. You may know it already from Readline is an enhancement for the input line. You may know it already from
the bash shell. the bash shell. Whether it is available in xorriso depends on the availability
of package readline-dev at the time when xorriso was built from its sourcecode.
.br .br
It allows to move the cursor over the text in the line by help of the It allows to move the cursor over the text in the line by help of the
Leftward and the Rightward arrow key. Leftward and the Rightward arrow key.
@ -576,7 +582,7 @@ Relative times counted from current clock time:
+|-Number["s"|"h"|"d"|"w"|"m"|"y"] +|-Number["s"|"h"|"d"|"w"|"m"|"y"]
.br .br
where "s" means seconds, "h" hours, "d" days, "w" weeks, "m"=30d, where "s" means seconds, "h" hours, "d" days, "w" weeks, "m"=30d,
"y"=365.25d plus 1d added multiplication result. "y"=365.25d plus 1d added to multiplication result.
.br .br
Absolute seconds counted from Jan 1 1970: Absolute seconds counted from Jan 1 1970:
=Number =Number
@ -654,6 +660,7 @@ other file causes a SORRY event.
Delete empty directories. Delete empty directories.
.TP .TP
\fB\-\-\fR \fB\-\-\fR
.br
Mark end of particular action argument list. Mark end of particular action argument list.
.TP .TP
\fB\-rollback\fR \fB\-rollback\fR
@ -843,7 +850,9 @@ Speed can be given in media dependent numbers or as a
desired throughput per second in MMC compliant kB (= 1000) desired throughput per second in MMC compliant kB (= 1000)
or MB (= 1000 kB). Media x-speed factor can be set explicity or MB (= 1000 kB). Media x-speed factor can be set explicity
by "c" for CD and "d" for "DVD". Example speeds: by "c" for CD and "d" for "DVD". Example speeds:
.br
706k = 706kB/s = 4c = 4xCD 706k = 706kB/s = 4c = 4xCD
.br
5540k = 5540kB/s = 4d = 4xDVD 5540k = 5540kB/s = 4d = 4xDVD
.br .br
If there is no hint about the speed unit attached, then the If there is no hint about the speed unit attached, then the
@ -876,6 +885,7 @@ and is one aspect of growisofs option -dvd-compat.
\fB\-abort_on\fR severity \fB\-abort_on\fR severity
Set the threshold for events to abort the program. Set the threshold for events to abort the program.
Events are classified by severity : Events are classified by severity :
.br
"NEVER", "ABORT", "FATAL", "SORRY", "WARNING", "NEVER", "ABORT", "FATAL", "SORRY", "WARNING",
"HINT", "NOTE", "UPDATE", "DEBUG", "ALL" "HINT", "NOTE", "UPDATE", "DEBUG", "ALL"
.br .br
@ -938,6 +948,7 @@ use -rollback to revoke the whole session.
.B Drive and media related inquiry actions: .B Drive and media related inquiry actions:
.TP .TP
\fB\-toc\fR \fB\-toc\fR
.br
Show media specific table of content. This is the media Show media specific table of content. This is the media
structure, not the ISO image directory tree. In case of structure, not the ISO image directory tree. In case of
overwriteable media holding a valid ISO image, a single overwriteable media holding a valid ISO image, a single
@ -981,9 +992,11 @@ image as it is at the moment.
Change the current working directory on filesystem. Change the current working directory on filesystem.
.TP .TP
\fB\-pwd\fR \fB\-pwd\fR
.br
Tell the current working directory in the ISO image. Tell the current working directory in the ISO image.
.TP .TP
\fB\-pwdx\fR \fB\-pwdx\fR
.br
Tell the current working directory on local filesystem. Tell the current working directory on local filesystem.
.TP .TP
\fB\-ls\fR iso_rr_pattern [***] \fB\-ls\fR iso_rr_pattern [***]
@ -1048,9 +1061,9 @@ List size of directories and files in the local filesystem
which match one of the patterns. which match one of the patterns.
Similar to shell command du -sk. Similar to shell command du -sk.
.TP .TP
\fB\-findx\fR disk_path [-name pattern] -- \fB\-findx\fR disk_path [-name pattern] [-type t] --
Like -find but operating on local filesystem and not on the ISO image. Like -find but operating on local filesystem and not on the ISO image.
This action is subject to the settings of -follow. This is subject to the settings of -follow.
.br .br
-findx accepts the -exec actions as does -find. But it will -findx accepts the -exec actions as does -find. But it will
always perform action "echo". always perform action "echo".
@ -1058,11 +1071,16 @@ always perform action "echo".
.B Scripting, dialog and program control features: .B Scripting, dialog and program control features:
.TP .TP
\fB\-no_rc\fR \fB\-no_rc\fR
.br
Only if used as first command line argument this option Only if used as first command line argument this option
prevents reading and interpretation of eventual startup prevents reading and interpretation of eventual startup
files. See section FILES below. files. See section FILES below.
.TP .TP
\fB\-options_from_file\fR fileaddress
Reads lines from fileaddress and executes them as dialog lines.
.TP
\fB\-help\fR \fB\-help\fR
.br
Print helptext. Print helptext.
.TP .TP
\fB\-version\fR \fB\-version\fR
@ -1074,8 +1092,11 @@ Copy textline into libreadline history.
\fB\-status\fR [mode|filter] \fB\-status\fR [mode|filter]
Print the current settings of xorriso. Print the current settings of xorriso.
Modes: Modes:
.br
short... print only important or altered settings short... print only important or altered settings
.br
long ... print all settings including defaults long ... print all settings including defaults
.br
long_history like long plus history lines long_history like long plus history lines
.br .br
Filters begin with '-' and are compared literally against the Filters begin with '-' and are compared literally against the
@ -1091,9 +1112,6 @@ buffering. Currently this applies to pattern expansion only.
.br .br
Default is 16m = 16 MiB, minimum 64k = 64 kiB, maximum 1024m = 1 GiB. Default is 16m = 16 MiB, minimum 64k = 64 kiB, maximum 1024m = 1 GiB.
.TP .TP
\fB\-options_from_file\fR fileaddress
Reads lines from fileaddress and executes them as dialog lines.
.TP
\fB\-print\fR text \fB\-print\fR text
Print a text to result channel. Print a text to result channel.
.TP .TP
@ -1103,6 +1121,7 @@ wait for the user to hit the Enter key
resp. to send a line via stdin. resp. to send a line via stdin.
.TP .TP
\fB\-end\fR \fB\-end\fR
.br
End program immediately End program immediately
.TP .TP
\fB#\fR any text \fB#\fR any text
@ -1117,7 +1136,9 @@ Consolidate text output on stdout and classify each
line by a channel indicator: line by a channel indicator:
.br .br
'R:' for result lines, 'R:' for result lines,
.br
'I:' for notes and error messages, 'I:' for notes and error messages,
.br
'M:' for -mark texts. 'M:' for -mark texts.
.br .br
Next is a decimal number of which only bit 0 has a meaning for now. Next is a decimal number of which only bit 0 has a meaning for now.
@ -1126,6 +1147,7 @@ the end of the output line belongs to the payload. After another colon follows
the payload text. the payload text.
.br .br
Example: Example:
.br
I:1: enter option and arguments : I:1: enter option and arguments :
.TP .TP
\fB\-logfile\fR channel fileaddress \fB\-logfile\fR channel fileaddress
@ -1287,9 +1309,13 @@ Seconds since Jan 1 1970:
.br .br
If not -no_rc is given as the first argument then xorriso attempts on startup If not -no_rc is given as the first argument then xorriso attempts on startup
to read and execute lines from the following files: to read and execute lines from the following files:
.br
/etc/default/xorriso /etc/default/xorriso
.br
/etc/opt/xorriso/rc /etc/opt/xorriso/rc
/etc/xorriso/cdrskin.conf .br
/etc/xorriso/xorriso.conf
.br
$HOME/.xorrisorc $HOME/.xorrisorc
.br .br
The files are read in the sequence given above, but none of them is required The files are read in the sequence given above, but none of them is required