--- loncom/build/doc_template.pl 2002/04/23 15:28:03 1.5 +++ loncom/build/doc_template.pl 2002/05/01 22:15:37 1.6 @@ -9,9 +9,11 @@ unless (scalar(@ARGV)==2) { my $template=shift @ARGV; my $data=shift @ARGV; my @lines; open IN,"<$data" or die("no file $data"); -@lines=; close IN; $d=join('',@lines); +@lines=; close IN; +my $d=join('',@lines); open IN,"<$template" or die("no file $data"); -@lines=; close IN; $t=join('',@lines); +@lines=; close IN; +my $t=join('',@lines); # ------- read in values from data $d=~/\(.*?)\<\/title.*?\>/s; @@ -75,8 +77,25 @@ END } $d=~/\<\!\-\- preamble start \-\-\>(.*?)\<\!\-\- preamble end \-\-\>/s; my $preamble=$1; +$preamble=~s/\]*)\>//g; +$preamble=~s/\<\/p([^\>]*)\>/<\/font><\/p$1>/g; +$preamble=~s/\]*)\>//g; +$preamble=~s/\<\/li([^\>]*)\>/<\/font><\/li$1>/g; $t=~s/\/$preamble/g; $d=~/\<\!\-\- maintext start \-\-\>(.*?)\<\!\-\- maintext end \-\-\>/s; my $maintext=$1; $t=~s/\/$maintext/g; +my $v=(< + Valid XHTML 1.0! +

+END +if ($d=~/\<\!\-\- validated \-\-\>/) { + $t=~s/\/$v/g; +} +else { + $t=~s/\//g; +} print $t;