From 74e8462c92f39508c0af0d3c243cf1219cf9d3a3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Jan 2013 23:14:53 -0500 Subject: v4 (v3): 4.0.2 (3.3.5) version & changelog --- data/doc/sisu/CHANGELOG_v3 | 7 +++++++ data/doc/sisu/CHANGELOG_v4 | 10 +++++++++- data/sisu/v3/v/version.yml | 6 +++--- data/sisu/v4/v/version.yml | 6 +++--- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 86b18d42..e76c1f8c 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -29,6 +29,13 @@ v1 branch is removed; it is available in sisu =< 2.7 %% Reverse Chronological: +%% 3.3.5.orig.tar.xz (2013-01-23:03/3) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_3.3.5 +http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.5.orig.tar.xz + sisu_3.3.5.orig.tar.xz + sisu_3.3.5-1.dsc + sisu_3.3.5-1.debian.tar.gz + %% 3.3.4.orig.tar.xz (2013-01-01:00/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_3.3.4 http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.4.orig.tar.xz diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 104c824c..9761e082 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -1,5 +1,5 @@ %% SiSU version 4 -v4 branch supersedes & replaces v3 branch +v4 stable branch supersedes & replaces v3 branch initial goals: * remove/retire "skins"; replace some functionality with headers and/or yml file (consider header like syntax for document and site appearance info) @@ -17,6 +17,14 @@ v2 branch is removed; it is available in sisu =< 3.3.2 %% Reverse Chronological: +%% 4.0.2.orig.tar.xz (2013-01-23:03/3) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.2 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.0.2-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.2.orig.tar.xz + sisu_4.0.2.orig.tar.xz + sisu_4.0.2-1.dsc + sisu_4.0.2-1.debian.tar.gz + %% 4.0.1.orig.tar.xz (2013-01-01:00/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.1 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.0.1-1 diff --git a/data/sisu/v3/v/version.yml b/data/sisu/v3/v/version.yml index e2927f10..db15c4ed 100644 --- a/data/sisu/v3/v/version.yml +++ b/data/sisu/v3/v/version.yml @@ -1,5 +1,5 @@ --- -:version: 3.3.4 -:date_stamp: 2013w00/2 -:date: "2013-01-01" +:version: 3.3.5 +:date_stamp: 2013w03/3 +:date: "2013-01-23" :project: SiSU diff --git a/data/sisu/v4/v/version.yml b/data/sisu/v4/v/version.yml index 2e6cdf1b..bc7ac30a 100644 --- a/data/sisu/v4/v/version.yml +++ b/data/sisu/v4/v/version.yml @@ -1,5 +1,5 @@ --- -:version: 4.0.1 -:date_stamp: 2013w00/2 -:date: "2013-01-01" +:version: 4.0.2 +:date_stamp: 2013w03/3 +:date: "2013-01-23" :project: SiSU -- cgit v1.2.3 From ad3483a9ffaf021101d10daffb9c737de1895034 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Jan 2013 23:17:58 -0500 Subject: v4 v3: texpdf_format, list of .sty files (& their texlive source within Debian) * not part of code (relevant for packaging) --- data/doc/sisu/CHANGELOG_v3 | 4 +++ data/doc/sisu/CHANGELOG_v4 | 4 +++ lib/sisu/v3/texpdf_format.rb | 75 ++++++++++++++++++++++++++++++++++++++++++++ lib/sisu/v4/texpdf_format.rb | 75 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 158 insertions(+) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index e76c1f8c..98d51729 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -36,6 +36,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.5.orig.tar.xz sisu_3.3.5-1.dsc sisu_3.3.5-1.debian.tar.gz +* v3: texpdf_format + * list of .sty files (and their texlive source within Debian) + [not part of code] + %% 3.3.4.orig.tar.xz (2013-01-01:00/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_3.3.4 http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.4.orig.tar.xz diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 9761e082..455b7be4 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -25,6 +25,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.2.orig.tar.xz sisu_4.0.2-1.dsc sisu_4.0.2-1.debian.tar.gz +* v4: texpdf_format + * list of .sty files (and their texlive source within Debian) + [not part of code] + %% 4.0.1.orig.tar.xz (2013-01-01:00/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.1 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.0.1-1 diff --git a/lib/sisu/v3/texpdf_format.rb b/lib/sisu/v3/texpdf_format.rb index 9d896f34..e1915d92 100644 --- a/lib/sisu/v3/texpdf_format.rb +++ b/lib/sisu/v3/texpdf_format.rb @@ -1577,3 +1577,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 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 -- cgit v1.2.3 From 7363e25d0952188795904d0e7a738a7adbff2b4a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Jan 2013 23:22:32 -0500 Subject: v4 v3: param, match possible sisu versions, detail --- data/doc/sisu/CHANGELOG_v3 | 2 ++ data/doc/sisu/CHANGELOG_v4 | 2 ++ lib/sisu/v3/param.rb | 2 +- lib/sisu/v4/param.rb | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 98d51729..471f7f39 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -40,6 +40,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.5.orig.tar.xz * list of .sty files (and their texlive source within Debian) [not part of code] +* v3: param, match possible sisu version, detail + %% 3.3.4.orig.tar.xz (2013-01-01:00/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_3.3.4 http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.4.orig.tar.xz diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 455b7be4..c067cf5d 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -29,6 +29,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.2.orig.tar.xz * list of .sty files (and their texlive source within Debian) [not part of code] +* v4: param, match possible sisu version, detail + %% 4.0.1.orig.tar.xz (2013-01-01:00/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.1 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.0.1-1 diff --git a/lib/sisu/v3/param.rb b/lib/sisu/v3/param.rb index c4befa26..0212c500 100644 --- a/lib/sisu/v3/param.rb +++ b/lib/sisu/v3/param.rb @@ -1169,7 +1169,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/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) -- cgit v1.2.3 From 6bc96aaedfc25c3bf3091868c31484e32b2e12cf Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Jan 2013 23:24:57 -0500 Subject: v4: sysenv, debug tag, triggered where output type not set --- data/doc/sisu/CHANGELOG_v4 | 2 ++ lib/sisu/v4/sysenv.rb | 3 +++ 2 files changed, 5 insertions(+) diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index c067cf5d..6814cdcf 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -31,6 +31,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.2.orig.tar.xz * v4: param, match possible sisu version, detail +* v4: sysenv, debug tag, triggered where output type not set + %% 4.0.1.orig.tar.xz (2013-01-01:00/2) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_4.0.1 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_4.0.1-1 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 -- cgit v1.2.3 From edbb402e1f060edab79e2a562efe49866163be23 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Jan 2013 23:26:13 -0500 Subject: v4 v3: dal_doc_objects, cosmetic, code arrangement, minor --- lib/sisu/v3/dal_doc_objects.rb | 6 ++++-- lib/sisu/v4/dal_doc_objects.rb | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/sisu/v3/dal_doc_objects.rb b/lib/sisu/v3/dal_doc_objects.rb index 70a4913d..37dfdcd3 100644 --- a/lib/sisu/v3/dal_doc_objects.rb +++ b/lib/sisu/v3/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/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 -- cgit v1.2.3 From dc62435254863fe25a39092c6fc94f5468cefbb6 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Jan 2013 23:35:02 -0500 Subject: v4 v3: epub_tune html_tune, remove unnecessary conversion of some utf-8 chars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * epub, fix, messed up table of contents, toc.ncx [bug reported by Mikael Böök] --- data/doc/sisu/CHANGELOG_v3 | 9 +++++ data/doc/sisu/CHANGELOG_v4 | 9 +++++ lib/sisu/v3/epub_tune.rb | 87 ---------------------------------------------- lib/sisu/v3/html_tune.rb | 87 +--------------------------------------------- lib/sisu/v4/epub_tune.rb | 87 ---------------------------------------------- lib/sisu/v4/html_tune.rb | 87 +--------------------------------------------- 6 files changed, 20 insertions(+), 346 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 471f7f39..e27bb0e3 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -36,6 +36,15 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.5.orig.tar.xz sisu_3.3.5-1.dsc sisu_3.3.5-1.debian.tar.gz +* v3: epub + * remove unnecessary conversion of some utf-8 characters to xhtml + representation; fix as messed up table of contents, toc.ncx + (e.g. in calibre) [bug reported by Mikael Böök] + +* v3: html + * remove unnecessary conversion of some utf-8 characters to html + representation + * v3: texpdf_format * list of .sty files (and their texlive source within Debian) [not part of code] diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 6814cdcf..a41ea6b7 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -25,6 +25,15 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.2.orig.tar.xz sisu_4.0.2-1.dsc sisu_4.0.2-1.debian.tar.gz +* v4: epub + * remove unnecessary conversion of some utf-8 characters to xhtml + representation; fix as messed up table of contents, toc.ncx + (e.g. in calibre) [bug reported by Mikael Böök] + +* v4: html + * remove unnecessary conversion of some utf-8 characters to html + representation + * v4: texpdf_format * list of .sty files (and their texlive source within Debian) [not part of code] diff --git a/lib/sisu/v3/epub_tune.rb b/lib/sisu/v3/epub_tune.rb index 89e30150..7bcfe03e 100644 --- a/lib/sisu/v3/epub_tune.rb +++ b/lib/sisu/v3/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,'*'). # * - gsub(/\+/u,'+'). # + - gsub(/¢/u,'¢'). # ¢ - gsub(/£/u,'£'). # £ - gsub(/¥/u,'¥'). # ¥ - gsub(/§/u,'§'). # § - gsub(/©/u,'©'). # © - gsub(/ª/u,'ª'). # ª - gsub(/«/u,'«'). # « - gsub(/®/u,'®'). # ® - gsub(/°/u,'°'). # ° - gsub(/±/u,'±'). # ± - gsub(/²/u,'²'). # ² - gsub(/³/u,'³'). # ³ - gsub(/µ/u,'µ'). # µ - gsub(/¶/u,'¶'). # ¶ - gsub(/¹/u,'¹'). # ¹ - gsub(/º/u,'º'). # º - gsub(/»/u,'»'). # » - gsub(/¼/u,'¼'). # ¼ - gsub(/½/u,'½'). # ½ - gsub(/¾/u,'¾'). # ¾ - gsub(/×/u,'×'). # × - gsub(/÷/u,'÷'). # ÷ - gsub(/¿/u,'¿'). # ¿ - gsub(/À/u,'À'). # À - gsub(/Á/u,'Á'). # Á - gsub(/Â/u,'Â'). # Â - gsub(/Ã/u,'Ã'). # Ã - gsub(/Ä/u,'Ä'). # Ä - gsub(/Å/u,'Å'). # Å - gsub(/Æ/u,'Æ'). # Æ - gsub(/Ç/u,'Ç'). # Ç - gsub(/È/u,'È'). # È - gsub(/É/u,'É'). # É - gsub(/Ê/u,'Ê'). # Ê - gsub(/Ë/u,'Ë'). # Ë - gsub(/Ì/u,'Ì'). # Ì - gsub(/Í/u,'Í'). # Í - gsub(/Î/u,'Î'). # Î - gsub(/Ï/u,'Ï'). # Ï - gsub(/Ð/u,'Ð'). # Ð - gsub(/Ñ/u,'Ñ'). # Ñ - gsub(/Ò/u,'Ò'). # Ò - gsub(/Ó/u,'Ó'). # Ó - gsub(/Ô/u,'Ô'). # Ô - gsub(/Õ/u,'Õ'). # Õ - gsub(/Ö/u,'Ö'). # Ö - gsub(/Ø/u,'Ø'). # Ø - gsub(/Ù/u,'Ù'). # Ù - gsub(/Ú/u,'Ú'). # Ú - gsub(/Û/u,'Û'). # Û - gsub(/Ü/u,'Ü'). # Ü - gsub(/Ý/u,'Ý'). # Ý - gsub(/Þ/u,'Þ'). # Þ - gsub(/ß/u,'ß'). # ß - gsub(/à/u,'à'). # à - gsub(/á/u,'á'). # á - gsub(/â/u,'â'). # â - gsub(/ã/u,'ã'). # ã - gsub(/ä/u,'ä'). # ä - gsub(/å/u,'å'). # å - gsub(/æ/u,'æ'). # æ - gsub(/ç/u,'ç'). # ç - gsub(/è/u,'è'). # è - gsub(/é/u,'é'). # é - gsub(/ê/u,'ê'). # ê - gsub(/ë/u,'ë'). # ë - gsub(/ì/u,'ì'). # ì - gsub(/í/u,'í'). # í - gsub(/î/u,'î'). # î - gsub(/ï/u,'ï'). # ï - gsub(/ð/u,'ð'). # ð - gsub(/ñ/u,'ñ'). # ñ - gsub(/ò/u,'ò'). # ò - gsub(/ó/u,'ó'). # ó - gsub(/ô/u,'ô'). # ô - gsub(/õ/u,'õ'). # õ - gsub(/ö/u,'ö'). # ö - gsub(/ø/u,'ø'). # ø - gsub(/ù/u,'ù'). # ú - gsub(/ú/u,'ú'). # û - gsub(/û/u,'û'). # ü - gsub(/ü/u,'ü'). # ý - gsub(/þ/u,'þ'). # þ - gsub(/ÿ/u,'ÿ'). # ÿ - gsub(/ý/u,'ý'). gsub(/
/u,'
'). gsub(/#{Mx[:nbsp]}/u,' ') end diff --git a/lib/sisu/v3/html_tune.rb b/lib/sisu/v3/html_tune.rb index 41c6e24d..81969961 100644 --- a/lib/sisu/v3/html_tune.rb +++ b/lib/sisu/v3/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,'¢'). # ¢ - gsub(/£/u,'£'). # £ - gsub(/¥/u,'¥'). # ¥ - gsub(/§/u,'§'). # § - gsub(/©/u,'©'). # © - gsub(/ª/u,'ª'). # ª - gsub(/«/u,'«'). # « - gsub(/®/u,'®'). # ® - gsub(/°/u,'°'). # ° - gsub(/±/u,'±'). # ± - gsub(/²/u,'²'). # ² - gsub(/³/u,'³'). # ³ - gsub(/µ/u,'µ'). # µ - gsub(/¶/u,'¶'). # ¶ - gsub(/¹/u,'¹'). # ¹ - gsub(/º/u,'º'). # º - gsub(/»/u,'»'). # » - gsub(/¼/u,'¼'). # ¼ - gsub(/½/u,'½'). # ½ - gsub(/¾/u,'¾'). # ¾ - gsub(/×/u,'×'). # × - gsub(/÷/u,'÷'). # ÷ - gsub(/¿/u,'¿'). # ¿ - gsub(/À/u,'À'). # À - gsub(/Á/u,'Á'). # Á - gsub(/Â/u,'Â'). # Â - gsub(/Ã/u,'Ã'). # Ã - gsub(/Ä/u,'Ä'). # Ä - gsub(/Å/u,'Å'). # Å - gsub(/Æ/u,'Æ'). # Æ - gsub(/Ç/u,'Ç'). # Ç - gsub(/È/u,'È'). # È - gsub(/É/u,'É'). # É - gsub(/Ê/u,'Ê'). # Ê - gsub(/Ë/u,'Ë'). # Ë - gsub(/Ì/u,'Ì'). # Ì - gsub(/Í/u,'Í'). # Í - gsub(/Î/u,'Î'). # Î - gsub(/Ï/u,'Ï'). # Ï - gsub(/Ð/u,'Ð'). # Ð - gsub(/Ñ/u,'Ñ'). # Ñ - gsub(/Ò/u,'Ò'). # Ò - gsub(/Ó/u,'Ó'). # Ó - gsub(/Ô/u,'Ô'). # Ô - gsub(/Õ/u,'Õ'). # Õ - gsub(/Ö/u,'Ö'). # Ö - gsub(/Ø/u,'Ø'). # Ø - gsub(/Ù/u,'Ù'). # Ù - gsub(/Ú/u,'Ú'). # Ú - gsub(/Û/u,'Û'). # Û - gsub(/Ü/u,'Ü'). # Ü - gsub(/Ý/u,'Ý'). # Ý - gsub(/Þ/u,'Þ'). # Þ - gsub(/ß/u,'ß'). # ß - gsub(/à/u,'à'). # à - gsub(/á/u,'á'). # á - gsub(/â/u,'â'). # â - gsub(/ã/u,'ã'). # ã - gsub(/ä/u,'ä'). # ä - gsub(/å/u,'å'). # å - gsub(/æ/u,'æ'). # æ - gsub(/ç/u,'ç'). # ç - gsub(/è/u,'è'). # è - gsub(/é/u,'é'). # é - gsub(/ê/u,'ê'). # ê - gsub(/ë/u,'ë'). # ë - gsub(/ì/u,'ì'). # ì - gsub(/í/u,'í'). # í - gsub(/î/u,'î'). # î - gsub(/ï/u,'ï'). # ï - gsub(/ð/u,'ð'). # ð - gsub(/ñ/u,'ñ'). # ñ - gsub(/ò/u,'ò'). # ò - gsub(/ó/u,'ó'). # ó - gsub(/ô/u,'ô'). # ô - gsub(/õ/u,'õ'). # õ - gsub(/ö/u,'ö'). # ö - gsub(/ø/u,'ø'). # ø - gsub(/ù/u,'ù'). # ú - gsub(/ú/u,'ú'). # û - gsub(/û/u,'û'). # ü - gsub(/ü/u,'ü'). # ý - gsub(/þ/u,'þ'). # þ - gsub(/ÿ/u,'ÿ'). # ÿ - gsub(/ý/u,'ý') + gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;') end end class Tune 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,'*'). # * - gsub(/\+/u,'+'). # + - gsub(/¢/u,'¢'). # ¢ - gsub(/£/u,'£'). # £ - gsub(/¥/u,'¥'). # ¥ - gsub(/§/u,'§'). # § - gsub(/©/u,'©'). # © - gsub(/ª/u,'ª'). # ª - gsub(/«/u,'«'). # « - gsub(/®/u,'®'). # ® - gsub(/°/u,'°'). # ° - gsub(/±/u,'±'). # ± - gsub(/²/u,'²'). # ² - gsub(/³/u,'³'). # ³ - gsub(/µ/u,'µ'). # µ - gsub(/¶/u,'¶'). # ¶ - gsub(/¹/u,'¹'). # ¹ - gsub(/º/u,'º'). # º - gsub(/»/u,'»'). # » - gsub(/¼/u,'¼'). # ¼ - gsub(/½/u,'½'). # ½ - gsub(/¾/u,'¾'). # ¾ - gsub(/×/u,'×'). # × - gsub(/÷/u,'÷'). # ÷ - gsub(/¿/u,'¿'). # ¿ - gsub(/À/u,'À'). # À - gsub(/Á/u,'Á'). # Á - gsub(/Â/u,'Â'). # Â - gsub(/Ã/u,'Ã'). # Ã - gsub(/Ä/u,'Ä'). # Ä - gsub(/Å/u,'Å'). # Å - gsub(/Æ/u,'Æ'). # Æ - gsub(/Ç/u,'Ç'). # Ç - gsub(/È/u,'È'). # È - gsub(/É/u,'É'). # É - gsub(/Ê/u,'Ê'). # Ê - gsub(/Ë/u,'Ë'). # Ë - gsub(/Ì/u,'Ì'). # Ì - gsub(/Í/u,'Í'). # Í - gsub(/Î/u,'Î'). # Î - gsub(/Ï/u,'Ï'). # Ï - gsub(/Ð/u,'Ð'). # Ð - gsub(/Ñ/u,'Ñ'). # Ñ - gsub(/Ò/u,'Ò'). # Ò - gsub(/Ó/u,'Ó'). # Ó - gsub(/Ô/u,'Ô'). # Ô - gsub(/Õ/u,'Õ'). # Õ - gsub(/Ö/u,'Ö'). # Ö - gsub(/Ø/u,'Ø'). # Ø - gsub(/Ù/u,'Ù'). # Ù - gsub(/Ú/u,'Ú'). # Ú - gsub(/Û/u,'Û'). # Û - gsub(/Ü/u,'Ü'). # Ü - gsub(/Ý/u,'Ý'). # Ý - gsub(/Þ/u,'Þ'). # Þ - gsub(/ß/u,'ß'). # ß - gsub(/à/u,'à'). # à - gsub(/á/u,'á'). # á - gsub(/â/u,'â'). # â - gsub(/ã/u,'ã'). # ã - gsub(/ä/u,'ä'). # ä - gsub(/å/u,'å'). # å - gsub(/æ/u,'æ'). # æ - gsub(/ç/u,'ç'). # ç - gsub(/è/u,'è'). # è - gsub(/é/u,'é'). # é - gsub(/ê/u,'ê'). # ê - gsub(/ë/u,'ë'). # ë - gsub(/ì/u,'ì'). # ì - gsub(/í/u,'í'). # í - gsub(/î/u,'î'). # î - gsub(/ï/u,'ï'). # ï - gsub(/ð/u,'ð'). # ð - gsub(/ñ/u,'ñ'). # ñ - gsub(/ò/u,'ò'). # ò - gsub(/ó/u,'ó'). # ó - gsub(/ô/u,'ô'). # ô - gsub(/õ/u,'õ'). # õ - gsub(/ö/u,'ö'). # ö - gsub(/ø/u,'ø'). # ø - gsub(/ù/u,'ù'). # ú - gsub(/ú/u,'ú'). # û - gsub(/û/u,'û'). # ü - gsub(/ü/u,'ü'). # ý - gsub(/þ/u,'þ'). # þ - gsub(/ÿ/u,'ÿ'). # ÿ - gsub(/ý/u,'ý'). gsub(/
/u,'
'). gsub(/#{Mx[:nbsp]}/u,' ') 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,'¢'). # ¢ - gsub(/£/u,'£'). # £ - gsub(/¥/u,'¥'). # ¥ - gsub(/§/u,'§'). # § - gsub(/©/u,'©'). # © - gsub(/ª/u,'ª'). # ª - gsub(/«/u,'«'). # « - gsub(/®/u,'®'). # ® - gsub(/°/u,'°'). # ° - gsub(/±/u,'±'). # ± - gsub(/²/u,'²'). # ² - gsub(/³/u,'³'). # ³ - gsub(/µ/u,'µ'). # µ - gsub(/¶/u,'¶'). # ¶ - gsub(/¹/u,'¹'). # ¹ - gsub(/º/u,'º'). # º - gsub(/»/u,'»'). # » - gsub(/¼/u,'¼'). # ¼ - gsub(/½/u,'½'). # ½ - gsub(/¾/u,'¾'). # ¾ - gsub(/×/u,'×'). # × - gsub(/÷/u,'÷'). # ÷ - gsub(/¿/u,'¿'). # ¿ - gsub(/À/u,'À'). # À - gsub(/Á/u,'Á'). # Á - gsub(/Â/u,'Â'). # Â - gsub(/Ã/u,'Ã'). # Ã - gsub(/Ä/u,'Ä'). # Ä - gsub(/Å/u,'Å'). # Å - gsub(/Æ/u,'Æ'). # Æ - gsub(/Ç/u,'Ç'). # Ç - gsub(/È/u,'È'). # È - gsub(/É/u,'É'). # É - gsub(/Ê/u,'Ê'). # Ê - gsub(/Ë/u,'Ë'). # Ë - gsub(/Ì/u,'Ì'). # Ì - gsub(/Í/u,'Í'). # Í - gsub(/Î/u,'Î'). # Î - gsub(/Ï/u,'Ï'). # Ï - gsub(/Ð/u,'Ð'). # Ð - gsub(/Ñ/u,'Ñ'). # Ñ - gsub(/Ò/u,'Ò'). # Ò - gsub(/Ó/u,'Ó'). # Ó - gsub(/Ô/u,'Ô'). # Ô - gsub(/Õ/u,'Õ'). # Õ - gsub(/Ö/u,'Ö'). # Ö - gsub(/Ø/u,'Ø'). # Ø - gsub(/Ù/u,'Ù'). # Ù - gsub(/Ú/u,'Ú'). # Ú - gsub(/Û/u,'Û'). # Û - gsub(/Ü/u,'Ü'). # Ü - gsub(/Ý/u,'Ý'). # Ý - gsub(/Þ/u,'Þ'). # Þ - gsub(/ß/u,'ß'). # ß - gsub(/à/u,'à'). # à - gsub(/á/u,'á'). # á - gsub(/â/u,'â'). # â - gsub(/ã/u,'ã'). # ã - gsub(/ä/u,'ä'). # ä - gsub(/å/u,'å'). # å - gsub(/æ/u,'æ'). # æ - gsub(/ç/u,'ç'). # ç - gsub(/è/u,'è'). # è - gsub(/é/u,'é'). # é - gsub(/ê/u,'ê'). # ê - gsub(/ë/u,'ë'). # ë - gsub(/ì/u,'ì'). # ì - gsub(/í/u,'í'). # í - gsub(/î/u,'î'). # î - gsub(/ï/u,'ï'). # ï - gsub(/ð/u,'ð'). # ð - gsub(/ñ/u,'ñ'). # ñ - gsub(/ò/u,'ò'). # ò - gsub(/ó/u,'ó'). # ó - gsub(/ô/u,'ô'). # ô - gsub(/õ/u,'õ'). # õ - gsub(/ö/u,'ö'). # ö - gsub(/ø/u,'ø'). # ø - gsub(/ù/u,'ù'). # ú - gsub(/ú/u,'ú'). # û - gsub(/û/u,'û'). # ü - gsub(/ü/u,'ü'). # ý - gsub(/þ/u,'þ'). # þ - gsub(/ÿ/u,'ÿ'). # ÿ - gsub(/ý/u,'ý') + gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;') end end class Tune -- cgit v1.2.3 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 --- data/doc/sisu/CHANGELOG_v3 | 1 + data/doc/sisu/CHANGELOG_v4 | 1 + lib/sisu/v3/epub_format.rb | 134 ++++++++++++++++++++-------------------- lib/sisu/v4/epub_format.rb | 148 ++++++++++++++++++++++----------------------- 4 files changed, 143 insertions(+), 141 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index e27bb0e3..c5f2af8e 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -40,6 +40,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.5.orig.tar.xz * remove unnecessary conversion of some utf-8 characters to xhtml representation; fix as messed up table of contents, toc.ncx (e.g. in calibre) [bug reported by Mikael Böök] + * cosmetic arrangement of code <<-WOK * v3: html * remove unnecessary conversion of some utf-8 characters to html diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index a41ea6b7..5a48ff9a 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -29,6 +29,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.2.orig.tar.xz * remove unnecessary conversion of some utf-8 characters to xhtml representation; fix as messed up table of contents, toc.ncx (e.g. in calibre) [bug reported by Mikael Böök] + * cosmetic arrangement of code <<-WOK * v4: html * remove unnecessary conversion of some utf-8 characters to html 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 From 7cc6d871a955444cb5c265f48d6310319ba08731 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Jan 2013 23:44:10 -0500 Subject: v4 v3: xhtml structure error, fix missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [bug reported by Mikael Böök] * fix of additional detail --- data/doc/sisu/CHANGELOG_v3 | 2 ++ data/doc/sisu/CHANGELOG_v4 | 2 ++ lib/sisu/v3/epub_format.rb | 11 ++++++----- lib/sisu/v4/epub_format.rb | 11 ++++++----- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index c5f2af8e..63731b1f 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -41,6 +41,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.5.orig.tar.xz representation; fix as messed up table of contents, toc.ncx (e.g. in calibre) [bug reported by Mikael Böök] * cosmetic arrangement of code <<-WOK + * xhtml structure error, fix missing + [bug reported by Mikael Böök] (fix of additional detail) * v3: html * remove unnecessary conversion of some utf-8 characters to html diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 5a48ff9a..1e253373 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -30,6 +30,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.2.orig.tar.xz representation; fix as messed up table of contents, toc.ncx (e.g. in calibre) [bug reported by Mikael Böök] * cosmetic arrangement of code <<-WOK + * xhtml structure error, fix missing + [bug reported by Mikael Böök] (fix of additional detail) * v4: html * remove unnecessary conversion of some utf-8 characters to html diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb index 709351d8..ee5118e2 100644 --- a/lib/sisu/v3/epub_format.rb +++ b/lib/sisu/v3/epub_format.rb @@ -1303,11 +1303,12 @@ application/epub+zip #{@vz.color_body}
-
- -

- #{dob.obj} -

+
+ +

+ #{dob.obj} +

+
} diff --git a/lib/sisu/v4/epub_format.rb b/lib/sisu/v4/epub_format.rb index 14304139..60c40dea 100644 --- a/lib/sisu/v4/epub_format.rb +++ b/lib/sisu/v4/epub_format.rb @@ -1303,11 +1303,12 @@ application/epub+zip #{@vz.color_body}
-
- -

