Mercurial > hg > Applications > o2s5
comparison o2s5.source @ 2:85a60c32503c default tip
theme fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 24 Sep 2011 04:00:11 +0900 |
parents | 450bcedf4ed4 |
children |
comparison
equal
deleted
inserted
replaced
1:450bcedf4ed4 | 2:85a60c32503c |
---|---|
1 #!/usr/bin/perl | 1 #!/usr/bin/perl |
2 | 2 |
3 | 3 |
4 | 4 |
5 $depth = 0; | 5 my $depth = 0; |
6 $section = 1; | 6 my $section = 1; |
7 $note = 1; | 7 my $note = 1; |
8 $abstract = 0; | 8 my $abstract = 0; |
9 $current = fh000; | 9 my $current = fh000; |
10 $tag = "content000"; | 10 my $tag = "content000"; |
11 | 11 |
12 $back = "white"; | 12 my $back = "white"; |
13 $fore = "black"; | 13 my $fore = "black"; |
14 | 14 |
15 $subtitle = ''; | 15 my $subtitle = ''; |
16 $affilation = ''; | 16 my $affilation = ''; |
17 $closing = "</li>"; | 17 my $closing = "</div>"; |
18 $opening = '<li class="slide">'; | 18 my $opening = '<div class="slide">'; |
19 $xoxo = ''; | 19 my $xoxo = ''; |
20 | 20 |
21 $tfont = 1; | 21 my $tfont = 1; |
22 | 22 |
23 $ul = 0; | 23 my $ul = 0; |
24 $theme = "default"; | 24 my $theme = "default"; |
25 my $in_title = ""; | |
25 | 26 |
26 @opt = grep(! /\.ind/,@ARGV); | 27 @opt = grep(! /\.ind/,@ARGV); |
27 @ARGV = grep( /\.ind/,@ARGV); | 28 @ARGV = grep( /\.ind/,@ARGV); |
28 | 29 |
29 sub title_init { | 30 sub title_init { |
30 | 31 |
31 if (grep(/-p/,@opt)) { | 32 if (grep(/-p/,@opt)) { |
32 $theme = "pixel"; | 33 $theme = "pixel"; |
33 } elsif (grep(/-f/,@opt)) { | 34 } elsif (grep(/-f/,@opt)) { |
34 $theme = "flower"; | 35 $theme = "flower"; |
36 } elsif (grep(/-n/,@opt)) { | |
37 $theme = "nautilus"; | |
38 } elsif (grep(/-i/,@opt)) { | |
39 $theme = "i18n"; | |
40 } elsif (grep(/-b/,@opt)) { | |
41 $theme = "blue"; | |
35 } elsif (grep(/-2/,@opt)) { | 42 } elsif (grep(/-2/,@opt)) { |
36 $closing = "</div>"; | 43 $closing = "</div>"; |
37 $opening = '<div class="slide">'; | 44 $opening = '<div class="slide">'; |
38 } else { | 45 } else { |
39 $xoxo = '<ol class="xoxo presentation">' | 46 $xoxo = '<ol class="xoxo presentation">' |
86 <img src="ui/slidy2/graphics/keys2.jpg" alt="Cover page images (keys)" | 93 <img src="ui/slidy2/graphics/keys2.jpg" alt="Cover page images (keys)" |
87 class="cover" /><br clear="all" /> | 94 class="cover" /><br clear="all" /> |
88 <h1>$title</h1> | 95 <h1>$title</h1> |
89 | 96 |
90 <p><a>$author</a>, | 97 <p><a>$author</a>, |
98 $in_title | |
91 <br /> | 99 <br /> |
92 <br /> | 100 <br /> |
93 <br /> | 101 <br /> |
94 </div> | 102 </div> |
95 RogueRogue | 103 RogueRogue |
154 <div class="slide"> | 162 <div class="slide"> |
155 <h1>$title</h1> | 163 <h1>$title</h1> |
156 <h2>$subtitle</h2> | 164 <h2>$subtitle</h2> |
157 <h3>$author</h3> | 165 <h3>$author</h3> |
158 <h4>$affilation</h4> | 166 <h4>$affilation</h4> |
167 $in_title | |
159 | 168 |
160 RogueRogue | 169 RogueRogue |
161 | 170 |
162 if (grep(/-2/,@opt)) { | 171 if (grep(/-2/,@opt)) { |
163 $closing = "</div>"; | 172 $closing = "</div>"; |
166 } | 175 } |
167 &init(); | 176 &init(); |
168 } | 177 } |
169 | 178 |
170 sub o2s5 { | 179 sub o2s5 { |
171 local($current) = @_; | 180 my ($current) = @_; |
172 %content = (); | 181 %content = (); |
173 | 182 |
174 my $in_comment = 0; | 183 my $in_comment = 0; |
175 | 184 |
176 line: while (<$current>) { | 185 line: while (<$current>) { |
291 $section++; | 300 $section++; |
292 $content{$tag} = " " x $depth . $section_title; | 301 $content{$tag} = " " x $depth . $section_title; |
293 $tag++; | 302 $tag++; |
294 next line; | 303 next line; |
295 } | 304 } |
296 next if ($title ne 'done'); | 305 if ($title ne 'done') { |
306 $in_title .= $_; | |
307 next; | |
308 } | |
297 | 309 |
298 if (/^\t/) { | 310 if (/^\t/) { |
299 if (! $ul) { | 311 if (! $ul) { |
300 $ul = 1; | 312 $ul = 1; |
301 print $fh "<ul>"; | 313 print $fh "<ul>"; |