texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/Pod-Simple-Texinfo pod2texi.pl


From: Karl Berry
Subject: texinfo/Pod-Simple-Texinfo pod2texi.pl
Date: Sat, 21 Apr 2012 16:04:49 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Karl Berry <karl>       12/04/21 16:04:49

Modified files:
        Pod-Simple-Texinfo: pod2texi.pl 

Log message:
        --preamble to override preamble, doc --help, etc.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/Pod-Simple-Texinfo/pod2texi.pl?cvsroot=texinfo&r1=1.16&r2=1.17

Patches:
Index: pod2texi.pl
===================================================================
RCS file: /sources/texinfo/texinfo/Pod-Simple-Texinfo/pod2texi.pl,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- pod2texi.pl 18 Apr 2012 21:13:20 -0000      1.16
+++ pod2texi.pl 21 Apr 2012 16:04:49 -0000      1.17
@@ -1,6 +1,6 @@
 #! /usr/bin/perl -w
 
-# pod2texi: Convert Pod to Texinfo
+# pod2texi -- convert Pod to Texinfo.
 #
 # Copyright 2012 Free Software Foundation, Inc.
 # 
@@ -80,17 +80,19 @@
 {
   return __("Usage: pod2texi [OPTION]... POD-FILE...
 
-Translate Pod to Texinfo.  If the base level is higher than 0, 
-a main manual including all the files is done otherwise all
+Translate Pod to Texinfo.  If --base-level is higher than 0, 
+a main manual including all the files is done; otherwise, all
 manuals are standalone (the default).
 
 Options:
     --base-level=NUM|NAME   level of the head1 commands.
     --debug=NUM             set debugging level
+    --help                  display this help and exit.
     --no-fill-section-gaps  do not fill sectioning gaps.
     --no-section-nodes      use anchors for sections instead of nodes.
     --output=NAME           output to <NAME> for the first or the main manual
                             instead of standard out.
+    --preamble=STR          insert STR as beginning boilerplate.
     --subdir=NAME           put files included in the main manual in <NAME>.
     --top                   top for the main manual.
     --unnumbered-sections   use unumbered sections.
@@ -101,6 +103,7 @@
 my $unnumbered_sections = 0;
 my $output = '-';
 my $top = 'top';
+my $preamble = undef;
 my $subdir;
 my $section_nodes = 1;
 my $fill_sectioning_gaps = 1;
@@ -126,6 +129,7 @@
    },
   'unnumbered-sections!' => \$unnumbered_sections,
   'output|o=s' => \$output,
+  'preamble=s' => \$preamble,
   'subdir=s' => \$subdir,
   'top=s' => \$top,
   'section-nodes!' => \$section_nodes,
@@ -403,22 +407,23 @@
   $outfile_name =~ s/\.te?x(i|info)?$//;
   $outfile_name .= '.info';
 
-  my $preamble = '@setfilename '
-    .Pod::Simple::Texinfo::_protect_text ($outfile_name)."\n\n".
-"address@hidden utf-8
+  if (! defined ($preamble)) {
+    $preamble = '\input texinfo
address@hidden ' . Pod::Simple::Texinfo::_protect_text ($outfile_name) . "
address@hidden utf-8
 
 address@hidden $top
 
address@hidden $top
-
address@hidden
 address@hidden
 
 address@hidden
 address@hidden Top
 address@hidden $top
 address@hidden ifnottex\n\n";
+  }
 
-  print $fh '\input texinfo'."\n" . $preamble;
+  print $fh $preamble;
   if ($section_nodes) {
     my $menu = _do_top_node_menu("address@hidden address@hidden 
top\n".$full_manual);
     print $fh $menu."\n";
@@ -454,9 +459,9 @@
 
 =head1 DESCRIPTION
 
-Translate Pod to Texinfo.  If the base level is higher than 0, 
-a main manual including all the files is done otherwise all
-manuals are standalone (the default).
+Translate Pod to Texinfo.  If the C<--base-level> is higher than 0, a
+main manual including all the files is done otherwise all manuals are
+standalone (the default).
 
 =head1 OPTIONS
 
@@ -480,6 +485,10 @@
 
 Set debugging level to I<NUM>.
 
+=item B<--help>
+
+Display help and exit.
+
 =item B<--output>=I<NAME>
 
 Name for the first manual, or the main manual if there is a main manual.
@@ -487,12 +496,19 @@
 
 =item B<--no-section-nodes>
 
-Add a anchors for each section instead of nodes.
+Use anchors for sections instead of nodes.
 
 =item B<--no-fill-section-gaps>
 
 Do not fill sectioning gaps with empty C<@unnumbered>.
 
+=item B<--preamble>=I<STR>
+
+Insert I<STR> as top boilerplate before includes.  The default is fairly
+minimal, and sets @documentencoding to C<utf-8>.  For example, you can
+set this to the empty string and then write your own top-level
+boilerplate which uses @include to incorporate the generated one.
+
 =item B<--subdir>=I<NAME>
 
 If there is a main manual with include files, each corresponding to



reply via email to

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