From 4fcfa03d0cc4e5d4f2c02d0cafa0c7a1c1ebf7e7 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 5 Feb 2014 01:06:46 -0500 Subject: v5 v6: epub, hash digests used only if available --- data/doc/sisu/CHANGELOG_v5 | 4 +++- data/doc/sisu/CHANGELOG_v6 | 4 +++- lib/sisu/v5/xhtml_epub2_format.rb | 10 ++++++---- lib/sisu/v6/xhtml_epub2_format.rb | 10 ++++++---- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index a97c8bc1..654a8fa6 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -50,7 +50,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.3.1.orig.tar.xz * tags * endnote name and nameref (make compliant) -* epub use same endnote name and nameref as introduced here for html +* epub + * use same endnote name and nameref as introduced here for html + * hash digests used only if availabile (availability check) * ocn turn on/off rules * txt diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 3000f42a..4634ce09 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -40,7 +40,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.1.orig.tar.xz * tags * endnote name and nameref (make compliant) -* epub use same endnote name and nameref as introduced here for html +* epub + * use same endnote name and nameref as introduced here for html + * hash digests used only if availabile (availability check) * ocn turn on/off rules * txt diff --git a/lib/sisu/v5/xhtml_epub2_format.rb b/lib/sisu/v5/xhtml_epub2_format.rb index e3b877aa..6522378b 100644 --- a/lib/sisu/v5/xhtml_epub2_format.rb +++ b/lib/sisu/v5/xhtml_epub2_format.rb @@ -1362,12 +1362,13 @@ output_epub_cont_seg.close depth=@md.lvs[1] + @md.lvs[2] + @md.lvs[3] + @md.lvs[4] title=SanitizeXML.xml(@md.title.full) author=SanitizeXML.xml(@md.author) + dgst=(@md.dgst.is_a?(Array) and @md.dgst.length > 1) ? @md.dgst[1] : 'na' <<-WOK #{title} by #{author} - + @@ -1579,18 +1580,19 @@ output_epub_cont_seg.close else '' end f=SiSU_Env::FileOp.new(@md) + dgst=(@md.dgst.is_a?(Array) and @md.dgst.length > 1) ? @md.dgst[1] : 'na' <<-WOK <#{$ep[:o]}metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" - unique-identifier="urn:uuid:#{@md.dgst[1]}" version="2.0"> + unique-identifier="urn:uuid:#{dgst}" version="2.0"> #{@md.title.full} #{cover_image}#{author}#{editor}#{translator}#{illustrator}#{language}#{date_published}#{subject}#{rights} #{f.output_path.epub.url.gsub(/http:\/\//,'')}/#{f.base_filename.epub} - urn:uuid:#{@md.dgst[1]} - + urn:uuid:#{dgst} + WOK end diff --git a/lib/sisu/v6/xhtml_epub2_format.rb b/lib/sisu/v6/xhtml_epub2_format.rb index 7ae97f95..626eb79f 100644 --- a/lib/sisu/v6/xhtml_epub2_format.rb +++ b/lib/sisu/v6/xhtml_epub2_format.rb @@ -1362,12 +1362,13 @@ output_epub_cont_seg.close depth=@md.lvs[1] + @md.lvs[2] + @md.lvs[3] + @md.lvs[4] title=SanitizeXML.xml(@md.title.full) author=SanitizeXML.xml(@md.author) + dgst=(@md.dgst.is_a?(Array) and @md.dgst.length > 1) ? @md.dgst[1] : 'na' <<-WOK #{title} by #{author} - + @@ -1579,18 +1580,19 @@ output_epub_cont_seg.close else '' end f=SiSU_Env::FileOp.new(@md) + dgst=(@md.dgst.is_a?(Array) and @md.dgst.length > 1) ? @md.dgst[1] : 'na' <<-WOK <#{$ep[:o]}metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" - unique-identifier="urn:uuid:#{@md.dgst[1]}" version="2.0"> + unique-identifier="urn:uuid:#{dgst}" version="2.0"> #{@md.title.full} #{cover_image}#{author}#{editor}#{translator}#{illustrator}#{language}#{date_published}#{subject}#{rights} #{f.output_path.epub.url.gsub(/http:\/\//,'')}/#{f.base_filename.epub} - urn:uuid:#{@md.dgst[1]} - + urn:uuid:#{dgst} + WOK end -- cgit v1.2.3