--- loncom/build/doc_template.pl 2002/02/11 08:02:41 1.3 +++ loncom/build/doc_template.pl 2002/05/02 02:09:34 1.7 @@ -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; @@ -19,8 +21,8 @@ my $title=$1; $t=~s/\/$title/g; $d=~/\$(.*?)\$/; my $e=$1; -$e=~s/\S*\s\S*\s+\S*$/ created by Scott Harrison/; -my $cvsdate="<i>CVS: $e</i>"; +$e=~s/\S*\s\S*\s+\S*$/ updated by Scott Harrison/; +my $cvsdate="<p align=\"left\"><font size=\"-2\"><i>CVS $e</i></font></p>"; $t=~s/\<DATE \/\>/$cvsdate/g; $d=~/\<\!\-\- pdfahref (.*?) \-\-\>/; my $pdfahref="<a href='$1'>"; @@ -75,8 +77,25 @@ END } $d=~/\<\!\-\- preamble start \-\-\>(.*?)\<\!\-\- preamble end \-\-\>/s; my $preamble=$1; +$preamble=~s/\<p([^\>]*)\>/<p$1><font face="helvetica">/g; +$preamble=~s/\<\/p([^\>]*)\>/<\/font><\/p$1>/g; +$preamble=~s/\<li([^\>]*)\>/<li$1><font face="helvetica">/g; +$preamble=~s/\<\/li([^\>]*)\>/<\/font><\/li$1>/g; $t=~s/\<PREAMBLE \/\>/$preamble/g; $d=~/\<\!\-\- maintext start \-\-\>(.*?)\<\!\-\- maintext end \-\-\>/s; my $maintext=$1; $t=~s/\<MAINTEXT \/\>/$maintext/g; +my $v=(<<END); +<p align="right"> + <a href="http://validator.w3.org/check/referer"><img + src="/loncapa_doc_icons/valid-xhtml10" + alt="Valid XHTML 1.0!" height="31" width="88" /></a> +</p> +END +if ($d=~/\<\!\-\- validated \-\-\>/) { + $t=~s/\<VALIDATED \/\>/$v/g; +} +else { + $t=~s/\<VALIDATED \/\>//g; +} print $t;