Admin/page/bin/mkcontents
author wenzelm
Thu, 15 Nov 2001 18:20:13 +0100
changeset 12207 4dff931b852f
parent 9699 14dc0f812901
child 12732 c93b2f69b3ba
permissions -rwxr-xr-x
added Induct/Binary_Trees.thy, Induct/Tree_Forest (converted from former ex/TF.ML ex/TF.thy ex/Term.ML ex/Term.thy);

#!/usr/bin/perl

# mkcontents.pl
#
#   $Id$
#
#   simple script to create a html version of the Contents file in the
#   Isabelle documentation directory.
#
#   Nov/14/1999 Version 1.0  -  Gerwin Klein <kleing@in.tum.de>
#
#   command line:
#   mkcontent [-p <url-path-prefix>] <Content-file> <output-file>
#


use Getopt::Long ;
   
$opt_p="";
$result = GetOptions ("p=s");

$path=$opt_p;

$infile  = $ARGV[0];
$outfile = $ARGV[1];

$fileHeader = "<ul>\n";
$lineHeader = "  <li> ";
$lineEnd    = "  </li>\n";
$fileFooter = "</ul>\n";

open(IN, "<$infile") || die "cannot read input file <$infile>";
open(OUT, ">$outfile") || die "cannot write output file <$outfile>";

print OUT $fileHeader;

while (<IN>) {
  if (/[ \t]*([^ \t]+)[ \t]+(.+)\n/) {
    print OUT $lineHeader;
    print OUT "<a href=\"$path$1.pdf\">$2</a>";
    print OUT $lineEnd;
  }
}

print OUT $fileFooter;

close(OUT);
close(IN);

exit(0);