[LON-CAPA-cvs] cvs: modules /gerd/Wiki convert.pl
www
www at source.lon-capa.org
Thu Dec 15 12:46:56 EST 2011
www Thu Dec 15 17:46:56 2011 EDT
Modified files:
/modules/gerd/Wiki convert.pl
Log:
Almost done! CSS missing to make things look pretty.
Index: modules/gerd/Wiki/convert.pl
diff -u modules/gerd/Wiki/convert.pl:1.10 modules/gerd/Wiki/convert.pl:1.11
--- modules/gerd/Wiki/convert.pl:1.10 Thu Dec 15 13:46:11 2011
+++ modules/gerd/Wiki/convert.pl Thu Dec 15 17:46:56 2011
@@ -151,7 +151,48 @@
$output.=$line."\n";
}
close(IN);
- print $output;
+ $output=&header($titleres{$idx}).$output.&footer();
+ open(OUT,">".$targetdir.'/'.$targetfile);
+ print OUT $output;
+ close(OUT);
+}
+
+sub header {
+ my ($title)=@_;
+ return(<<ENDHEADER);
+<html>
+<head>
+<title>$title</title>
+<script type="text/javascript">
+function toggleDisplay( id, hidetext, showtext )
+{
+ link = document.getElementById( id + "l" ).childNodes[0];
+
+ with( document.getElementById( id ).style )
+ {
+ if( display == "none" )
+ {
+ display = "inline";
+ link.nodeValue = hidetext;
+ }
+ else
+ {
+ display = "none";
+ link.nodeValue = showtext;
+ }
+ }
+}
+</script>
+</head>
+<body>
+ENDHEADER
+}
+
+sub footer {
+ return(<<ENDFOOTER);
+</body>
+</html>
+ENDFOOTER
}
sub unformat {
More information about the LON-CAPA-cvs
mailing list