]> hackdaworld.org Git - lectures/dfb-slides.git/blob - parse.pl
2e923a5194eb7ec8f34535910e1519dc4c31e24b
[lectures/dfb-slides.git] / parse.pl
1 #!/usr/bin/perl
2
3 @content=<STDIN>;
4 chomp @content;
5
6 @slide=();
7
8 print "<?xml version='1.0'?>\n";
9 print "<slides effect=\"slide top left, blend\"
10         bgcolor=\"#000000\" fgcolor=\"#FFFFFF\" 
11         face=\"../ttf/decker.ttf\" size=\"15\"
12         bgimage=\"../img/bg.png\"
13         bullet=\"../img/bullet.png\"
14         screen_width=\"1024\" screen_height=\"768\">\n";
15
16 push(@content," 23");
17
18 foreach(@content) {
19         s/\#.*//;
20         s/&/&amp;/g;
21         s/</&lt;/;
22         s/>/&gt;/;
23         # unterpunkt
24         if(/^ \d/) {
25                 if(@slide) {
26                         print "<slide>\n";
27                         pop(@slide);
28                         print "<header size=\"20\">$topic</header>\n<text></text>\n";
29                         foreach(@slide) {
30                                 if(/ \+ /) {
31                                         s/\+//;
32                                         print "<listitem size=\"20\">$_</listitem>\n";
33                                 }
34                                 else {
35                                         print "<text>$_</text>\n";
36                                 }
37                         }
38                         print "</slide>\n\n";
39                 }
40                 @slide=();
41                 #push(@slide,$_);
42                 $topic=$_;
43         }
44         # ueberpunkt
45         elsif (/^\d/) {
46                 #$topic=$_;
47         }
48         # normaler content
49         else {
50                 push(@slide,$_);
51         }
52 }
53
54 print "</slides>\n";