texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp/Texinfo/Convert HTML.pm


From: Patrice Dumas
Subject: texinfo/tp/Texinfo/Convert HTML.pm
Date: Sun, 26 Jun 2011 23:25:10 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        11/06/26 23:25:10

Modified files:
        tp/Texinfo/Convert: HTML.pm 

Log message:
        Handle @set*contentsaftertitlepage

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/Texinfo/Convert/HTML.pm?cvsroot=texinfo&r1=1.95&r2=1.96

Patches:
Index: HTML.pm
===================================================================
RCS file: /sources/texinfo/texinfo/tp/Texinfo/Convert/HTML.pm,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- HTML.pm     24 Jun 2011 13:10:19 -0000      1.95
+++ HTML.pm     26 Jun 2011 23:25:10 -0000      1.96
@@ -968,7 +968,8 @@
 
 my @informative_global_commands = ('contents', 'shortcontents',
   'summarycontents', 'allowcodebreaks', 'documentlanguage',
-  'footnotestyle');
+  'footnotestyle', 'documentencoding', 
+  'setcontentsaftertitlepage', 'setshortcontentsaftertitlepage');
 # taken from global
 # 'xrefautomaticsectiontitle' (or in Parser?)
 # 'documentencoding'
@@ -987,6 +988,24 @@
   return @informative_global_commands;
 }
 
+my %contents_commands = (
+ 'contents' => 1,
+ 'shortcontents' => 1,
+ 'summarycontents' => 1,
+);
+
+sub _initialize_global_command($$)
+{
+  my $self = shift;
+  my $command = shift;
+  my $root = shift;
+  if (ref($root) ne 'ARRAY') {
+    $self->_informative_command($root);
+  } elsif ($contents_commands{$command}) {
+    $self->_informative_command($root->[0]);
+  }
+}
+
 #my %ignored_misc_commands;
 foreach my $misc_command (keys(%misc_commands)) {
 #  $ignored_misc_commands{$misc_command} = 1 
@@ -2901,18 +2920,12 @@
 }
 $default_commands_conversion{'printindex'} = \&_convert_printindex_command;
 
-sub _convert_informative_command($$$$)
+sub _contents_inline_element($$$)
 {
   my $self = shift;
   my $cmdname = shift;
   my $command = shift;
 
-  $cmdname = 'shortcontents' if ($cmdname eq 'summarycontents');
-
-  $self->_informative_command($command);
-  if ($self->get_conf('INLINE_CONTENTS')) {
-    if ($cmdname eq 'contents' or $cmdname eq 'shortcontents') {
-
       my $content = $self->{'contents'}($self, $cmdname, $command);
       if ($content) {
         my $result = '';
@@ -2927,6 +2940,21 @@
         $result .= $content . "\n";
         return $result;
       }
+  return '';
+}
+
+sub _convert_informative_command($$$$)
+{
+  my $self = shift;
+  my $cmdname = shift;
+  my $command = shift;
+
+  $cmdname = 'shortcontents' if ($cmdname eq 'summarycontents');
+
+  $self->_informative_command($command);
+  if ($self->get_conf('INLINE_CONTENTS')) {
+    if ($cmdname eq 'contents' or $cmdname eq 'shortcontents') {
+      return $self->_contents_inline_element($cmdname, $command);
     }
   }
   return '';
@@ -3507,13 +3535,11 @@
     if (defined($titlepage_text));
   if ($self->{'structuring'} and $self->{'structuring'}->{'sectioning_root'}) {
     if ($self->get_conf('setcontentsaftertitlepage')) {
-      # FIXME put formatted contents
-      # @{$Texi2HTML::THISDOC{'inline_contents'}->{'contents'}}
+      $result .= $self->_contents_inline_element('contents', undef);
       $result .= $self->get_conf('DEFAULT_RULE')."\n";
     }
     if ($self->get_conf('setshortcontentsaftertitlepage')) {
-      # FIXME put formatted shortcontents
-      # @{$Texi2HTML::THISDOC{'inline_contents'}->{'shortcontents'}}
+      $result .= $self->_contents_inline_element('shortcontents', undef);
       $result .= $self->get_conf('DEFAULT_RULE')."\n";
     }
   }
@@ -4443,17 +4469,17 @@
   # FIXME do that here or let it to the user?
   if ($self->{'structuring'} and $self->{'structuring'}->{'sectioning_root'}) {
     if ($self->get_conf('contents')) {
-      if ($self->get_conf('INLINE_CONTENTS')) {
-      } elsif ($self->get_conf('setcontentsaftertitlepage')
-               and $self->get_conf('USE_TITLEPAGE_FOR_TITLE')) {
+      if ($self->get_conf('INLINE_CONTENTS') 
+         or ($self->get_conf('setcontentsaftertitlepage')
+             and $self->get_conf('USE_TITLEPAGE_FOR_TITLE'))) {
       } else {
         $do_special{'Contents'} = 1;
       }
     }
     if ($self->get_conf('shortcontents')) {
-      if ($self->get_conf('INLINE_CONTENTS')) {
-      } elsif ($self->get_conf('setshortcontentsaftertitlepage')
-               and $self->get_conf('USE_TITLEPAGE_FOR_TITLE')) {
+      if ($self->get_conf('INLINE_CONTENTS')
+          or ($self->get_conf('setshortcontentsaftertitlepage')
+             and $self->get_conf('USE_TITLEPAGE_FOR_TITLE'))) {
       } else {
         $do_special{'Overview'} = 1;
       }



reply via email to

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