Browse Source

Reacting on changes in the output of my local man -H

master
Thomas Schmitt 7 years ago
parent
commit
e3f6ed3aa2
  1. 21
      xorriso/man_xorrecord_to_html.sh
  2. 68
      xorriso/man_xorriso_to_html.sh
  3. 35
      xorriso/man_xorrisofs_to_html.sh
  4. 124
      xorriso/unite_html_b_line.c
  5. 2
      xorriso/xorriso_timestamp.h

21
xorriso/man_xorrecord_to_html.sh

@ -1,7 +1,7 @@
#!/bin/sh
#
# man_xorrecord_to_html.sh - ts A80118 , B10309
# man_xorrecord_to_html.sh - ts A80118 , B10309 , B50730
#
# Generates a HTML version of man page xorrecord.1
#
@ -42,15 +42,16 @@ then
-e 's/<title>XORRECORD<\/title>/<title>man 1 xorrecord<\/title>/' \
-e 's/<h1 align=center>XORRECORD<\/h1>/<h1 align=center>man 1 xorrecord<\/h1>/' \
-e 's/<body>/<body BGCOLOR="#F5DEB3" TEXT=#000000 LINK=#0000A0 VLINK=#800000>/' \
-e 's/<b>MMC, Session, Track, Media types:<\/b>/\&nbsp;<BR><b>MMC, Session, Track, Media types:<\/b>/' \
-e 's/<b>MMC, Session, Track, Media types:<\/b>/\&nbsp;<BR><b>MMC, Session, Track, Media types:<\/b>/' \
-e 's/<b>Relation to program xorriso:<\/b>/\&nbsp;<BR><b>Relation to program xorriso:<\/b>/' \
-e 's/<b>MMC, Session, Track, Media types: <br> MMC<\/b>/<b>MMC, Session, Track, Media types:<\/b><BR>\&nbsp;<BR><b>MMC<\/b>/' \
-e 's/<b>Drive preparation and addressing:<\/b>/<b>Drive preparation and addressing:<\/b><BR>/' \
-e 's/<b>Relation to program xorriso: <br> xorrecord<\/b>/<b>Relation to program xorriso:<\/b><BR>\&nbsp;<BR><b>xorrecord<\/b>/' \
-e 's/<b>Addressing the drive: <br> --devices<\/b>/<b>Addressing the drive: <\/b><BR>\&nbsp;<BR><b>--devices<\/b>/' \
-e 's/EXAMPLES):<br>/<A HREF="#EXAMPLES">EXAMPLES<\/A>):<br>/' \
-e 's/<b>Drive addressing:<\/b>/\&nbsp;<BR><b>Drive addressing:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Inquiring drive and media:<\/b>/\&nbsp;<BR><b>Inquiring drive and media:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Settings for the burn run<\/b>/\&nbsp;<BR><b>Settings for the burn run:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Program version and verbosity:<\/b>/\&nbsp;<BR><b>Program version and verbosity:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Options not compatible to cdrecord:<\/b>/\&nbsp;<BR><b>Options not compatible to cdrecord:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Settings for the burn run:<\/b>/\&nbsp;<BR><b>Settings for the burn run:<\/b><BR>/' \
-e 's/<b><br> blank=mode<\/b>/<BR>\&nbsp;<BR><b>blank=mode<\/b>/' \
-e 's/<b>Program version and verbosity: <br> &minus;version<\/b>/\&nbsp;<BR><b>Program version and verbosity:<\/b><BR>\&nbsp;<BR><b>-version<\/b>/' \
-e 's/<b>Options not compatible to cdrecord: <br> --no_rc<\/b>/\&nbsp;<BR><b>Options not compatible to cdrecord:<\/b><BR>\&nbsp;<BR><b>--no_rc<\/b>/' \
\
-e 's/<\/body>/<BR><HR><FONT SIZE=-1><CENTER>(HTML generated from '"$manpage"'.1 on '"$(date)"' by '$(basename "$0")' )<\/CENTER><\/FONT><\/body>/' \
-e 's/&minus;/-/g' \
@ -64,8 +65,10 @@ then
else
export BROWSER='cp "%s" '"$raw_html"
# export BROWSER='cp "%s" '"$raw_html"
export BROWSER=$(pwd)/'xorriso/unite_html_b_line "%s" '"$raw_html"
man -H "$manpage"
# cp "$raw_html" /tmp/x.html
"$0" -work_as_filter "$raw_html"
rm "$raw_html"
rm "$man_dir"/man1

