*shower* :-)
[lectures/dfb-slides.git] / parse.pl
index e071258..0dbf9a0 100755 (executable)
--- a/parse.pl
+++ b/parse.pl
@@ -5,7 +5,8 @@ chomp @content;
 
 @slide=();
 
-@actions=( "slide top",
+@actions=( "",
+                           "slide top",
                                "slide top right",
                                "slide top left",
                                "slide bottom",
@@ -20,6 +21,17 @@ print "<slides bgcolor=\"#222266\" fgcolor=\"#9999ff\"
         bullet=\"../img/bullet.png\"
         screen_width=\"1024\" screen_height=\"768\">\n";
 
+@topics=();
+
+foreach(@content) {
+       if((/^\d/) or (/^ \d/)) {
+               push(@topics,$_);
+               #print STDERR "$_\n";
+       }
+}
+
+$topic=0;
+
 push(@content," 23");
 
 foreach(@content) {
@@ -40,7 +52,8 @@ foreach(@content) {
                if(@slide) {
                        print "<slide>\n";
                        pop(@slide);
-                       print "<header size=\"20\" fgcolor=\"#22FF22\">$topic</header>\n<text></text>\n";
+                       print STDERR "$topics[$topic]\n";
+                       print "<header size=\"20\" fgcolor=\"#22FF22\">$topics[$topic]</header>\n<text></text>\n";
                        foreach(@slide) {
                                if(/^  \+ /) {
                                        s/\+//;
@@ -55,14 +68,18 @@ foreach(@content) {
                                }
                        }
                        print "</slide>\n\n";
+                       #$topic++;
                }
                @slide=();
-               #push(@slide,$_);
-               $topic=$_;
+               $topic++;
+               $_=$topics[$topic];
+               if(/^\d/) {
+                       $topic++;
+               }
        }
        # ueberpunkt
        elsif (/^\d/) {
-               #$topic=$_;
+               
        }
        # normaler content
        else {