texinfo-commits
[Top][All Lists]
Advanced

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

[5520] * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm,


From: Patrice Dumas
Subject: [5520] * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm,
Date: Tue, 06 May 2014 19:52:27 +0000

Revision: 5520
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5520
Author:   pertusus
Date:     2014-05-06 19:52:27 +0000 (Tue, 06 May 2014)
Log Message:
-----------
        * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm, 
        Pod-Simple-Texinfo/pod2texi.pl: add texinfo_sectioning_style 
        'appendix' and command-line option--appendix-sections.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
    trunk/Pod-Simple-Texinfo/pod2texi.pl

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-05-06 17:57:50 UTC (rev 5519)
+++ trunk/ChangeLog     2014-05-06 19:52:27 UTC (rev 5520)
@@ -2,6 +2,9 @@
 
        * tp/Makefile.am (install-exec-hook): use $(transform) for
        --program-suffix.  Report from Glenn Morris.
+       * Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm, 
+       Pod-Simple-Texinfo/pod2texi.pl: add texinfo_sectioning_style 
+       'appendix' and command-line option--appendix-sections.
 
 2014-05-05  Karl Berry  <address@hidden>
 

Modified: trunk/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm
===================================================================
--- trunk/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm  2014-05-06 17:57:50 UTC 
(rev 5519)
+++ trunk/Pod-Simple-Texinfo/lib/Pod/Simple/Texinfo.pm  2014-05-06 19:52:27 UTC 
(rev 5520)
@@ -55,6 +55,8 @@
 
 my @numbered_sectioning_commands = ('part', 'chapter', 'section', 
'subsection', 
   'subsubsection');
+my @appendix_sectioning_commands = ('part', 'appendix', 'appendixsec',
+  'appendixsubsec', 'appendixsubsubsec');
 my @unnumbered_sectioning_commands = ('part', 'unnumbered', 'unnumberedsec', 
   'unnumberedsubsec', 'unnumberedsubsubsec');
 
@@ -110,8 +112,10 @@
   $base_level = 1 if ($base_level <= 1);
   if ($self->texinfo_sectioning_style eq 'numbered') {
     $self->{'texinfo_sectioning_commands'} = address@hidden;
+  } elsif ($self->texinfo_sectioning_style eq 'unnumbered') {
+    $self->{'texinfo_sectioning_commands'} = address@hidden;
   } else {
-    $self->{'texinfo_sectioning_commands'} = address@hidden;
+    $self->{'texinfo_sectioning_commands'} = address@hidden;
   }
   foreach my $heading_command (keys(%head_commands_level)) {
     my $level = $head_commands_level{$heading_command} + $base_level -1;
@@ -461,6 +465,10 @@
           my $linktype = $token->attr('type');
           my $content_implicit = $token->attr('content-implicit');
           #print STDERR " L: $linktype\n";
+          #my @attrs = keys %{$token->attr_hash};
+          #print STDERR "  @attrs\n";
+          #my $raw_L = $token->attr('raw').'';
+          #print STDERR " $token->attr('raw'): $raw_L\n";
           my ($url_arg, $texinfo_node, $texinfo_manual, $texinfo_section);
           if ($linktype eq 'man') {
             # NOTE: the .'' is here to force the $token->attr to ba a real
@@ -534,9 +542,11 @@
                                      $self->texinfo_sectioning_base_level);
               $texinfo_section = _normalize_texinfo_name(
                  _protect_comma(_protect_text($section)), 'section');
+              #print STDERR "L: internal: $texinfo_node/$texinfo_section\n";
             }
             $texinfo_node = _normalize_texinfo_name(
                     _protect_comma(_protect_text($texinfo_node)), 'anchor');
+            #print STDERR "L: normalized node: $texinfo_node\n";
 
             # for pod, 'to' is the pod manual name.  Then 'section' is the 
             # section.
@@ -588,6 +598,7 @@
       my $tagname = $token->tagname();
       if ($context_tags{$tagname}) {
         my ($result, $out) = _end_context(address@hidden);
+        #print STDERR "end: $tagname: $result, $out\n";
         my $texinfo_node = '';
         if ($line_commands{$tagname}) {
 
@@ -768,8 +779,10 @@
 =item texinfo_sectioning_style
 
 Default is C<numbered>, using the numbered sectioning Texinfo @-commands
-(@chapter, @section...), any other value would lead to using unnumbered
-sectioning command variants (@unnumbered...).
+(@chapter, @section...).  C<unnumbered> any other value would lead to 
+using unnumbered sectioning command variants (@unnumbered...), any other 
+value would lead to using appendix-like sectioning command variants 
+(@appendix...).
 
 =item texinfo_add_upper_sectioning_command
 

Modified: trunk/Pod-Simple-Texinfo/pod2texi.pl
===================================================================
--- trunk/Pod-Simple-Texinfo/pod2texi.pl        2014-05-06 17:57:50 UTC (rev 
5519)
+++ trunk/Pod-Simple-Texinfo/pod2texi.pl        2014-05-06 19:52:27 UTC (rev 
5520)
@@ -120,6 +120,7 @@
 a hand-written top-level file.
 
 Options:
+  --appendix-sections     use appendix-like sections.
   --base-level=NUM|NAME   level of the head1 commands; default 0.
   --debug=NUM             set debugging level.
   --help                  display this help and exit.
@@ -140,6 +141,7 @@
 
 my $base_level = 0;
 my $unnumbered_sections = 0;
+my $appendix_sections = 0;
 my $output = '-';
 my $top = 'top';
 my $preamble = undef;
@@ -167,6 +169,7 @@
      }
    },
   'unnumbered-sections!' => \$unnumbered_sections,
+  'appendix-sections!' => \$appendix_sections,
   'output|o=s' => \$output,
   'preamble=s' => \$preamble,
   'subdir=s' => \$subdir,
@@ -370,6 +373,8 @@
   }
   if ($unnumbered_sections) {
     $new->texinfo_sectioning_style('unnumbered');
+  } elsif ($appendix_sections) {
+    $new->texinfo_sectioning_style('appendix');
   }
   if ($base_level > 0 and @manuals) {
     $new->texinfo_internal_pod_manuals(address@hidden);
@@ -512,6 +517,12 @@
 
 =over
 
+=item B<--appendix-sections>
+
+Use appendix sectioning commands (C<@appendix>, ...) instead of the
+default numbered sectioning Texinfo @-commands (C<@chapter>,
+C<@section>, ...).
+
 =item B<--base-level>=I<NUM|NAME>
 
 Sets the level of the C<head1> commands.  It may be an integer or a




reply via email to

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