Hi folks,

Output of man pages with lengthy synopses from grohtml do not disable adjustment and hyphenation as for tty, breaking long options between the hyphens and anywhere else available.

Attached is a man page I generated from help2man, then fixed to use current macros and look okay on the tty. I then generated HTML output, and added fixes so the output looked as good as on the tty.
For each option, I had to use:

‑  U+2011   NON-BREAKING HYPHEN
   U+2060   WORD JOINER
⁠
‑ U+2011 NON-BREAKING HYPHEN ‑ as option flag(s), instead of normal \- output, followed by U+2060 WORD JOINER ⁠ to avoid breaks before the option character or in a long option.

If you wanted to avoid breaks within long options with multiple hyphenated words, you would have to use the same character sequence instead of hyphens.

Similarly, to avoid breaks between alternatives within brackets, vertical bars or other punctuation needs to be followed by ⁠ to keep as one word e.g.

*-a*|*--all*
[<b>&#x2011;&#x2060;a</b>|&#x2060;<b>&#x2011;&#x2011;all</b>]

*-c*|*--outputencoding* /outputencoding/
[<b>&#x2011;&#x2060;c</b>|&#x2060;<b>&#x2011;&#x2011;outputencoding&nbsp;</b><i>outputencoding</i>]

--
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                -- Antoine de Saint-Exupéry
.\" xlsx2csv man page
.TH xlsx2csv "1" "2023-Jan-9" "0.8.1"
.SH NAME
.B xlsx2csv
\- convert MS Excel xlsx files to CSV
.SH SYNOPSIS
.SY xlsx2csv
.OP OPTION\fP\&.\|.\|.\&
.I xlsxfile 
.RI [ outfile ]
.SY xlsx2csv
.OP \-a\fR|\fB\-\-all
.OP \-c\fR|\fB\-\-outputencoding \fIoutputencoding\fR
.OP \-d\fR|\fB\-\-delimiter \fIdelimiter\fR
.OP \-\-hyperlinks
.OP \-e\fR|\fB\-\-escape
.OP \-\-no\-line\-breaks
.OP \-E\fR|\fB\-\-exclude_sheet_pattern exclude_sheet_pattern\fP\&.\|.\|.\&\fR
.OP \-f\fR|\fB\-\-dateformat dateformat
.OP \-t\fR|\fB\-\-timeformat timeformat
.OP \-\-floatformat floatformat
.OP \-\-sci\-float
.OP \-I\fR|\fB\-\-include_sheet_pattern include_sheet_pattern\fP\&.\|.\|.\&\fR
.OP \-\-exclude_hidden_sheets
.OP \-\-ignore\-formats ignore_format\fP\&.\|.\|.\&\fR
.OP \-l\fR|\fB\-\-lineterminator lineterminator
.OP \-m\fR|\fB\-\-merge\-cells
.OP \-n\fR|\fB\-\-sheetname sheetname
.OP \-i\fR|\fB\-\-ignoreempty
.OP \-\-skipemptycolumns
.OP \-p\fR|\fB\-\-sheetdelimiter sheetdelimiter
.OP \-q\fR|\fB\-\-quoting quoting
.OP \-s\fR|\fB\-\-sheetid sheetid
.OP \-\-include\-hidden\-rows
.I xlsxfile 
.RI [ outfile ]
.SY xlsx2csv
.BR \-h | \-\-help
.SY xlsx2csv
.BR \-v | \-\-version
.YS
.SS "positional arguments"
.TP
\fIxlsxfile\fP
xlsx file path
.TP
\fIoutfile\fP
output CSV file path
.SH DESCRIPTION
.PP
.B xlsx2csv
reads an MS Excel
.IR xlsxfile ,
containing a zip archive of XML files,
from which python\[aq]s built-in expat SAX parser
collects cell values in a dictionary
for output in CSV, tab, or other delimited format,
optionally in an
.IR outfile .
.SH OPTIONS
.TP
\fB\-a\fR, \fB\-\-all\fR
export all sheets
.TP
\fB\-c\fR, \fB\-\-outputencoding\fR \fIoutputencoding\fR
encoding of output CSV (default: utf\-8) \fIPython 3 only\fP
.TP
\fB\-d\fR, \fB\-\-delimiter\fR \fIdelimiter\fR
column delimiter character in CSV
\- \fIdelimiter\fR escape or character
tab \[aq]\et\[aq], \[aq]x09\[aq], or \[aq]tab\[aq]
(default: comma \[aq],\[aq])
.TP
\fB\-\-hyperlinks\fR
include hyperlinks
.TP
\fB\-e\fR, \fB\-\-escape\fR
escape tab \[aq]\et\[aq], newline \[aq]\en\[aq], return \[aq]\er\[aq] characters
.TP
\fB\-\-no\-line\-breaks\fR
replace tab \[aq]\et\[aq], newline \[aq]\en\[aq], return \[aq]\er\[aq] with 
space
.TP
\fB\-E\fR, \fB\-\-exclude_sheet_pattern\fR 
\fIEXCLUDE_SHEET_PATTERN\fR\&.\|.\|.\&
exclude sheets named matching given pattern:
only effective when \fB\-a\fR, \fB\-\-all\fR option is used
.TP
\fB\-f\fR, \fB\-\-dateformat\fR \fIdateformat\fR
override date/time format (ex. %Y/%m/%d)
.TP
\fB\-t\fR, \fB\-\-timeformat\fR \fItimeformat\fR
override time format (ex. %H/%M/%S)
.TP
\fB\-\-floatformat\fR \fIfloatformat\fR
override float format (ex. %.15f)
.TP
\fB\-\-sci\-float\fR
force scientific notation to float
.TP
\fB\-I\fR, \fB\-\-include_sheet_pattern\fR 
\fIinclude_sheet_pattern\fR\&.\|.\|.\&
only include sheets named matching given pattern:
only effective when \fB\-a\fR, \fB\-\-all\fR option is used
.TP
\fB\-\-exclude_hidden_sheets\fR
exclude hidden sheets from the output:
only effective when \fB\-a\fR, \fB\-\-all\fR option is used
.TP
\fB\-\-ignore\-formats\fR \fIignore_format\fR\&.\|.\|.\&
ignores format for specific data types
.TP
\fB\-l\fR, \fB\-\-lineterminator\fR \fIlineterminator\fR
end of line terminator in CSV \- \fIlineterminator\fR
\[aq]\en\[aq] \[aq]\er\en\[aq] or \[aq]\er\[aq]
(default: \[aq]\en\[aq])
.TP
\fB\-m\fR, \fB\-\-merge\-cells\fR
merge cells
.TP
\fB\-n\fR, \fB\-\-sheetname\fR \fIsheetname\fR
sheet name to convert
.TP
\fB\-i\fR, \fB\-\-ignoreempty\fR
skip empty lines
.TP
\fB\-\-skipemptycolumns\fR
skip trailing empty columns
.TP
\fB\-p\fR, \fB\-\-sheetdelimiter\fR \fIsheetdelimiter\fR
sheet delimiter character or string used to separate sheets 
\- \fIsheetdelimiter\fR no delimiter \[aq]\[aq],
form feed \[aq]\ef\[aq] or \[aq]x12\[aq]
(default: eight dashes \[aq]\-\-\-\-\-\-\-\-\[aq])
.TP
\fB\-q\fR, \fB\-\-quoting\fR \fIquoting\fR
field quoting in CSV \- \fIquoting\fR
\[aq]none\[aq], \[aq]minimal\[aq], \[aq]nonnumeric\[aq], or \[aq]all\[aq]
(default: \[aq]minimal\[aq])
.TP
\fB\-s\fR, \fB\-\-sheet\fR \fIsheetid\fR
sheet number to convert
.TP
\fB\-\-include\-hidden\-rows\fR
include hidden rows
.TP
\fB\-h\fR, \fB\-\-help\fR
show this help message and exit
.TP
\fB\-v\fR, \fB\-\-version\fR
.SH "SEE ALSO"
.BR catdoc (1),
.BR catppt (1),
.BR xls2csv (1)
.SH AUTHOR
Brian Inglis, based on help2man output
.\" © (c) Copyright 2023 Brian · Inglis @ SystematicSW · ab · ca
.\" contributed under MIT license

Reply via email to