texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

texinfo/tp/Texinfo Common.pm Convert/Info.pm Co...


From: Patrice Dumas
Subject: texinfo/tp/Texinfo Common.pm Convert/Info.pm Co...
Date: Sun, 28 Aug 2011 21:22:54 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/08/28 21:22:54

Modified files:
        tp/Texinfo     : Common.pm 
        tp/Texinfo/Convert: Info.pm XML.pm 

Log message:
        @node in XML.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Common.pm?cvsroot=texinfo&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Info.pm?cvsroot=texinfo&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/XML.pm?cvsroot=texinfo&r1=1.2&r2=1.3

Patches:
Index: Common.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Common.pm,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- Common.pm   25 Aug 2011 07:33:32 -0000      1.59
+++ Common.pm   28 Aug 2011 21:22:53 -0000      1.60
@@ -1133,4 +1133,13 @@
   return (undef, undef, undef);
 }
 
+sub normalize_top_node($)
+{
+  my $node = shift;
+  if ($node =~ /^top$/i) {
+    return 'Top';
+  }
+  return $node;
+}
+
 1;

Index: Convert/Info.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Info.pm,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- Convert/Info.pm     20 Aug 2011 23:06:05 -0000      1.59
+++ Convert/Info.pm     28 Aug 2011 21:22:53 -0000      1.60
@@ -460,10 +460,7 @@
 sub _normalize_top_node($)
 {
   my $node = shift;
-  if ($node =~ /^top$/i) {
-    return 'Top';
-  }
-  return $node;
+  return Texinfo::Common::normalize_top_node($node);
 }
 
 my @directions = ('Next', 'Prev', 'Up');

Index: Convert/XML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/XML.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- Convert/XML.pm      27 Aug 2011 22:56:24 -0000      1.2
+++ Convert/XML.pm      28 Aug 2011 21:22:54 -0000      1.3
@@ -256,6 +256,12 @@
   }
 }
 
+sub _normalize_top_node($)
+{
+  my $node = shift;
+  return Texinfo::Common::normalize_top_node($node);
+}
+
 sub output($$)
 {
   my $self = shift;
@@ -309,6 +315,8 @@
   return $result;
 }
 
+my @node_directions = ('Next', 'Prev', 'Up');
+
 sub convert($$;$);
 
 sub convert($$;$)
@@ -375,11 +383,43 @@
                ."</$command>\n"
       } elsif ($type eq 'line') {
         if ($root->{'cmdname'} eq 'node') {
-          # FIXME
-          $result = '';
+          $result .= "<node>\n";
+          $self->{'document_context'}->[-1]->{'code'}++;
+          $result .= "<nodename>".
+             $self->convert({'contents' => $root->{'extra'}->{'node_content'}})
+             ."</nodename>\n";
+          my $direction_index = 0;
+          foreach my $direction(@node_directions) {
+            if ($root->{'node_'.lc($direction)}) {
+              my $node_direction = $root->{'node_'.lc($direction)};
+              my $element = 'node'.lc($direction);
+              my $node_name = '';
+              my $attribute = '';
+              if (! 
defined($node_direction->{'extra'}->{'nodes_manuals'}->[$direction_index])) {
+                $attribute = ' automatic="on"';
+              }
+              if ($node_direction->{'extra'}->{'manual_content'}) {
+                $node_name .= $self->convert({
+                             'contents' => [{'text' => '('},
+                             @{$node_direction->{'extra'}->{'manual_content'}},
+                                          {'text' => ')'}]});
+              }
+              if ($node_direction->{'extra'}->{'node_content'}) {
+                $node_name .= _normalize_top_node($self->convert({
+                  'contents' => 
$node_direction->{'extra'}->{'node_content'}}));
+              }
+              $result .= "<$element${attribute}>$node_name</$element>\n";
+              $direction_index++;
+            }
+          }
+          $result .= "</node>\n";
+          $self->{'document_context'}->[-1]->{'code'}--;
         } elsif ($Texinfo::Common::root_commands{$root->{'cmdname'}}) {
           # FIXME
           $result = '';
+         # FIXME index entry
+        #} elsif {
+          
         } else {
           my $attribute = '';
           if ($root->{'cmdname'} eq 'listoffloats' and $root->{'extra'} 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]