[LON-CAPA-cvs] cvs: modules /gerd/Wiki convert.pl

www www at source.lon-capa.org
Tue Dec 13 17:39:39 EST 2011


www		Tue Dec 13 22:39:39 2011 EDT

  Modified files:              
    /modules/gerd/Wiki	convert.pl 
  Log:
  Generate the directory structure
  
  
Index: modules/gerd/Wiki/convert.pl
diff -u modules/gerd/Wiki/convert.pl:1.3 modules/gerd/Wiki/convert.pl:1.4
--- modules/gerd/Wiki/convert.pl:1.3	Tue Dec 13 22:29:27 2011
+++ modules/gerd/Wiki/convert.pl	Tue Dec 13 22:39:39 2011
@@ -100,13 +100,16 @@
 mkdir('htmlwiki');
 foreach my $idx (keys(%idxres)) {
    my $targetfile=$fileres{$idx}.'.html';
-   print $idxres{$idx}." ---> ".$resdir{$idxres{$idx}}."\n"; 
-   my $targetdir='htmlwiki';
-   if ($targetfile=~/\//) {
-      my ($dir,$res)=split(/\//,$targetfile);
-      $targetdir.='/'.$dir;
-#      mkdir($targetdir);
-   }
+   print $idxres{$idx}." ---> ".$resdir{$idxres{$idx}}."\n";
+   my ($dir1,$dir2)=split(/\//,$resdir{$idxres{$idx}});
+   my $targetdir='htmlwiki'; 
+   unless ($dir1) { $dir1='reference'; }
+   $targetdir.='/'.$dir1;
+   mkdir($targetdir);
+   if ($dir2) { 
+      $targetdir.='/'.$dir2;
+      mkdir($targetdir);
+    }
 #   open(IN,'dump/'.$idx.'.wikitext');
 #   while (my $line=<IN>) {
 #      chomp($line);




More information about the LON-CAPA-cvs mailing list