aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-01-24 20:49:58 -0500
committerRalph Amissah <ralph@amissah.com>2013-01-24 20:49:58 -0500
commit0fc8f80a23ad8bc2213af84c169fbc1828978f8a (patch)
treebba9b57928b77c59ffbb24144af6f5b7cee8efb4 /lib/sisu/v4
parentdebian/changelog (4.0.1-1) [posted to experimental, awaiting Wheezy freeze end] (diff)
parentv4 v3: epub, epub_format, provide full depth epub table of contents (diff)
Merge tag 'sisu_4.0.2' into debian/sid
Diffstat (limited to 'lib/sisu/v4')
-rw-r--r--lib/sisu/v4/dal_doc_objects.rb6
-rw-r--r--lib/sisu/v4/epub.rb95
-rw-r--r--lib/sisu/v4/epub_format.rb197
-rw-r--r--lib/sisu/v4/epub_tune.rb87
-rw-r--r--lib/sisu/v4/html_tune.rb87
-rw-r--r--lib/sisu/v4/param.rb2
-rw-r--r--lib/sisu/v4/sysenv.rb3
-rw-r--r--lib/sisu/v4/texpdf_format.rb75
8 files changed, 251 insertions, 301 deletions
diff --git a/lib/sisu/v4/dal_doc_objects.rb b/lib/sisu/v4/dal_doc_objects.rb
index 70a4913d..37dfdcd3 100644
--- a/lib/sisu/v4/dal_doc_objects.rb
+++ b/lib/sisu/v4/dal_doc_objects.rb
@@ -128,9 +128,11 @@ module SiSU_DAL_DocumentStructure
end
end
def heading(h,o=nil)
- if not h[:ln] and (h[:lv] and h[:lv]=~/[1-6A-C]/)
+ if not h[:ln] \
+ and (h[:lv] and h[:lv]=~/[1-6A-C]/)
h[:ln]=heading_ln(h[:lv])
- elsif not h[:lv] and (h[:ln] and h[:ln].to_s=~/[1-9]/)
+ elsif not h[:lv] \
+ and (h[:ln] and h[:ln].to_s=~/[1-9]/)
h[:lv]=heading_lv(h[:ln])
end
of= @of #String, classification - group
diff --git a/lib/sisu/v4/epub.rb b/lib/sisu/v4/epub.rb
index d2d5cc6c..1af5ec49 100644
--- a/lib/sisu/v4/epub.rb
+++ b/lib/sisu/v4/epub.rb
@@ -197,7 +197,7 @@ module SiSU_EPUB
@@toc={ seg: [], seg_mini: [], scr: [], ncx: [], opf: [] }
md_opf_a_content,md_opf_a_spine,md_opf_a_guide=[],[],[]
@nav_no=0
- @s_a_no,@s_b_no,@s_c_no=0,0,0
+ @s_a_no,@s_b_no,@s_c_no,@lv5_no,@lv6_no=0,0,0,0,0
@@toc[:ncx] << @epub.toc_ncx.open #epub ncx navmap
@@toc[:ncx] << @epub.toc_ncx.head_open << @epub.toc_ncx.head << @epub.toc_ncx.head_close
@@toc[:ncx] << @epub.toc_ncx.doc_title << @epub.toc_ncx.doc_author
@@ -230,67 +230,100 @@ module SiSU_EPUB
toc=case dob_toc.ln
when 1
@s_a_no +=1
- name_s_a='section_a' + @s_a_no.to_s
+ lv_name='section_a' + @s_a_no.to_s
@nav_no+=1
@nav_no2=@nav_no
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[1]
- @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4]=true,false,false,false
- @epub.sections(dob_toc,name_s_a)
- @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_s_a) if dob_toc
+ @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false,false
+ @epub.sections(dob_toc,lv_name)
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc
if @level_a_first_occurrence \
&& @make.build.toc?
@nav_no+=1
@@toc[:ncx] << @epub.toc_ncx.navmap_sisu_toc(@nav_no) #epub ncx navmap, toc
@level_a_first_occurrence=false
end
- md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_s_a)
- md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,name_s_a)
- md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,name_s_a)
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name)
SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_1
when 2
@s_b_no +=1
- name_s_b='section_b' + @s_b_no.to_s
+ lv_name='section_b' + @s_b_no.to_s
@nav_no+=1
@nav_no2=@nav_no
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]
- @ncxo[2],@ncxo[3],@ncxo[4]=true,false,false
- @epub.sections(dob_toc,name_s_b)
- @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_s_b) if dob_toc
- md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_s_b)
- md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,name_s_b)
- md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,name_s_b)
+ @ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false,false
+ @epub.sections(dob_toc,lv_name)
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name)
SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_2
when 3
@s_c_no +=1
- name_s_c='section_c' + @s_c_no.to_s
+ lv_name='section_c' + @s_c_no.to_s
@nav_no+=1
@nav_no3=@nav_no
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
- @ncxo[3],@ncxo[4]=true,false
- @epub.sections(dob_toc,name_s_c)
- @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,name_s_c) if dob_toc
- md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_s_c)
- md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,name_s_c)
- md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,name_s_c)
+ @ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,false
+ @epub.sections(dob_toc,lv_name)
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name)
SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_3
when 4
@ncx_cls=[]
+ lv_name=dob_toc.name
@nav_no+=1
+ @dob_name=dob.name
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
- @ncxo[4]=true
- @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no) if dob_toc
- md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc)
- md_opf_a_spine << @epub.metadata_opf.spine(dob_toc)
- md_opf_a_guide << @epub.metadata_opf.guide(dob_toc)
+ @ncxo[4],@ncxo[5],@ncxo[6]=true,false,false
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name)
SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_4
- when 5; SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_5
- when 6; SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_6
+ when 5
+ @ncx_cls=[]
+ hashtag='#o' + dob_toc.ocn.to_s
+ lv_name=@dob_name
+ @nav_no+=1
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
+ @ncxo[5],@ncxo[6]=true,false
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name,hashtag) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name,hashtag)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name,hashtag)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name,hashtag)
+ SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_5
+ when 6
+ @ncx_cls=[]
+ hashtag='#o' + dob_toc.ocn.to_s
+ lv_name=@dob_name
+ @nav_no+=1
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @ncxo[6]=true
+ @@toc[:ncx] << @epub.toc_ncx.navpoint(dob_toc,@nav_no,lv_name,hashtag) if dob_toc
+ md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,lv_name,hashtag)
+ md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,lv_name,hashtag)
+ md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,lv_name,hashtag)
+ SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_6
else nil
end
toc.each do |k,d|
@@ -313,10 +346,12 @@ module SiSU_EPUB
end
end
end
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[6]
+ @@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[5]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[4]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[3]
@@toc[:ncx] << @epub.toc_ncx.navpoint_close if @ncxo[2]
- @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4]=false,false,false,false
+ @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=false,false,false,false,false,false
md_opf_a_content << @epub.metadata_opf.manifest_images(@md.ec[:image])
@@toc[:seg] << "</div>\n</div>"
@@toc[:scr] << "</div>\n</div>"
diff --git a/lib/sisu/v4/epub_format.rb b/lib/sisu/v4/epub_format.rb
index 5a63a6ec..84d32000 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
/* SiSU epub css default stylesheet */
body {
color: black;
@@ -1214,7 +1214,7 @@ module SiSU_EPUB_Format
margin-bottom: 20px;
margin-right: 15mm;
}
-WOK
+ WOK
end
end
class HeadInformation
@@ -1232,17 +1232,17 @@ WOK
@tocband_scroll,@tocband_segtoc=nil,nil
end
def doc_type_xhtml
-<<WOK
+ <<-WOK
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/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
- <<WOK
+ <<-WOK
application/epub+zip
-WOK
+ WOK
end
def metainf_container #container.xml file in META-INF directory
#simple, make sure full-path of rootfile points to metadata.opf
#epub_metadata.opf content.opf
- <<WOK
+ <<-WOK
<?xml version='1.0' encoding='utf-8'?>
<container version="1.0"
xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
@@ -1285,12 +1285,12 @@ WOK
media-type="application/oebps-package+xml" />
</rootfiles>
</container>
-WOK
+ WOK
end
- def sections(dob,name)
- filename="#{name}#{Sfx[:epub_xhtml]}"
- dir_epub_cont="#{@md.env.processing_path.epub}/#{Ep[:d_oebps]}"
- segfilename="#{dir_epub_cont}/#{filename}"
+ def sections(dob,fn_base)
+ name=fn_base + Sfx[:epub_xhtml]
+ dir_epub_cont=@md.env.processing_path.epub + '/' + Ep[:d_oebps]
+ segfilename=dir_epub_cont + '/' + name
output_epub_cont_seg=File.new(segfilename,'w')
output_epub_cont_seg << %{#{doc_type}
<head>
@@ -1303,11 +1303,12 @@ WOK
</head>
#{@vz.color_body}
<div class="content">
-<div class="substance">
- <label class="ocn"><a href="#o8" class="lnkocn">8</a></label>
- <h1 class="norm" id="o8">
- #{dob.obj}
- </h1>
+ <div class="substance">
+ <label class="ocn"><a href="#o#{dob.ocn}" class="lnkocn">#{dob.ocn}</a></label>
+ <h1 class="norm" id="o#{dob.ocn}">
+ #{dob.obj}
+ </h1>
+ </div>
</div>
</body>
</html>}
@@ -1327,26 +1328,26 @@ output_epub_cont_seg.close
close
end
def open
- <<WOK
+ <<-WOK
<?xml version="1.0"?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN"
"http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
-WOK
+ WOK
end
def close
- <<WOK
+ <<-WOK
</ncx>
-WOK
+ WOK
end
def head_open
- <<WOK
+ <<-WOK
<head>
-WOK
+ WOK
end
def head
depth=@md.lvs[1] + @md.lvs[2] + @md.lvs[3] + @md.lvs[4]
- <<WOK
+ <<-WOK
<!-- four required metadata items (for all NCX documents,
(including the relaxed constraints of OPS 2.0) -->
<title>#{@md.title.full} by #{@md.author}</title>
@@ -1356,67 +1357,68 @@ WOK
<meta name="dtb:depth" content="#{depth}" />
<meta name="dtb:totalPageCount" content="0" />
<meta name="dtb:maxPageNumber" content="0" />
-WOK
+ WOK
end
def head_close
- <<WOK
+ <<-WOK
</head>
-WOK
+ WOK
end
def doc_title
- <<WOK
+ <<-WOK
<docTitle>
<text>#{@md.title.full}</text>
</docTitle>
-WOK
+ WOK
end
def doc_author
- <<WOK
+ <<-WOK
<docAuthor>
<text>#{@md.author}</text>
</docAuthor>
-WOK
+ WOK
end
def navmap_open
- <<WOK
+ <<-WOK
<navMap>
-WOK
+ WOK
end
def navmap_sisu_toc(no)
id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \
? ''
: "-#{no}"
- <<WOK
+ <<-WOK
<navPoint id="navpoint#{id_u}" playOrder="#{no}">
<navLabel>
<text>Table of Contents</text>
</navLabel>
<content src="index#{Sfx[:epub_xhtml]}" />
</navPoint>
-WOK
+ WOK
end
- def navpoint(dob,no,name=nil)
- name=name ? name : dob.name
+ def navpoint(dob,no,fn_base,hashtag=nil)
+ fn=fn_base + Sfx[:epub_xhtml]
+ name=hashtag ? fn + hashtag : fn
id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \
? ''
: "-#{no}"
- <<WOK
+ <<-WOK
<navPoint id="navpoint#{id_u}" playOrder="#{no}">
<navLabel>
<text>#{dob.obj}</text>
</navLabel>
- <content src="#{name}#{Sfx[:epub_xhtml]}" />
-WOK
+ <content src="#{name}" />
+ WOK
end
def navpoint_close
- <<WOK
+ <<-WOK
</navPoint>
-WOK
+ WOK
end
def navmap_close
- <<WOK
+ <<-WOK
</navMap>
-WOK
+ WOK
end
self
end
@@ -1434,15 +1436,15 @@ WOK
package_close
end
def package_open
- <<WOK
+ <<-WOK
<?xml version='1.0' encoding='utf-8'?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="EPB-UUID" version="2.0">
-WOK
+ WOK
end
def package_close
- <<WOK
+ <<-WOK
</package>
-WOK
+ WOK
end
def metadata #metadata dc
cover_image=if defined? @md.make.cover_image \
@@ -1568,7 +1570,7 @@ WOK
else ''
end
f=SiSU_Env::FileOp.new(@md)
- <<WOK
+ <<-WOK
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:opf="http://www.idpf.org/2007/opf"
unique-identifier="urn:uuid:#{@md.dgst[1]}" version="2.0">
@@ -1578,38 +1580,39 @@ WOK
<dc:identifier id="bookid">urn:uuid:#{@md.dgst[1]}</dc:identifier>
<!-- <dc:identifier id="EPB-UUID">urn:uuid:#{@md.dgst[1]}</dc:identifier> -->
</metadata>
-WOK
+ WOK
end
def manifest_open
- <<WOK
+ <<-WOK
<manifest>
<!-- NCX -->
<item id="ncx" href="#{Ep[:f_ncx]}" media-type="application/x-dtbncx+xml" />
<!-- CSS Style Sheets -->
<item id="main-css" href="css/xhtml.css" media-type="text/css" />
<!-- Content Documents -->
-WOK
+ WOK
end
def manifest_content_sisu_toc
- <<WOK
- <item id="index" href="index.xhtml" media-type="application/xhtml+xml" />
-WOK
+ <<-WOK
+ <item id="index#{Sfx[:epub_xhtml]}" href="index#{Sfx[:epub_xhtml]}" media-type="application/xhtml+xml" />
+ 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
<item id="cover_image_file" href="cover_image#{Sfx[:epub_xhtml]}" media-type="application/xhtml+xml" />
-WOK
+ WOK
else ''
end
end
- def manifest_content(dob,name=nil)
- name=name ? name : dob.name
- <<WOK
- <item id="#{name}" href="#{name}#{Sfx[:epub_xhtml]}" media-type="application/xhtml+xml" />
-WOK
+ def manifest_content(dob,fn_base,hashtag=nil)
+ fn=fn_base + Sfx[:epub_xhtml]
+ name=hashtag ? fn + hashtag : fn
+ <<-WOK
+ <item id="#{name}" href="#{name}" media-type="application/xhtml+xml" />
+ 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 +1620,75 @@ WOK
imgs.each do |i|
image,type=/(\S+?)\.(png|jpg|gif)/.match(i)[1,2]
type=type.sub(/jpg/,'jpeg')
- images<<<<WOK
+ images<<<<-WOK
<item id="#{image}" href="image/#{image}.#{type}" media-type="image/#{type}" />
-WOK
+ WOK
end
images=images.join('')
images
end
def manifest_close
- <<WOK
+ <<-WOK
</manifest>
-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
<spine toc="ncx">
-WOK
+ WOK
end
def spine_cover_image
- <<WOK
+ <<-WOK
<itemref idref="cover_image_file" />
-WOK
+ WOK
end
def spine_sisu_toc
- <<WOK
- <itemref idref="index" linear="yes" />
-WOK
+ <<-WOK
+ <itemref idref="index#{Sfx[:epub_xhtml]}" linear="yes" />
+ WOK
end
- def spine(dob,name=nil)
- name=name ? name : dob.name
- <<WOK
+ def spine(dob,fn_base,hashtag=nil)
+ fn=fn_base + Sfx[:epub_xhtml]
+ name=hashtag ? fn + hashtag : fn
+ <<-WOK
<itemref idref="#{name}" linear="yes" />
-WOK
+ WOK
end
def spine_close
- <<WOK
+ <<-WOK
</spine>
-WOK
+ WOK
end
def guide_open
#guide: presentation order of XHTML files by reader).
- <<WOK
+ <<-WOK
<guide>
-WOK
+ WOK
end
def guide_cover_image
- <<WOK
+ <<-WOK
<reference type="cover" title="Cover of [book title]" href="cover_image#{Sfx[:epub_xhtml]}" />
-WOK
+ WOK
end
def guide_sisu_toc
- <<WOK
- <reference type="index" href="index#{Sfx[:epub_xhtml]}" />
-WOK
+ <<-WOK
+ <reference type="index#{Sfx[:epub_xhtml]}" href="index#{Sfx[:epub_xhtml]}" />
+ WOK
end
- def guide(dob,name=nil)
+ def guide(dob,fn_base,hashtag=nil)
+ fn=fn_base + Sfx[:epub_xhtml]
+ name=hashtag ? fn + hashtag : fn
name=name ? name : dob.name
- <<WOK
- <reference type="text" href="#{name}#{Sfx[:epub_xhtml]}" />
-WOK
+ guide_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml])
+ <<-WOK
+ <reference type="text" href="#{guide_name}" />
+ WOK
end
def guide_close
- <<WOK
+ <<-WOK
</guide>
-WOK
+ WOK
end
self
end
diff --git a/lib/sisu/v4/epub_tune.rb b/lib/sisu/v4/epub_tune.rb
index 85bf7a64..b64fd675 100644
--- a/lib/sisu/v4/epub_tune.rb
+++ b/lib/sisu/v4/epub_tune.rb
@@ -102,93 +102,6 @@ module SiSU_EPUB_Tune
end
str=str.gsub(/#{Mx[:gl_o]}(#[0-9]{3})#{Mx[:gl_c]}/u,'&\1;').
gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;').
- gsub(/\*/u,'&#042;'). # &#042;
- gsub(/\+/u,'&#043;'). # &#043;
- gsub(/¢/u,'&cent;'). # &#162;
- gsub(/£/u,'&pound;'). # &#163;
- gsub(/¥/u,'&yen;'). # &#165;
- gsub(/§/u,'&sect;'). # &#167;
- gsub(/©/u,'&copy;'). # &#169;
- gsub(/ª/u,'&ordf;'). # &#170;
- gsub(/«/u,'&laquo;'). # &#171;
- gsub(/®/u,'&reg;'). # &#174;
- gsub(/°/u,'&deg;'). # &#176;
- gsub(/±/u,'&plusmn;'). # &#177;
- gsub(/²/u,'&sup2;'). # &#178;
- gsub(/³/u,'&sup3;'). # &#179;
- gsub(/µ/u,'&micro;'). # &#181;
- gsub(/¶/u,'&para;'). # &#182;
- gsub(/¹/u,'&sup1;'). # &#185;
- gsub(/º/u,'&ordm;'). # &#186;
- gsub(/»/u,'&raquo;'). # &#187;
- gsub(/¼/u,'&frac14;'). # &#188;
- gsub(/½/u,'&frac12;'). # &#189;
- gsub(/¾/u,'&frac34;'). # &#190;
- gsub(/×/u,'&times;'). # &#215;
- gsub(/÷/u,'&divide;'). # &#247;
- gsub(/¿/u,'&iquest;'). # &#191;
- gsub(/À/u,'&Agrave;'). # &#192;
- gsub(/Á/u,'&Aacute;'). # &#193;
- gsub(/Â/u,'&Acirc;'). # &#194;
- gsub(/Ã/u,'&Atilde;'). # &#195;
- gsub(/Ä/u,'&Auml;'). # &#196;
- gsub(/Å/u,'&Aring;'). # &#197;
- gsub(/Æ/u,'&AElig;'). # &#198;
- gsub(/Ç/u,'&Ccedil;'). # &#199;
- gsub(/È/u,'&Egrave;'). # &#200;
- gsub(/É/u,'&Eacute;'). # &#201;
- gsub(/Ê/u,'&Ecirc;'). # &#202;
- gsub(/Ë/u,'&Euml;'). # &#203;
- gsub(/Ì/u,'&Igrave;'). # &#204;
- gsub(/Í/u,'&Iacute;'). # &#205;
- gsub(/Î/u,'&Icirc;'). # &#206;
- gsub(/Ï/u,'&Iuml;'). # &#207;
- gsub(/Ð/u,'&ETH;'). # &#208;
- gsub(/Ñ/u,'&Ntilde;'). # &#209;
- gsub(/Ò/u,'&Ograve;'). # &#210;
- gsub(/Ó/u,'&Oacute;'). # &#211;
- gsub(/Ô/u,'&Ocirc;'). # &#212;
- gsub(/Õ/u,'&Otilde;'). # &#213;
- gsub(/Ö/u,'&Ouml;'). # &#214;
- gsub(/Ø/u,'&Oslash;'). # &#216;
- gsub(/Ù/u,'&Ugrave;'). # &#217;
- gsub(/Ú/u,'&Uacute;'). # &#218;
- gsub(/Û/u,'&Ucirc;'). # &#219;
- gsub(/Ü/u,'&Uuml;'). # &#220;
- gsub(/Ý/u,'&Yacute;'). # &#221;
- gsub(/Þ/u,'&THORN;'). # &#222;
- gsub(/ß/u,'&szlig;'). # &#223;
- gsub(/à/u,'&agrave;'). # &#224;
- gsub(/á/u,'&aacute;'). # &#225;
- gsub(/â/u,'&acirc;'). # &#226;
- gsub(/ã/u,'&atilde;'). # &#227;
- gsub(/ä/u,'&auml;'). # &#228;
- gsub(/å/u,'&aring;'). # &#229;
- gsub(/æ/u,'&aelig;'). # &#230;
- gsub(/ç/u,'&ccedil;'). # &#231;
- gsub(/è/u,'&egrave;'). # &#232;
- gsub(/é/u,'&eacute;'). # &#233;
- gsub(/ê/u,'&ecirc;'). # &#234;
- gsub(/ë/u,'&euml;'). # &#235;
- gsub(/ì/u,'&igrave;'). # &#236;
- gsub(/í/u,'&iacute;'). # &#237;
- gsub(/î/u,'&icirc;'). # &#238;
- gsub(/ï/u,'&iuml;'). # &#239;
- gsub(/ð/u,'&eth;'). # &#240;
- gsub(/ñ/u,'&ntilde;'). # &#241;
- gsub(/ò/u,'&ograve;'). # &#242;
- gsub(/ó/u,'&oacute;'). # &#243;
- gsub(/ô/u,'&ocirc;'). # &#244;
- gsub(/õ/u,'&otilde;'). # &#245;
- gsub(/ö/u,'&ouml;'). # &#246;
- gsub(/ø/u,'&oslash;'). # &#248;
- gsub(/ù/u,'&ugrave;'). # &#250;
- gsub(/ú/u,'&uacute;'). # &#251;
- gsub(/û/u,'&ucirc;'). # &#252;
- gsub(/ü/u,'&uuml;'). # &#253;
- gsub(/þ/u,'&thorn;'). # &#254;
- gsub(/ÿ/u,'&yuml;'). # &#255;
- gsub(/ý/u,'&yacute;').
gsub(/<br>/u,'<br />').
gsub(/#{Mx[:nbsp]}/u,'&nbsp;')
end
diff --git a/lib/sisu/v4/html_tune.rb b/lib/sisu/v4/html_tune.rb
index 5196f046..92caec94 100644
--- a/lib/sisu/v4/html_tune.rb
+++ b/lib/sisu/v4/html_tune.rb
@@ -106,92 +106,7 @@ module SiSU_HTML_Tune
else html.obj
end
str=str.gsub(/#{Mx[:gl_o]}(#[0-9]{3})#{Mx[:gl_c]}/u,'&\1;').
- gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;').
- gsub(/¢/u,'&cent;'). # &#162;
- gsub(/£/u,'&pound;'). # &#163;
- gsub(/¥/u,'&yen;'). # &#165;
- gsub(/§/u,'&sect;'). # &#167;
- gsub(/©/u,'&copy;'). # &#169;
- gsub(/ª/u,'&ordf;'). # &#170;
- gsub(/«/u,'&laquo;'). # &#171;
- gsub(/®/u,'&reg;'). # &#174;
- gsub(/°/u,'&deg;'). # &#176;
- gsub(/±/u,'&plusmn;'). # &#177;
- gsub(/²/u,'&sup2;'). # &#178;
- gsub(/³/u,'&sup3;'). # &#179;
- gsub(/µ/u,'&micro;'). # &#181;
- gsub(/¶/u,'&para;'). # &#182;
- gsub(/¹/u,'&sup1;'). # &#185;
- gsub(/º/u,'&ordm;'). # &#186;
- gsub(/»/u,'&raquo;'). # &#187;
- gsub(/¼/u,'&frac14;'). # &#188;
- gsub(/½/u,'&frac12;'). # &#189;
- gsub(/¾/u,'&frac34;'). # &#190;
- gsub(/×/u,'&times;'). # &#215;
- gsub(/÷/u,'&divide;'). # &#247;
- gsub(/¿/u,'&iquest;'). # &#191;
- gsub(/À/u,'&Agrave;'). # &#192;
- gsub(/Á/u,'&Aacute;'). # &#193;
- gsub(/Â/u,'&Acirc;'). # &#194;
- gsub(/Ã/u,'&Atilde;'). # &#195;
- gsub(/Ä/u,'&Auml;'). # &#196;
- gsub(/Å/u,'&Aring;'). # &#197;
- gsub(/Æ/u,'&AElig;'). # &#198;
- gsub(/Ç/u,'&Ccedil;'). # &#199;
- gsub(/È/u,'&Egrave;'). # &#200;
- gsub(/É/u,'&Eacute;'). # &#201;
- gsub(/Ê/u,'&Ecirc;'). # &#202;
- gsub(/Ë/u,'&Euml;'). # &#203;
- gsub(/Ì/u,'&Igrave;'). # &#204;
- gsub(/Í/u,'&Iacute;'). # &#205;
- gsub(/Î/u,'&Icirc;'). # &#206;
- gsub(/Ï/u,'&Iuml;'). # &#207;
- gsub(/Ð/u,'&ETH;'). # &#208;
- gsub(/Ñ/u,'&Ntilde;'). # &#209;
- gsub(/Ò/u,'&Ograve;'). # &#210;
- gsub(/Ó/u,'&Oacute;'). # &#211;
- gsub(/Ô/u,'&Ocirc;'). # &#212;
- gsub(/Õ/u,'&Otilde;'). # &#213;
- gsub(/Ö/u,'&Ouml;'). # &#214;
- gsub(/Ø/u,'&Oslash;'). # &#216;
- gsub(/Ù/u,'&Ugrave;'). # &#217;
- gsub(/Ú/u,'&Uacute;'). # &#218;
- gsub(/Û/u,'&Ucirc;'). # &#219;
- gsub(/Ü/u,'&Uuml;'). # &#220;
- gsub(/Ý/u,'&Yacute;'). # &#221;
- gsub(/Þ/u,'&THORN;'). # &#222;
- gsub(/ß/u,'&szlig;'). # &#223;
- gsub(/à/u,'&agrave;'). # &#224;
- gsub(/á/u,'&aacute;'). # &#225;
- gsub(/â/u,'&acirc;'). # &#226;
- gsub(/ã/u,'&atilde;'). # &#227;
- gsub(/ä/u,'&auml;'). # &#228;
- gsub(/å/u,'&aring;'). # &#229;
- gsub(/æ/u,'&aelig;'). # &#230;
- gsub(/ç/u,'&ccedil;'). # &#231;
- gsub(/è/u,'&egrave;'). # &#232;
- gsub(/é/u,'&eacute;'). # &#233;
- gsub(/ê/u,'&ecirc;'). # &#234;
- gsub(/ë/u,'&euml;'). # &#235;
- gsub(/ì/u,'&igrave;'). # &#236;
- gsub(/í/u,'&iacute;'). # &#237;
- gsub(/î/u,'&icirc;'). # &#238;
- gsub(/ï/u,'&iuml;'). # &#239;
- gsub(/ð/u,'&eth;'). # &#240;
- gsub(/ñ/u,'&ntilde;'). # &#241;
- gsub(/ò/u,'&ograve;'). # &#242;
- gsub(/ó/u,'&oacute;'). # &#243;
- gsub(/ô/u,'&ocirc;'). # &#244;
- gsub(/õ/u,'&otilde;'). # &#245;
- gsub(/ö/u,'&ouml;'). # &#246;
- gsub(/ø/u,'&oslash;'). # &#248;
- gsub(/ù/u,'&ugrave;'). # &#250;
- gsub(/ú/u,'&uacute;'). # &#251;
- gsub(/û/u,'&ucirc;'). # &#252;
- gsub(/ü/u,'&uuml;'). # &#253;
- gsub(/þ/u,'&thorn;'). # &#254;
- gsub(/ÿ/u,'&yuml;'). # &#255;
- gsub(/ý/u,'&yacute;')
+ gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;')
end
end
class Tune
diff --git a/lib/sisu/v4/param.rb b/lib/sisu/v4/param.rb
index 916d89c1..bcbf9ce3 100644
--- a/lib/sisu/v4/param.rb
+++ b/lib/sisu/v4/param.rb
@@ -968,7 +968,7 @@ module SiSU_Param
sm_a,sm_b,sm_c=fns_array[0].match(/^(?:%\s+)?(?:SiSU\s+(?:master\s+)?|sisu-)([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?$/)[1..3]
sm_c ||=0
sv=(@opt.cmd =~/[VMv]/) ? ("SiSU version (#{@sisu_version[:version]})") : ''
- s_a,s_b,s_c=@sisu_version[:version].match(/^([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?(?:\-\S+)?$/)[1..3]
+ s_a,s_b,s_c=@sisu_version[:version].match(/^([0-9]+)?(?:\.([0-9]+))?(?:\.([0-9]+))?(?:[~-]\S+)?$/)[1..3]
tell=(@markup_version_declared.to_f==@markup_version.determined) \
? SiSU_Screen::Ansi.new(@opt.cmd,"Markup version (#{@markup_version.series} version #{@markup_version.determined})",sv)
: SiSU_Screen::Ansi.new(@opt.cmd,"Markup version declared (#{@markup_version_declared}), determined (#{@markup_version.series} version #{@markup_version.determined})",sv)
diff --git a/lib/sisu/v4/sysenv.rb b/lib/sisu/v4/sysenv.rb
index f54b3f26..2b36a222 100644
--- a/lib/sisu/v4/sysenv.rb
+++ b/lib/sisu/v4/sysenv.rb
@@ -1066,6 +1066,9 @@ module SiSU_Env
pt.split[-1].to_s
elsif output_dir_structure.by_filename?
''
+ else
+ puts SiSU_Debug::Mark.new(__LINE__,__FILE__).set(:fuschia)
+ puts 'set output type, by: language, filetype or filename'
end
@stub_set_manifest=stub + '/manifest'
end
diff --git a/lib/sisu/v4/texpdf_format.rb b/lib/sisu/v4/texpdf_format.rb
index fb569fca..e1dbcb18 100644
--- a/lib/sisu/v4/texpdf_format.rb
+++ b/lib/sisu/v4/texpdf_format.rb
@@ -1571,3 +1571,78 @@ WOK
end
end
__END__
+#ack usepackage texpdf*
+#ack usepackage texpdf* |ack '\{.+?\}'
+#see sisu_texpdf_usepackage.rb
+ alltt.sty
+ amssymb.sty
+ babel.sty
+ boites.sty
+ color.sty
+ endnotes.sty
+ fancyhdr.sty
+ fontspec.sty
+ footmisc.sty
+ graphicx.sty
+ inputenc.sty
+ listings.sty
+ longtable.sty
+ manyfoot.sty
+ multicol.sty
+ parskip.sty
+ polyglossia.sty
+ soul.sty
+ textcomp.sty
+ thumbpdf.sty
+ titlepic.sty
+ ucs.sty
+ ulem.sty
+ url.sty
+ xetex.sty
+ xltxtra.sty
+ xunicode.sty
+---
+texlive-latex-base
+texlive-base
+texlive-latex-extra
+texlive-latex-recommended
+texlive-xetex
+texlive-generic-recommended
+---
+texlive-latex-base:
+ /usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty
+ /usr/share/texlive/texmf-dist/tex/latex/base/alltt.sty
+ /usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
+ /usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty
+ /usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
+ /usr/share/texlive/texmf-dist/tex/latex/graphics/color.sty
+ /usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
+ /usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty
+ /usr/share/texlive/texmf-dist/tex/latex/tools/multicol.sty
+---
+texlive-base:
+ /usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty
+---
+texlive-latex-extra:
+ /usr/share/texlive/texmf-dist/tex/latex/boites/boites.sty
+ /usr/share/texlive/texmf-dist/tex/latex/endnotes/endnotes.sty
+ /usr/share/texlive/texmf-dist/tex/latex/footmisc/footmisc.sty
+ /usr/share/texlive/texmf-dist/tex/latex/ncctools/manyfoot.sty
+ /usr/share/texlive/texmf-dist/tex/latex/soul/soul.sty
+ /usr/share/texlive/texmf-dist/tex/latex/titlepic/titlepic.sty
+ /usr/share/texlive/texmf-dist/tex/latex/ucs/ucs.sty
+---
+texlive-latex-recommended:
+ /usr/share/texlive/texmf-dist/tex/generic/thumbpdf/thumbpdf.sty
+ /usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
+ /usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty
+ /usr/share/texlive/texmf-dist/tex/latex/parskip/parskip.sty
+ /usr/share/texlive/texmf-dist/tex/latex/url/url.sty
+---
+texlive-xetex:
+ /usr/share/texlive/texmf-dist/tex/latex/xltxtra/xltxtra.sty
+ /usr/share/texlive/texmf-dist/tex/xelatex/polyglossia/polyglossia.sty
+ /usr/share/texlive/texmf-dist/tex/xelatex/xunicode/xunicode.sty
+---
+texlive-generic-recommended:
+ /usr/share/texlive/texmf-dist/tex/generic/ulem/ulem.sty