aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v2/epub_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v2/epub_format.rb')
-rw-r--r--lib/sisu/v2/epub_format.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/sisu/v2/epub_format.rb b/lib/sisu/v2/epub_format.rb
index 5599a435..498912a3 100644
--- a/lib/sisu/v2/epub_format.rb
+++ b/lib/sisu/v2/epub_format.rb
@@ -1024,17 +1024,28 @@ WOK
WOK
end
def metadata #metadata dc
- illustrator=if defined? @md.creator.illustrator and @md.creator.illustrator =~/\S+/
+ author=if defined? @md.creator.author \
+ and @md.creator.author =~/\S+/
+ %{\n <dc:creator opf:file-as="#{@md.creator.author}" opf:role="aut">#{@md.creator.author}</dc:creator>}
+ else ''
+ end
+ illustrator=if defined? @md.creator.illustrator \
+ and @md.creator.illustrator =~/\S+/
%{\n <dc:creator opf:file-as="#{@md.creator.illustrator}" opf:role="ill">#{@md.creator.illustrator}</dc:creator>}
else ''
end
+ rights=if defined? @md.rights.all \
+ and @md.rights.all =~/\S+/
+ %{\n <dc:rights>#{@md.rights.all}</dc:rights>}
+ else ''
+ end
<<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>
- <dc:creator opf:file-as="#{@md.creator.author}" opf:role="aut">#{@md.creator.author}</dc:creator>#{illustrator}
+ #{author}#{illustrator}
<dc:language>en-US</dc:language>
<dc:identifier id="bookid">...</dc:identifier>
- <dc:rights>#{@md.rights.all}</dc:rights>
+ #{rights}
<dc:identifier id="EPB-UUID">urn:uuid:#{@md.dgst[1]}</dc:identifier>
</metadata>
WOK