[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp TODO Texinfo/Convert/HTML.pm Texinfo...
From: |
Patrice Dumas |
Subject: |
texinfo/tp TODO Texinfo/Convert/HTML.pm Texinfo... |
Date: |
Sun, 23 Sep 2012 19:30:34 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 12/09/23 19:30:34
Modified files:
tp : TODO
tp/Texinfo/Convert: HTML.pm Line.pm Paragraph.pm Unicode.pm
tp/t : html_tests.t
tp/t/results/html_tests: check_htmlxref.pl
Log message:
Add line number in CHECK_HTMLXREF messages when possible (not on node
line).
Remove Unicode::EastAsianWidth:: prefix from
Unicode::EastAsianWidth::InFullwidth, it should not be needed.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.304&r2=1.305
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.260&r2=1.261
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Line.pm?cvsroot=texinfo&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Paragraph.pm?cvsroot=texinfo&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Unicode.pm?cvsroot=texinfo&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/html_tests.t?cvsroot=texinfo&r1=1.22&r2=1.23
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/html_tests/check_htmlxref.pl?cvsroot=texinfo&r1=1.1&r2=1.2
Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.304
retrieving revision 1.305
diff -u -b -r1.304 -r1.305
--- TODO 18 Sep 2012 23:17:21 -0000 1.304
+++ TODO 23 Sep 2012 19:30:33 -0000 1.305
@@ -23,8 +23,6 @@
my $collator = Unicode::Collate::Locale->new('locale' => $locale_name,
'normalization' => 'NFKD')
@sorted = $collator->sort(@not_sorted);
-In HTML.pm with CHECK_HTMLXREF, it would be nice to have the line number.
-
Currently there is no error for something like
@chapter @address@hidden
Index: Texinfo/Convert/HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.260
retrieving revision 1.261
diff -u -b -r1.260 -r1.261
--- Texinfo/Convert/HTML.pm 18 Sep 2012 23:17:21 -0000 1.260
+++ Texinfo/Convert/HTML.pm 23 Sep 2012 19:30:33 -0000 1.261
@@ -362,16 +362,17 @@
return undef;
}
-sub command_href($$$)
+sub command_href($$;$$)
{
my $self = shift;
my $command = shift;
my $filename = shift;
+ my $link_command = shift;
$filename = $self->{'current_filename'} if (!defined($filename));
if ($command->{'manual_content'} or $command->{'top_node_up'}) {
- return $self->_external_node_href($command, $filename);
+ return $self->_external_node_href($command, $filename, $link_command);
}
my $target = $self->command_target($command);
@@ -3048,7 +3049,7 @@
$command = $node if (!$node->{'extra'}->{'associated_section'}
or $node->{'extra'}->{'associated_section'} ne
$command);
- my $href = $self->command_href($command);
+ my $href = $self->command_href($command, undef, $root);
if (!defined($name)) {
if ($self->get_conf('xrefautomaticsectiontitle') eq 'on'
@@ -3126,7 +3127,7 @@
'contents' =>
address@hidden>{'manual_content'}}]};
$file = $self->convert_tree($file_with_node_tree, 'node file in ref');
}
- my $href = $self->command_href($node_entry);
+ my $href = $self->command_href($node_entry, undef, $root);
if ($book eq '') {
if (!defined($name)) {
@@ -3756,7 +3757,7 @@
# external node
my $external_node;
if ($node_entry->{'manual_content'}) {
- $href = $self->command_href($node_entry);
+ $href = $self->command_href($node_entry, undef, $command);
$external_node = 1;
} else {
$node = $self->label_command($node_entry->{'normalized'});
@@ -3766,9 +3767,9 @@
and !$self->get_conf('NODE_NAME_IN_MENU')
and !($self->command_element_command($node) eq $node)) {
$section = $node->{'extra'}->{'associated_section'};
- $href = $self->command_href($section);
+ $href = $self->command_href($section, undef, $command);
} else {
- $href = $self->command_href($node);
+ $href = $self->command_href($node, undef, $command);
}
}
@@ -5755,11 +5756,12 @@
my %htmlxref_entries = %Texinfo::Common::htmlxref_entries;
-sub _external_node_href($$;$)
+sub _external_node_href($$$$)
{
my $self = shift;
my $external_node = shift;
my $filename = shift;
+ my $link_command = shift;
if ($external_node->{'top_node_up'}
and defined($self->get_conf('TOP_NODE_UP_URL'))) {
@@ -5807,13 +5809,16 @@
} else { # nothing specified for that manual, use default
$target_split = $default_target_split;
if ($self->get_conf('CHECK_HTMLXREF')
- and !$external_node->{'top_node_up'}
- and !$self->{'check_htmlxref_already_warned'}->{$manual_name}) {
- #$self->line_warn(sprintf($self->__(
+ and !$external_node->{'top_node_up'}) {
+ if (defined($link_command) and $link_command->{'line_nr'}) {
+ $self->line_warn(sprintf($self->__(
+ "No htmlxref.cnf entry found for `%s'"), $manual_name),
+ $link_command->{'line_nr'});
+ } elsif (!$self->{'check_htmlxref_already_warned'}->{$manual_name}) {
$self->document_warn(sprintf($self->__(
"No htmlxref.cnf entry found for `%s'"), $manual_name),
);
- #$external_node->{'line_nr'});
+ }
$self->{'check_htmlxref_already_warned'}->{$manual_name} = 1;
}
}
Index: Texinfo/Convert/Line.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Line.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- Texinfo/Convert/Line.pm 5 Nov 2011 16:36:49 -0000 1.25
+++ Texinfo/Convert/Line.pm 23 Sep 2012 19:30:34 -0000 1.26
@@ -306,9 +306,9 @@
}
}
}
- } elsif ($text =~ s/^([^\s\p{Unicode::EastAsianWidth::InFullwidth}]+)//) {
+ } elsif ($text =~ s/^([^\s\p{InFullwidth}]+)//) {
my $added_word = $1;
- $underlying_text =~
s/^([^\s\p{Unicode::EastAsianWidth::InFullwidth}]+)//;
+ $underlying_text =~ s/^([^\s\p{InFullwidth}]+)//;
my $underlying_added_word = $1;
$result .= $line->_add_next($added_word, $underlying_added_word);
@@ -332,9 +332,9 @@
} elsif ($text =~ s/^\n//) {
$underlying_text =~ s/^\n//;
$result .= $line->_end_line();
- } elsif ($text =~ s/^(\p{Unicode::EastAsianWidth::InFullwidth})//) {
+ } elsif ($text =~ s/^(\p{InFullwidth})//) {
my $added = $1;
- $underlying_text =~ s/^(\p{Unicode::EastAsianWidth::InFullwidth})//;
+ $underlying_text =~ s/^(\p{InFullwidth})//;
my $underlying_added = $1;
print STDERR "EAST_ASIAN.L\n" if ($line->{'DEBUG'});
if (!defined($line->{'word'})) {
Index: Texinfo/Convert/Paragraph.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Paragraph.pm,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- Texinfo/Convert/Paragraph.pm 28 Jul 2012 22:39:41 -0000 1.29
+++ Texinfo/Convert/Paragraph.pm 23 Sep 2012 19:30:34 -0000 1.30
@@ -383,9 +383,9 @@
if ($spaces =~ /\n/ and $paragraph->{'keep_end_lines'}) {
$result .= $paragraph->_end_line();
}
- } elsif ($text =~ s/^(\p{Unicode::EastAsianWidth::InFullwidth})//) {
+ } elsif ($text =~ s/^(\p{InFullwidth})//) {
my $added = $1;
- $underlying_text =~ s/^(\p{Unicode::EastAsianWidth::InFullwidth})//;
+ $underlying_text =~ s/^(\p{InFullwidth})//;
my $underlying_added = $1;
print STDERR "EAST_ASIAN\n" if ($paragraph->{'DEBUG'});
@@ -404,9 +404,9 @@
$result .= $paragraph->_add_pending_word();
delete $paragraph->{'end_sentence'};
$paragraph->{'space'} = '';
- } elsif ($text =~ s/^([^\s\p{Unicode::EastAsianWidth::InFullwidth}]+)//) {
+ } elsif ($text =~ s/^([^\s\p{InFullwidth}]+)//) {
my $added_word = $1;
- $underlying_text =~
s/^([^\s\p{Unicode::EastAsianWidth::InFullwidth}]+)//;
+ $underlying_text =~ s/^([^\s\p{InFullwidth}]+)//;
my $underlying_added_word = $1;
$result .= $paragraph->_add_next($added_word, $underlying_added_word);
Index: Texinfo/Convert/Unicode.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Unicode.pm,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- Texinfo/Convert/Unicode.pm 13 Aug 2012 19:05:03 -0000 1.31
+++ Texinfo/Convert/Unicode.pm 23 Sep 2012 19:30:34 -0000 1.32
@@ -1457,7 +1457,7 @@
}
my $width = 0;
foreach my $character(split '', $string) {
- if ($character =~ /\p{Unicode::EastAsianWidth::InFullwidth}/) {
+ if ($character =~ /\p{InFullwidth}/) {
$width += 2;
} elsif ($character =~ /\pM/) {
# a mark set at length 0
Index: t/html_tests.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/html_tests.t,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- t/html_tests.t 18 Sep 2012 23:17:21 -0000 1.22
+++ t/html_tests.t 23 Sep 2012 19:30:34 -0000 1.23
@@ -235,7 +235,7 @@
* (other_no_existing_no_manual)::
@end menu
address@hidden first
address@hidden first, (no_existing_no_manual.info)
', {}, {'CHECK_HTMLXREF' => 1}],
);
Index: t/results/html_tests/check_htmlxref.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/results/html_tests/check_htmlxref.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- t/results/html_tests/check_htmlxref.pl 18 Sep 2012 23:17:21 -0000
1.1
+++ t/results/html_tests/check_htmlxref.pl 23 Sep 2012 19:30:34 -0000
1.2
@@ -587,6 +587,20 @@
{
'parent' => {},
'text' => 'first'
+ }
+ ],
+ 'parent' => {},
+ 'type' => 'misc_line_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => ' ',
+ 'type' => 'empty_spaces_before_argument'
+ },
+ {
+ 'parent' => {},
+ 'text' => '(no_existing_no_manual.info)'
},
{
'parent' => {},
@@ -609,6 +623,14 @@
{
'node_content' => [],
'normalized' => 'first'
+ },
+ {
+ 'manual_content' => [
+ {
+ 'parent' => {},
+ 'text' => 'no_existing_no_manual.info'
+ }
+ ]
}
],
'normalized' => 'first',
@@ -723,10 +745,13 @@
$result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'extra'}{'command'}
= $result_trees{'check_htmlxref'}{'contents'}[3];
$result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'parent'}
= $result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[0];
$result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[0]{'contents'}[1]{'parent'}
= $result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[0];
-$result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[0]{'contents'}[2]{'parent'}
= $result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[0];
$result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[0]{'parent'} =
$result_trees{'check_htmlxref'}{'contents'}[3];
+$result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[1]{'contents'}[1]{'parent'}
= $result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[1];
+$result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[1]{'contents'}[2]{'parent'}
= $result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[1];
+$result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[1]{'parent'} =
$result_trees{'check_htmlxref'}{'contents'}[3];
$result_trees{'check_htmlxref'}{'contents'}[3]{'extra'}{'node_content'}[0] =
$result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[0]{'contents'}[1];
$result_trees{'check_htmlxref'}{'contents'}[3]{'extra'}{'nodes_manuals'}[0]{'node_content'}
= $result_trees{'check_htmlxref'}{'contents'}[3]{'extra'}{'node_content'};
+$result_trees{'check_htmlxref'}{'contents'}[3]{'extra'}{'nodes_manuals'}[1]{'manual_content'}[0]{'parent'}
= $result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[1];
$result_trees{'check_htmlxref'}{'contents'}[3]{'extra'}{'spaces_after_command'}
= $result_trees{'check_htmlxref'}{'contents'}[3]{'args'}[0]{'contents'}[0];
$result_trees{'check_htmlxref'}{'contents'}[3]{'parent'} =
$result_trees{'check_htmlxref'};
@@ -742,7 +767,7 @@
* (other_no_existing_no_manual)::
@end menu
address@hidden first
address@hidden first, (no_existing_no_manual.info)
';
@@ -793,7 +818,15 @@
'extra' => {
'normalized' => 'first'
},
- 'node_up' => {}
+ 'node_next' => {
+ 'extra' => {
+ 'manual_content' => [
+ {
+ 'text' => 'no_existing_no_manual.info'
+ }
+ ]
+ }
+ }
},
'menus' => [
{
@@ -831,7 +864,6 @@
}
}
};
-$result_nodes{'check_htmlxref'}{'menu_child'}{'node_up'} =
$result_nodes{'check_htmlxref'};
$result_nodes{'check_htmlxref'}{'menus'}[0]{'extra'}{'end_command'}{'extra'}{'command'}
= $result_nodes{'check_htmlxref'}{'menus'}[0];
$result_nodes{'check_htmlxref'}{'node_prev'} =
$result_nodes{'check_htmlxref'}{'menu_child'};
$result_nodes{'check_htmlxref'}{'node_up'}{'extra'}{'top_node_up'} =
$result_nodes{'check_htmlxref'};
@@ -934,7 +966,7 @@
<a name="first"></a>
<div class="header">
<p>
-Up: <a href="#Top" accesskey="u" rel="up">Top</a> </p>
+Next: <a href="no_existing_no_manual.html#Top" accesskey="n"
rel="next">(no_existing_no_manual.info)</a> </p>
</div>
<h4 class="node-heading">first</h4>
<hr>
@@ -953,16 +985,31 @@
'type' => 'warning'
},
{
- 'error_line' => 'warning: No htmlxref.cnf entry found for
`no_existing_no_manual.info\'
+ 'file_name' => '',
+ 'error_line' => ':5: warning: No htmlxref.cnf entry found for
`no_existing_no_manual.info\'
',
'text' => 'No htmlxref.cnf entry found for `no_existing_no_manual.info\'',
- 'type' => 'warning'
+ 'type' => 'warning',
+ 'macro' => '',
+ 'line_nr' => 5
+ },
+ {
+ 'file_name' => '',
+ 'error_line' => ':6: warning: No htmlxref.cnf entry found for
`no_existing_no_manual.info\'
+',
+ 'text' => 'No htmlxref.cnf entry found for `no_existing_no_manual.info\'',
+ 'type' => 'warning',
+ 'macro' => '',
+ 'line_nr' => 6
},
{
- 'error_line' => 'warning: No htmlxref.cnf entry found for
`other_no_existing_no_manual\'
+ 'file_name' => '',
+ 'error_line' => ':10: warning: No htmlxref.cnf entry found for
`other_no_existing_no_manual\'
',
'text' => 'No htmlxref.cnf entry found for `other_no_existing_no_manual\'',
- 'type' => 'warning'
+ 'type' => 'warning',
+ 'macro' => '',
+ 'line_nr' => 10
}
];
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/tp TODO Texinfo/Convert/HTML.pm Texinfo...,
Patrice Dumas <=