diff 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
line wrap: on
line diff
--- a/presen/o2s5	Tue Jan 08 17:52:41 2013 +0900
+++ b/presen/o2s5	Thu Jan 10 15:13:48 2013 +0900
@@ -5,8 +5,8 @@
 my $o = '-';
 
 use Getopt::Std;
-our($opt_s);
-getopts('s:');
+our($opt_s, $opt_p, $opt_f, $opt_n, $opt_i, $opt_b, $opt_g, $opt_2);
+getopts('s:pfnibg2');
 
 if ($opt_s) { $o = $opt_s; }
 
@@ -29,6 +29,8 @@
 my $tfont = 1;
 my $slidy_init;
 my $init;
+my $ending = "\n</body></html>\n";
+my $so = "<h1>"; my $se ="</h1>";
 
 my $ul = 0;
 my $theme = "default";
@@ -53,26 +55,25 @@
 
 my @depend;
 
-my @opt  = grep(! /\.ind/,@ARGV);
 @ARGV = grep(  /\.ind/,@ARGV);
 
 sub title_init {
 
-    if (grep(/-p/,@opt)) {
+    if ($opt_p) {
 	$theme = "pixel";
-    } elsif (grep(/-f/,@opt)) {
+    } elsif ($opt_f) {
 	$theme = "flower";
-    } elsif (grep(/-n/,@opt)) {
+    } elsif ($opt_n) {
 	$theme = "nautilus";
-    } elsif (grep(/-i/,@opt)) {
+    } elsif ($opt_i) {
 	$theme = "i18n";
-    } elsif (grep(/-b/,@opt)) {
+    } elsif ($opt_b) {
 	$theme = "blue";
-    } elsif (grep(/-g/,@opt)) {
+    } elsif ($opt_g) {
 	$theme = "google";
         $closing = "</article>";
         $opening = '<article>';
-    } elsif (grep(/-2/,@opt)) {
+    } elsif ($opt_2) {
 	$closing = "</div>";
 	$opening = '<div class="slide">';
     } else {
@@ -205,7 +206,7 @@
        &init_google();
        return;
     }
-    if (grep(/-2/,@opt)) {
+    if ($opt_2) {
 	$closing = "</div>";
 	$opening = '<div class="slide">';
 	$init = $slidy_init;
@@ -215,7 +216,10 @@
 
 sub init_google
 {
-      $init = <<"RogueRogue";
+	$closing = "</article>";
+	$opening = '<article>';
+     $so = "<h3>"; $se ="</h3>";
+     $init = <<"RogueRogue";
 <!DOCTYPE html>
 
 <!--
@@ -261,10 +265,9 @@
         <p>$author
         </p>
 	琉球大学 並列信頼研究室
-      </article>
 RogueRogue
 
-    $closing = <<"RogueRogue";
+    $ending = <<"RogueRogue";
 </Section>
 </body>
 </html>
@@ -412,7 +415,7 @@
 	}
 	print $fh <<RogueRogue;
 $opening
-<h1>$section_title</h1>
+$so$section_title$se
 RogueRogue
 	$section++;
 	$content{$tag} = " " x $depth . $section_title;
@@ -471,8 +474,10 @@
   open($ofd,"|nkf -w >$out"); 
   $fh = $ofd;
   &o2s5($arg, $fdbase);
+  print $ofd $ending;
 }
 
+
 # close($fh);