From 44da0e47b64fbb542150059ff0c48dd2229acfe2 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 18 Jan 2008 17:03:41 +0000 Subject: [PATCH] Made a generator for HTML man page --- libisoburn/trunk/test/convert_man_to_html.sh | 106 ++++++++++++++++++ .../trunk/test/make_xorriso_standalone.sh | 6 +- libisoburn/trunk/test/xorriso.1 | 42 +++++-- 3 files changed, 144 insertions(+), 10 deletions(-) create mode 100755 libisoburn/trunk/test/convert_man_to_html.sh diff --git a/libisoburn/trunk/test/convert_man_to_html.sh b/libisoburn/trunk/test/convert_man_to_html.sh new file mode 100755 index 00000000..acd30e6c --- /dev/null +++ b/libisoburn/trunk/test/convert_man_to_html.sh @@ -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///' \ + -e 's///' \ + -e 's/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>/' \ + -e 's/<b>Creating, Growing, Modifying:<\/b>/\ <BR><b>Creating, Growing, Modifying:<\/b>/' \ + -e 's/<b>Libburn drives:<\/b>/\ <BR><b>Libburn drives:<\/b>/' \ + -e 's/^-dev /\ \ -dev /' \ + -e 's/^-devices /\ \ -devices /' \ + -e 's/<b>Rock Ridge, POSIX, X\/Open:<\/b>/\ <BR><b>Rock Ridge, POSIX, X\/Open:<\/b>/' \ + -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>/' \ + -e 's/<b>Data manipulations:<\/b>/\ <BR><b>Data manipulations:<\/b><BR>\ <BR>/' \ + -e 's/^<p><b>−iso_rr_pattern/<p>\ <BR><b>\−iso_rr_pattern/' \ + -e 's/EXAMPLES):<br>/<A HREF="#EXAMPLES">EXAMPLES<\/A>):<br>/' \ + -e 's/<b>Writing the result:<\/b>/\ <BR><b>Writing the result:<\/b><BR>/' \ + -e 's/^-find \/ /\ \ -find \/ /' \ + -e 's/<b>Settings for data insertion:<\/b>/\ <BR><b>Settings for data insertion:<\/b><BR>\ <BR>/' \ + -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/' \ + -e 's/<b>Exception processing:<\/b>/\ <BR><b>Exception processing:<\/b><BR>\ <BR>/' \ + -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>/' \ + -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>/' \ + <"$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 diff --git a/libisoburn/trunk/test/make_xorriso_standalone.sh b/libisoburn/trunk/test/make_xorriso_standalone.sh index 946b9fd7..ba6fcbe9 100755 --- a/libisoburn/trunk/test/make_xorriso_standalone.sh +++ b/libisoburn/trunk/test/make_xorriso_standalone.sh @@ -98,6 +98,8 @@ copy_files \ ng_src/*.[ch] \ "$lone_dir"/libisoburn +test/convert_man_to_html.sh + create_dir "$lone_dir"/xorriso copy_files \ test/ng_xorrisoburn.[ch] \ @@ -105,10 +107,10 @@ copy_files \ test/xorriso_private.h \ test/xorriso_timestamp.h \ test/changelog.txt \ + test/xorriso_eng.html \ + test/man_1_xorriso.html \ "$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.c "$lone_dir"/xorriso/xorrisoburn.c diff --git a/libisoburn/trunk/test/xorriso.1 b/libisoburn/trunk/test/xorriso.1 index aabdfb3b..4b923cec 100644 --- a/libisoburn/trunk/test/xorriso.1 +++ b/libisoburn/trunk/test/xorriso.1 @@ -235,11 +235,15 @@ Even those which will not be useable for reading an ISO image. .PP 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. +.br -dev /dev/sr0 +.br -dev /dev/hdc +.br -dev /dev/sg2 .br Get a list of accessible drives by command +.br -devices .br 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 Filesystem objects of nearly any type can be addressed by prefix "stdio:" and their path in the filesystem. E.g.: +.br -dev stdio:/tmp/pseudo_drive .br 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. .PP 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 It allows to move the cursor over the text in the line by help of the Leftward and the Rightward arrow key. @@ -576,7 +582,7 @@ Relative times counted from current clock time: +|-Number["s"|"h"|"d"|"w"|"m"|"y"] .br 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 Absolute seconds counted from Jan 1 1970: =Number @@ -654,6 +660,7 @@ other file causes a SORRY event. Delete empty directories. .TP \fB\-\-\fR +.br Mark end of particular action argument list. .TP \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) or MB (= 1000 kB). Media x-speed factor can be set explicity by "c" for CD and "d" for "DVD". Example speeds: +.br 706k = 706kB/s = 4c = 4xCD +.br 5540k = 5540kB/s = 4d = 4xDVD .br 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 Set the threshold for events to abort the program. Events are classified by severity : +.br "NEVER", "ABORT", "FATAL", "SORRY", "WARNING", "HINT", "NOTE", "UPDATE", "DEBUG", "ALL" .br @@ -938,6 +948,7 @@ use -rollback to revoke the whole session. .B Drive and media related inquiry actions: .TP \fB\-toc\fR +.br Show media specific table of content. This is the media structure, not the ISO image directory tree. In case of 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. .TP \fB\-pwd\fR +.br Tell the current working directory in the ISO image. .TP \fB\-pwdx\fR +.br Tell the current working directory on local filesystem. .TP \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. Similar to shell command du -sk. .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. -This action is subject to the settings of -follow. +This is subject to the settings of -follow. .br -findx accepts the -exec actions as does -find. But it will always perform action "echo". @@ -1058,11 +1071,16 @@ always perform action "echo". .B Scripting, dialog and program control features: .TP \fB\-no_rc\fR +.br Only if used as first command line argument this option prevents reading and interpretation of eventual startup files. See section FILES below. .TP +\fB\-options_from_file\fR fileaddress +Reads lines from fileaddress and executes them as dialog lines. +.TP \fB\-help\fR +.br Print helptext. .TP \fB\-version\fR @@ -1074,8 +1092,11 @@ Copy textline into libreadline history. \fB\-status\fR [mode|filter] Print the current settings of xorriso. Modes: +.br short... print only important or altered settings +.br long ... print all settings including defaults +.br long_history like long plus history lines .br Filters begin with '-' and are compared literally against the @@ -1091,9 +1112,6 @@ buffering. Currently this applies to pattern expansion only. .br Default is 16m = 16 MiB, minimum 64k = 64 kiB, maximum 1024m = 1 GiB. .TP -\fB\-options_from_file\fR fileaddress -Reads lines from fileaddress and executes them as dialog lines. -.TP \fB\-print\fR text Print a text to result channel. .TP @@ -1103,6 +1121,7 @@ wait for the user to hit the Enter key resp. to send a line via stdin. .TP \fB\-end\fR +.br End program immediately .TP \fB#\fR any text @@ -1117,7 +1136,9 @@ Consolidate text output on stdout and classify each line by a channel indicator: .br 'R:' for result lines, +.br 'I:' for notes and error messages, +.br 'M:' for -mark texts. .br 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. .br Example: +.br I:1: enter option and arguments : .TP \fB\-logfile\fR channel fileaddress @@ -1287,9 +1309,13 @@ Seconds since Jan 1 1970: .br If not -no_rc is given as the first argument then xorriso attempts on startup to read and execute lines from the following files: +.br /etc/default/xorriso +.br /etc/opt/xorriso/rc - /etc/xorriso/cdrskin.conf +.br + /etc/xorriso/xorriso.conf +.br $HOME/.xorrisorc .br The files are read in the sequence given above, but none of them is required