Mercurial > hg > Papers > 2012 > sugi-prosym
comparison presen/o2s5 @ 38:b46ef6dc302a
o2s5 fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 10 Jan 2013 15:13:48 +0900 |
parents | 47e80dcfe316 |
children |
comparison
equal
deleted
inserted
replaced
37:47e80dcfe316 | 38:b46ef6dc302a |
---|---|
3 use strict; | 3 use strict; |
4 | 4 |
5 my $o = '-'; | 5 my $o = '-'; |
6 | 6 |
7 use Getopt::Std; | 7 use Getopt::Std; |
8 our($opt_s); | 8 our($opt_s, $opt_p, $opt_f, $opt_n, $opt_i, $opt_b, $opt_g, $opt_2); |
9 getopts('s:'); | 9 getopts('s:pfnibg2'); |
10 | 10 |
11 if ($opt_s) { $o = $opt_s; } | 11 if ($opt_s) { $o = $opt_s; } |
12 | 12 |
13 my $depth = 0; | 13 my $depth = 0; |
14 my $section = 1; | 14 my $section = 1; |
27 my $xoxo = ''; | 27 my $xoxo = ''; |
28 | 28 |
29 my $tfont = 1; | 29 my $tfont = 1; |
30 my $slidy_init; | 30 my $slidy_init; |
31 my $init; | 31 my $init; |
32 my $ending = "\n</body></html>\n"; | |
33 my $so = "<h1>"; my $se ="</h1>"; | |
32 | 34 |
33 my $ul = 0; | 35 my $ul = 0; |
34 my $theme = "default"; | 36 my $theme = "default"; |
35 my $in_title = ""; | 37 my $in_title = ""; |
36 | 38 |
51 my $title; | 53 my $title; |
52 | 54 |
53 | 55 |
54 my @depend; | 56 my @depend; |
55 | 57 |
56 my @opt = grep(! /\.ind/,@ARGV); | |
57 @ARGV = grep( /\.ind/,@ARGV); | 58 @ARGV = grep( /\.ind/,@ARGV); |
58 | 59 |
59 sub title_init { | 60 sub title_init { |
60 | 61 |
61 if (grep(/-p/,@opt)) { | 62 if ($opt_p) { |
62 $theme = "pixel"; | 63 $theme = "pixel"; |
63 } elsif (grep(/-f/,@opt)) { | 64 } elsif ($opt_f) { |
64 $theme = "flower"; | 65 $theme = "flower"; |
65 } elsif (grep(/-n/,@opt)) { | 66 } elsif ($opt_n) { |
66 $theme = "nautilus"; | 67 $theme = "nautilus"; |
67 } elsif (grep(/-i/,@opt)) { | 68 } elsif ($opt_i) { |
68 $theme = "i18n"; | 69 $theme = "i18n"; |
69 } elsif (grep(/-b/,@opt)) { | 70 } elsif ($opt_b) { |
70 $theme = "blue"; | 71 $theme = "blue"; |
71 } elsif (grep(/-g/,@opt)) { | 72 } elsif ($opt_g) { |
72 $theme = "google"; | 73 $theme = "google"; |
73 $closing = "</article>"; | 74 $closing = "</article>"; |
74 $opening = '<article>'; | 75 $opening = '<article>'; |
75 } elsif (grep(/-2/,@opt)) { | 76 } elsif ($opt_2) { |
76 $closing = "</div>"; | 77 $closing = "</div>"; |
77 $opening = '<div class="slide">'; | 78 $opening = '<div class="slide">'; |
78 } else { | 79 } else { |
79 $xoxo = '<ol class="xoxo presentation">' | 80 $xoxo = '<ol class="xoxo presentation">' |
80 } | 81 } |
203 | 204 |
204 if ($theme eq 'google') { | 205 if ($theme eq 'google') { |
205 &init_google(); | 206 &init_google(); |
206 return; | 207 return; |
207 } | 208 } |
208 if (grep(/-2/,@opt)) { | 209 if ($opt_2) { |
209 $closing = "</div>"; | 210 $closing = "</div>"; |
210 $opening = '<div class="slide">'; | 211 $opening = '<div class="slide">'; |
211 $init = $slidy_init; | 212 $init = $slidy_init; |
212 } | 213 } |
213 &init(); | 214 &init(); |
214 } | 215 } |
215 | 216 |
216 sub init_google | 217 sub init_google |
217 { | 218 { |
218 $init = <<"RogueRogue"; | 219 $closing = "</article>"; |
220 $opening = '<article>'; | |
221 $so = "<h3>"; $se ="</h3>"; | |
222 $init = <<"RogueRogue"; | |
219 <!DOCTYPE html> | 223 <!DOCTYPE html> |
220 | 224 |
221 <!-- | 225 <!-- |
222 Google HTML5 slide template | 226 Google HTML5 slide template |
223 | 227 |
259 | 263 |
260 </h1> | 264 </h1> |
261 <p>$author | 265 <p>$author |
262 </p> | 266 </p> |
263 琉球大学 並列信頼研究室 | 267 琉球大学 並列信頼研究室 |
264 </article> | |
265 RogueRogue | 268 RogueRogue |
266 | 269 |
267 $closing = <<"RogueRogue"; | 270 $ending = <<"RogueRogue"; |
268 </Section> | 271 </Section> |
269 </body> | 272 </body> |
270 </html> | 273 </html> |
271 RogueRogue | 274 RogueRogue |
272 } | 275 } |
410 $closing | 413 $closing |
411 RogueRogue | 414 RogueRogue |
412 } | 415 } |
413 print $fh <<RogueRogue; | 416 print $fh <<RogueRogue; |
414 $opening | 417 $opening |
415 <h1>$section_title</h1> | 418 $so$section_title$se |
416 RogueRogue | 419 RogueRogue |
417 $section++; | 420 $section++; |
418 $content{$tag} = " " x $depth . $section_title; | 421 $content{$tag} = " " x $depth . $section_title; |
419 $tag++; | 422 $tag++; |
420 next line; | 423 next line; |
469 } | 472 } |
470 my $ofd; | 473 my $ofd; |
471 open($ofd,"|nkf -w >$out"); | 474 open($ofd,"|nkf -w >$out"); |
472 $fh = $ofd; | 475 $fh = $ofd; |
473 &o2s5($arg, $fdbase); | 476 &o2s5($arg, $fdbase); |
477 print $ofd $ending; | |
474 } | 478 } |
479 | |
475 | 480 |
476 # close($fh); | 481 # close($fh); |
477 | 482 |
478 | 483 |
479 | 484 |