68
xorriso/man_xorriso_to_html.sh

@ -1,7 +1,7 @@
#!/bin/sh
#
# man_xorriso_to_html.sh - ts A80118 , B10309
# man_xorriso_to_html.sh - ts A80118 , B10309 , B50730
#
# Generates a HTML version of man page xorriso.1
#
@ -44,55 +44,53 @@ then
-e 's/<body>/<body BGCOLOR="#F5DEB3" TEXT=#000000 LINK=#0000A0 VLINK=#800000>/' \
-e 's/<b>Overview of features:<\/b>/\&nbsp;<BR><A NAME="Overview"><\/A><b>Overview of features:<\/b>/' \
-e 's/<b>General information paragraphs:<\/b>/\&nbsp;<BR><A NAME="General"><\/A><b>General information paragraphs:<\/b>/' \
-e 's/^<p>Session model<br>/<p><A HREF="#Model">Session model<\/A><br>/' \
-e 's/^Media types and states/<A HREF="#Media">Media types and states/' \
-e 's/Session model <br>/<A HREF="#Model">Session model<\/A> <br>/' \
-e 's/^Media types and states/<A HREF="#Media">Media types and states<\/A>/' \
-e 's/^Creating, Growing, Modifying, Blind Growing/<A HREF="#Methods">Creating, Growing, Modifying, Blind Growing<\/A>/' \
-e 's/^Libburn drives/<A HREF="#Drives">Libburn drives<\/A>/' \
-e 's/^Rock Ridge, POSIX, X\/Open, El Torito, ACL, xattr/<A HREF="#Extras">Rock Ridge, POSIX, X\/Open, El Torito, ACL, xattr<\/A>/' \
-e 's/^Command processing/<A HREF="#Processing">Command processing<\/A>/' \
-e 's/^Dialog, Readline, Result pager/<A HREF="#Dialog">Dialog, Readline, Result pager<\/A>/' \
-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><A NAME="Model"><\/A><b>Session model:<\/b>/' \
-e 's/<b>Media types and states:<\/b>/\&nbsp;<BR><A NAME="Media"><\/A><b>Media types and states:<\/b>/' \
-e 's/<b>Creating, Growing, Modifying, Blind/\&nbsp;<BR><A NAME="Methods"><\/A><b>Creating, Growing, Modifying, Blind/' \
-e 's/<b>Libburn drives:<\/b>/\&nbsp;<BR><b>Libburn drives:<\/b><A NAME="Drives"><\/A>/' \
-e 's/<b>Session model:<\/b>/\&nbsp;<BR><A NAME="Model"><\/A><b>Session model:<\/b><BR>/' \
-e 's/<b>Media types and states:<\/b>/\&nbsp;<BR><A NAME="Media"><\/A><b>Media types and states:<\/b><BR>/' \
-e 's/<b>Creating, Growing, Modifying, Blind Growing:<\/b>/\&nbsp;<BR><A NAME="Methods"><\/A><b>Creating, Growing, Modifying, BlindBlind Growing:<\/b><BR>/' \
-e 's/<b>Libburn drives:<\/b>/\&nbsp;<BR><b>Libburn drives:<\/b><A NAME="Drives"><\/A><BR>/' \
-e 's/^-dev /\&nbsp;\&nbsp;-dev /' \
-e 's/^-devices /\&nbsp;\&nbsp;-devices /' \
-e 's/<b>Rock Ridge, POSIX, X\/Open, El Torito, ACL,/\&nbsp;<BR><A NAME="Extras"><\/A><b>Rock Ridge, POSIX, X\/Open, El Torito, ACL,/' \
-e 's/<b>Command processing:<\/b>/\&nbsp;<BR><A NAME="Processing"><\/A><b>Command processing:<\/b>/' \
-e 's/<b>Dialog, Readline, Result pager:<\/b>/\&nbsp;<BR><A NAME="Dialog"><\/A<b>Dialog, Readline, Result pager:<\/b>/' \
-e 's/<b>Execution order of program arguments:<\/b>/\&nbsp;<BR><A NAME="ArgSort"><\/A><b>Execution order of program arguments:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Acquiring source and target drive:<\/b>/\&nbsp;<BR><A NAME="AqDrive"><\/A><b>Acquiring source and target drive:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Rock Ridge, POSIX, X\/Open, El Torito, ACL, xattr: <br> Rock Ridge<\/b>/\&nbsp;<BR><A NAME="Extras"><\/A><b>Rock Ridge, POSIX, X\/Open, El Torito, ACL, xattr:<\/b><BR>\&nbsp;<BR><b>Rock Ridge<\/b>/' \
-e 's/<b>Command processing:<\/b>/\&nbsp;<BR><A NAME="Processing"><\/A><b>Command processing:<\/b><BR>/' \
-e 's/<b>Dialog, Readline, Result pager:<\/b>/<A NAME="Dialog"><\/A><b>Dialog, Readline, Result pager:<\/b><BR>/' \
-e 's/<b><br> Execution order of program arguments:<\/b>/<br>\&nbsp;<BR><A NAME="ArgSort"><\/A><b>Execution order of program arguments:<\/b><BR>/' \
-e 's/<b>Acquiring source and target drive:<\/b>/\&nbsp;<BR><A NAME="AqDrive"><\/A><b>Acquiring source and target drive:<\/b><BR>/' \
-e 's/<b>Influencing the behavior of image/\&nbsp;<BR><A NAME="Loading"><\/A><b>Influencing the behavior of image/' \
-e 's/<b>Inserting files into ISO image:<\/b>/\&nbsp;<BR><A NAME="Insert"><\/A><b>Inserting files into ISO image:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Inserting files into ISO image:<\/b>/\&nbsp;<BR><A NAME="Insert"><\/A><b>Inserting files into ISO image:<\/b><BR>/' \
-e 's/<b>Settings for file insertion:<\/b>/\&nbsp;<BR><A NAME="SetInsert"><\/A><b>Settings for file insertion:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>File manipulations:<\/b>/\&nbsp;<BR><A NAME="Manip"><\/A><b>File manipulations:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Tree traversal command -find:<\/b>/\&nbsp;<BR><A NAME="CmdFind"><\/A><b>Tree traversal command -find:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Tree traversal command -find: <br> \&minus;find<\/b>/\&nbsp;<BR><A NAME="CmdFind"><\/A><b>Tree traversal command -find:<\/b><BR>\&nbsp;<BR><b>-find<\/b>/' \
-e 's/<b>File manipulations:<\/b>/\&nbsp;<BR><A NAME="Manip"><\/A><b>File manipulations:<\/b><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>Filters for data file content:<\/b>/\&nbsp;<BR><A NAME="Filter"><\/A><b>Filters for data file content:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Writing the result, drive control:<\/b>/\&nbsp;<BR><A NAME="Writing"><\/A><b>Writing the result, drive control:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Filters for data file content:<\/b>/\&nbsp;<BR><A NAME="Filter"><\/A><b>Filters for data file content:<\/b><BR>/' \
-e 's/<b>Writing the result, drive control:<\/b>/\&nbsp;<BR><A NAME="Writing"><\/A><b>Writing the result, drive control:<\/b><BR>/' \
-e 's/^-find \/ /\&nbsp;\&nbsp;-find \/ /' \
-e 's/^$<\/b> ln -s/\&nbsp;\&nbsp;$<\/b> ln -s/' \
-e 's/<b>Settings for result writing:<\/b>/\&nbsp;<BR><A NAME="SetWrite"><\/A><b>Settings for result writing:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Settings for result writing:<\/b>/\&nbsp;<BR><A NAME="SetWrite"><\/A><b>Settings for result writing:<\/b><BR>/' \
-e 's/^706k = 706kB/\&nbsp;\&nbsp;706k = 706kB/' \
-e 's/^5540k = 5540kB/\&nbsp;\&nbsp;5540k = 5540kB/' \
-e 's/<b>Bootable ISO images:<\/b>/\&nbsp;<BR><A NAME="Bootable"><\/A><b>Bootable ISO images:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Jigdo Template Extraction:<\/b>/\&nbsp;<BR><A NAME="Jigdo"><\/A><b>Jigdo Template Extraction:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Character sets:<\/b>/\&nbsp;<BR><A NAME="Charset"><\/A><b>Character sets:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Exception processing:<\/b>/\&nbsp;<BR><A NAME="Exception"><\/A><b>Exception processing:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Dialog mode control:<\/b>/\&nbsp;<BR><A NAME="DialogCtl"><\/A><b>Dialog mode control:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Drive and media related inquiry actions:<\/b>/\&nbsp;<BR><A NAME="Inquiry"><\/A><b>Drive and media related inquiry actions:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Navigation in ISO image/\&nbsp;<BR><A NAME="Navigate"><\/A><b>Navigation in ISO image/' \
-e 's/^filesystem:<\/b>/filesystem:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Evaluation of readability and recovery:<\/b>/\&nbsp;<BR><A NAME="Verify"><\/A><b>Evaluation of readability and recovery:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>osirrox ISO-to-disk restore commands:<\/b>/\&nbsp;<BR><A NAME="Restore"><\/A><b>osirrox ISO-to-disk restore commands:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Command compatibility emulations:<\/b>/\&nbsp;<BR><A NAME="Emulation"><\/A><b>Command compatibility emulations:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Bootable ISO images:<\/b>/\&nbsp;<BR><A NAME="Bootable"><\/A><b>Bootable ISO images:<\/b><BR>/' \
-e 's/<b>Jigdo Template Extraction:<\/b>/\&nbsp;<BR><A NAME="Jigdo"><\/A><b>Jigdo Template Extraction:<\/b><BR>/' \
-e 's/<b>Character sets:<\/b>/\&nbsp;<BR><A NAME="Charset"><\/A><b>Character sets:<\/b><BR>/' \
-e 's/<b>Exception processing:<\/b>/\&nbsp;<BR><A NAME="Exception"><\/A><b>Exception processing:<\/b><BR>/' \
-e 's/<b>Dialog mode control: <br> &minus;dialog<\/b>/\&nbsp;<BR><A NAME="DialogCtl"><\/A><b>Dialog mode control:<\/b><BR>\&nbsp;<BR><b>-dialog<\/b>/' \
-e 's/<b>Drive and media related inquiry actions: <br> &minus;devices<\/b>/\&nbsp;<BR><A NAME="Inquiry"><\/A><b>Drive and media related inquiry actions:<\/b><BR>\&nbsp;<BR><b>-devices<\/b>/' \
-e 's/<b>Navigation in ISO image and disk filesystem: <br> &minus;cd/\&nbsp;<BR><A NAME="Navigate"><\/A><b>Navigation in ISO image and disk filesystem:<\/b><BR>\&nbsp;<BR><b>-cd<\/b>/' \
-e 's/<b>Evaluation of readability and recovery:<\/b>/\&nbsp;<BR><A NAME="Verify"><\/A><b>Evaluation of readability and recovery:<\/b><BR>/' \
-e 's/<b>osirrox ISO-to-disk restore commands:<\/b>/\&nbsp;<BR><A NAME="Restore"><\/A><b>osirrox ISO-to-disk restore commands:<\/b><BR>/' \
-e 's/<b>Command compatibility emulations:<\/b>/\&nbsp;<BR><A NAME="Emulation"><\/A><b>Command compatibility emulations:<\/b><BR>/' \
-e 's/^<p><b>&minus;as</<p>\&nbsp;<BR><b>\&minus;as</' \
-e 's/<b>Scripting, dialog and/\&nbsp;<BR><A NAME="Scripting"><\/A><b>Scripting, dialog and/' \
-e 's/^features:<\/b>/features:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Support for frontend/\&nbsp;<BR><A NAME="Frontend"><\/A><b>Support for frontend/' \
-e 's/^listening at stdout:<\/b>/listening at stdout:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Scripting, dialog and program control features:<\/b>/\&nbsp;<BR><A NAME="Scripting"><\/A><b>Scripting, dialog and program control features:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Support for frontend programs via stdin and stdout: <br> &minus;pkt_output<\/b>/\&nbsp;<BR><A NAME="Frontend"><\/A><b>Support for frontend programs via stdin and stdout:<\/b><BR>\&nbsp;<BR><b>-pkt_output<\/b>/' \
-e 's/disk_path_stdin disk_path_stdout <br>/disk_path_stdin disk_path_stdout/' \
-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; /' \
@ -118,8 +116,10 @@ then
else
export BROWSER='cp "%s" '"$raw_html"
# export BROWSER='cp "%s" '"$raw_html"
export BROWSER=$(pwd)/'xorriso/unite_html_b_line "%s" '"$raw_html"
man -H "$manpage"
# cp "$raw_html" /tmp/x.html
"$0" -work_as_filter "$raw_html"
rm "$raw_html"
rm "$man_dir"/man1

