From 62701442505f35ad9b773c6c52514ba9f1102c56 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Jan 2013 23:39:12 -0500 Subject: v4 v3: epub_format, cosmetic arrangement of code <<-WOK --- lib/sisu/v3/epub_format.rb | 134 ++++++++++++++++++++-------------------- lib/sisu/v4/epub_format.rb | 148 ++++++++++++++++++++++----------------------- 2 files changed, 141 insertions(+), 141 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb index 3b0412ba..709351d8 100644 --- a/lib/sisu/v3/epub_format.rb +++ b/lib/sisu/v3/epub_format.rb @@ -92,7 +92,7 @@ module SiSU_EPUB_Format end class CSS def css_epub_xhtml -< -WOK + WOK end =begin ~/epub |-- META-INF - | `-- container.xml #✓ simple, make sure full-path of rootfile points to metadata.opf + | `-- container.xml # simple, make sure full-path of rootfile points to metadata.opf |-- content | |-- 1.xhtml | |-- 2.xhtml @@ -1262,21 +1262,21 @@ WOK | |-- metadata.xhtml | `-- toc.xhtml |-- metadata.opf #(i) metadata dc; (ii) manifest (contents); (iii) spine (mimetypes) - |-- mimetype #✓ application/epub+zip - `-- toc.ncx #✓ (i) head (ii) doc title (iii) navmap, list of navigation points (like chapters) + |-- mimetype # application/epub+zip + `-- toc.ncx #(i) head (ii) doc title (iii) navmap, list of navigation points (like chapters) =end def doc_type doc_type_xhtml end def mimetype - < @@ -1285,7 +1285,7 @@ WOK media-type="application/oebps-package+xml" /> -WOK + WOK end def sections(dob,name) filename="#{name}#{Sfx[:epub_xhtml]}" @@ -1327,26 +1327,26 @@ output_epub_cont_seg.close close end def open - < -WOK + WOK end def close - < -WOK + WOK end def head_open - < -WOK + WOK end def head depth=@md.lvs[1] + @md.lvs[2] + @md.lvs[3] + @md.lvs[4] - < #{@md.title.full} by #{@md.author} @@ -1356,67 +1356,67 @@ WOK -WOK + WOK end def head_close - < -WOK + WOK end def doc_title - < #{@md.title.full} -WOK + WOK end def doc_author - < #{@md.author} -WOK + WOK end def navmap_open - < -WOK + WOK end def navmap_sisu_toc(no) id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \ ? '' : "-#{no}" - < Table of Contents -WOK + WOK end def navpoint(dob,no,name=nil) name=name ? name : dob.name id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \ ? '' : "-#{no}" - < #{dob.obj} -WOK + WOK end def navpoint_close - < -WOK + WOK end def navmap_close - < -WOK + WOK end self end @@ -1434,15 +1434,15 @@ WOK package_close end def package_open - < -WOK + WOK end def package_close - < -WOK + WOK end def metadata #metadata dc author=if defined? @md.creator.author \ @@ -1562,7 +1562,7 @@ WOK else '' end f=SiSU_Env::FileOp.new(@md) - < @@ -1572,89 +1572,89 @@ WOK urn:uuid:#{@md.dgst[1]} -WOK + WOK end def manifest_open - < -WOK + WOK end def manifest_content_sisu_toc - < -WOK + WOK end def manifest_content(dob,name=nil) name=name ? name : dob.name - < -WOK + WOK end def manifest_images(imgs) imgs=imgs + ['arrow_next_red.png','arrow_prev_red.png','arrow_up_red.png','bullet_09.png'] images=[" \n"] imgs.each do |i| image,type=/(\S+?)\.(png|jpg|gif)/.match(i)[1,2] - images<<< -WOK + WOK end images=images.join('') images end def manifest_close - < -WOK + WOK end def spine_open #spine: reading order of XHTML files from manifest, idref attribute refers back to id in manifest (exclude images, CSS etc.). - < -WOK + WOK end def spine_sisu_toc - < -WOK + WOK end def spine(dob,name=nil) name=name ? name : dob.name - < -WOK + WOK end def spine_close - < -WOK + WOK end def guide_open #guide: presentation order of XHTML files by reader). - < -WOK + WOK end def guide_sisu_toc - < -WOK + WOK end def guide(dob,name=nil) name=name ? name : dob.name - < -WOK + WOK end def guide_close - < -WOK + WOK end self end diff --git a/lib/sisu/v4/epub_format.rb b/lib/sisu/v4/epub_format.rb index 5a63a6ec..14304139 100644 --- a/lib/sisu/v4/epub_format.rb +++ b/lib/sisu/v4/epub_format.rb @@ -92,7 +92,7 @@ module SiSU_EPUB_Format end class CSS def css_epub_xhtml -< -WOK + WOK end =begin ~/epub |-- META-INF - | `-- container.xml #✓ simple, make sure full-path of rootfile points to metadata.opf + | `-- container.xml # simple, make sure full-path of rootfile points to metadata.opf |-- content | |-- 1.xhtml | |-- 2.xhtml @@ -1262,21 +1262,21 @@ WOK | |-- metadata.xhtml | `-- toc.xhtml |-- metadata.opf #(i) metadata dc; (ii) manifest (contents); (iii) spine (mimetypes) - |-- mimetype #✓ application/epub+zip - `-- toc.ncx #✓ (i) head (ii) doc title (iii) navmap, list of navigation points (like chapters) + |-- mimetype # application/epub+zip + `-- toc.ncx #(i) head (ii) doc title (iii) navmap, list of navigation points (like chapters) =end def doc_type doc_type_xhtml end def mimetype - < @@ -1285,7 +1285,7 @@ WOK media-type="application/oebps-package+xml" /> -WOK + WOK end def sections(dob,name) filename="#{name}#{Sfx[:epub_xhtml]}" @@ -1327,26 +1327,26 @@ output_epub_cont_seg.close close end def open - < -WOK + WOK end def close - < -WOK + WOK end def head_open - < -WOK + WOK end def head depth=@md.lvs[1] + @md.lvs[2] + @md.lvs[3] + @md.lvs[4] - < #{@md.title.full} by #{@md.author} @@ -1356,67 +1356,67 @@ WOK -WOK + WOK end def head_close - < -WOK + WOK end def doc_title - < #{@md.title.full} -WOK + WOK end def doc_author - < #{@md.author} -WOK + WOK end def navmap_open - < -WOK + WOK end def navmap_sisu_toc(no) id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \ ? '' : "-#{no}" - < Table of Contents -WOK + WOK end def navpoint(dob,no,name=nil) name=name ? name : dob.name id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \ ? '' : "-#{no}" - < #{dob.obj} - -WOK + + WOK end def navpoint_close - < -WOK + WOK end def navmap_close - < -WOK + WOK end self end @@ -1434,15 +1434,15 @@ WOK package_close end def package_open - < -WOK + WOK end def package_close - < -WOK + WOK end def metadata #metadata dc cover_image=if defined? @md.make.cover_image \ @@ -1568,7 +1568,7 @@ WOK else '' end f=SiSU_Env::FileOp.new(@md) - < @@ -1578,38 +1578,38 @@ WOK urn:uuid:#{@md.dgst[1]} -WOK + WOK end def manifest_open - < -WOK + WOK end def manifest_content_sisu_toc - < -WOK + WOK end def manifest_cover_image_information(md) cover_image=if defined? md.make.cover_image \ and @md.make.cover_image.is_a?(Hash) \ and md.make.cover_image[:cover] =~/\S+/ - < -WOK + WOK else '' end end def manifest_content(dob,name=nil) name=name ? name : dob.name - < -WOK + WOK end def manifest_images(imgs) imgs=imgs + ['arrow_next_red.png','arrow_prev_red.png','arrow_up_red.png','bullet_09.png'] @@ -1617,71 +1617,71 @@ WOK imgs.each do |i| image,type=/(\S+?)\.(png|jpg|gif)/.match(i)[1,2] type=type.sub(/jpg/,'jpeg') - images<<< -WOK + WOK end images=images.join('') images end def manifest_close - < -WOK + WOK end def spine_open #spine: reading order of XHTML files from manifest, idref attribute refers back to id in manifest (exclude images, CSS etc.). - < -WOK + WOK end def spine_cover_image - < -WOK + WOK end def spine_sisu_toc - < -WOK + WOK end def spine(dob,name=nil) name=name ? name : dob.name - < -WOK + WOK end def spine_close - < -WOK + WOK end def guide_open #guide: presentation order of XHTML files by reader). - < -WOK + WOK end def guide_cover_image - < -WOK + WOK end def guide_sisu_toc - < -WOK + WOK end def guide(dob,name=nil) name=name ? name : dob.name - < -WOK + WOK end def guide_close - < -WOK + WOK end self end -- cgit v1.2.3