texinfo-devel
[Top][All Lists]
Advanced

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

perlpod conversion


From: Karl Berry
Subject: perlpod conversion
Date: Sat, 14 Apr 2012 14:10:10 -0700

Hi Patrice,

Back on my request about converting the perl doc.  The script worked
fine after I added some more -I's.  (Appended for the record.)

But here is my next request (sorry): can you easily add a variable to
make the output be suitable as an @included file, instead of turning
each pod into its own .texi?  That is, what I really want in the end is
one big perl.info, not 150 small ones.  (I'll write the top-level
perl.texi with all the @includes by hand.)

I imagine the easy part is having a variable to omit the \input texinfo
.. @settitle and top node boilerplate.  The harder part is making
unique node names.  I see 450 or so collisions now, seems impossible to
determine in advance.  Instead of trying to do that, would it be
feasible to simply add the file basename (perlop, perlfunc, etc.) as a
prefix to all nodes in that file?  (Or have it specifiable as an
option.)  Ugly but functional.  Wdyt?

I expect other pod collections would benefit from this too.  E.g., I'd
want to do the same thing for my TeX Live pods.

Thanks,
Karl


#! /bin/sh

texinfo_dir=$HOME/gnu/src/texinfo
perl_pod_dir=$local/src/perl-5.14.2/pod

cd $perl_pod_dir || exit 1

mkdir -p fixed_texi
for file in *.pod; do
  bfile=`basename $file .pod` 
  
  printf "making $bfile.texi in `pwd` ..."
  perl -I $texinfo_dir/tp \
       -I $texinfo_dir/tp/maintain/lib/Text-Unidecode/lib \
       -I $texinfo_dir/tp/maintain/lib/Unicode-EastAsianWidth/lib \
       -I $texinfo_dir/tp/maintain/lib/libintl-perl/lib \
       -I $texinfo_dir/Pod-Simple-Texinfo/lib \
       $texinfo_dir/Pod-Simple-Texinfo/pod2texi.pl \
    $file > $bfile.texi || exit 1

  echo "fixing"
  perl -I $texinfo_dir/tp \
       $texinfo_dir/tp/texi2any.pl \
       --no-validate \
       --set-init-var PLAINTEXINFO \
       --set-init-var TREE_TRANSFORMATIONS=fill_gaps_in_sectioning \
       $bfile.texi > fixed_texi/$bfile.texi || exit 1
done

(
cd fixed_texi
pwd
for file in *.texi; do 
  echo " --> $file"
  perl -I $texinfo_dir/tp $texinfo_dir/tp/texi2any.pl $file
done
) > cnvert_to_info.out 2>&1



reply via email to

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