#!/usr/bin/ruby
+# -*- coding: utf-8 -*-
require "rexml/document"
class REXML::Element
ep = @file_hash[href]
c.unshift(make_a_element(href, (lang == "ja" ? ep.title_ja : ep.title_en)))
end
+ if (href = prev_link(ef)) != nil
+ c.push(REXML::Text.new(" ", false, nil, true))
+ c.push(make_a_element(href, (lang == "ja" ? "[前]" : "[Prev]")))
+ end
+ if (href = next_link(ef)) != nil
+ c.push(REXML::Text.new(" ", false, nil, true))
+ c.push(make_a_element(href, (lang == "ja" ? "[次]" : "[Next]")))
+ end
+ otherlang = (lang == "ja" ? "en" : "ja")
+ n = REXML::Element.new("span")
+ n.add_attribute("class", "float_right")
+ n.add(make_a_element('../' + otherlang + '/' + ef.attributes['file'], (otherlang == "ja" ? "[Japanese]" : "[English]")))
+ c.push(n)
c.each { |n|
if n.is_a?(String)
en.add_text(n)
en.add(make_a_element(href, (lang == "ja" ? "[次: #{ep.title_ja}]" : "[Next: #{ep.title_en}]")))
en.add_text(" ")
end
+ otherlang = (lang == "ja" ? "en" : "ja")
+ n = REXML::Element.new("span")
+ n.add_attribute("class", "float_right")
+ n.add(make_a_element('../' + otherlang + '/' + ef.attributes['file'], (otherlang == "ja" ? "[Japanese]" : "[English]")))
+ en.add(n)
elsif id == "\#toc"
en = REXML::Element.new("div")
en.add_attribute("class", "contents")
e = e.deep_clone
if e.name == "title"
e = REXML::Element.new("title")
- e.add_text(lang == "ja" ? ef.title_ja : ef.title_ja)
+ e.add_text(lang == "ja" ? ef.title_ja : ef.title_en)
elsif e.name == "meta"
if e.attributes["http-equiv"] == "Content-Type"
e.attributes["lang"] = lang
system("cd #{base_dir}/#{lang}; sed 's!/>! />!g' _#{file} >#{file}; rm _#{file}")
end
}
-target_dir = "../doc"
-system("cp -r etc #{base_dir}; rm -rf #{base_dir}/etc/CVS")
-system("rm -rf #{target_dir}/*")
-system("mv #{base_dir}/* #{target_dir}")
-system("rmdir #{base_dir}")
-print "Documents were successfully created in #{target_dir}/{en,ja}.\n"
+
+system("cp -r -p etc #{base_dir}; rm -rf #{base_dir}/etc/CVS #{base_dir}/etc/.svn #{base_dir}/etc/.DS_Store")
+system("cp -r -p src/molby_rb #{base_dir}/en; rm -rf #{base_dir}/en/molby_rb/CVS #{base_dir}/en/molby_rb/.svn")
+system("cp -r -p #{base_dir}/en/molby_rb #{base_dir}/ja")
+print "Documents were successfully created in #{base_dir}/{en,ja}.\n"
+exit 0