texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp texi2any.pl Texinfo/Common.pm Texinf...


From: Patrice Dumas
Subject: texinfo/tp texi2any.pl Texinfo/Common.pm Texinf...
Date: Wed, 13 Apr 2011 22:49:17 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/04/13 22:49:17

Modified files:
        tp             : texi2any.pl 
        tp/Texinfo     : Common.pm 
        tp/Texinfo/Convert: HTML.pm 

Log message:
        Do page end.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/texi2any.pl?cvsroot=texinfo&r1=1.31&r2=1.32
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Common.pm?cvsroot=texinfo&r1=1.33&r2=1.34
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.20&r2=1.21

Patches:
Index: texi2any.pl
===================================================================
RCS file: /sources/texinfo/texinfo/tp/texi2any.pl,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- texi2any.pl 13 Apr 2011 20:10:49 -0000      1.31
+++ texi2any.pl 13 Apr 2011 22:49:17 -0000      1.32
@@ -690,6 +690,7 @@
   my $converter_options = { %$converter_default_options, 
                             %$cmdline_options,
                             %$Texinfo::Config::options };
+
   if (defined(get_conf('OUTFILE')) and $file_number == 0) {
     $converter_options->{'OUTFILE'} = get_conf('OUTFILE');
   }

Index: Texinfo/Common.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Common.pm,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- Texinfo/Common.pm   13 Apr 2011 20:14:29 -0000      1.33
+++ Texinfo/Common.pm   13 Apr 2011 22:49:17 -0000      1.34
@@ -128,6 +128,7 @@
   'TEXI2DVI', 'DUMP_TREE', 'MAX_MACRO_CALL_NESTING',
   'PROGRAM_AND_VERSION', 'PROGRAM_HOMEPAGE', 'PROGRAM',
   'AFTER_BODY_OPEN', 'EXTRA_HEAD', 'LINKS_BUTTONS', 'DO_ABOUT',
+  'PRE_BODY_CLOSE',
   'CSS_FILES', 'CSS_REFS');
 
 my %valid_options;

Index: Texinfo/Convert/HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- Texinfo/Convert/HTML.pm     13 Apr 2011 20:42:54 -0000      1.20
+++ Texinfo/Convert/HTML.pm     13 Apr 2011 22:49:17 -0000      1.21
@@ -293,6 +293,7 @@
   
   'DEBUG'                => 0,
   'TEST'                 => 0,
+  'output_format'        => 'html',
 );
 
 sub _defaults($)
@@ -871,6 +872,9 @@
      ['heading_text', \&default_heading_text, $Texinfo::Config::heading_text],
      ['comment', \&default_comment, $Texinfo::Config::comment],
      ['css_lines', \&default_css_lines, $Texinfo::Config::css_lines],
+     ['begin_file', \&default_begin_file, $Texinfo::Config::begin_file],
+     ['end_file', \&default_end_file, $Texinfo::Config::end_file],
+     ['program_string', \&default_program_string, 
$Texinfo::Config::program_string],
   ) {
     if (defined($formatting_references->[2])) {
       $self->{$formatting_references->[0]} = $formatting_references->[2];
@@ -1686,7 +1690,38 @@
   }
 }
 
-sub begin_file($$$)
+sub default_program_string($)
+{
+  my $self = shift;
+  return $self->convert_tree(
+    $self->gdt('This document was generated on @address@hidden using 
@uref{{program_homepage}, @emph{{program}}}.',
+         { 'program_homepage' => $self->get_conf('PROGRAM_HOMEPAGE'),
+           'program' => $self->get_conf('PROGRAM') }));
+}
+
+sub default_end_file($)
+{
+  my $self = shift;
+  my $program_text = '';
+  if ($self->get_conf('PROGRAM_NAME_IN_FOOTER')) {
+    my $program_string = &{$self->{'program_string'}}($self);
+    $program_text = " <font size=\"-1\">
+  $program_string
+ </font>
+ <br>";
+  }
+  my $pre_body_close = $self->get_conf('PRE_BODY_CLOSE');
+  $pre_body_close = '' if (!defined($pre_body_close));
+  return "<p>
+$program_text
+$pre_body_close
+</p>
+</body>
+</html>
+";
+}
+
+sub default_begin_file($$$)
 {
   my $self = shift;
   my $filename = shift;
@@ -1997,7 +2032,7 @@
       #$self->{'fh'} = $fh;
     }
     $self->{'current_filename'} = $self->{'output_filename'};
-    my $header = begin_file($self, $self->{'output_filename'}, undef);
+    my $header = &{$self->{'begin_file'}}($self, $self->{'output_filename'}, 
undef);
     $output .= _output_text($header, $fh);
     if ($elements and @$elements) {
       foreach my $element (@$elements) {
@@ -2007,6 +2042,7 @@
     } else {
       $output .= _output_text($self->_convert($root), $fh);
     }
+    $output .= _output_text(&{$self->{'end_file'}}($self), $fh);
   } else {
     # output with pages
     my %files;
@@ -2025,7 +2061,7 @@
           return undef;
         }
         $self->{'current_filename'} = $page->{'filename'};
-        print $file_fh "".begin_file($self, $page->{'filename'}, $page);
+        print $file_fh "".&{$self->{'begin_file'}}($self, $page->{'filename'}, 
$page);
         $files{$page->{'filename'}}->{'fh'} = $file_fh;
       } else {
         $file_fh = $files{$page->{'filename'}}->{'fh'};
@@ -2037,6 +2073,7 @@
       $self->{'file_counters'}->{$page->{'filename'}}--;
       if ($self->{'file_counters'}->{$page->{'filename'}} == 0) {
         # end file
+        print $file_fh "". &{$self->{'end_file'}}($self);
       }
     }
   }



reply via email to

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