diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-07-26 20:16:49 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-07-26 20:16:49 -0400 |
commit | 2e6af20c3742adb42c756568fda2c05f7abd6d03 (patch) | |
tree | 5a0121ec974d40accd532473a5eb010db6ab0713 /lib/sisu/v3/epub_format.rb | |
parent | v3: qrcode, manifest, (++), QR code (metadata) images for manifest (diff) |
v3: param, manifest, qrcode, epub, added creator.editor field
Diffstat (limited to 'lib/sisu/v3/epub_format.rb')
-rw-r--r-- | lib/sisu/v3/epub_format.rb | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb index 9f169f5e..6879c933 100644 --- a/lib/sisu/v3/epub_format.rb +++ b/lib/sisu/v3/epub_format.rb @@ -1057,6 +1057,28 @@ WOK %{\n <dc:creator opf:file-as="#{m}" opf:role="aut">#{x}</dc:creator>} else '' end + editor=if defined? @md.creator.editor \ + and @md.creator.editor =~/\S+/ + m='' + @md.creator.editor_detail.each do |x| + surname=x[:the] \ + ? x[:the] \ + : '' + other_names=x[:others] \ + ? ', ' + x[:others] \ + : '' + m=(m.empty?) \ + ? (surname + other_names) \ + : (m + '; ' + surname + ', ' + other_names) + m.gsub!(/</,'<'); m.gsub!(/>/,'>') + m.gsub!(/<br(?: \/)?>/,';') + end + x=@md.creator.editor.dup + x.gsub!(/</,'<'); x.gsub!(/>/,'>') + x.gsub!(/<br(?: \/)?>/,'<br />') + %{\n <dc:creator opf:file-as="#{m}" opf:role="edt">#{x}</dc:creator>} + else '' + end translator=if defined? @md.creator.translator \ and @md.creator.translator =~/\S+/ m='' @@ -1132,7 +1154,7 @@ WOK <<WOK <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf"> <dc:title>#{@md.title.full}</dc:title> - #{author}#{translator}#{illustrator}#{language}#{date_published}#{subject}#{rights} + #{author}#{editor}#{translator}#{illustrator}#{language}#{date_published}#{subject}#{rights} <dc:identifier id="bookid">...</dc:identifier> <dc:identifier id="EPB-UUID">urn:uuid:#{@md.dgst[1]}</dc:identifier> </metadata> |