[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Convert/Plaintext.pm t/...
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Convert/Plaintext.pm t/... |
Date: |
Sun, 27 Feb 2011 17:28:59 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/02/27 17:28:58
Modified files:
tp : TODO
tp/Texinfo/Convert: Plaintext.pm
tp/t : 30sectioning.t
tp/t/results/info_tests: top_node_normalization.pl
tp/t/results/sectioning: at_commands_in_refs.pl
character_and_spaces_in_refs.pl
Added files:
tp/t/results/sectioning: equivalent_nodes.pl
Log message:
Normalize better node names in menu and ref, to get the target
formatting
corresponding to the actual target formatting.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.98&r2=1.99
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Plaintext.pm?cvsroot=texinfo&r1=1.98&r2=1.99
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/30sectioning.t?cvsroot=texinfo&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/info_tests/top_node_normalization.pl?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/at_commands_in_refs.pl?cvsroot=texinfo&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/character_and_spaces_in_refs.pl?cvsroot=texinfo&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/equivalent_nodes.pl?cvsroot=texinfo&rev=1.1
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -b -r1.98 -r1.99
--- TODO 27 Feb 2011 15:07:40 -0000 1.98
+++ TODO 27 Feb 2011 17:28:57 -0000 1.99
@@ -131,7 +131,6 @@
tests in test/macros, not incorporated
glossary.texi
bib-example.texi (big test)
-macro-at.texi (the macro part is already done)
tests of the command:
macros/
@@ -176,7 +175,7 @@
sectioning/test_refs.texi
sectioning/nodename_parentheses.texi
sectioning/double_node_anchor_float.texi
-sectioning/double_top.texi (but not @ref)
+sectioning/double_top.texi
sectioning/nodes_test.texi (done: unknown entry in menu and * (info)::
and errors. Not sure the remaining is
interesting)
Index: Texinfo/Convert/Plaintext.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Plaintext.pm,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -b -r1.98 -r1.99
--- Texinfo/Convert/Plaintext.pm 27 Feb 2011 15:07:40 -0000 1.98
+++ Texinfo/Convert/Plaintext.pm 27 Feb 2011 17:28:58 -0000 1.99
@@ -1457,6 +1457,21 @@
if ($root->{'extra'} and $root->{'extra'}->{'brace_command_contents'}
and scalar(@{$root->{'extra'}->{'brace_command_contents'}})) {
my @args = @{$root->{'extra'}->{'brace_command_contents'}};
+ $args[0] = [{'text' => ''}] if (!defined($args[0]));
+
+ #Â normalize node name, to get a ref with the right formatting
+ #Â FIXME as a consequence, the line numbers appearing in case of errors
+ #Â correspond to the node lines numbers, and not the @ref.
+ my $node_content;
+ if ($root->{'extra'}->{'node_argument'}
+ and $root->{'extra'}->{'node_argument'}->{'normalized'}
+ and $self->{'labels'}
+ and
$self->{'labels'}->{$root->{'extra'}->{'node_argument'}->{'normalized'}}) {
+ $node_content =
$self->{'labels'}->{$root->{'extra'}->{'node_argument'}->{'normalized'}}->{'extra'}->{'node_content'};
+ } else {
+ $node_content = $args[0];
+ }
+
# if it a reference to a float with a label, $arg[1] is
# set to '$type $number' or '$number' if there is no type.
if (! defined($args[1])
@@ -1470,6 +1485,7 @@
if ($float->{'extra'}->{'type'}) {
$type = {'contents' => $float->{'extra'}->{'type'}->{'content'}};
}
+
my $name;
if ($type) {
if (defined($float->{'number'})) {
@@ -1486,7 +1502,6 @@
}
$args[1] = $name->{'contents'};
}
- $args[0] = [{'text' => ''}] if (!defined($args[0]));
if ($command eq 'inforef' and scalar(@args) == 3) {
$args[3] = $args[2];
$args[2] = undef;
@@ -1516,7 +1531,7 @@
#Â FIXME why define the name if there is a file argument?
if ($file and !$name) {
@$name = ({'type' => 'code',
- 'contents' => $args[0]});
+ 'contents' => $node_content});
}
if ($name) {
@@ -1526,10 +1541,11 @@
}
# node name
push @contents, ({'type' => 'code',
- 'contents' => $args[0]});
+ 'contents' => $node_content});
push @contents, {'text' => '.'} if ($command eq 'pxref');
} else {
- push @contents, (@{$args[0]}, {'text' => '::'});
+ push @contents, ({'type' => 'code',
+ 'contents' => address@hidden, {'text' => '::'}]});
}
#unshift @{$self->{'current_contents'}->[-1]}, @contents;
$result = $self->_convert({'contents' => address@hidden);
@@ -2125,10 +2141,24 @@
print STDERR " --> $result" if ($self->{'DEBUG'});
}
} elsif ($root->{'type'} eq 'menu_entry') {
+ my $menu_entry_internal_node;
+ if ($root->{'extra'} and $root->{'extra'}->{'menu_entry_node'}
+ and defined($root->{'extra'}->{'menu_entry_node'}->{'normalized'})
+ and $self->{'labels'}
+ and
$self->{'labels'}->{$root->{'extra'}->{'menu_entry_node'}->{'normalized'}}) {
+ $menu_entry_internal_node =
$self->{'labels'}->{$root->{'extra'}->{'menu_entry_node'}->{'normalized'}};
+ }
foreach my $arg (@{$root->{'args'}}) {
if ($arg->{'type'} eq 'menu_entry_node') {
+ #Â if it is an internal ref, get the real node target name
+ my $node_contents;
+ if ($menu_entry_internal_node) {
+ $node_contents =
$menu_entry_internal_node->{'extra'}->{'node_content'};
+ } else {
+ $node_contents = $arg->{'contents'};
+ }
$result .= $self->_convert({'type' => 'code',
- 'contents' => $arg->{'contents'}});
+ 'contents' => $node_contents});
} else {
$result .= $self->_convert($arg);
}
Index: t/30sectioning.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/30sectioning.t,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- t/30sectioning.t 27 Feb 2011 15:57:19 -0000 1.24
+++ t/30sectioning.t 27 Feb 2011 17:28:58 -0000 1.25
@@ -328,6 +328,17 @@
@anchor{TOP}.
'],
+['equivalent_nodes',
+'@node Top, @emph{node}
+
address@hidden
+* @strong{node}::
address@hidden menu
+
address@hidden @samp{node}
+
address@hidden
+'],
);
my @test_cases = (
Index: t/results/info_tests/top_node_normalization.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/info_tests/top_node_normalization.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- t/results/info_tests/top_node_normalization.pl 27 Feb 2011 15:57:19
-0000 1.3
+++ t/results/info_tests/top_node_normalization.pl 27 Feb 2011 17:28:58
-0000 1.4
@@ -342,11 +342,11 @@
File: , Node: Top, Next: Top, Prev: Top, Up: (dir)
-*Note TOP::. *Note tOP::.
+*Note ToP::. *Note ToP::.
* Menu:
-* tOP::
+* ToP::
Tag Table:
Index: t/results/sectioning/at_commands_in_refs.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/sectioning/at_commands_in_refs.pl,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- t/results/sectioning/at_commands_in_refs.pl 27 Feb 2011 12:06:57 -0000
1.31
+++ t/results/sectioning/at_commands_in_refs.pl 27 Feb 2011 17:28:58 -0000
1.32
@@ -19726,50 +19726,50 @@
*note { }::
*note !
-. . ? @:: *note LaTeX TeX * , (C) ... ...:: *note == error--> Euro !
-==> -::
+. . ? @:: *note LaTeX TeX * , (C) ... ...:: *note == error--> Euro ! ==>
+-::
*note >= <= ->::
*note a o -!- # -| ? (R):: *note => o a b aa:: *note AA ae oe AE OE
/o /O ss /l /L D d TH th:: *note a" e~ i^ a^ a` e\' c, e= e* e\'\' e;::
*note e. e( e_ .e e< j ee[:: *note `` \'\' ` \' ,, ,:: *note << >> << >> <
->:: *note " " -- -:: *note AAA (fff) AAA BBB:: *note CCC (rrr) CCC DDD::
-*note the someone <address@hidden> <address@hidden>:: *note [image
src="f--ile.png" alt="alt" text="[Image description\\"\\"\\\\.]"