35
xorriso/man_xorrisofs_to_html.sh

@ -1,7 +1,7 @@
#!/bin/sh
#
# man_xorrisofs_to_html.sh - ts A80118 , B10309
# man_xorrisofs_to_html.sh - ts A80118 , B10309 , B50730
#
# Generates a HTML version of man page xorrisofs.1
#
@ -42,22 +42,23 @@ then
-e 's/<title>XORRISOFS<\/title>/<title>man 1 xorrisofs<\/title>/' \
-e 's/<h1 align=center>XORRISOFS<\/h1>/<h1 align=center>man 1 xorrisofs<\/h1>/' \
-e 's/<body>/<body BGCOLOR="#F5DEB3" TEXT=#000000 LINK=#0000A0 VLINK=#800000>/' \
-e 's/<b>ISO 9660, Rock Ridge, Joliet, HFS+:<\/b>/\&nbsp;<BR><b>ISO 9660, Rock Ridge, Joliet, HFS+:<\/b>/' \
-e 's/<b>Inserting files into the ISO image:<\/b>/\&nbsp;<BR><b>Inserting files into the ISO image:<\/b>/' \
-e 's/<b>Relation to program xorriso:<\/b>/\&nbsp;<BR><b>Relation to program xorriso:<\/b>/' \
-e 's/<b>ISO 9660, Rock Ridge, Joliet, HFS+: <br> ISO 9660<\/b>/\&nbsp;<BR><b>ISO 9660, Rock Ridge, Joliet, HFS+:<\/b><BR>\&nbsp;<BR><b>ISO 9660<\/b>/' \
-e 's/<b>Inserting files into the ISO image: <br> xorrisofs<\/b>/\&nbsp;<BR><b>Inserting files into the ISO image:<\/b><BR>\&nbsp;<BR><b>xorrisofs<\/b>/' \
-e 's/<b>Relation to program xorriso: <br> xorrisofs<\/b>/\&nbsp;<BR><b>Relation to program xorriso:<\/b><BR>\&nbsp;<BR><b>xorrisofs<\/b>/' \
-e 's/EXAMPLES):<br>/<A HREF="#EXAMPLES">EXAMPLES<\/A>):<br>/' \
-e 's/<b>Image loading:<\/b>/\&nbsp;<BR><b>Image loading:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Settings for file insertion:<\/b>/\&nbsp;<BR><b>Settings for file insertion:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Settings for image production:<\/b>/\&nbsp;<BR><b>Settings for image production:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Settings for standards compliance:<\/b>/\&nbsp;<BR><b>Settings for standards compliance:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Image loading:<\/b>/<b>Image loading:<\/b><BR>/' \
-e 's/<b>Settings for file insertion: <br> \&minus;path-list<\/b>/\&nbsp;<BR><b>Settings for file insertion:<\/b><BR>\&nbsp;<BR><b>-path-list<\/b>/' \
-e 's/<b>Settings for image production: <br> &minus;o<\/b>/\&nbsp;<BR><b>Settings for image production:<\/b><BR>\&nbsp;<BR><b>-o<\/b>/' \
-e 's/<b>Settings for standards compliance: <br> \&minus;iso-level<\/b>/\&nbsp;<BR><b>Settings for standards compliance:<\/b><BR>\&nbsp;<BR><b>-iso-level<\/b>/' \
-e 's/<b>Settings for standards extensions:<\/b>/\&nbsp;<BR><b>Settings for standards extensions:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Settings for file hiding:<\/b>/\&nbsp;<BR><b>Settings for file hiding:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>ISO image ID strings:<\/b>/\&nbsp;<BR><b>ISO image ID strings:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>El Torito Bootable ISO images:<\/b>/\&nbsp;<BR><b>El Torito Bootable ISO images:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>System Area, MBR, other boot blocks:<\/b>/\&nbsp;<BR><b>System Area, MBR, other boot blocks:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Character sets:<\/b>/\&nbsp;<BR><b>Character sets:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Jigdo Template Extraction:<\/b>/\&nbsp;<BR><b>Jigdo Template Extraction:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Miscellaneous options:<\/b>/\&nbsp;<BR><b>Miscellaneous options:<\/b><BR>\&nbsp;<BR>/' \
-e 's/<b>Settings for file hiding: <br> \&minus;hide<\/b>/\&nbsp;<BR><b>Settings for file hiding:<\/b><BR>\&nbsp;<BR><b>-hide<\/b>/' \
-e 's/<b>ISO image ID strings:<\/b>/\&nbsp;<BR><b>ISO image ID strings:<\/b><BR>/' \
-e 's/<b>El Torito Bootable ISO images:<\/b>/\&nbsp;<BR><b>El Torito Bootable ISO images:<\/b><BR>/' \
-e 's/<b>System Area, MBR, GPT, APM, other boot blocks:<\/b>/\&nbsp;<BR><b>System Area, MBR, GPT, APM, other boot blocks:<\/b><BR>/' \
-e 's/<b><br> &minus;G<\/b> disk_path/<BR>\&nbsp;<BR><b>-G<\/b> disk_path/' \
-e 's/<b>Character sets:<\/b>/\&nbsp;<BR><b>Character sets:<\/b><BR>/' \
-e 's/<b>Jigdo Template Extraction:<\/b>/\&nbsp;<BR><b>Jigdo Template Extraction:<\/b><BR>/' \
-e 's/<b>Miscellaneous options: <br> &minus;print-size<\/b>/\&nbsp;<BR><b>Miscellaneous options:<\/b><BR>\&nbsp;<BR><b>-print-size<\/b>/' \
\
-e 's/<\/body>/<BR><HR><FONT SIZE=-1><CENTER>(HTML generated from '"$manpage"'.1 on '"$(date)"' by '$(basename "$0")' )<\/CENTER><\/FONT><\/body>/' \
-e 's/&minus;/-/g' \
@ -71,8 +72,10 @@ then
else
export BROWSER='cp "%s" '"$raw_html"
# export BROWSER='cp "%s" '"$raw_html"
export BROWSER=$(pwd)/'xorriso/unite_html_b_line "%s" '"$raw_html"
man -H "$manpage"
# cp "$raw_html" /tmp/x.html
"$0" -work_as_filter "$raw_html"
rm "$raw_html"
rm "$man_dir"/man1

