This is the mail archive of the
docbook-tools-discuss@sources.redhat.com
mailing list for the docbook-tools project.
about docbook2man (docbook2man-spec.pl)
- From: Philippe Batailler <pbatailler at teaser dot fr>
- To: docbook-tools-discuss at sources dot redhat dot com
- Date: Sat, 27 Jul 2002 17:55:52 +0200
- Subject: about docbook2man (docbook2man-spec.pl)
- Reply-to: pbatailler at teaser dot fr
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