X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=parse.pl;h=42f453f7f1ba91d6d5a595d75a4ec11dafe70dec;hb=3797656d7cd3de9c370a1b4d830d6cda47c7a88f;hp=a25052fa9a13ce2f4960665fe89fce227078015d;hpb=30b736f4c67d275b2e828da4543e65ee459786c3;p=lectures%2Fdfb-slides.git diff --git a/parse.pl b/parse.pl index a25052f..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,11 +50,29 @@ 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(/ \+ /) { + if(/^ \+ /) { + s/\+//; + print "\n$_\n"; + } + elsif(/ \+ /) { s/\+//; print "\n$_\n"; } @@ -51,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 {