X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=parse.pl;h=42f453f7f1ba91d6d5a595d75a4ec11dafe70dec;hb=3797656d7cd3de9c370a1b4d830d6cda47c7a88f;hp=e071258591e281d282dbf9677ffd9fecee67a63a;hpb=dd74245a5f1d1e5b9449cd5e41f56d5929ddf462;p=lectures%2Fdfb-slides.git diff --git a/parse.pl b/parse.pl index e071258..42f453f 100755 --- 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 "\n"; +@topics=(); + +foreach(@content) { + if((/^\d/) or (/^ \d/)) { + push(@topics,$_); + #print STDERR "$_\n"; + } +} + +$topic=0; + push(@content," 23"); foreach(@content) { @@ -38,9 +50,23 @@ foreach(@content) { # unterpunkt if(/^ \d/) { if(@slide) { - print "\n"; - pop(@slide); - print "
$topic
\n\n"; + $action=$actions[int(rand($#actions))]; + if(length($action)>0) { + if(int(rand(2))==1) { + $action.=", blend"; + } + } + else { + if(int(rand(2))==1) { + $action.="blend"; + } + } + if(length($action)>0) { + $action=" effect=\"$action\""; + } + print "\n"; + print STDERR "$topics[$topic] $action\n"; + print "
$topics[$topic]
\n\n"; foreach(@slide) { if(/^ \+ /) { s/\+//; @@ -55,14 +81,18 @@ foreach(@content) { } } print "
\n\n"; + #$topic++; } @slide=(); - #push(@slide,$_); - $topic=$_; + $topic++; + $_=$topics[$topic]; + if(/^\d/) { + $topic++; + } } # ueberpunkt elsif (/^\d/) { - #$topic=$_; + } # normaler content else {