#!/usr/bin/perl # Work on the files that are created by makeinfo for html output # split into many small files. # This will walk though the files listed on the command line, install # Sebastian Rose's key reader and add a small top-level-only table # of contents that will be placed into a special region and visible # in all subfiles. The small contents is a constant and has to be updated # by hand, currently. $contents = <

Table of Contents

EOF $script = <<'EOF'; EOF while ($page = shift) { system "mv $page $page.orig"; open IN,"<$page.orig" or die "Cannot read from $page.orig\n"; undef $/; $all = ; close IN; $all =~ s//$&\n$script/; $all =~ s/^/\n$contents/m; open OUT,">$page" or die "Cannot write to $page\n"; print OUT $all; close OUT; system "rm $page.orig"; }