124
xorriso/unite_html_b_line.c

@ -0,0 +1,124 @@
/*
( cd xorriso ; cc -g -Wall -o unite_html_b_line unite_html_b_line.c )
*/
/*
Specialized converter for the output of man -H,
which unites lines where the line end is between <b> and </b>.
Copyright 2015 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
int unite_lines(char *buffer, int *b_open, int *b_state, int flag)
{
char *cpt;
int last_was_nl= 0;
for(cpt= buffer; *cpt != 0; cpt++) {
if(*b_open) {
if(*b_state == 0 && *cpt == '<') {
*b_state= 1;
} else if(*b_state == 1) {
if(*cpt == '/')
*b_state= 2;
else
*b_state= 0;
} else if(*b_state == 2) {
if(*cpt == 'b' || *cpt == 'B')
*b_state= 3;
else
*b_state= 0;
} else if(*b_state == 3) {
if(*cpt == '>')
*b_open= 0;
*b_state= 0;
}
} else {
if(*b_state == 0 && *cpt == '<') {
*b_state= 1;
} else if(*b_state == 1) {
if(*cpt == 'b' || *cpt == 'B')
*b_state= 2;
else
*b_state= 0;
} else if(*b_state == 2) {
if(*cpt == '>')
*b_open= 1;
*b_state= 0;
}
}
last_was_nl= (*cpt == '\n');
}
if(*b_open && last_was_nl) {
/* replace newline */
*(cpt - 1)= ' ';
}
return(1);
}
int main(int argc, char **argv)
{
FILE *fpin, *fpout;
char buffer[4096], *respt;
int ret, b_open= 0, b_state= 0;
if(argc != 3) {
fprintf(stderr, "usage: %s input_path output_path\n", argv[0]);
return(1);
}
if(strcmp(argv[1], "-") == 0) {
fpin= stdin;
} else {
fpin= fopen(argv[1], "rb");
if(fpin == 0) {
fprintf(stderr, "Error with input file '%s' : %s\n",
argv[1], strerror(errno));
return(2);
}
}
if(strcmp(argv[2], "-") == 0) {
fpout= stdout;
} else {
fpout= fopen(argv[2], "wb");
if(fpout == 0) {
fprintf(stderr, "Error with output file '%s' : %s\n",
argv[2], strerror(errno));
return(3);
}
}
while(1) {
respt= fgets(buffer, sizeof(buffer), fpin);
if(respt == NULL)
break;
ret= unite_lines(buffer, &b_open, &b_state, 0);
if(ret <= 0)
break;
ret= fputs(buffer, fpout);
if(ret < 0) {
fprintf(stderr, "Error writing to output file '%s' : %s\n",
argv[2], strerror(errno));
return(4);
}
}
if(fpin != stdin)
fclose(fpin);
if(fpout != stdout)
fclose(stdout);
return(0);
}

2
xorriso/xorriso_timestamp.h

@ -1 +1 @@
#define Xorriso_timestamP "2015.07.31.162206"
#define Xorriso_timestamP "2015.07.31.165816"

Loading…
Cancel
Save