From: Norman Walsh Date: Thu, 13 Jun 2002 17:55:36 +0000 (+0000) Subject: Improve presentation of descriptions X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f976566ee9dc8a1692f4fc16895e02f28db85554;p=docbook-dsssl Improve presentation of descriptions --- diff --git a/xmlcharent/spec/gentext.pl b/xmlcharent/spec/gentext.pl index 4d0ea7c84..7da7dc7e2 100644 --- a/xmlcharent/spec/gentext.pl +++ b/xmlcharent/spec/gentext.pl @@ -57,18 +57,19 @@ while ($name = readdir(DIR)) { open (TBL, ">$tbldir/$base.gen"); print TBL "\n"; - print TBL "\n"; + print TBL "\n"; print TBL "\n"; print TBL "\n"; print TBL "\n"; print TBL "\n"; - print TBL "\n"; + print TBL "\n"; + print TBL "\n"; print TBL "\n"; print TBL "\n"; print TBL " Entity Name\n"; print TBL " Unicode Code point\n"; print TBL " Sample Glyph\n"; - print TBL " Description\n"; + print TBL " Description\n"; print TBL "\n"; print TBL "\n"; print TBL "\n"; @@ -85,6 +86,27 @@ while ($name = readdir(DIR)) { $desc = $desc{$name} if exists($desc{$name}); + # let's patch the description + # see SGML Handbook, p502,503 + my %relation = ("A" => "[Relation (arrow)]", + "B" => "[Binary operator]", + "C" => "[Closing delimiter]", + "L" => "[Large operator]", + "N" => "[Relation (negated)]", + "O" => "[Opening delimiter]", + "P" => "[Punctuation]", + "R" => "[Relation]"); + + my $math = undef; + $desc =~ s/\/\S+\s*//sg; # remove references to MathSci chars + if ($desc =~ /([ABCLNOPR]):\s*/) { + $desc = $` . $'; # ' + $math = $relation{$1}; + } + if ($desc =~ /^\s*=/) { + $desc = $'; # ' + } + $glyph = "Blank"; $code = "FFFD"; @@ -122,7 +144,15 @@ while ($name = readdir(DIR)) { print TBL "\n"; print TBL ""; - print TBL "\n $desc\n"; + print TBL "\n "; + + if ($math) { + print TBL "$desc\n "; + print TBL "$math\n"; + } else { + print TBL "$desc\n"; + } + print TBL "\n"; } }