* about docbook2man (docbook2man-spec.pl)
2002-12-20 19:23 about docbook2man (docbook2man-spec.pl) Philippe Batailler
@ 2002-07-27 8:52 ` Philippe Batailler
2002-12-20 19:23 ` Tim Waugh
1 sibling, 0 replies; 4+ messages in thread
From: Philippe Batailler @ 2002-07-27 8:52 UTC (permalink / raw)
To: docbook-tools-discuss
Hello,
When using package docbook-utils, version 0.6.11, and docbook2man to
create a manpage, the output shows "NAME" for every language.
It should be localized.
Also, the non breakable space, nbsp, is handled like a simple space;
and, for french language, we need a declaration of "thinsp".
What do you think of the kind of patch I attach to this mail ?
Please, cc me.
Regards,
--
philippe batailler
in girum imus nocte et consumimur igni
-----------------------------------------------
--- docbook2man-spec.pl Thu Jul 25 22:55:11 2002
+++ docbook2man-spec.pl.new Thu Jul 25 22:59:57 2002
@@ -344,7 +344,16 @@
# NAME section
-man_sgml('<REFNAMEDIV>', "\n.SH NAME\n");
+# one can add key-value pair in '%words'
+# and the good 'name' will be printed.
+man_sgml('<REFNAMEDIV>', sub {
+ my %words = qw( fr NOM es NOMBRE de NAME );
+ if (defined($_[0]->attribute('LANG')->value)) {
+ my $id = $_[0]->attribute('LANG')->value;
+ my $ad = $words{$id};
+ output("\n.SH $ad\n");}
+ else {output("\n.SH NAME\n");}
+});
sgml('<REFNAME>', \&save_cdata);
sgml('</REFNAME>', sub {
@@ -1154,7 +1163,8 @@
man_sgml('|[lt ]|', '<');
man_sgml('|[gt ]|', '>');
man_sgml('|[amp ]|', '&');
-man_sgml('|[nbsp ]|', ' ');
+man_sgml('|[nbsp ]|', '\~');
+man_sgml('|[thinsp ]|', '\~');
#
# Default handlers (uncomment these if needed). Right now, these are set
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: about docbook2man (docbook2man-spec.pl)
2002-12-20 19:23 ` Tim Waugh
@ 2002-07-28 11:14 ` Tim Waugh
0 siblings, 0 replies; 4+ messages in thread
From: Tim Waugh @ 2002-07-28 11:14 UTC (permalink / raw)
To: Philippe Batailler; +Cc: docbook-tools-discuss
[-- Attachment #1: Type: text/plain, Size: 692 bytes --]
On Sat, Jul 27, 2002 at 05:55:52PM +0200, Philippe Batailler wrote:
> Hello,
> When using package docbook-utils, version 0.6.11, and docbook2man to
> create a manpage, the output shows "NAME" for every language.
> It should be localized.
Good point.
> What do you think of the kind of patch I attach to this mail ?
Good, except for this bit:
> + my $id = $_[0]->attribute('LANG')->value;
We need to use the current value of the 'lang' attribute for this.
For example:
<refentry lang="de">
...
</refentry>
<refentry lang="es">
...
</refentry>
So we need to look for the 'lang' attribute on the ancestor nodes.
I have applied the nbsp and thinsp handlers---thanks.
Tim.
*/
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* about docbook2man (docbook2man-spec.pl)
@ 2002-12-20 19:23 Philippe Batailler
2002-07-27 8:52 ` Philippe Batailler
2002-12-20 19:23 ` Tim Waugh
0 siblings, 2 replies; 4+ messages in thread
From: Philippe Batailler @ 2002-12-20 19:23 UTC (permalink / raw)
To: docbook-tools-discuss
Hello,
When using package docbook-utils, version 0.6.11, and docbook2man to
create a manpage, the output shows "NAME" for every language.
It should be localized.
Also, the non breakable space, nbsp, is handled like a simple space;
and, for french language, we need a declaration of "thinsp".
What do you think of the kind of patch I attach to this mail ?
Please, cc me.
Regards,
--
philippe batailler
in girum imus nocte et consumimur igni
-----------------------------------------------
--- docbook2man-spec.pl Thu Jul 25 22:55:11 2002
+++ docbook2man-spec.pl.new Thu Jul 25 22:59:57 2002
@@ -344,7 +344,16 @@
# NAME section
-man_sgml('<REFNAMEDIV>', "\n.SH NAME\n");
+# one can add key-value pair in '%words'
+# and the good 'name' will be printed.
+man_sgml('<REFNAMEDIV>', sub {
+ my %words = qw( fr NOM es NOMBRE de NAME );
+ if (defined($_[0]->attribute('LANG')->value)) {
+ my $id = $_[0]->attribute('LANG')->value;
+ my $ad = $words{$id};
+ output("\n.SH $ad\n");}
+ else {output("\n.SH NAME\n");}
+});
sgml('<REFNAME>', \&save_cdata);
sgml('</REFNAME>', sub {
@@ -1154,7 +1163,8 @@
man_sgml('|[lt ]|', '<');
man_sgml('|[gt ]|', '>');
man_sgml('|[amp ]|', '&');
-man_sgml('|[nbsp ]|', ' ');
+man_sgml('|[nbsp ]|', '\~');
+man_sgml('|[thinsp ]|', '\~');
#
# Default handlers (uncomment these if needed). Right now, these are set
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: about docbook2man (docbook2man-spec.pl)
2002-12-20 19:23 about docbook2man (docbook2man-spec.pl) Philippe Batailler
2002-07-27 8:52 ` Philippe Batailler
@ 2002-12-20 19:23 ` Tim Waugh
2002-07-28 11:14 ` Tim Waugh
1 sibling, 1 reply; 4+ messages in thread
From: Tim Waugh @ 2002-12-20 19:23 UTC (permalink / raw)
To: Philippe Batailler; +Cc: docbook-tools-discuss
[-- Attachment #1: Type: text/plain, Size: 692 bytes --]
On Sat, Jul 27, 2002 at 05:55:52PM +0200, Philippe Batailler wrote:
> Hello,
> When using package docbook-utils, version 0.6.11, and docbook2man to
> create a manpage, the output shows "NAME" for every language.
> It should be localized.
Good point.
> What do you think of the kind of patch I attach to this mail ?
Good, except for this bit:
> + my $id = $_[0]->attribute('LANG')->value;
We need to use the current value of the 'lang' attribute for this.
For example:
<refentry lang="de">
...
</refentry>
<refentry lang="es">
...
</refentry>
So we need to look for the 'lang' attribute on the ancestor nodes.
I have applied the nbsp and thinsp handlers---thanks.
Tim.
*/
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-07-28 18:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-20 19:23 about docbook2man (docbook2man-spec.pl) Philippe Batailler
2002-07-27 8:52 ` Philippe Batailler
2002-12-20 19:23 ` Tim Waugh
2002-07-28 11:14 ` Tim Waugh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).