#!/usr/bin/env ruby
#
# 表題: ape お絵描きサムネイル HTML 作成スクリプト
#
# 履歴: 2003/09/28 やまだ由 
#
# 注意: 本プログラムは, 
#       dcphoto.pl Ver 1.02 - 写真用 HTML作成スクリプト
#       Mitsuda Chihiro   <totera@ep.sci.hokudai.ac.jp>
#       を ruby で写経し, やまだ由用にカスタマイズしたものである 
#
#
#
#

END{

  html_make
  html_sonota_make

}



########################################################
##  include ファイル
########################################################

require 'date'
#require '/home/yukiko/lib/ape-thum.rb'
require './ape-thum.rb'
$KCODE = "e"


########################################################
##  ユーザ設定
########################################################

def jikkou

# インデックスファイル  $PWD/../html/${index}.html, $PWD/../html/table_${index}.rd
#$index = ""

# 情報ファイル, $PWD/${infofile}
#$infofile = $index + ".txt"

# 拡張子
#$base = "-lay1.gif"

# 絵のあるディレクトリ名, $PWD/../${figdir}
#$figdir = "tmean"
# $figdir = "spct"
#$figdir = "xteq"


# 横にならべるファイル数
# $figtable_num = 5
#$figtable_num = 4


#画像ファイルサイズ
# $width  = "160"
# $height = "120"
# $width  = "200"
# $height = "150"
# $width  = "280"
# $height = "210"


# テーブル, フォントの色
$color_table   = "#ADD8E6" 
$color_font    = "#000080" 
$color_link    = "#269900" 
$color_visited = "#269900" 
$color_hover   = "#CC9933" 

# html ヘッダタイトル
#$title  = "baseSST q,t の qradl への感度"

# サムネイルタイトル
$header1 = $title 
$header2 = "
kuo-c-mod Exp. <br>
<hr>

<hr> 
[<a href =\"../stdexp/stdexp.html\">Standard</a>] 
[<a href =\"../t42l12/t42l12.html\">T42L12</a>] 
[<a href =\"../hs86sst/hs86sst.html\">HS86SST</a>] 
<hr> 
[<a href =\"../../\">HOME</a>]
"

# サムネイルフッタ ;
$footer = "Last update: #{Time.now} <br> 
           Copyright &copy\; 2005 YAMADA Yukiko"


# ファイル生成実行
print $title, "\n" ; apethum

end


def anim_sed(index)

#  `sed s/-t0.gif\"\>/-anim.gif\"\>/ ../#{index}.html > tmp.html`
  `sed s/_t0.gif\\"\\>/_anim.gif\\"\\>/ ../#{index}.html > tmp.html`
  `mv tmp.html ../#{index}.html`

end


def html_make

  $width  = "200";  $height = "150"
  $head = ""
  $base = ".gif"
  $figdir = "figs"
  $index = "#{$head}#{$figdir}"
  $infofile = "#{$figdir}.txt"
  $title  = "kuo-c-mphys Experiment"
  $figtable_num = 4
  jikkou
  anim_sed($index)

end

def html_sonota_make

  $head = ""
  $base = ".gif"
  $figdir = ""
  $index = "kuo-c-mphys"
  $infofile = "kuo-c-mphys.txt"
  $title  = "kuo-c-mphys Experiment index"
  $figtable_num = 4
  jikkou


end










