diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-02-05 01:06:46 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-02-05 01:06:46 -0500 |
commit | 4fcfa03d0cc4e5d4f2c02d0cafa0c7a1c1ebf7e7 (patch) | |
tree | 6136fc522f6c3ad60a0784afff42df3e1d3f0a8b | |
parent | v5 v6: html, endnote name and nameref make compliant (epub use same) (diff) |
v5 v6: epub, hash digests used only if available
-rw-r--r-- | data/doc/sisu/CHANGELOG_v5 | 4 | ||||
-rw-r--r-- | data/doc/sisu/CHANGELOG_v6 | 4 | ||||
-rw-r--r-- | lib/sisu/v5/xhtml_epub2_format.rb | 10 | ||||
-rw-r--r-- | 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 <!-- four required metadata items (for all NCX documents, (including the relaxed constraints of OPS 2.0) --> <title>#{title} by #{author}</title> <link href="css/xhtml.css" rel="stylesheet" type="text/css" id="main-css" /> - <meta name="dtb:uid" content="urn:uuid:#{@md.dgst[1]}" /> + <meta name="dtb:uid" content="urn:uuid:#{dgst}" /> <!-- <meta name="epub-creator" content="#{@md.publisher}" /> --> <meta name="dtb:depth" content="#{depth}" /> <meta name="dtb:totalPageCount" content="0" /> @@ -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"> <dc:title>#{@md.title.full}</dc:title> #{cover_image}#{author}#{editor}#{translator}#{illustrator}#{language}#{date_published}#{subject}#{rights} <dc:identifier opf:scheme="URI">#{f.output_path.epub.url.gsub(/http:\/\//,'')}/#{f.base_filename.epub}</dc:identifier> - <dc:identifier id="bookid">urn:uuid:#{@md.dgst[1]}</dc:identifier> - <!-- <dc:identifier id="EPB-UUID">urn:uuid:#{@md.dgst[1]}</dc:identifier> --> + <dc:identifier id="bookid">urn:uuid:#{dgst}</dc:identifier> + <!-- <dc:identifier id="EPB-UUID">urn:uuid:#{dgst}</dc:identifier> --> </#{$ep[:o]}metadata> 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 <!-- four required metadata items (for all NCX documents, (including the relaxed constraints of OPS 2.0) --> <title>#{title} by #{author}</title> <link href="css/xhtml.css" rel="stylesheet" type="text/css" id="main-css" /> - <meta name="dtb:uid" content="urn:uuid:#{@md.dgst[1]}" /> + <meta name="dtb:uid" content="urn:uuid:#{dgst}" /> <!-- <meta name="epub-creator" content="#{@md.publisher}" /> --> <meta name="dtb:depth" content="#{depth}" /> <meta name="dtb:totalPageCount" content="0" /> @@ -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"> <dc:title>#{@md.title.full}</dc:title> #{cover_image}#{author}#{editor}#{translator}#{illustrator}#{language}#{date_published}#{subject}#{rights} <dc:identifier opf:scheme="URI">#{f.output_path.epub.url.gsub(/http:\/\//,'')}/#{f.base_filename.epub}</dc:identifier> - <dc:identifier id="bookid">urn:uuid:#{@md.dgst[1]}</dc:identifier> - <!-- <dc:identifier id="EPB-UUID">urn:uuid:#{@md.dgst[1]}</dc:identifier> --> + <dc:identifier id="bookid">urn:uuid:#{dgst}</dc:identifier> + <!-- <dc:identifier id="EPB-UUID">urn:uuid:#{dgst}</dc:identifier> --> </#{$ep[:o]}metadata> WOK end |