I was not the author of the manpage stylesheet, but having read through much
of it, I can tell you that it struggles with whitespace between text and
elements. It is actually the text nodes between the inline elements that
trigger the line breaks, and here is the comment in the code (in
manpages/utility.xsl):
<xsl:when test="self::text()">
<!-- * Check to see if this is a text node. -->
<!-- * -->
<!-- * If so, replace all whitespace at the beginning or end of it -->
<!-- * with a single linebreak. -->
So if the inilne <application> element did not have whitespace before or
after, it would not generate any line breaks.
The added line breaks are not incorrect for nroff output, where a line break
is equivalent to a space. The nroff/troff formatter will reassemble the para
with a space for each line break, reinstating the whitespace from the
original docbook input. Are you seeing any format artifacts that are not
correct?
Bob Stayton
Sagehill Enterprises
b...@sagehill.net
From: Yong Sun
Sent: Tuesday, June 25, 2013 6:43 PM
To: docbook@lists.oasis-open.org
Subject: [docbook] Why manpage stylesheet add line breaks before each
markup?
Hi, guys,
Could anyone help me to understand why manpage stylesheet add line breaks
before each markup?
Take an example from foo.1.example_manpage.xml,
<para><command>&dhpackage;</command> frobnicates the
<application>bar</application> library by tweaking internal symbol tables.
By default it parses all baz segments and rearranges them in reverse order
by time for the
<citerefentry><refentrytitle>xyzzy</refentrytitle><manvolnum>1</manvolnum></citerefentry>
linker to find them. The symdef entry is then compressed using the
<abbrev>WBG</abbrev> (Whiz-Bang-Gizmo) algorithm. All files are processed in
the order specified.</para>
The generated result is
.PP
\fBfoo\fR
frobnicates the
bar
library by tweaking internal symbol tables\&. By default it parses all baz
segments and rearranges them in reverse order by time for the
\fBxyzzy\fR(1)
linker to find them\&. The symdef entry is then compressed using the
WBG
(Whiz\-Bang\-Gizmo) algorithm\&. All files are processed in the order
specified\&.
Is there any param/option to eliminate such unnecessary line breaks?
--
Yong Sun <m...@yongsun.me>
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-h...@lists.oasis-open.org