texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp TODO Texinfo/Convert/Converter.pm Te...


From: Patrice Dumas
Subject: texinfo/tp TODO Texinfo/Convert/Converter.pm Te...
Date: Sat, 22 Oct 2011 13:15:32 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/10/22 13:15:32

Modified files:
        tp             : TODO 
        tp/Texinfo/Convert: Converter.pm HTML.pm 
        tp/t/init      : t2h_singular.init 

Log message:
        Handle PREFIX TOP_FILE, fix SHORTEXTN.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/TODO?cvsroot=texinfo&r1=1.193&r2=1.194
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/Converter.pm?cvsroot=texinfo&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.189&r2=1.190
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/init/t2h_singular.init?cvsroot=texinfo&r1=1.1&r2=1.2

Patches:
Index: TODO
===================================================================
RCS file: /sources/texinfo/texinfo/tp/TODO,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -b -r1.193 -r1.194
--- TODO        18 Oct 2011 23:16:15 -0000      1.193
+++ TODO        22 Oct 2011 13:15:31 -0000      1.194
@@ -154,9 +154,6 @@
 It is unclear whether it is right or wrong. It happens this way because
 the paragraph starts right after the footnote number.
 
-test node non automatic directions, especially in html and for external
-nodes.  Done?
-
 In html, test 
  empty lines at the begining, 
  content ignored before setfilename, 
@@ -177,6 +174,12 @@
 Test @address@hidden and @sc{@'e} in HTML with 8bit and utf_, with and without
 enable encoding and entities.
 
+In singular manual, the first node is the Top node, it has no associated
+sectioning command.  The up_section for this node is set to the first
+sectioning element, the Preface, which is also associated with that node but
+is below, and maybe they are in the same element?  In any case it seems to
+be wrong.
+
 In @copying things like some raw formats may be expanded.  However it is
 not clear that it should be the same than in the main converter.  Maybe a 
 specific list of formats could be passed to Convert::Text::convert, which
@@ -329,6 +332,9 @@
 equivalent_nodes mainly for equivalent_nodes-noderename.cnf parsing and renamed
 nodes handling.
 
+singular_manual
+SHORTEXTN and TOP_FILE, although those options should not necessarily be
+used anymore.
 
 formatting/
 inter_item_commands.texi

Index: Texinfo/Convert/Converter.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/Converter.pm,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- Texinfo/Convert/Converter.pm        8 Oct 2011 09:55:56 -0000       1.55
+++ Texinfo/Convert/Converter.pm        22 Oct 2011 13:15:32 -0000      1.56
@@ -357,6 +357,7 @@
   $input_basename =~ s/^.*\///;
   $self->{'input_basename'} = $input_basename;
   $input_basename = $STDIN_DOCU_NAME if ($input_basename eq '-');
+  $input_basename =~ s/\.te?x(i|info)?$//;
 
   my $setfilename;
   $setfilename = $self->{'extra'}->{'setfilename'}->{'extra'}->{'text_arg'}
@@ -364,6 +365,14 @@
         and $self->{'extra'}->{'setfilename'}->{'extra'}
         and 
defined($self->{'extra'}->{'setfilename'}->{'extra'}->{'text_arg'}));
 
+  # FIXME use TOP_FILE?
+  # FIXME PREFIX is the same as setfilename, maybe override setfilename 
+  # instead?
+  if (defined($self->get_conf('PREFIX'))) {
+    $setfilename = undef;
+    $input_basename = $self->get_conf('PREFIX');
+  }
+
   my $document_name;
   my $set_outfile = $self->get_conf('OUTFILE');
   # determine output file and output file name
@@ -382,7 +391,7 @@
       }
     } elsif ($input_basename ne '') {
       $outfile = $input_basename;
-      $outfile =~ s/\.te?x(i|info)?$//;
+      #$outfile =~ s/\.te?x(i|info)?$//;
       $document_name = $outfile;
       $outfile .= '.'.$self->get_conf('EXTENSION') 
         if (defined($self->get_conf('EXTENSION')) 
@@ -414,7 +423,6 @@
       $document_name =~ s/\.[^\.]*$//;
     }
   }
-  # FIXME use a specific configuration variable (TOP_FILE, PREFIX)?
   $document_name =~ s/^.*\///;
   $self->{'document_name'} = $document_name;
   $output_basename =~ s/^.*\///;

