2 # Script for formatting documentation from definition lists
3 # (they get out of extract-doc.pl as a side-product).
4 # (c) 2008 Michal Vaner <vorner@ucw.cz>
11 open OUT, ">$out" or die "Could not write output $out ($!)\n";
12 open HEAD, $head or die "Could not open head $head ($!)\n";
13 print OUT foreach( <HEAD> );
17 $dir =~ s/\/[^\/]+$//;
19 while( defined( my $line = <> ) ) {
21 my( $file, $num, $text ) = split /,/, $line, 3;
23 while( shift @{[ $dircp =~ /([^\/]+)/, "//" ]} eq shift @{[ $file =~ /([^\/]+)/, "///" ]} ) {
24 $dircp =~ s/[^\/]+\/?//;
25 $file =~ s/[^\/]+\/?//;
27 $dircp =~ s/[^\/]+/../g;
28 $file = $dircp."/".$file;
30 $file =~ s/\.[^.]+$//;
31 $text =~ s/\(/!!PARENT_OPEN!!/g;
32 print OUT "- <<$file:auto_$num,`$text`>>\n";