Michael Smith [Thu, 26 May 2005 23:29:25 +0000 (23:29 +0000)]
Make language codes RFC compliant (closes #1208931; thanks to
Bernd Groh for reporting).
::PROBLEM:
Stylesheets output two-part language codes in the form "zh_CN".
But underscores in language codes are actually neither RFC
compliant nor compliant with the HTML 4.0 rec. The separator
should be a hyphen. To quote the specs:
Section 8.1.1, "Language Codes"[1], in the HTML 4.0 Rec.
states that:
[RFC1766] defines and explains the language codes that MUST be
used in HTML documents.
Briefly, language codes consist of a primary code and a
possibly empty series of subcodes:
language-code = primary-code ( "-" subcode )*
And in RFC 1766, "Tags for the Identification of
Languages"[2], the EBNF for "language tag" is given as:
::CAUSE:
Stylesheets simply pass through language codes unaltered. So if
users put "zh_CN" in their source, they will get "zh_CN" in
their HTML output.
::FIX:
Added a new boolean config parameter, "l10n.lang.value.rfc.compliant",
set to 1 by default. If it is non-zero, any underscore in a
language code will be converted to a hyphen in HTML output. If
it is zero, the language code will be left as-is.
::AFFECTS:
This change affects any HTML output that contains two-part
language codes.
Bob Stayton [Wed, 25 May 2005 22:35:19 +0000 (22:35 +0000)]
Set start-indent and end-indent for fo:table-body used to format lists to
zero so that they do not inherit any start-indent from their container, which
would indent relative to the cell boundary.
Michael Smith [Tue, 24 May 2005 22:40:41 +0000 (22:40 +0000)]
Make xrefs and olinks work, and prevent instances of “ and
” entities in output (closes #741578 and #956072; thanks to
Jens Granseuer and Sam Steingold for reporting the problems)
::Problem:
If you include an xref in a source document, instead of getting
the xref text you would expect in the output, you just get
"[xref to refsect1]", where "refsect" is the name of the target
element for the xref. If you include an olink, it works as
expected -- except that the output text has “ and ”
entities (double "curly" quotation marks).
::Cause:
The manpages/docbook.xsl driver imports the html/docbook.xsl
stylesheet, which in turn imports the html/xref.xsl file.
The manpages/docbook.xsl file then imports the manpages/xref.xsl
file. That file contains a "xref" template that overrides the
the one in html/xref.xsl and that, by design, does nothing
except to generate the "[xref to refsect1]" text instead of the
expected xref output.
On the other hand, the manpages stylesheets don't override the
"olink" template; therefore, the "olink" template from the
html/xref.xsl file is used "as is". And being that it is
intended for HTML output, that template uses the “ and
” to wrap titles in xref output.
::Fix:
The original manpages/xref.xsl file has now been removed. The
build for the manpages distribution now makes that file, using
the textify.xsl stylesheet to automatically generate it from the
html/xref.xsl file. It is built in such a away that it basically
just contains special copies of the "xref" and "olink" templates
that cause “ and ” instances to be transformed into
"\(lq" and "\(rq" (groff "left quote" and "right quote").
It might seem odd that templates from the html/xref.xsl are
used, since those templates a designed to generate hyperlinks of
the form <a href="#foo">the section called "Bar"</a>. But it
works because the manpages stylesheets end up using the text
value of the output of the above. Thus, the <a href="#foo"> and
</a> parts are stripped out, leaving just the text between
('the section called "Bar"').
::Affects
Only affects output of xref and olink elements. The fix may not
be complete and/or may cause other problems. Please test.
In particular, while it may fix the “ and ” problem
that English lang/locales users have run into, it doesn't fix
the corresponding problem for output of xrefs and olinks in many
non-English locales, which use quoting characters other than
“ and ”
To give just one example of many: in Japanese, the quoting
characters are 「 and 」 ("left corner bracket" and
"right corner bracket"). It is possible to "fix" the problem for
all locales; but it is just a question of whether there is
enough of a demand for it that it is worth doing.
Michael Smith [Tue, 24 May 2005 09:40:55 +0000 (09:40 +0000)]
Prevent "sticky" fonts changes. (closes #956070; thanks to Sam
Steingold for reporting the problem, and for his patience...)
::Problem:
Sometimes a bold or italic font change inadvertently ends up
becoming "sticky" such that a following chunk of text that
should just be rendered as plain text instead gets
boldfaced/italicized.
::Cause:
Font changes were simply being nested, as they are in HTML.
While that works for HTML, it doesn't work for roff, where
font-change instructions aren't actually intended to nest.
::Fix:
Attempted to un-nest bold/italic font changes. When the manpages
stylesheets encounter node sets that need to be boldfaced or
italicized, they now put the \fBfoo\fR \fIbar\fR groff
bold/italic instructions separately around each node in the set.
This may not be a complete fix for the problem. In fact, it may
cause other problems. Please test :^)
Michael Smith [Tue, 24 May 2005 06:55:18 +0000 (06:55 +0000)]
Support generation of choice separator in inline simplelist
(closes #1207532)
This ehancement enables auto-generation of an appropriate
localized "choice separator" (for example, "and" or
"or") before the final item in an inline simplelist.
To indicate that you want a choice separator generated
for a particular list, you need to put a processing
instruction (PI) of the form <?dbchoice choice="foo"?>
as a child a of the list. For example:
<para>This release adds localiation support for the
following Indic languages:
<simplelist type="inline">
<?dbchoice choice="and" ?>
<member>Hindi</member>
<member>Punjabi</member>
<member>Tamil</member>
<member>Oriya</member>
<member>Gujarati</member>
</simplelist>.
</para>
Output (for English):
This release adds localiation support for the
following Indic languages: Hindi, Punjabi, Tamil,
Oriya, and Gujarati.
Or if the logical relationship between the items in the
list is an "or" relationship, then use choice="or":
<para>Choose from ONE and ONLY ONE of the following:
<simplelist type="inline">
<?dbchoice choice="or" ?>
<member>A</member>
<member>B</member>
<member>C</member>.
</simplelist>
</para>
Output (for English):
Choose from ONE and only ONE of the
following choices: A, B, or C.
As a temporary workaround for the fact that most of the
DocBook non-English locale files don't have a
localization for the word "or", you can put in a
literal string to be used; example for French:
<para>Choose from ONE and ONLY ONE of the following:
<simplelist type="inline">
<?dbchoice choice="ou" ?>
<member>A</member>
<member>B</member>
<member>C</member>.
</simplelist>
</para>
Michael Smith [Mon, 23 May 2005 13:59:11 +0000 (13:59 +0000)]
Rolled back some over-aggressive line-break cleanup, and removed
space-normalizing call in group|arg template because it causes
<sbr/> to be handled incorrectly.
Michael Smith [Mon, 23 May 2005 12:05:30 +0000 (12:05 +0000)]
Make handling of date format strings more robust (closes #1206837).
::Problem:
If the "dbtimestamp" PI has words in it that contain any of the
single-letter characters used as date/time formatting
instructions, the output is not what would be expected.
For example, Spanish "long" dates look like this:
23 de mayo de 2005
So you would expect that you could generate a date of that form
using the dbtimestamp PI with a format string like the following:
<?dbtimestamp format="d de B de Y"?>
But if you try that, you get the following output:
23 23e mayo 23e 2005
That is, the "d" in "de" is replaced with the day of the month.
::Cause::
The format-string parsing logic works by walking through the
format string character-by-character. So when it gets to the "d"
in "de", it has no way of discerning that it is not the "d"
formatting instruction but is instead part of a word intended to
be included in the output as a literal string.
::Fix::
The format-string parsing logic now splits format strings into
tokens and delimiters and evaluates them token-by-token instead
of character-by-character.
For example, it splits the Spanish "long" date format like this:
Thus, in looking for the "d" formatting instruction, the "d"
token matches but the "de" token does not.
As delimiters, it recognizes the following characters:
<space> <tab> <CR> <LF> , . / - ( ) [ ]
::Affects:
This change affects output of the "dbtimestamp" PI as well as
output from any customization layers that call the
"datetime.format" template. It affect all formats (HTML, FO, etc.).
Michael Smith [Sun, 22 May 2005 12:25:26 +0000 (12:25 +0000)]
Grand Unification: Epilogue (2): If "neighboring" text nodes in
mixed content are whitespace-only, apply the special sauce just
before serving; that is, at the end, not both at the beginning and
at the end.
Michael Smith [Sun, 22 May 2005 01:38:03 +0000 (01:38 +0000)]
Repaired line-breaking in list output. Thanks to Hendrik Sattler
for reporting the problem.
The cause of this is was a change that was made a while back to
reduce excessive blank lines in output. Looks like in this case it
cut it back a bit too aggressively. There may yet be some other
cases that will need more fine-tuning.
Michael Smith [Sat, 21 May 2005 11:17:23 +0000 (11:17 +0000)]
Whitespace Grand Unification: Epilogue (1): If "neighboring" text
nodes in mixed content are whitespace-only, leave them unseasoned;
that is, don't add the special sauce.
Michael Smith [Fri, 20 May 2005 09:08:59 +0000 (09:08 +0000)]
Verbatim environment "Grand Unification" fix.
Attempte to fix handling of verbatim environments (literallayout,
programlisting, screen) and, in a related way, text nodes.
Particularly in mixed-content blocks. I think I got it working...
Michael Smith [Fri, 13 May 2005 02:38:01 +0000 (02:38 +0000)]
Added/Corrected HTML Help language codes. Note that there are no
HTML Help language codes for Bangla, Gujarati, Punjabi, or Tamil.
So, set the code for those to the code for Hindi, which, it seems,
is the closest we can get.
Michael Smith [Wed, 11 May 2005 14:48:13 +0000 (14:48 +0000)]
Simplified and corrected rendering of simplelist. (closes #1154750
and #699081; thanks to Matthias Andree and Bert Vermeulen for
reporting the problem)
- Any simplelist type="inline" instance is now rendered as a
comma-separated list, with a comma and also a localized "and"
before the last item.
- Any simplelist instance whose type is not inline is rendered
as a one-column vertical list (ignoring the values of the type
and columns attributes if present)
Michael Smith [Tue, 10 May 2005 19:50:04 +0000 (19:50 +0000)]
Support localization of gentext for various things (issue
#1199352, #1199153, #1199033, and #1167995; thanks to Hendrik
Sattler for reporting the issue).
Gentext is now localized for the following
- Heading generated for refsynopsis section
- Heading generated for refname section
- Heading generated for author attribution
- Headings generated for admontions
There are some other bits of gentext that still need to be
localized.
Michael Smith [Tue, 10 May 2005 15:49:32 +0000 (15:49 +0000)]
Added template to uppercase strings (closes #1199123)
Given a string, this template does a language-aware conversion of
that string to all uppercase letters, based on the values of the
lowercase.alpha and uppercase.alpha gentext keys for the current
locale. It affects only those characters found in the values of
lowercase.alpha and uppercase.alpha. All other characters are left
unchanged.
Michael Smith [Tue, 10 May 2005 12:02:04 +0000 (12:02 +0000)]
Partially support having multiple parameters in one paramdef.
DocBook says it is valid, but it's not clear why anybody would
ever want to do it. Prior to this fix, each parameter would get
rendered twice. There is still a problem with whitespace between
parameters getting dropped, but it's not worth fixing unless
somebody can actually show a use case for having multiple
parameters in one paramdef.
Michael Smith [Tue, 10 May 2005 11:45:24 +0000 (11:45 +0000)]
make funcsynopsis.decoration=1 have effect for nontabular K&R
output (closes bug # 1198960)
::PROBLEM
If you set the funcsynopsis.decoration param to 1 and generate
notablular K&R output for a functionsynopsis, the parameters in
the function argument synopsis are not styled (italicized) as
they are for K&R tabular output.
::FIX
Changed K&R nontabular logic to base styling for function
argument synopsis on value of funcsynopsis.decoration.
Michael Smith [Tue, 10 May 2005 04:54:22 +0000 (04:54 +0000)]
Strip whitespace in Manvolnum; closes bug #959805
(thanks to Jens Elkner for reporting the problem)
::PROBLEM:
Whitespace is preserved in output for Manvolnum. Among other
things, this results in garbled filenames for man pages
generated from the manpages stylesheets.
::CAUSE
Manvolnum was not included in the master list of "strip space"
elements.
::FIX
Added Manvolnum to master list of "strip space" elements.
Michael Smith [Mon, 9 May 2005 08:41:52 +0000 (08:41 +0000)]
::Problem:
PAGE UP, PAGE DOWN, and HOME keyboard shortcuts not longer work
as expected
::Cause:
Shortcuts were replaced with letter-key shortcuts (N, P, H).
::Fix:
Restored PAGE UP, PAGE DOWN, and HOME shortcuts by appending
those keys to the list of valid shortcuts. Now, both those and
the letter-key shortcuts are available. Also, added RIGHT ARROW,
LEFT ARROW, and UP ARROW shortcuts. The complete list of
shortcuts is now:
* forward = n, N, SPACE, ENTER, RETURN, PAGE UP, RIGHT ARROW
* backward = p, P, BACKSPACE, PAGE DOWN, LEFT ARROW
* up = u, U, UP ARROW
* home = h, H, HOME
* toc = t, T
(Closes bug #1196429; thanks to Roland Huss for reporting the
problem)
Michael Smith [Mon, 9 May 2005 05:39:14 +0000 (05:39 +0000)]
Problem:
Invalid HTML generated for manually created Indexes that lack
Indexdivs.
Cause:
The indexentry template assumes a dl wrapper has been generated,
but the dl wrapper gets generated only if an Indexdiv exists.
Fix:
For Indexes that lack Indexdiv, generate a dl wrapper before
processing Indexentries (closes bug ##1196670; thanks to Petr
Pajas for reporting the problem).
Affects:
HTML output for manually created Indexes; has no effect on
processing of automatically generated Indexes.