[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/tp texi2any.pl Texinfo/Parser.pm Texinf...
From: |
Patrice Dumas |
Subject: |
texinfo/tp texi2any.pl Texinfo/Parser.pm Texinf... |
Date: |
Sun, 03 Apr 2011 17:04:32 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Patrice Dumas <pertusus> 11/04/03 17:04:32
Modified files:
tp : texi2any.pl
tp/Texinfo : Parser.pm Structuring.pm
tp/Texinfo/Convert: HTML.pm
tp/t : 02coverage.t 30sectioning.t
tp/t/results/sectioning: double_top_section.pl
Log message:
Add top as a global unique command.
Fixes for HTML.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/texi2any.pl?cvsroot=texinfo&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Parser.pm?cvsroot=texinfo&r1=1.231&r2=1.232
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Structuring.pm?cvsroot=texinfo&r1=1.44&r2=1.45
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/02coverage.t?cvsroot=texinfo&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/30sectioning.t?cvsroot=texinfo&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/results/sectioning/double_top_section.pl?cvsroot=texinfo&r1=1.4&r2=1.5
Patches:
Index: texi2any.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/texi2any.pl,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- texi2any.pl 22 Mar 2011 00:37:03 -0000 1.27
+++ texi2any.pl 3 Apr 2011 17:04:31 -0000 1.28
@@ -169,6 +169,7 @@
require Texinfo::Parser;
require Texinfo::Structuring;
require Texinfo::Convert::Info;
+require Texinfo::Convert::HTML;
require DebugTexinfo::DebugCount;
# determine configuration directories.
@@ -574,6 +575,11 @@
'floats' => 1,
'converter' => sub{Texinfo::Convert::Plaintext->converter(@_)},
},
+ 'html' => {
+ 'nodes_tree' => 1,
+ 'floats' => 1,
+ 'converter' => sub{Texinfo::Convert::HTML->converter(@_)},
+ },
'debugcount' => {
'nodes_tree' => 1,
'floats' => 1,
Index: Texinfo/Parser.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Parser.pm,v
retrieving revision 1.231
retrieving revision 1.232
diff -u -b -r1.231 -r1.232
--- Texinfo/Parser.pm 27 Mar 2011 17:12:47 -0000 1.231
+++ Texinfo/Parser.pm 3 Apr 2011 17:04:31 -0000 1.232
@@ -418,7 +418,7 @@
'setshortcontentsaftertitlepage',
'documentencoding', 'everyheadingmarks','everyfootingmarks',
'evenheadingmarks', 'oddheadingmarks', 'evenfootingmarks', 'oddfootingmarks',
- 'fonttextsize', 'pagesizes', 'setchapternewpage'
+ 'fonttextsize', 'pagesizes', 'setchapternewpage', 'top'
) {
$global_unique_commands{$global_unique_command} = 1;
}
Index: Texinfo/Structuring.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Structuring.pm,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- Texinfo/Structuring.pm 27 Mar 2011 08:24:55 -0000 1.44
+++ Texinfo/Structuring.pm 3 Apr 2011 17:04:31 -0000 1.45
@@ -198,8 +198,9 @@
and $content->{'cmdname'} ne 'bye') {
if ($content->{'cmdname'} eq 'top') {
if ($section_top) {
- $self->line_error($self->__("address@hidden already exists"),
- $content->{'line_nr'});
+ # already warned as a unique command.
+ # $self->line_error($self->__("address@hidden already exists"),
+ # $content->{'line_nr'});
} else {
$section_top = $content;
}
Index: Texinfo/Convert/HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- Texinfo/Convert/HTML.pm 3 Apr 2011 11:09:09 -0000 1.5
+++ Texinfo/Convert/HTML.pm 3 Apr 2011 17:04:31 -0000 1.6
@@ -139,13 +139,13 @@
sub top_format($)
{
my $self = shift;
- return $self->{'context'}->[-1]->{'formats'};
+ return $self->{'formats'}->[-1];
}
sub align($)
{
my $self = shift;
- return $self->{'context'}->[-1]->{'align'};
+ return $self->{'context'}->[-1]->{'align'}->[-1];
}
@@ -176,6 +176,7 @@
'OPEN_QUOTE_SYMBOL' => '‘',
'CLOSE_QUOTE_SYMBOL' => '’',
'USE_ISO' => 1,
+ 'allowcodebreaks' => 'true',
'DEBUG' => 0,
@@ -605,9 +606,9 @@
my $in_format = $self->top_format();
# FIXME also verify that in @item/@tab/@headitem
return $content
- if ($in_format eq 'itemize'
+ if ($in_format and ($in_format eq 'itemize'
or $in_format eq 'enumerate'
- or $in_format eq 'multitable');
+ or $in_format eq 'multitable'));
}
my $align = $self->align();
if ($paragraph_style{$align}) {
@@ -748,9 +749,9 @@
}
}
- $self->{'context'} = [{'cmdname' => '_toplevel_context'}];
+ $self->{'context'} = [{'cmdname' => '_toplevel_context',
+ 'align' => ['raggedright']}];
$self->{'formats'} = [];
- $self->{'align'} = ['raggedright'];
return $self;
}
@@ -799,8 +800,11 @@
foreach my $element (@$elements) {
foreach my $root_command(@{$element->{'contents'}}) {
+ # FIXME this happens before the first element, for type 'text_root'.
+ # What should be done in that case?
+ next if (!defined($root_command->{'cmdname'}));
if ($root_command->{'cmdname'} eq 'node') {
- my $target =
_normalized_to_id($root_command->{'extra'}->{'normalzed'});
+ my $target =
_normalized_to_id($root_command->{'extra'}->{'normalized'});
my $id = $target;
#Â FIXME something spcial for Top node ?
if (defined($Texinfo::Config::node_target_name)) {
@@ -841,6 +845,20 @@
}
}
+sub _set_page_files($$)
+{
+ my $self = shift;
+ my $pages = shift;
+ return undef if (!defined($pages) or address@hidden);
+
+ my $node_top = $self->{'labels'}->{'Top'};
+
+ #Â first determine the top node file name.
+ if ($self->{'USE_NODES'}) {
+
+ }
+}
+
sub _prepare_elements($$)
{
my $self = shift;
@@ -932,6 +950,7 @@
my $fh;
my $output = '';
if (!$pages) {
+ #Â not split output
if ($self->{'OUTFILE'} ne '') {
$fh = $self->Texinfo::Common::open_out ($self->{'OUTFILE'},
$self->{'perl_encoding'});
@@ -941,7 +960,6 @@
return undef;
}
#$self->{'fh'} = $fh;
-
}
my $header = page_head($self, $self->{'output_filename'}, undef);
$output .= _output_text($header, $fh);
@@ -954,6 +972,7 @@
$output .= _output_text($self->_convert($root), $fh);
}
} else {
+ #Â split output
my %files;
#Â TODO set page file names $page->{'filename'} (relative) and
#Â $page->{'out_filename'} (absolute)
@@ -1283,7 +1302,8 @@
my $result;
my $content_formatted;
if (exists($format_context_commands{$root->{'cmdname'}})) {
- push @{$self->{'context'}}, {'cmdname' => $root->{'cmdname'}};
+ push @{$self->{'context'}}, {'cmdname' => $root->{'cmdname'},
+ 'align' => ['raggedright']};
}
if (exists($block_commands{$root->{'cmdname'}})) {
push @{$self->{'formats'}}, $root->{'cmdname'};
@@ -1301,7 +1321,7 @@
} elsif ($root->{'cmdname'} eq 'w') {
$self->{'context'}->[-1]->{'space_protected'}++;
} elsif ($align_commands{$root->{'cmdname'}}) {
- push @{$self->{'align'}}, $root->{'cmdname'};
+ push @{$self->{'context'}->[-1]->{'align'}}, $root->{'cmdname'};
}
if ($root->{'contents'}) {
$content_formatted = '';
@@ -1358,7 +1378,7 @@
} elsif ($root->{'cmdname'} eq 'w') {
$self->{'context'}->[-1]->{'space_protected'}--;
} elsif ($align_commands{$root->{'cmdname'}}) {
- pop @{$self->{'align'}};
+ pop @{$self->{'context'}->[-1]->{'align'}};
}
if (exists($block_commands{$root->{'cmdname'}})) {
pop @{$self->{'formats'}};
Index: t/02coverage.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/02coverage.t,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- t/02coverage.t 27 Mar 2011 22:55:13 -0000 1.47
+++ t/02coverage.t 3 Apr 2011 17:04:32 -0000 1.48
@@ -667,7 +667,7 @@
foreach my $test (@test_cases) {
push @{$test->[2]->{'test_formats'}}, 'plaintext';
-# push @{$test->[2]->{'test_formats'}}, 'html';
+ #push @{$test->[2]->{'test_formats'}}, 'html';
}
our ($arg_test_case, $arg_generate, $arg_debug);
Index: t/30sectioning.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/30sectioning.t,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- t/30sectioning.t 19 Mar 2011 10:09:34 -0000 1.33
+++ t/30sectioning.t 3 Apr 2011 17:04:32 -0000 1.34
@@ -1236,6 +1236,7 @@
foreach my $test (@tests_converted) {
push @{$test->[2]->{'test_formats'}}, 'plaintext';
+ #push @{$test->[2]->{'test_formats'}}, 'html';
}
foreach my $test (@tests_info) {
push @{$test->[2]->{'test_formats'}}, 'info';
Index: t/results/sectioning/double_top_section.pl
===================================================================
RCS file:
/sources/texinfo/texinfo/tp/t/results/sectioning/double_top_section.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- t/results/sectioning/double_top_section.pl 6 Mar 2011 14:44:08 -0000
1.4
+++ t/results/sectioning/double_top_section.pl 3 Apr 2011 17:04:32 -0000
1.5
@@ -200,13 +200,13 @@
$result_errors{'double_top_section'} = [
{
- 'error_line' => ':5: @top already exists
+ 'error_line' => ':5: warning: Multiple @top
',
'file_name' => '',
'line_nr' => 5,
'macro' => '',
- 'text' => '@top already exists',
- 'type' => 'error'
+ 'text' => 'Multiple @top',
+ 'type' => 'warning'
}
];
- texinfo/tp texi2any.pl Texinfo/Parser.pm Texinf...,
Patrice Dumas <=