# encoding: utf-8
# = epubv2.rb -- EPUB version 2 producer.
#
# Copyright (c) 2010-2014 Kenshi Muto and Masayoshi Takahashi
#
# This program is free software.
# You can distribute or modify this program under the terms of
# the GNU LGPL, Lesser General Public License version 2.1.
# For details of the GNU LGPL, see the file "COPYING".
#
require 'epubmaker/producer'
require 'cgi'
module EPUBMaker
# EPUBv2 is EPUB version 2 producer.
class EPUBv2
# Construct object with parameter hash +params+ and message resource hash +res+.
def initialize(producer)
@producer = producer
end
# Return mimetype content.
def mimetype
"application/epub+zip"
end
# Return opf file content.
def opf
s = <#{CGI.escapeHTML(@producer.params["title"])}
EOT
if @producer.params["aut"]
s << <
#{date_to_s(item)} #{editstr}#{revstr} 発行
\n] # FIXME:i18n else # custom date with string item.match(/\A(\d+\-\d+\-\d+)[\s ](.+)/) do |m| s << %Q[#{date_to_s(m[1])} #{m[2]}
\n] end end end end else s << %Q[#{date_to_s(@producer.params["date"])} 発行
\n] #FIXME:i18n end s << %Q[#{@producer.res.v("c-aut")} | #{CGI.escapeHTML(@producer.params["aut"].join(", "))} |
---|---|
#{@producer.res.v("c-csl")} | #{CGI.escapeHTML(@producer.params["csl"].join(", "))} |
#{@producer.res.v("c-trl")} | #{CGI.escapeHTML(@producer.params["trl"].join(", "))} |
#{@producer.res.v("c-dsr")} | #{CGI.escapeHTML(@producer.params["dsr"].join(", "))} |
#{@producer.res.v("c-ill")} | #{CGI.escapeHTML(@producer.params["ill"].join(", "))} |
#{@producer.res.v("c-edt")} | #{CGI.escapeHTML(@producer.params["edt"].join(", "))} |
#{@producer.res.v("c-prt")} | #{CGI.escapeHTML(@producer.params["prt"].join(", "))} |
#{@producer.res.v("c-pht")} | #{CGI.escapeHTML(@producer.params["pht"].join(", "))} |
ISBN | #{isbn} |