#!/usr/bin/ruby file = ARGV[0] type = '' names = [] File::open(file) {|f| f.each {|line| name = line.gsub(/=.*$/,'').strip fs = name[0..0] if fs == '[' type = name end if (type == '[Boxes]' or type == '[Images]') && fs != '[' && fs != '' && fs != ';' names.push(name) end } } names.push('Firefox') names.push('IE') css = File.open('skin.css', 'w') names.each {|i| c = i.gsub(/\.|\s/,'-') css.puts ".#{c}\{" css.puts %Q{background-image : -o-skin("#{i}")}; css.puts "\}" } css.close html = File.open('skin.html', 'w') html.puts %Q{} html.puts %Q{} html.puts "
" html.puts %Q{} html.puts "解説} html.puts "
| Name | Image | " html.puts "
|---|---|
| #{i} | } html.puts " |
このページのHTML&CSSはskin.rbで生成しています。
} html.puts "" html.close