From ec29e71378c31e5a43ea4ac163bbed5ac661fb14 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 5 Sep 2014 22:42:45 -0400 Subject: v5 v6: version & changelog --- data/doc/sisu/CHANGELOG_v5 | 7 +++++++ data/doc/sisu/CHANGELOG_v6 | 7 +++++++ data/sisu/v5/v/version.yml | 6 +++--- data/sisu/v6/v/version.yml | 6 +++--- setup/sisu_version.rb | 4 ++-- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 474da965..d72b1767 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -31,6 +31,13 @@ v2 branch is removed; it is available in sisu =< 3.3.2 %% Reverse Chronological: +%% 5.6.5.orig.tar.xz (2014-09-05:35/5) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.6.5 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.6.5-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.5.orig.tar.xz + sisu_5.6.5.orig.tar.xz + sisu_5.6.5-1.dsc + %% 5.6.4.orig.tar.xz (2014-09-01:35/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.6.4 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.6.4-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 29136e1f..5fba6a12 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -21,6 +21,13 @@ v2 branch is removed; it is available in sisu =< 3.3.2 %% Reverse Chronological: +%% 6.2.6.orig.tar.xz (2014-09-05:35/5) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.2.6 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.2.6-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.6.orig.tar.xz + sisu_6.2.6.orig.tar.xz + sisu_6.2.6-1.dsc + %% 6.2.5.orig.tar.xz (2014-09-01:35/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.2.5 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.2.5-1 diff --git a/data/sisu/v5/v/version.yml b/data/sisu/v5/v/version.yml index 2f531540..91755ba4 100644 --- a/data/sisu/v5/v/version.yml +++ b/data/sisu/v5/v/version.yml @@ -1,5 +1,5 @@ --- :project: SiSU -:version: 5.6.4 -:date_stamp: 2014w35/1 -:date: "2014-09-01" +:version: 5.6.5 +:date_stamp: 2014w35/5 +:date: "2014-09-05" diff --git a/data/sisu/v6/v/version.yml b/data/sisu/v6/v/version.yml index 0239fe45..a0164ff7 100644 --- a/data/sisu/v6/v/version.yml +++ b/data/sisu/v6/v/version.yml @@ -1,5 +1,5 @@ --- :project: SiSU -:version: 6.2.5 -:date_stamp: 2014w35/1 -:date: "2014-09-01" +:version: 6.2.6 +:date_stamp: 2014w35/5 +:date: "2014-09-05" diff --git a/setup/sisu_version.rb b/setup/sisu_version.rb index 768eb7db..5c1223d8 100644 --- a/setup/sisu_version.rb +++ b/setup/sisu_version.rb @@ -1,7 +1,7 @@ #% constants module SiSUversion - SiSU_version_next_stable = '5.6.4' #% set version stable current - SiSU_version_next_unstable = '6.2.5' #% set version unstable dev + SiSU_version_next_stable = '5.6.5' #% set version stable current + SiSU_version_next_unstable = '6.2.6' #% set version unstable dev #% qi quick install file SiSU_version_generic_next_stable = '5.4.x' SiSU_version_generic_next_unstable = '6.0.x' -- cgit v1.2.3 From 94cf89b09cfd60a87d096926035aaec061a24c56 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 5 Sep 2014 22:45:07 -0400 Subject: v5 v6: link/path fixes * manifest, link where no "document harvest" * html, home button links url (remove slash) * harvest_authors, by_filetype, manifest path --- data/doc/sisu/CHANGELOG_v5 | 5 +++++ data/doc/sisu/CHANGELOG_v6 | 5 +++++ lib/sisu/v5/harvest_authors.rb | 4 ++-- lib/sisu/v5/html_format.rb | 2 +- lib/sisu/v5/manifest.rb | 2 +- lib/sisu/v6/harvest_authors.rb | 4 ++-- lib/sisu/v6/html_format.rb | 2 +- lib/sisu/v6/manifest.rb | 2 +- 8 files changed, 18 insertions(+), 8 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index d72b1767..089f9a5f 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,11 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.5.orig.tar.xz sisu_5.6.5.orig.tar.xz sisu_5.6.5-1.dsc +* link/path fixes, + * manifest, link where no "document harvest" + * html, home button links url (remove slash) + * harvest_authors, by_filetype, manifest path + %% 5.6.4.orig.tar.xz (2014-09-01:35/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.6.4 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.6.4-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 5fba6a12..2222fc85 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -28,6 +28,11 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.6.orig.tar.xz sisu_6.2.6.orig.tar.xz sisu_6.2.6-1.dsc +* link/path fixes, + * manifest, link where no "document harvest" + * html, home button links url (remove slash) + * harvest_authors, by_filetype, manifest path + %% 6.2.5.orig.tar.xz (2014-09-01:35/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.2.5 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.2.5-1 diff --git a/lib/sisu/v5/harvest_authors.rb b/lib/sisu/v5/harvest_authors.rb index 26a0a9e3..c43733ee 100644 --- a/lib/sisu/v5/harvest_authors.rb +++ b/lib/sisu/v5/harvest_authors.rb @@ -433,9 +433,9 @@ WOK manifest_at=if @env.output_dir_structure.by? == :language i[:file] + Sfx[:html] elsif @env.output_dir_structure.by? == :filetype - i[:file] + '.' + lang_code_insert + Sfx[:html] + i[:file] + lang_code_insert + Sfx[:html] elsif @env.output_dir_structure.by? == :filename - "./#{i[:file]}/#{i[:page]}" + './' + i[:file] + '/' + i[:page] else '' #error end work=[ diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb index 7731464a..16120d88 100644 --- a/lib/sisu/v5/html_format.rb +++ b/lib/sisu/v5/html_format.rb @@ -198,7 +198,7 @@ module SiSU_HTML_Format button +=%{

home icon -->

\n} elsif @md.home_button_links.is_a?(Array) @md.home_button_links.each do |links| - button +=%{

\n #{links[:say]}\n

\n} + button +=%{

\n #{links[:say]}\n

\n} end end button +=%{ \n } diff --git a/lib/sisu/v5/manifest.rb b/lib/sisu/v5/manifest.rb index f19f8b38..b6c7bc63 100644 --- a/lib/sisu/v5/manifest.rb +++ b/lib/sisu/v5/manifest.rb @@ -947,7 +947,7 @@ WOK harvest=(FileTest.file?("#{pth_local}/authors#{@fn_lng}.html") \ && FileTest.file?("#{pth_local}/topics#{@fn_lng}.html")) \ ? %{

.: other document manifests: [authors] [topics] #{output_organised_by}

} - : %{

#{output_organised_by}

} + : %{

#{output_organised_by}

} manifest_title=%{

#{@translate.manifest_description}

#{harvest}} @manifest[:html] <<< diff --git a/lib/sisu/v6/harvest_authors.rb b/lib/sisu/v6/harvest_authors.rb index 762545c6..b27cf599 100644 --- a/lib/sisu/v6/harvest_authors.rb +++ b/lib/sisu/v6/harvest_authors.rb @@ -433,9 +433,9 @@ WOK manifest_at=if @env.output_dir_structure.by? == :language i[:file] + Sfx[:html] elsif @env.output_dir_structure.by? == :filetype - i[:file] + '.' + lang_code_insert + Sfx[:html] + i[:file] + lang_code_insert + Sfx[:html] elsif @env.output_dir_structure.by? == :filename - "./#{i[:file]}/#{i[:page]}" + './' + i[:file] + '/' + i[:page] else '' #error end work=[ diff --git a/lib/sisu/v6/html_format.rb b/lib/sisu/v6/html_format.rb index b2476719..febfc30e 100644 --- a/lib/sisu/v6/html_format.rb +++ b/lib/sisu/v6/html_format.rb @@ -198,7 +198,7 @@ module SiSU_HTML_Format button +=%{

home icon -->

\n} elsif @md.home_button_links.is_a?(Array) @md.home_button_links.each do |links| - button +=%{

\n #{links[:say]}\n

\n} + button +=%{

\n #{links[:say]}\n

\n} end end button +=%{ \n } diff --git a/lib/sisu/v6/manifest.rb b/lib/sisu/v6/manifest.rb index a0d4102f..5863ddb9 100644 --- a/lib/sisu/v6/manifest.rb +++ b/lib/sisu/v6/manifest.rb @@ -947,7 +947,7 @@ WOK harvest=(FileTest.file?("#{pth_local}/authors#{@fn_lng}.html") \ && FileTest.file?("#{pth_local}/topics#{@fn_lng}.html")) \ ? %{

.: other document manifests: [authors] [topics] #{output_organised_by}

} - : %{

#{output_organised_by}

} + : %{

#{output_organised_by}

} manifest_title=%{

#{@translate.manifest_description}

#{harvest}} @manifest[:html] <<< -- cgit v1.2.3 From 8422ce1dca74dcae385c1a14c16e038e83d68afc Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 5 Sep 2014 22:49:57 -0400 Subject: v5 v6: shared_metadata, requires xml_shared --- data/doc/sisu/CHANGELOG_v5 | 2 ++ data/doc/sisu/CHANGELOG_v6 | 2 ++ lib/sisu/v5/shared_metadata.rb | 1 + lib/sisu/v6/shared_metadata.rb | 1 + 4 files changed, 6 insertions(+) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 089f9a5f..17889091 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.5.orig.tar.xz sisu_5.6.5.orig.tar.xz sisu_5.6.5-1.dsc +* shared_metadata, requires xml_shared + * link/path fixes, * manifest, link where no "document harvest" * html, home button links url (remove slash) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 2222fc85..6c043373 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -28,6 +28,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.6.orig.tar.xz sisu_6.2.6.orig.tar.xz sisu_6.2.6-1.dsc +* shared_metadata, requires xml_shared + * link/path fixes, * manifest, link where no "document harvest" * html, home button links url (remove slash) diff --git a/lib/sisu/v5/shared_metadata.rb b/lib/sisu/v5/shared_metadata.rb index 1f21af3f..405e7939 100644 --- a/lib/sisu/v5/shared_metadata.rb +++ b/lib/sisu/v5/shared_metadata.rb @@ -61,6 +61,7 @@ =end module SiSU_Metadata + require_relative 'xml_shared' # xml_shared.rb class Summary attr_accessor :tag,:inf,:class,:attrib def initialize(md,display_heading=false) diff --git a/lib/sisu/v6/shared_metadata.rb b/lib/sisu/v6/shared_metadata.rb index dae28c6c..bef13903 100644 --- a/lib/sisu/v6/shared_metadata.rb +++ b/lib/sisu/v6/shared_metadata.rb @@ -61,6 +61,7 @@ =end module SiSU_Metadata + require_relative 'xml_shared' # xml_shared.rb class Summary attr_accessor :tag,:inf,:class,:attrib def initialize(md,display_heading=false) -- cgit v1.2.3 From 6a13e63f51e69dacefe580b9084006ae66d3fafc Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 5 Sep 2014 22:54:22 -0400 Subject: v5 v6: xml xhtml outputs, & issues --- data/doc/sisu/CHANGELOG_v5 | 2 + data/doc/sisu/CHANGELOG_v6 | 2 + lib/sisu/v5/shared_metadata.rb | 15 +++++- lib/sisu/v5/xhtml.rb | 2 +- lib/sisu/v5/xhtml_epub2.rb | 2 + lib/sisu/v5/xml_format.rb | 20 ++++++-- lib/sisu/v5/xml_odf_odt.rb | 2 + lib/sisu/v5/xml_shared.rb | 107 +++-------------------------------------- lib/sisu/v6/shared_metadata.rb | 15 +++++- lib/sisu/v6/xhtml.rb | 2 +- lib/sisu/v6/xhtml_epub2.rb | 2 + lib/sisu/v6/xml_format.rb | 20 ++++++-- lib/sisu/v6/xml_odf_odt.rb | 2 + lib/sisu/v6/xml_shared.rb | 107 +++-------------------------------------- 14 files changed, 84 insertions(+), 216 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 17889091..443f07bf 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.5.orig.tar.xz sisu_5.6.5.orig.tar.xz sisu_5.6.5-1.dsc +* xml xhtml outputs, & issues + * shared_metadata, requires xml_shared * link/path fixes, diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 6c043373..22b9d305 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -28,6 +28,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.6.orig.tar.xz sisu_6.2.6.orig.tar.xz sisu_6.2.6-1.dsc +* xml xhtml outputs, & issues + * shared_metadata, requires xml_shared * link/path fixes, diff --git a/lib/sisu/v5/shared_metadata.rb b/lib/sisu/v5/shared_metadata.rb index 405e7939..e6721964 100644 --- a/lib/sisu/v5/shared_metadata.rb +++ b/lib/sisu/v5/shared_metadata.rb @@ -74,6 +74,14 @@ module SiSU_Metadata language=l[:n] tr=SiSU_Translate::Source.new(@md,language) @attrib='md' + def meta_content_clean(content='') + content=if not content.nil? + content=content.tr('"',"'"). + gsub(/&/,'&') + content=SiSU_XML_Munge::Trans.new(@md).char_enc.utf8(content) + else content + end + end if @display_heading @tag,@inf=%{Document Metadata},'' meta << self.meta_para @@ -115,7 +123,7 @@ module SiSU_Metadata end if defined? @md.rights.all \ and @md.rights.all=~/\S+/ - @tag,@inf,@class=tr.rights,@md.rights.all,'dc' #15 + @tag,@inf,@class=tr.rights,meta_content_clean(@md.rights.all),'dc' #15 meta << self.meta_para end if defined? @md.classify.subject \ @@ -810,7 +818,8 @@ module SiSU_Metadata end def xml_docbook def meta_para - inf_xml=char_enc(@inf).utf8 + inf_xml=char_enc(@inf).amp + inf_xml=char_enc(inf_xml).utf8 inf_xml=char_enc(inf_xml).br < @@ -843,6 +852,7 @@ WOK end def xml_dom def meta_para + inf_xml=char_enc(inf_xml).amp inf_xml=char_enc(@inf).utf8 inf_xml=char_enc(inf_xml).br <\1'). #footnote/endnote clean - gsub(/#{Mx[:en_b_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_b_c]}/,'\1') #footnote/endnote clean + gsub(/#{Mx[:en_b_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_b_c]}/,'\1') util=SiSU_TextUtils::Wrap.new(dob.obj,70) wrapped=util.line_wrap @@xml[:body] << if defined? dob.ocn diff --git a/lib/sisu/v5/xhtml_epub2.rb b/lib/sisu/v5/xhtml_epub2.rb index e0aa70cb..daa00f39 100644 --- a/lib/sisu/v5/xhtml_epub2.rb +++ b/lib/sisu/v5/xhtml_epub2.rb @@ -71,6 +71,8 @@ module SiSU_XHTML_EPUB2 include SiSU_Particulars require_relative 'defaults' # defaults.rb include SiSU_Viz + require_relative 'xml_shared' # xml_shared.rb + include SiSU_XML_Munge require_relative 'xhtml_table' # xhtml_table.rb require_relative 'xhtml_epub2_format' # xhtml_epub2_format.rb include SiSU_XHTML_EPUB2_Format diff --git a/lib/sisu/v5/xml_format.rb b/lib/sisu/v5/xml_format.rb index fb2cff88..4a7264c0 100644 --- a/lib/sisu/v5/xml_format.rb +++ b/lib/sisu/v5/xml_format.rb @@ -191,15 +191,26 @@ module SiSU_XML_Format end if defined? @md.rights.all \ and @md.rights.all=~/\S+/ # DublinCore 15 - rights - @rdf_rights=%{ dc.rights="#{@md.rights.all}"\n} - @rights=%{\n} + rights=meta_content_clean(@md.rights.all) + copyright=meta_content_clean(@md.rights.copyright.all) + @rdf_rights=%{ dc.rights="#{rights}"\n} + @rights=%{\n} end - @copyright=%{\n} if @md.rights.copyright.all # possibly redundant see dc.rights + @copyright=%{\n} \ + if @md.rights.copyright.all # possibly redundant see dc.rights @owner=%{\n} if @md.owner @keywords=%{\n} if @md.keywords @vz=SiSU_Viz::Defaults.new #margin,paragraph,table,banner,url,png,txt,color,font,nav_txt,nav_png,credits,js,php @index='index' end + def meta_content_clean(content='') + content=if not content.nil? + content=content.tr('"',"'"). + gsub(/&/,'&') + content=SiSU_XML_Munge::Trans.new(@md).char_enc.utf8(content) + else content + end + end def table_close ' ' end @@ -558,7 +569,8 @@ WOK def prefix_a end def rights - rights=@md.rights.copyright.all.gsub(/^\s*Copyright\s+\(C\)/,'Copyright © ') + copyright=meta_content_clean(@md.rights.copyright.all) + rights=copyright(/^\s*Copyright\s+\(C\)/,'Copyright © ') %{

Rights: #{rights}

} end diff --git a/lib/sisu/v5/xml_odf_odt.rb b/lib/sisu/v5/xml_odf_odt.rb index 4e540fde..0c9dc7aa 100644 --- a/lib/sisu/v5/xml_odf_odt.rb +++ b/lib/sisu/v5/xml_odf_odt.rb @@ -71,6 +71,8 @@ module SiSU_XML_ODF_ODT include SiSU_XML_ODF_ODT_Format require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb + require_relative 'xml_shared' # xml_shared.rb + include SiSU_XML_Munge @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 class Source begin diff --git a/lib/sisu/v5/xml_shared.rb b/lib/sisu/v5/xml_shared.rb index bd0e383b..d059cd7b 100644 --- a/lib/sisu/v5/xml_shared.rb +++ b/lib/sisu/v5/xml_shared.rb @@ -232,104 +232,6 @@ module SiSU_XML_Munge if @sys.locale =~/utf-?8/i # instead ucs for utf8 # String#encode Iñtërnâtiônàlizætiøn dob.obj=dob.obj.gsub(/ /u,' '). # space identify gsub(/ /u,' ') # space identify - else - dob.obj=dob.obj.gsub(/¢/u,'¢'). # ¢ - gsub(/£/u,'£'). # £ - gsub(/¥/u,'¥'). # ¥ - gsub(/§/u,'§'). # § - gsub(/©/u,'©'). # © - gsub(/ª/u,'ª'). # ª - gsub(/«/u,'«'). # « - gsub(/®/u,'®'). # ® - gsub(/°/u,'°'). # ° - gsub(/±/u,'±'). # ± - gsub(/²/u,'²'). # ² - gsub(/³/u,'³'). # ³ - gsub(/µ/u,'µ'). # µ - gsub(/¶/u,'¶'). # ¶ - gsub(/¹/u,'¹'). # ¹ - gsub(/º/u,'º'). # º - gsub(/»/u,'»'). # » - gsub(/¼/u,'¼'). # ¼ - gsub(/½/u,'½'). # ½ - gsub(/¾/u,'¾'). # ¾ - gsub(/×/u,'×'). # × - gsub(/÷/u,'÷'). # ÷ - gsub(/¿/u,'¿'). # ¿ - gsub(/À/u,'À'). # À - gsub(/Á/u,'Á'). # Á - gsub(/Â/u,'Â'). # Â - gsub(/Ã/u,'Ã'). # Ã - gsub(/Ä/u,'Ä'). # Ä - gsub(/Å/u,'Å'). # Å - gsub(/Æ/u,'Æ'). # Æ - gsub(/Ç/u,'Ç'). # Ç - gsub(/È/u,'È'). # È - gsub(/É/u,'É'). # É - gsub(/Ê/u,'Ê'). # Ê - gsub(/Ë/u,'Ë'). # Ë - gsub(/Ì/u,'Ì'). # Ì - gsub(/Í/u,'Í'). # Í - gsub(/Î/u,'Î'). # Î - gsub(/Ï/u,'Ï'). # Ï - gsub(/Ð/u,'Ð'). # Ð - gsub(/Ñ/u,'Ñ'). # Ñ - gsub(/Ò/u,'Ò'). # Ò - gsub(/Ó/u,'Ó'). # Ó - gsub(/Ô/u,'Ô'). # Ô - gsub(/Õ/u,'Õ'). # Õ - gsub(/Ö/u,'Ö'). # Ö - gsub(/Ø/u,'Ø'). # Ø - gsub(/Ù/u,'Ù'). # Ù - gsub(/Ú/u,'Ú'). # Ú - gsub(/Û/u,'Û'). # Û - gsub(/Ü/u,'Ü'). # Ü - gsub(/Ý/u,'Ý'). # Ý - gsub(/Þ/u,'Þ'). # Þ - gsub(/ß/u,'ß'). # ß - gsub(/à/u,'à'). # à - gsub(/á/u,'á'). # á - gsub(/â/u,'â'). # â - gsub(/ã/u,'ã'). # ã - gsub(/ä/u,'ä'). # ä - gsub(/å/u,'å'). # å - gsub(/æ/u,'æ'). # æ - gsub(/ç/u,'ç'). # ç - gsub(/è/u,'è'). # è - gsub(/é/u,'´'). # é - gsub(/ê/u,'ˆ'). # ê - gsub(/ë/u,'ë'). # ë - gsub(/ì/u,'ì'). # ì - gsub(/í/u,'´'). # í - gsub(/î/u,'î'). # î - gsub(/ï/u,'ï'). # ï - gsub(/ð/u,'ð'). # ð - gsub(/ñ/u,'ñ'). # ñ - gsub(/ò/u,'ò'). # ò - gsub(/ó/u,'ó'). # ó - gsub(/ô/u,'ô'). # ô - gsub(/õ/u,'õ'). # õ - gsub(/ö/u,'ö'). # ö - gsub(/ø/u,'ø'). # ø - gsub(/ù/u,'ù'). # ú - gsub(/ú/u,'ú'). # û - gsub(/û/u,'û'). # ü - gsub(/ü/u,'ü'). # ý - gsub(/þ/u,'þ'). # þ - gsub(/ÿ/u,'ÿ'). # ÿ - gsub(/‘/u,'&#lsquo;'). # ‘ # ‘ - gsub(/’/u,'&#rsquo;'). # ’ # ’ - gsub(/“/u,'“'). # “ # “ - gsub(/”/u,'”'). # ” # ” - gsub(/–/u,'–'). # – # – - gsub(/—/u,'—'). # — # — - gsub(/∝/u,'∝'). # ∝ # ∝ - gsub(/∞/u,'∞'). # ∞ # ∞ - gsub(/™/u,'™'). # ™ # ™ - gsub(/✠/u,'✠'). # ✠ - #gsub(/✠/u '†'). # † # † incorrect replacement † - gsub(/ /u,' '). # space identify - gsub(/ /u,' ') # space identify end end self @@ -411,7 +313,8 @@ module SiSU_XML_Munge %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}). gsub(/#{Dx[:url_o]}/,"#{Dx[:url_o_xml]}"). gsub(/#{Dx[:url_c]}/,"#{Dx[:url_c_xml]}"). - gsub(/ |#{Mx[:nbsp]}/m,' ') + gsub(/ |#{Mx[:nbsp]}/m,' '). + gsub(/;&([^#]|(?:[^gl][^t]|[^a][^m][^p]|[^n][^b][^s][^p])[^;])/,';&\1') # pattern not to match dob end def markup_light(dob='') @@ -426,7 +329,8 @@ module SiSU_XML_Munge gsub(/&([^;]{1,5})/,'&\1'). #sort, rough estimate, revisit #WATCH found in node not sax gsub(/(?:^|[^_\\])#{Mx[:lnk_o]}(\S+?\.(?:png|jpg|gif))[ ]+.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image)/, "#{@md.file.output_path.xml.rel_image}\/\\1"). - gsub(/ |#{Mx[:nbsp]}/,' ') + gsub(/ |#{Mx[:nbsp]}/,' '). + gsub(/;&([^#]|(?:[^gl][^t]|[^a][^m][^p]|[^n][^b][^s][^p])[^;])/,';&\1') # pattern not to match wordlist=dob.obj.scan(/&[#0-9a-z]+;|\S+|\n/) #\n needed for tables, check though added 2005w17 dob.obj=tidywords(wordlist).join(' ').strip dob @@ -698,7 +602,8 @@ module SiSU_XML_Tags #Format end def meta_content_clean(content='') content=if not content.nil? - content=content.tr('"',"'") + content=content.tr('"',"'"). + gsub(/&/,'&') content=SiSU_XML_Munge::Trans.new(@md).char_enc.utf8(content) else content end diff --git a/lib/sisu/v6/shared_metadata.rb b/lib/sisu/v6/shared_metadata.rb index bef13903..b51fc8f4 100644 --- a/lib/sisu/v6/shared_metadata.rb +++ b/lib/sisu/v6/shared_metadata.rb @@ -74,6 +74,14 @@ module SiSU_Metadata language=l[:n] tr=SiSU_Translate::Source.new(@md,language) @attrib='md' + def meta_content_clean(content='') + content=if not content.nil? + content=content.tr('"',"'"). + gsub(/&/,'&') + content=SiSU_XML_Munge::Trans.new(@md).char_enc.utf8(content) + else content + end + end if @display_heading @tag,@inf=%{Document Metadata},'' meta << self.meta_para @@ -115,7 +123,7 @@ module SiSU_Metadata end if defined? @md.rights.all \ and @md.rights.all=~/\S+/ - @tag,@inf,@class=tr.rights,@md.rights.all,'dc' #15 + @tag,@inf,@class=tr.rights,meta_content_clean(@md.rights.all),'dc' #15 meta << self.meta_para end if defined? @md.classify.subject \ @@ -810,7 +818,8 @@ module SiSU_Metadata end def xml_docbook def meta_para - inf_xml=char_enc(@inf).utf8 + inf_xml=char_enc(@inf).amp + inf_xml=char_enc(inf_xml).utf8 inf_xml=char_enc(inf_xml).br < @@ -843,6 +852,7 @@ WOK end def xml_dom def meta_para + inf_xml=char_enc(inf_xml).amp inf_xml=char_enc(@inf).utf8 inf_xml=char_enc(inf_xml).br <\1'). #footnote/endnote clean - gsub(/#{Mx[:en_b_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_b_c]}/,'\1') #footnote/endnote clean + gsub(/#{Mx[:en_b_o]}([\d*+]+)\s+(?:.+?)#{Mx[:en_b_c]}/,'\1') util=SiSU_TextUtils::Wrap.new(dob.obj,70) wrapped=util.line_wrap @@xml[:body] << if defined? dob.ocn diff --git a/lib/sisu/v6/xhtml_epub2.rb b/lib/sisu/v6/xhtml_epub2.rb index 26399ef7..44495ff3 100644 --- a/lib/sisu/v6/xhtml_epub2.rb +++ b/lib/sisu/v6/xhtml_epub2.rb @@ -71,6 +71,8 @@ module SiSU_XHTML_EPUB2 include SiSU_Particulars require_relative 'defaults' # defaults.rb include SiSU_Viz + require_relative 'xml_shared' # xml_shared.rb + include SiSU_XML_Munge require_relative 'xhtml_table' # xhtml_table.rb require_relative 'xhtml_epub2_format' # xhtml_epub2_format.rb include SiSU_XHTML_EPUB2_Format diff --git a/lib/sisu/v6/xml_format.rb b/lib/sisu/v6/xml_format.rb index 38cc7f85..e649fa51 100644 --- a/lib/sisu/v6/xml_format.rb +++ b/lib/sisu/v6/xml_format.rb @@ -191,15 +191,26 @@ module SiSU_XML_Format end if defined? @md.rights.all \ and @md.rights.all=~/\S+/ # DublinCore 15 - rights - @rdf_rights=%{ dc.rights="#{@md.rights.all}"\n} - @rights=%{\n} + rights=meta_content_clean(@md.rights.all) + copyright=meta_content_clean(@md.rights.copyright.all) + @rdf_rights=%{ dc.rights="#{rights}"\n} + @rights=%{\n} end - @copyright=%{\n} if @md.rights.copyright.all # possibly redundant see dc.rights + @copyright=%{\n} \ + if @md.rights.copyright.all # possibly redundant see dc.rights @owner=%{\n} if @md.owner @keywords=%{\n} if @md.keywords @vz=SiSU_Viz::Defaults.new #margin,paragraph,table,banner,url,png,txt,color,font,nav_txt,nav_png,credits,js,php @index='index' end + def meta_content_clean(content='') + content=if not content.nil? + content=content.tr('"',"'"). + gsub(/&/,'&') + content=SiSU_XML_Munge::Trans.new(@md).char_enc.utf8(content) + else content + end + end def table_close ' ' end @@ -558,7 +569,8 @@ WOK def prefix_a end def rights - rights=@md.rights.copyright.all.gsub(/^\s*Copyright\s+\(C\)/,'Copyright © ') + copyright=meta_content_clean(@md.rights.copyright.all) + rights=copyright(/^\s*Copyright\s+\(C\)/,'Copyright © ') %{

Rights: #{rights}

} end diff --git a/lib/sisu/v6/xml_odf_odt.rb b/lib/sisu/v6/xml_odf_odt.rb index 967812db..e6cfafe5 100644 --- a/lib/sisu/v6/xml_odf_odt.rb +++ b/lib/sisu/v6/xml_odf_odt.rb @@ -71,6 +71,8 @@ module SiSU_XML_ODF_ODT include SiSU_XML_ODF_ODT_Format require_relative 'shared_metadata' # shared_metadata.rb require_relative 'txt_shared' # txt_shared.rb + require_relative 'xml_shared' # xml_shared.rb + include SiSU_XML_Munge @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 class Source begin diff --git a/lib/sisu/v6/xml_shared.rb b/lib/sisu/v6/xml_shared.rb index 35d1132d..3ffda8f3 100644 --- a/lib/sisu/v6/xml_shared.rb +++ b/lib/sisu/v6/xml_shared.rb @@ -232,104 +232,6 @@ module SiSU_XML_Munge if @sys.locale =~/utf-?8/i # instead ucs for utf8 # String#encode Iñtërnâtiônàlizætiøn dob.obj=dob.obj.gsub(/ /u,' '). # space identify gsub(/ /u,' ') # space identify - else - dob.obj=dob.obj.gsub(/¢/u,'¢'). # ¢ - gsub(/£/u,'£'). # £ - gsub(/¥/u,'¥'). # ¥ - gsub(/§/u,'§'). # § - gsub(/©/u,'©'). # © - gsub(/ª/u,'ª'). # ª - gsub(/«/u,'«'). # « - gsub(/®/u,'®'). # ® - gsub(/°/u,'°'). # ° - gsub(/±/u,'±'). # ± - gsub(/²/u,'²'). # ² - gsub(/³/u,'³'). # ³ - gsub(/µ/u,'µ'). # µ - gsub(/¶/u,'¶'). # ¶ - gsub(/¹/u,'¹'). # ¹ - gsub(/º/u,'º'). # º - gsub(/»/u,'»'). # » - gsub(/¼/u,'¼'). # ¼ - gsub(/½/u,'½'). # ½ - gsub(/¾/u,'¾'). # ¾ - gsub(/×/u,'×'). # × - gsub(/÷/u,'÷'). # ÷ - gsub(/¿/u,'¿'). # ¿ - gsub(/À/u,'À'). # À - gsub(/Á/u,'Á'). # Á - gsub(/Â/u,'Â'). # Â - gsub(/Ã/u,'Ã'). # Ã - gsub(/Ä/u,'Ä'). # Ä - gsub(/Å/u,'Å'). # Å - gsub(/Æ/u,'Æ'). # Æ - gsub(/Ç/u,'Ç'). # Ç - gsub(/È/u,'È'). # È - gsub(/É/u,'É'). # É - gsub(/Ê/u,'Ê'). # Ê - gsub(/Ë/u,'Ë'). # Ë - gsub(/Ì/u,'Ì'). # Ì - gsub(/Í/u,'Í'). # Í - gsub(/Î/u,'Î'). # Î - gsub(/Ï/u,'Ï'). # Ï - gsub(/Ð/u,'Ð'). # Ð - gsub(/Ñ/u,'Ñ'). # Ñ - gsub(/Ò/u,'Ò'). # Ò - gsub(/Ó/u,'Ó'). # Ó - gsub(/Ô/u,'Ô'). # Ô - gsub(/Õ/u,'Õ'). # Õ - gsub(/Ö/u,'Ö'). # Ö - gsub(/Ø/u,'Ø'). # Ø - gsub(/Ù/u,'Ù'). # Ù - gsub(/Ú/u,'Ú'). # Ú - gsub(/Û/u,'Û'). # Û - gsub(/Ü/u,'Ü'). # Ü - gsub(/Ý/u,'Ý'). # Ý - gsub(/Þ/u,'Þ'). # Þ - gsub(/ß/u,'ß'). # ß - gsub(/à/u,'à'). # à - gsub(/á/u,'á'). # á - gsub(/â/u,'â'). # â - gsub(/ã/u,'ã'). # ã - gsub(/ä/u,'ä'). # ä - gsub(/å/u,'å'). # å - gsub(/æ/u,'æ'). # æ - gsub(/ç/u,'ç'). # ç - gsub(/è/u,'è'). # è - gsub(/é/u,'´'). # é - gsub(/ê/u,'ˆ'). # ê - gsub(/ë/u,'ë'). # ë - gsub(/ì/u,'ì'). # ì - gsub(/í/u,'´'). # í - gsub(/î/u,'î'). # î - gsub(/ï/u,'ï'). # ï - gsub(/ð/u,'ð'). # ð - gsub(/ñ/u,'ñ'). # ñ - gsub(/ò/u,'ò'). # ò - gsub(/ó/u,'ó'). # ó - gsub(/ô/u,'ô'). # ô - gsub(/õ/u,'õ'). # õ - gsub(/ö/u,'ö'). # ö - gsub(/ø/u,'ø'). # ø - gsub(/ù/u,'ù'). # ú - gsub(/ú/u,'ú'). # û - gsub(/û/u,'û'). # ü - gsub(/ü/u,'ü'). # ý - gsub(/þ/u,'þ'). # þ - gsub(/ÿ/u,'ÿ'). # ÿ - gsub(/‘/u,'&#lsquo;'). # ‘ # ‘ - gsub(/’/u,'&#rsquo;'). # ’ # ’ - gsub(/“/u,'“'). # “ # “ - gsub(/”/u,'”'). # ” # ” - gsub(/–/u,'–'). # – # – - gsub(/—/u,'—'). # — # — - gsub(/∝/u,'∝'). # ∝ # ∝ - gsub(/∞/u,'∞'). # ∞ # ∞ - gsub(/™/u,'™'). # ™ # ™ - gsub(/✠/u,'✠'). # ✠ - #gsub(/✠/u '†'). # † # † incorrect replacement † - gsub(/ /u,' '). # space identify - gsub(/ /u,' ') # space identify end end self @@ -411,7 +313,8 @@ module SiSU_XML_Munge %{#{@brace_url.xml_open}\\1#{@brace_url.xml_close}}). gsub(/#{Dx[:url_o]}/,"#{Dx[:url_o_xml]}"). gsub(/#{Dx[:url_c]}/,"#{Dx[:url_c_xml]}"). - gsub(/ |#{Mx[:nbsp]}/m,' ') + gsub(/ |#{Mx[:nbsp]}/m,' '). + gsub(/;&([^#]|(?:[^gl][^t]|[^a][^m][^p]|[^n][^b][^s][^p])[^;])/,';&\1') # pattern not to match dob end def markup_light(dob='') @@ -426,7 +329,8 @@ module SiSU_XML_Munge gsub(/&([^;]{1,5})/,'&\1'). #sort, rough estimate, revisit #WATCH found in node not sax gsub(/(?:^|[^_\\])#{Mx[:lnk_o]}(\S+?\.(?:png|jpg|gif))[ ]+.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image)/, "#{@md.file.output_path.xml.rel_image}\/\\1"). - gsub(/ |#{Mx[:nbsp]}/,' ') + gsub(/ |#{Mx[:nbsp]}/,' '). + gsub(/;&([^#]|(?:[^gl][^t]|[^a][^m][^p]|[^n][^b][^s][^p])[^;])/,';&\1') # pattern not to match wordlist=dob.obj.scan(/&[#0-9a-z]+;|\S+|\n/) #\n needed for tables, check though added 2005w17 dob.obj=tidywords(wordlist).join(' ').strip dob @@ -698,7 +602,8 @@ module SiSU_XML_Tags #Format end def meta_content_clean(content='') content=if not content.nil? - content=content.tr('"',"'") + content=content.tr('"',"'"). + gsub(/&/,'&') content=SiSU_XML_Munge::Trans.new(@md).char_enc.utf8(content) else content end -- cgit v1.2.3 From 57c8b068358e785f80879a87e3f456ad24366ecf Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 5 Sep 2014 22:57:26 -0400 Subject: v5 v6: (for html) set default to navigation bar off --- data/doc/sisu/CHANGELOG_v5 | 2 ++ data/doc/sisu/CHANGELOG_v6 | 2 ++ lib/sisu/v5/hub_options.rb | 2 +- lib/sisu/v5/se_processing.rb | 2 +- lib/sisu/v6/hub_options.rb | 2 +- lib/sisu/v6/se_processing.rb | 2 +- 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 443f07bf..41443428 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.5.orig.tar.xz sisu_5.6.5.orig.tar.xz sisu_5.6.5-1.dsc +* (for html) set default to navigation bar off + * xml xhtml outputs, & issues * shared_metadata, requires xml_shared diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 22b9d305..783899f1 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -28,6 +28,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.6.orig.tar.xz sisu_6.2.6.orig.tar.xz sisu_6.2.6-1.dsc +* (for html) set default to navigation bar off + * xml xhtml outputs, & issues * shared_metadata, requires xml_shared diff --git a/lib/sisu/v5/hub_options.rb b/lib/sisu/v5/hub_options.rb index d871c9c3..676577fb 100644 --- a/lib/sisu/v5/hub_options.rb +++ b/lib/sisu/v5/hub_options.rb @@ -960,7 +960,7 @@ module SiSU_Commandline =~/"--(?:exc|no)-html-navigation-bar"|"--(?:exc|no)-navigation-bar"/ \ || act[:switch][:off].inspect =~/"html_navigation_bar"|"navbar"/ { bool: false, set: :off } - else { bool: true, set: :na } + else { bool: false, set: :na } end act[:segsubtoc]=if select_arr.inspect \ =~/"--inc-segsubtoc"/ diff --git a/lib/sisu/v5/se_processing.rb b/lib/sisu/v5/se_processing.rb index 35fa72c2..33b4a4ed 100644 --- a/lib/sisu/v5/se_processing.rb +++ b/lib/sisu/v5/se_processing.rb @@ -309,7 +309,7 @@ module SiSU_Processing_Settings elsif env_rc.build.html_navigation_bar? ==:off false else - true + false end end def search_form? diff --git a/lib/sisu/v6/hub_options.rb b/lib/sisu/v6/hub_options.rb index 336f0d93..6f9543d3 100644 --- a/lib/sisu/v6/hub_options.rb +++ b/lib/sisu/v6/hub_options.rb @@ -960,7 +960,7 @@ module SiSU_Commandline =~/"--(?:exc|no)-html-navigation-bar"|"--(?:exc|no)-navigation-bar"/ \ || act[:switch][:off].inspect =~/"html_navigation_bar"|"navbar"/ { bool: false, set: :off } - else { bool: true, set: :na } + else { bool: false, set: :na } end act[:segsubtoc]=if select_arr.inspect \ =~/"--inc-segsubtoc"/ diff --git a/lib/sisu/v6/se_processing.rb b/lib/sisu/v6/se_processing.rb index 32b2490a..15db8cff 100644 --- a/lib/sisu/v6/se_processing.rb +++ b/lib/sisu/v6/se_processing.rb @@ -309,7 +309,7 @@ module SiSU_Processing_Settings elsif env_rc.build.html_navigation_bar? ==:off false else - true + false end end def search_form? -- cgit v1.2.3 From 984b76e0779f3b465b9287b55119d2353423c27f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 5 Sep 2014 22:59:44 -0400 Subject: v5 v6: html navigation, enable turn off (nav buttons on remaining html segments) --- data/doc/sisu/CHANGELOG_v5 | 2 ++ data/doc/sisu/CHANGELOG_v6 | 2 ++ lib/sisu/v5/html_format.rb | 41 ++++++++++++++++++++++++++--------------- lib/sisu/v6/html_format.rb | 41 ++++++++++++++++++++++++++--------------- 4 files changed, 56 insertions(+), 30 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 41443428..aed37d24 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.5.orig.tar.xz sisu_5.6.5.orig.tar.xz sisu_5.6.5-1.dsc +* html navigation, enable turn off (nav buttons on remaining html segments) + * (for html) set default to navigation bar off * xml xhtml outputs, & issues diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 783899f1..2e6a6f9b 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -28,6 +28,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.6.orig.tar.xz sisu_6.2.6.orig.tar.xz sisu_6.2.6-1.dsc +* html navigation, enable turn off (nav buttons on remaining html segments) + * (for html) set default to navigation bar off * xml xhtml outputs, & issues diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb index 16120d88..aa002ec7 100644 --- a/lib/sisu/v5/html_format.rb +++ b/lib/sisu/v5/html_format.rb @@ -310,6 +310,15 @@ WOK end end def concordance_navigation_band + up_button=if @make.build.html_navigation? + %{ + +   + #{png_nav.toc} +   +} + else '' + end if @make.build.html_top_band? %{ -
@@ -317,29 +326,29 @@ WOK #{doc_types} - -   - #{png_nav.toc} -   +#{up_button} #{@vz.table_close}

} else '' end end def seg_head_navigation_band(page=:seg) - if page==:manifest - nxt=(@file.output_dir_structure.by_language_code? \ - || @file.output_dir_structure.by_filetype?) \ - ? "../html/#{@md.fnb}/toc#{@md.lang_code_insert}#{Sfx[:html]}" - : "toc#{@md.lang_code_insert}#{Sfx[:html]}" - firstseg=%{ + if @make.build.html_navigation? + if page==:manifest + nxt=(@file.output_dir_structure.by_language_code? \ + || @file.output_dir_structure.by_filetype?) \ + ? "../html/#{@md.fnb}/toc#{@md.lang_code_insert}#{Sfx[:html]}" + : "toc#{@md.lang_code_insert}#{Sfx[:html]}" + firstseg=%{ + #{png_nav.nxt}} + elsif @md.firstseg =~/\S+/ + firstseg=%{ #{png_nav.nxt}} - elsif @md.firstseg =~/\S+/ - firstseg=%{ - #{png_nav.nxt}} + end + else '' end - %{ + if @make.build.html_top_band? + %{
@@ -350,6 +359,8 @@ WOK  #{firstseg}  #{@vz.table_close}

} + else '' + end end def manifest_link(text) # @file=SiSU_Env::FileOp.new(@md) if @md diff --git a/lib/sisu/v6/html_format.rb b/lib/sisu/v6/html_format.rb index febfc30e..acc62a74 100644 --- a/lib/sisu/v6/html_format.rb +++ b/lib/sisu/v6/html_format.rb @@ -310,6 +310,15 @@ WOK end end def concordance_navigation_band + up_button=if @make.build.html_navigation? + %{ +

#{button_home(page)} +   + #{png_nav.toc} +   +} + else '' + end if @make.build.html_top_band? %{ -
@@ -317,29 +326,29 @@ WOK #{doc_types} - -   - #{png_nav.toc} -   +#{up_button} #{@vz.table_close}

} else '' end end def seg_head_navigation_band(page=:seg) - if page==:manifest - nxt=(@file.output_dir_structure.by_language_code? \ - || @file.output_dir_structure.by_filetype?) \ - ? "../html/#{@md.fnb}/toc#{@md.lang_code_insert}#{Sfx[:html]}" - : "toc#{@md.lang_code_insert}#{Sfx[:html]}" - firstseg=%{ + if @make.build.html_navigation? + if page==:manifest + nxt=(@file.output_dir_structure.by_language_code? \ + || @file.output_dir_structure.by_filetype?) \ + ? "../html/#{@md.fnb}/toc#{@md.lang_code_insert}#{Sfx[:html]}" + : "toc#{@md.lang_code_insert}#{Sfx[:html]}" + firstseg=%{ + #{png_nav.nxt}} + elsif @md.firstseg =~/\S+/ + firstseg=%{ #{png_nav.nxt}} - elsif @md.firstseg =~/\S+/ - firstseg=%{ - #{png_nav.nxt}} + end + else '' end - %{ + if @make.build.html_top_band? + %{
@@ -350,6 +359,8 @@ WOK  #{firstseg}  #{@vz.table_close}

} + else '' + end end def manifest_link(text) # @file=SiSU_Env::FileOp.new(@md) if @md -- cgit v1.2.3 From cf1ec2346fbe9d0c54d887eb7cd79588dcf3606b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 5 Sep 2014 23:17:24 -0400 Subject: v5 v6: ao_numbering, provide more information on duplicate numbering before stop --- data/doc/sisu/CHANGELOG_v5 | 2 ++ data/doc/sisu/CHANGELOG_v6 | 2 ++ lib/sisu/v5/ao_numbering.rb | 23 +++++++++++++---------- lib/sisu/v6/ao_numbering.rb | 23 +++++++++++++---------- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index aed37d24..90d95339 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.5.orig.tar.xz sisu_5.6.5.orig.tar.xz sisu_5.6.5-1.dsc +* ao_numbering, provide more information on duplicate numbering before stop + * html navigation, enable turn off (nav buttons on remaining html segments) * (for html) set default to navigation bar off diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 2e6a6f9b..772c2df9 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -28,6 +28,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.6.orig.tar.xz sisu_6.2.6.orig.tar.xz sisu_6.2.6-1.dsc +* ao_numbering, provide more information on duplicate numbering before stop + * html navigation, enable turn off (nav buttons on remaining html segments) * (for html) set default to navigation bar off diff --git a/lib/sisu/v5/ao_numbering.rb b/lib/sisu/v5/ao_numbering.rb index b4ff7f0b..f9257e6a 100644 --- a/lib/sisu/v5/ao_numbering.rb +++ b/lib/sisu/v5/ao_numbering.rb @@ -314,11 +314,11 @@ module SiSU_AO_Numbering possible_seg_name.to_s end end - def auto_seg_name(possible_seg_name,heading_num_is,lv,type) + def auto_seg_name(possible_seg_name,heading_num_is,dob,type) prefix=case type when :auto then Mx[:segname_prefix_auto_num_provide] when :extract then Mx[:segname_prefix_auto_num_extract] - else '_'*lv.to_i #should not occur + else '_'*dob.lv.to_i #should not occur end if possible_seg_name =~/^[0-9]+?\.$/m #!~/[.,:-]+/ possible_seg_name=possible_seg_name. @@ -326,35 +326,38 @@ module SiSU_AO_Numbering end chosen_seg_name=if possible_seg_name.to_s =~/^[0-9]+[.]?$/m \ and possible_seg_name.to_i <= heading_num_is.to_i \ - and lv == '1' + and dob.lv == '1' prefix + leading_zeros_fixed_width_number(possible_seg_name) elsif possible_seg_name.to_s =~/^[0-9]+[.,:-]*$/m \ - and lv == '1' + and dob.lv == '1' possible_seg_name=possible_seg_name.to_s. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') prefix + possible_seg_name elsif possible_seg_name.to_s =~ /^[0-9]+[.,:-][0-9]+[.,:-]*$/m \ - and lv == '2' + and dob.lv == '2' possible_seg_name=possible_seg_name.to_s. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') prefix + possible_seg_name elsif possible_seg_name.to_s =~ /^[0-9]+[.,:-][0-9]+[.,:-][0-9][\d.,:-]*$/m \ - and lv == '3' + and dob.lv == '3' possible_seg_name=possible_seg_name.to_s. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') prefix + possible_seg_name - else Mx[:segname_prefix_auto_num_other]*lv.to_i + possible_seg_name.to_s + else + Mx[:segname_prefix_auto_num_other]*dob.lv.to_i \ + + possible_seg_name.to_s end @chosen_seg_names << chosen_seg_name if @chosen_seg_names.compact.uniq.length == @chosen_seg_names.compact.length #checks that all auto given seg names are unique chosen_seg_name else - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark("duplicated auto segment name: #{type} #{chosen_seg_name} - #{@chosen_seg_names}; manually name level 1 segments '1~given_name'") + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green). + mark("duplicated auto segment name: #{type} #{chosen_seg_name} - #{@chosen_seg_names}; manually name level 1 segments '1~given_name'\n #{@md.fns}\n #{dob.obj}") exit end end @@ -396,7 +399,7 @@ module SiSU_AO_Numbering and dob.obj =~/^\s*(?:\S+\s+)?([0-9][0-9.,:-]*)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name possible_seg_name=$1 possible_seg_name= - auto_seg_name(possible_seg_name,heading_num_is,dob.lv,:extract) + auto_seg_name(possible_seg_name,heading_num_is,dob,:extract) possible_seg_name=possible_seg_name. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') @@ -421,7 +424,7 @@ module SiSU_AO_Numbering if dob.ln==4 \ and not dob.name #if still no segment name, provide a numerical one possible_seg_name= - auto_seg_name(art_filename_auto,heading_num_is,dob.lv,:auto) + auto_seg_name(art_filename_auto,heading_num_is,dob,:auto) if @md.seg_names.is_a?(Array) \ and not @md.seg_names.include?(possible_seg_name) dob.name=possible_seg_name diff --git a/lib/sisu/v6/ao_numbering.rb b/lib/sisu/v6/ao_numbering.rb index a96df577..7a4e4cee 100644 --- a/lib/sisu/v6/ao_numbering.rb +++ b/lib/sisu/v6/ao_numbering.rb @@ -314,11 +314,11 @@ module SiSU_AO_Numbering possible_seg_name.to_s end end - def auto_seg_name(possible_seg_name,heading_num_is,lv,type) + def auto_seg_name(possible_seg_name,heading_num_is,dob,type) prefix=case type when :auto then Mx[:segname_prefix_auto_num_provide] when :extract then Mx[:segname_prefix_auto_num_extract] - else '_'*lv.to_i #should not occur + else '_'*dob.lv.to_i #should not occur end if possible_seg_name =~/^[0-9]+?\.$/m #!~/[.,:-]+/ possible_seg_name=possible_seg_name. @@ -326,35 +326,38 @@ module SiSU_AO_Numbering end chosen_seg_name=if possible_seg_name.to_s =~/^[0-9]+[.]?$/m \ and possible_seg_name.to_i <= heading_num_is.to_i \ - and lv == '1' + and dob.lv == '1' prefix + leading_zeros_fixed_width_number(possible_seg_name) elsif possible_seg_name.to_s =~/^[0-9]+[.,:-]*$/m \ - and lv == '1' + and dob.lv == '1' possible_seg_name=possible_seg_name.to_s. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') prefix + possible_seg_name elsif possible_seg_name.to_s =~ /^[0-9]+[.,:-][0-9]+[.,:-]*$/m \ - and lv == '2' + and dob.lv == '2' possible_seg_name=possible_seg_name.to_s. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') prefix + possible_seg_name elsif possible_seg_name.to_s =~ /^[0-9]+[.,:-][0-9]+[.,:-][0-9][\d.,:-]*$/m \ - and lv == '3' + and dob.lv == '3' possible_seg_name=possible_seg_name.to_s. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') prefix + possible_seg_name - else Mx[:segname_prefix_auto_num_other]*lv.to_i + possible_seg_name.to_s + else + Mx[:segname_prefix_auto_num_other]*dob.lv.to_i \ + + possible_seg_name.to_s end @chosen_seg_names << chosen_seg_name if @chosen_seg_names.compact.uniq.length == @chosen_seg_names.compact.length #checks that all auto given seg names are unique chosen_seg_name else - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark("duplicated auto segment name: #{type} #{chosen_seg_name} - #{@chosen_seg_names}; manually name level 1 segments '1~given_name'") + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green). + mark("duplicated auto segment name: #{type} #{chosen_seg_name} - #{@chosen_seg_names}; manually name level 1 segments '1~given_name'\n #{@md.fns}\n #{dob.obj}") exit end end @@ -396,7 +399,7 @@ module SiSU_AO_Numbering and dob.obj =~/^\s*(?:\S+\s+)?([0-9][0-9.,:-]*)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name possible_seg_name=$1 possible_seg_name= - auto_seg_name(possible_seg_name,heading_num_is,dob.lv,:extract) + auto_seg_name(possible_seg_name,heading_num_is,dob,:extract) possible_seg_name=possible_seg_name. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') @@ -421,7 +424,7 @@ module SiSU_AO_Numbering if dob.ln==4 \ and not dob.name #if still no segment name, provide a numerical one possible_seg_name= - auto_seg_name(art_filename_auto,heading_num_is,dob.lv,:auto) + auto_seg_name(art_filename_auto,heading_num_is,dob,:auto) if @md.seg_names.is_a?(Array) \ and not @md.seg_names.include?(possible_seg_name) dob.name=possible_seg_name -- cgit v1.2.3 From 98066f7dbc056c75b808b49f8406b7ac21118111 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 5 Sep 2014 23:20:13 -0400 Subject: v5 v6: ao_doc_str, if faulty document structure, stop; if --no-stop option, skip --- data/doc/sisu/CHANGELOG_v5 | 3 +++ data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v5/ao_doc_str.rb | 32 +++++++++++++++++++++++++------- lib/sisu/v6/ao_doc_str.rb | 32 +++++++++++++++++++++++++------- 4 files changed, 56 insertions(+), 14 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 90d95339..1fd44736 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.6.5.orig.tar.xz sisu_5.6.5.orig.tar.xz sisu_5.6.5-1.dsc +* ao_doc_str, if faulty document structure, stop; if --no-stop option, skip + processing document + * ao_numbering, provide more information on duplicate numbering before stop * html navigation, enable turn off (nav buttons on remaining html segments) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 772c2df9..a6ef4d23 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -28,6 +28,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.2.6.orig.tar.xz sisu_6.2.6.orig.tar.xz sisu_6.2.6-1.dsc +* ao_doc_str, if faulty document structure, stop; if --no-stop option, skip + processing document + * ao_numbering, provide more information on duplicate numbering before stop * html navigation, enable turn off (nav buttons on remaining html segments) diff --git a/lib/sisu/v5/ao_doc_str.rb b/lib/sisu/v5/ao_doc_str.rb index e10cc4ef..49c9bdf1 100644 --- a/lib/sisu/v5/ao_doc_str.rb +++ b/lib/sisu/v5/ao_doc_str.rb @@ -1308,7 +1308,10 @@ module SiSU_AO_DocumentStructureExtract STDERR.puts %{current level: #{structure_info.lv[node_ln]} (possible parent levels: #{structure_info.possible_parents(structure_info.lv[node_ln])}) parent level: #{structure_info.lv[node_parent_ln]} (possible child levels: #{structure_info.possible_children(structure_info.lv[node_parent_ln])}) SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} - $process_document = :skip + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + else exit + end end end end @@ -1327,7 +1330,10 @@ has incorrect level and/or parent level @title: SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}" } - $process_document = :skip + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + else exit + end end unless (defined? @md.creator.author \ and @md.creator.author) @@ -1337,7 +1343,10 @@ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}" :author: anonymous? SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}" } - $process_document = :skip + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + else exit + end end end def ocn #and auto segment numbering increment @@ -1672,8 +1681,11 @@ or this level should be 6~ rather #{dob.lv}" STDERR.puts %{Substantive text objects must follow a level 1~ 2~ or 3~ heading: #{lev}~ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} puts dob.obj.gsub(/^(.{1,80})/,'"\1"') - $process_document = :skip - break + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + break + else exit + end end if not dob.obj =~/~#|-#/ ocn_flag=true @@ -1751,13 +1763,19 @@ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} STDERR.puts %{The number of level A~ in this document: #{@lev_occurences[:a]} There must be one level A~ (no more and no less) SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} - $process_document = :skip + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + else exit + end end unless @lev_occurences[:l1] > 0 STDERR.puts %{The number of level 1~ in this document: #{@lev_occurences[:l1]} There must be at least one level 1~ (and as many as required) SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} - $process_document = :skip + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + else exit + end end @o_array end diff --git a/lib/sisu/v6/ao_doc_str.rb b/lib/sisu/v6/ao_doc_str.rb index 6e7a103f..6be0e068 100644 --- a/lib/sisu/v6/ao_doc_str.rb +++ b/lib/sisu/v6/ao_doc_str.rb @@ -1308,7 +1308,10 @@ module SiSU_AO_DocumentStructureExtract STDERR.puts %{current level: #{structure_info.lv[node_ln]} (possible parent levels: #{structure_info.possible_parents(structure_info.lv[node_ln])}) parent level: #{structure_info.lv[node_parent_ln]} (possible child levels: #{structure_info.possible_children(structure_info.lv[node_parent_ln])}) SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} - $process_document = :skip + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + else exit + end end end end @@ -1327,7 +1330,10 @@ has incorrect level and/or parent level @title: SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}" } - $process_document = :skip + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + else exit + end end unless (defined? @md.creator.author \ and @md.creator.author) @@ -1337,7 +1343,10 @@ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}" :author: anonymous? SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}" } - $process_document = :skip + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + else exit + end end end def ocn #and auto segment numbering increment @@ -1672,8 +1681,11 @@ or this level should be 6~ rather #{dob.lv}" STDERR.puts %{Substantive text objects must follow a level 1~ 2~ or 3~ heading: #{lev}~ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} puts dob.obj.gsub(/^(.{1,80})/,'"\1"') - $process_document = :skip - break + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + break + else exit + end end if not dob.obj =~/~#|-#/ ocn_flag=true @@ -1751,13 +1763,19 @@ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} STDERR.puts %{The number of level A~ in this document: #{@lev_occurences[:a]} There must be one level A~ (no more and no less) SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} - $process_document = :skip + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + else exit + end end unless @lev_occurences[:l1] > 0 STDERR.puts %{The number of level 1~ in this document: #{@lev_occurences[:l1]} There must be at least one level 1~ (and as many as required) SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} - $process_document = :skip + if @md.opt.act[:no_stop][:set]==:on + $process_document = :skip + else exit + end end @o_array end -- cgit v1.2.3

#{button_home(page)}