- #{dob.obj} -

+
+ +

+ #{dob.obj} +

+
} -- cgit v1.2.3 From ff824c5c3d36f278e3050b171293e04c22b7356e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Jan 2013 23:48:09 -0500 Subject: v4 v3: epub, epub_format, provide full depth epub table of contents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [request Mikael Böök] --- data/doc/sisu/CHANGELOG_v3 | 1 + data/doc/sisu/CHANGELOG_v4 | 1 + lib/sisu/v3/epub.rb | 48 +++++++++++++++++++---- lib/sisu/v3/epub_format.rb | 9 +++-- lib/sisu/v4/epub.rb | 95 +++++++++++++++++++++++++++++++--------------- lib/sisu/v4/epub_format.rb | 38 +++++++++++-------- 6 files changed, 135 insertions(+), 57 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 63731b1f..e3b717b8 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -40,6 +40,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.3.5.orig.tar.xz * remove unnecessary conversion of some utf-8 characters to xhtml representation; fix as messed up table of contents, toc.ncx (e.g. in calibre) [bug reported by Mikael Böök] + * provide full depth epub table of contents [request Mikael Böök] * cosmetic arrangement of code <<-WOK * xhtml structure error, fix missing
[bug reported by Mikael Böök] (fix of additional detail) diff --git a/data/doc/sisu/CHANGELOG_v4 b/data/doc/sisu/CHANGELOG_v4 index 1e253373..f5d9f44a 100644 --- a/data/doc/sisu/CHANGELOG_v4 +++ b/data/doc/sisu/CHANGELOG_v4 @@ -29,6 +29,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_4.0.2.orig.tar.xz * remove unnecessary conversion of some utf-8 characters to xhtml representation; fix as messed up table of contents, toc.ncx (e.g. in calibre) [bug reported by Mikael Böök] + * provide full depth epub table of contents [request Mikael Böök] * cosmetic arrangement of code <<-WOK * xhtml structure error, fix missing
[bug reported by Mikael Böök] (fix of additional detail) diff --git a/lib/sisu/v3/epub.rb b/lib/sisu/v3/epub.rb index c51a7656..fdb1398f 100644 --- a/lib/sisu/v3/epub.rb +++ b/lib/sisu/v3/epub.rb @@ -199,7 +199,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 @@ -228,11 +228,13 @@ module SiSU_EPUB name_s_a='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 + @ncxo[1],@ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,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 if @level_a_first_occurrence \ @@ -250,10 +252,12 @@ module SiSU_EPUB name_s_b='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 + @ncxo[2],@ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,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) @@ -265,9 +269,11 @@ module SiSU_EPUB name_s_c='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 + @ncxo[3],@ncxo[4],@ncxo[5],@ncxo[6]=true,false,false,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) @@ -277,15 +283,39 @@ module SiSU_EPUB when 4 @ncx_cls=[] @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 + @ncxo[4],@ncxo[5],@ncxo[6]=true,false,false @@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) 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=[] + name_lv5=@dob_name + '.xhtml' + '#o' + dob_toc.ocn.to_s + @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,name_lv5) if dob_toc + md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_lv5) + md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,name_lv5) + md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,name_lv5) + SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_5 + when 6 + @ncx_cls=[] + name_lv6=@dob_name + '.xhtml' + '#o' + dob_toc.ocn.to_s + @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,name_lv6) if dob_toc + md_opf_a_content << @epub.metadata_opf.manifest_content(dob_toc,name_lv6) + md_opf_a_spine << @epub.metadata_opf.spine(dob_toc,name_lv6) + md_opf_a_guide << @epub.metadata_opf.guide(dob_toc,name_lv6) + SiSU_EPUB::Source::Toc.new(@md,dob_toc).level_6 else nil end toc.each do |k,d| @@ -308,10 +338,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] << "\n" @@toc[:scr] << "\n" diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb index ee5118e2..38717359 100644 --- a/lib/sisu/v3/epub_format.rb +++ b/lib/sisu/v3/epub_format.rb @@ -1398,6 +1398,7 @@ output_epub_cont_seg.close end def navpoint(dob,no,name=nil) name=name ? name : dob.name + cont_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) id_u=DISABLE[:epub][:ncx_navpoint_unique_id] \ ? '' : "-#{no}" @@ -1406,7 +1407,7 @@ output_epub_cont_seg.close #{dob.obj} - + WOK end def navpoint_close @@ -1592,8 +1593,9 @@ output_epub_cont_seg.close end def manifest_content(dob,name=nil) name=name ? name : dob.name + href_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) <<-WOK - + WOK end def manifest_images(imgs) @@ -1648,8 +1650,9 @@ output_epub_cont_seg.close end def guide(dob,name=nil) name=name ? name : dob.name + guide_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) <<-WOK - + WOK end def guide_close 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] << "\n" @@toc[:scr] << "\n" diff --git a/lib/sisu/v4/epub_format.rb b/lib/sisu/v4/epub_format.rb index 60c40dea..84d32000 100644 --- a/lib/sisu/v4/epub_format.rb +++ b/lib/sisu/v4/epub_format.rb @@ -1287,10 +1287,10 @@ application/epub+zip 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} @@ -1396,8 +1396,9 @@ output_epub_cont_seg.close 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}" @@ -1593,7 +1594,7 @@ output_epub_cont_seg.close end def manifest_content_sisu_toc <<-WOK - + WOK end def manifest_cover_image_information(md) @@ -1606,10 +1607,11 @@ output_epub_cont_seg.close else '' end end - def manifest_content(dob,name=nil) - name=name ? name : dob.name + def manifest_content(dob,fn_base,hashtag=nil) + fn=fn_base + Sfx[:epub_xhtml] + name=hashtag ? fn + hashtag : fn <<-WOK - + WOK end def manifest_images(imgs) @@ -1643,11 +1645,12 @@ output_epub_cont_seg.close end def spine_sisu_toc <<-WOK - + WOK end - def spine(dob,name=nil) - name=name ? name : dob.name + def spine(dob,fn_base,hashtag=nil) + fn=fn_base + Sfx[:epub_xhtml] + name=hashtag ? fn + hashtag : fn <<-WOK WOK @@ -1670,13 +1673,16 @@ output_epub_cont_seg.close end def guide_sisu_toc <<-WOK - + 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 + guide_name=(name =~/#{Sfx[:epub_xhtml]}/) ? name : (name + Sfx[:epub_xhtml]) <<-WOK - + WOK end def guide_close -- cgit v1.2.3