Index: Texinfo/Convert/HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -b -r1.189 -r1.190
--- Texinfo/Convert/HTML.pm     21 Oct 2011 22:59:05 -0000      1.189
+++ Texinfo/Convert/HTML.pm     22 Oct 2011 13:15:32 -0000      1.190
@@ -4229,7 +4229,7 @@
   my $self = shift;
 
   if ($self->get_conf('SHORTEXTN')) {
-    $self->set_conf('EXTENSION', 'html');
+    $self->set_conf('EXTENSION', 'htm');
   }
   $foot_num = 0;
   $foot_lines = '';
@@ -4896,6 +4896,10 @@
     #$section_top = $self->{'extra'}->{'top'} if ($self->{'extra'});
   
     my $top_node_filename;
+    if (defined($self->get_conf('TOP_FILE')) 
+        and $self->get_conf('TOP_FILE') ne '') {
+      $top_node_filename = $self->get_conf('TOP_FILE');
+    } else {
     if (defined($self->get_conf('TOP_NODE_FILE'))) {
       $top_node_filename = $self->get_conf('TOP_NODE_FILE');
     } else {
@@ -4905,18 +4909,22 @@
       $top_node_filename = $self->{'document_name'};
     }
     if (defined($top_node_filename)) {
-      $top_node_filename .= '.'.$self->get_conf('NODE_FILE_EXTENSION') 
-          if (defined($self->get_conf('NODE_FILE_EXTENSION')) 
-              and $self->get_conf('NODE_FILE_EXTENSION') ne '');
+        my $top_node_extension;
+        if ($self->get_conf('NODE_FILENAMES')) {
+          $top_node_extension = $self->get_conf('NODE_FILE_EXTENSION');
+        } else {
+          $top_node_extension = $self->get_conf('EXTENSION');
+        }
+        $top_node_filename .= '.'.$top_node_extension 
+          if (defined($top_node_extension) and $top_node_extension ne '');
+      }
     }
     # first determine the top node file name.
     if ($self->get_conf('NODE_FILENAMES') and $node_top 
         and defined($top_node_filename)) {
       my ($node_top_element) = $self->_get_element($node_top);
-      die "BUG: No page for top node" if (!defined($node_top));
-      #if (defined($self->get_conf('TOP_NODE_FILE'))) {
+      die "BUG: No element for top node" if (!defined($node_top));
       $self->_set_element_file($node_top_element, $top_node_filename);
-      #}
     }
     # FIXME add a number for each page?
     my $file_nr = 0;

Index: t/init/t2h_singular.init
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/init/t2h_singular.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- t/init/t2h_singular.init    21 Oct 2011 22:57:52 -0000      1.1
+++ t/init/t2h_singular.init    22 Oct 2011 13:15:32 -0000      1.2
@@ -132,7 +132,6 @@
     src="${T2H_SING_base_images}singular-icon-transparent.png" width="50"
       border="0" alt="Top"></a>
 EOT
-#  print $fh $result if (defined($fh));
   return $result;
 }
 
@@ -164,10 +163,9 @@
 my %ACTIVE_ICONS;
 my %PASSIVE_ICONS;
 
-if ($T2H_BLUE_BUTTONS)
-{
+if ($T2H_BLUE_BUTTONS) {
   
-%ACTIVE_ICONS =
+  %ACTIVE_ICONS =
   (
    'Top',      'blue_top.png',
    'Contents', 'blue_dir.png',
@@ -184,7 +182,7 @@
    ' ',        ''
   );
 
-%PASSIVE_ICONS =
+  %PASSIVE_ICONS =
   (
    'Top',      'blue_top.png',
    'Contents', 'blue_dir.png',
@@ -199,10 +197,10 @@
    'FastForward', 'blue_nnext.png',
    'About' ,    'blue_help.png',
   );
-}
-else
-{
-%ACTIVE_ICONS =
+
+} else {
+
+  %ACTIVE_ICONS =
   (
    'Top',      'a_top.png',
    'Contents', 'a_tableofcon.png',
@@ -219,7 +217,7 @@
    ' ',        'a_empty.png'
   );
 
-%PASSIVE_ICONS =
+  %PASSIVE_ICONS =
   (
    'Top',      'a_top_na.png',
    'Contents', 'a_tableofcon_na.png',
@@ -267,6 +265,7 @@
 and is best  viewed with a 16 or 18 point screen font.
 <p></p>
 EOT
+  return $result;
 }
 
 set_from_init_file ('PRE_ABOUT', \&T2H_SING_pre_about);



reply via email to

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