From e132337b5095718f14764b9db701729d811ba4da Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:27:19 -0400 Subject: v5 v6: version & changelog (& rakefile) --- 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 +++--- rbuild | 6 +++--- 5 files changed, 23 insertions(+), 9 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 04a836fb..a03b1b0e 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.3.5.orig.tar.xz (2014-05-12:19/1) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.3.5 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.3.5-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_5.3.5.orig.tar.xz + sisu_5.3.5.orig.tar.xz + sisu_5.3.5-1.dsc + %% 5.3.4.orig.tar.xz (2014-02-14:06/5) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.3.4 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.3.4-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 922c84fd..a2541dc2 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.0.5.orig.tar.xz (2014-05-12:19/1) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_6.0.5 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_6.0.5-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz + sisu_6.0.5.orig.tar.xz + sisu_6.0.5-1.dsc + %% 6.0.4.orig.tar.xz (2014-02-14:06/5) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_6.0.4 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_6.0.4-1 diff --git a/data/sisu/v5/v/version.yml b/data/sisu/v5/v/version.yml index 077b7e41..cbe3f4e0 100644 --- a/data/sisu/v5/v/version.yml +++ b/data/sisu/v5/v/version.yml @@ -1,5 +1,5 @@ --- :project: SiSU -:version: 5.3.4 -:date_stamp: 2014w06/5 -:date: "2014-02-14" +:version: 5.3.5 +:date_stamp: 2014w19/1 +:date: "2014-05-12" diff --git a/data/sisu/v6/v/version.yml b/data/sisu/v6/v/version.yml index 4c93b69d..8ce3ad41 100644 --- a/data/sisu/v6/v/version.yml +++ b/data/sisu/v6/v/version.yml @@ -1,5 +1,5 @@ --- :project: SiSU -:version: 6.0.4 -:date_stamp: 2014w06/5 -:date: "2014-02-14" +:version: 6.0.5 +:date_stamp: 2014w19/1 +:date: "2014-05-12" diff --git a/rbuild b/rbuild index 82ce763f..e5a776f1 100644 --- a/rbuild +++ b/rbuild @@ -37,8 +37,8 @@ #require 'mkmf' #create_makefile("sisu") #% manual settings, edit/update as required (note current default settings are obtained from sisu version yml file) -SiSU_version_next_stable = '5.3.4' -SiSU_version_next_unstable = '6.0.4' +SiSU_version_next_stable = '5.3.5' +SiSU_version_next_unstable = '6.0.5' #% rake file SiSU_version_generic_next_stable = '5.3.x' SiSU_version_generic_next_unstable = '6.0.x' @@ -377,7 +377,7 @@ end end def self.install(fn) system(%{ - sudo gem install --no-rdoc --no-ri --verbose #{fn}.gem + sudo gem install --no-document --verbose #{fn}.gem }) end module Current -- cgit v1.2.3 From e38554e5acad9b3dd93b0e6e4cedd39d5ff2f1a2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:31:23 -0400 Subject: v5 v6: coding, various minor cosmetic --- .../sisu/markup-samples/manual/en/sisu_markup.sst | 12 +----- lib/sisu/v5/constants.rb | 2 +- lib/sisu/v5/digests.rb | 12 +++--- lib/sisu/v5/html_format.rb | 2 +- lib/sisu/v5/html_minitoc.rb | 3 +- lib/sisu/v6/constants.rb | 2 +- lib/sisu/v6/digests.rb | 12 +++--- lib/sisu/v6/html_format.rb | 2 +- lib/sisu/v6/html_minitoc.rb | 3 +- lib/sisu/v6/texpdf_format.rb | 46 +++++++++++----------- lib/sisu/v6/xml_docbook5.rb | 2 +- lib/sisu/v6/xml_fictionbook2.rb | 2 +- 12 files changed, 47 insertions(+), 53 deletions(-) diff --git a/data/doc/sisu/markup-samples/manual/en/sisu_markup.sst b/data/doc/sisu/markup-samples/manual/en/sisu_markup.sst index fbd6d1f4..be6d7b9d 100644 --- a/data/doc/sisu/markup-samples/manual/en/sisu_markup.sst +++ b/data/doc/sisu/markup-samples/manual/en/sisu_markup.sst @@ -1168,9 +1168,9 @@ To draw a dividing line dividing paragraphs, see the section on page breaks. Page breaks are only relevant and honored in some output formats. A page break or a new page may be inserted manually using the following markup on a line on its own: -page new =\\= or <:pn> breaks the page, starts a new page. +page new =\\= (or <:pn>) breaks the page, starts a new page. -page break -\\- or <:pb> breaks a column, starts a new column, if using columns, else breaks the page, starts a new page. +page break -\\- (or <:pb>) breaks a column, starts a new column, if using columns, else breaks the page, starts a new page. page break line across page -..- draws a dividing line, dividing paragraphs @@ -1180,10 +1180,6 @@ code{ -\\- -or - -<:pb> - }code page (break) new: @@ -1192,10 +1188,6 @@ code{ =\\= -or - -<:pn> - }code page (break) line across page (dividing paragraphs): diff --git a/lib/sisu/v5/constants.rb b/lib/sisu/v5/constants.rb index a9be54f0..d47d9a7e 100644 --- a/lib/sisu/v5/constants.rb +++ b/lib/sisu/v5/constants.rb @@ -353,7 +353,7 @@ check: ♩ ♭  ✠  ▭ ▬ ▪ 【】〖〗◢ ◣ ◀ ▶ ◘ ◙ 《》「」 - ‹ › ∗  + ‹ › ∗  ∴ ∷ '〔lv1〕','〔lv2〕','〔lv3〕','〔lv4〕','〔lv5〕','〔lv6〕','〔lv7〕','〔lv8〕','〔lv9〕' '〔 Ѳ1〕','〔 Ѳ2〕','〔 Ѳ3〕','〔 Ѳ4〕','〔 Ѳ5〕','〔Ѳ6〕','〔Ѳ7〕','〔Ѳ8〕','〔Ѳ9〕' ◁▷ diff --git a/lib/sisu/v5/digests.rb b/lib/sisu/v5/digests.rb index 7099b646..3acd51eb 100644 --- a/lib/sisu/v5/digests.rb +++ b/lib/sisu/v5/digests.rb @@ -91,13 +91,13 @@ module SiSU_DigestView if @opt.act[:verbose_plus][:set]==:on \ or @opt.act[:maintenance][:set]==:on SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}").flow - end - end - if SiSU_Env::SystemCall.new.openssl - SiSU_DigestView::Source::Scroll.new(@particulars).songsheet - else - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('*EXITED* hash digests will not run without openssl') end + end + if SiSU_Env::SystemCall.new.openssl + SiSU_DigestView::Source::Scroll.new(@particulars).songsheet + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('*EXITED* hash digests will not run without openssl') + end rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ diff --git a/lib/sisu/v5/html_format.rb b/lib/sisu/v5/html_format.rb index e244bbb8..058a8f34 100644 --- a/lib/sisu/v5/html_format.rb +++ b/lib/sisu/v5/html_format.rb @@ -217,7 +217,7 @@ module SiSU_HTML_Format @env=SiSU_Env::InfoEnv.new(md.fns) @file=SiSU_Env::FileOp.new(md) @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure - @make=SiSU_Env::ProcessingSettings.new(@md) + @make=SiSU_Env::ProcessingSettings.new(md) end def home %{ diff --git a/lib/sisu/v5/html_minitoc.rb b/lib/sisu/v5/html_minitoc.rb index 5366b127..8b802a81 100644 --- a/lib/sisu/v5/html_minitoc.rb +++ b/lib/sisu/v5/html_minitoc.rb @@ -143,7 +143,8 @@ end txt_obj={ txt: title } format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj) - toc_mini=if txt.name =~/^meta/ and txt.obj=~/Document Information/ + toc_mini=if txt.name =~/^meta/ \ + and txt.obj=~/Document Information/ format_toc.mini_tail else format_toc.mini_lev1 end diff --git a/lib/sisu/v6/constants.rb b/lib/sisu/v6/constants.rb index e70a2f98..0f76ed59 100644 --- a/lib/sisu/v6/constants.rb +++ b/lib/sisu/v6/constants.rb @@ -353,7 +353,7 @@ check: ♩ ♭  ✠  ▭ ▬ ▪ 【】〖〗◢ ◣ ◀ ▶ ◘ ◙ 《》「」 - ‹ › ∗  + ‹ › ∗  ∴ ∷ '〔lv1〕','〔lv2〕','〔lv3〕','〔lv4〕','〔lv5〕','〔lv6〕','〔lv7〕','〔lv8〕','〔lv9〕' '〔 Ѳ1〕','〔 Ѳ2〕','〔 Ѳ3〕','〔 Ѳ4〕','〔 Ѳ5〕','〔Ѳ6〕','〔Ѳ7〕','〔Ѳ8〕','〔Ѳ9〕' ◁▷ diff --git a/lib/sisu/v6/digests.rb b/lib/sisu/v6/digests.rb index e708e4e9..1fa2c80f 100644 --- a/lib/sisu/v6/digests.rb +++ b/lib/sisu/v6/digests.rb @@ -91,13 +91,13 @@ module SiSU_DigestView if @opt.act[:verbose_plus][:set]==:on \ or @opt.act[:maintenance][:set]==:on SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"file://#{@md.file.output_path.hash_digest.dir}/#{@md.file.base_filename.hash_digest}").flow - end - end - if SiSU_Env::SystemCall.new.openssl - SiSU_DigestView::Source::Scroll.new(@particulars).songsheet - else - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('*EXITED* hash digests will not run without openssl') end + end + if SiSU_Env::SystemCall.new.openssl + SiSU_DigestView::Source::Scroll.new(@particulars).songsheet + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error('*EXITED* hash digests will not run without openssl') + end rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ diff --git a/lib/sisu/v6/html_format.rb b/lib/sisu/v6/html_format.rb index de5a7144..2f7b030e 100644 --- a/lib/sisu/v6/html_format.rb +++ b/lib/sisu/v6/html_format.rb @@ -217,7 +217,7 @@ module SiSU_HTML_Format @env=SiSU_Env::InfoEnv.new(md.fns) @file=SiSU_Env::FileOp.new(md) @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure - @make=SiSU_Env::ProcessingSettings.new(@md) + @make=SiSU_Env::ProcessingSettings.new(md) end def home %{ diff --git a/lib/sisu/v6/html_minitoc.rb b/lib/sisu/v6/html_minitoc.rb index 13045b0d..b36188ec 100644 --- a/lib/sisu/v6/html_minitoc.rb +++ b/lib/sisu/v6/html_minitoc.rb @@ -143,7 +143,8 @@ end txt_obj={ txt: title } format_toc=SiSU_HTML_Format::FormatToc.new(@md,txt_obj) - toc_mini=if txt.name =~/^meta/ and txt.obj=~/Document Information/ + toc_mini=if txt.name =~/^meta/ \ + and txt.obj=~/Document Information/ format_toc.mini_tail else format_toc.mini_lev1 end diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index 97007d17..c1bd0f1c 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -1188,16 +1188,16 @@ module SiSU_TeX_Pdf @brace_url=SiSU_Viz::Defaults.new.url_decoration @tex2pdf=@@tex3pdf ||=SiSU_Env::SystemCall.new.tex2pdf_engine end - def xetex_code_listings(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list + def xetex_code_listings(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list word=str.scan(/\S+|\n/) #unless line =~/^(?:@\S|%+\s)/ para_array=[] str=if word word.each do |w| # _ - / # | : ! ^ ~ w=w.gsub(/#{Mx[:gl_o]}#lt#{Mx[:gl_c]}/,'<').gsub(/#{Mx[:gl_o]}#gt#{Mx[:gl_c]}/,'>'). gsub(/[\\]?~/,'~'). - gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,"\n"). #watch - gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). #126 usual - gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX + gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,"\n"). #watch + gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). #126 usual + gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX para_array << w end str=para_array.join(' ') @@ -1210,30 +1210,30 @@ module SiSU_TeX_Pdf gsub(/#{Mx[:br_eof]}/,''). gsub(/#{Mx[:br_endnotes]}/,''). #problem sequence -> - gsub(/&(?:lt|#060);/,'<'). # < SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'>'). # > SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'{'). # { SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'}'). # } SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). # ~ SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'#'). # # SiSU special character also LaTeX + gsub(/&(?:lt|#060);/,'<'). # < SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'>'). # > SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'{'). # { SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'}'). # } SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'~'). # ~ SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#035#{Mx[:gl_c]}/,'#'). # SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#033#{Mx[:gl_c]}/,'!'). # ! SiSU not really special sisu character but done, also LaTeX #gsub(/(^|\s)\*\s/,'\1\asterisk '). # * should you wish to escape astrisk e.g. describing \*{bold}* - gsub(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*'). # * should you wish to escape astrisk e.g. describing \*{bold}* + gsub(/#{Mx[:gl_o]}#042#{Mx[:gl_c]}/,'*'). # * should you wish to escape astrisk e.g. describing \*{bold}* gsub(/#{Mx[:gl_o]}#045#{Mx[:gl_c]}/,'-'). # - SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#043#{Mx[:gl_c]}/,'+'). # + SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#044#{Mx[:gl_c]}/,','). # + SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#038#{Mx[:gl_c]}/,'&'). #unless @txt=~/<:code>/ # / SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'/'). # / SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\'). # \ SiSU special character also LaTeX - gsub(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'_'). # _ SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#038#{Mx[:gl_c]}/,'&'). #unless @txt=~/<:code>/ # / SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#047#{Mx[:gl_c]}/,'/'). # / SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#092#{Mx[:gl_c]}/,'\\'). # \ SiSU special character also LaTeX + gsub(/#{Mx[:gl_o]}#095#{Mx[:gl_c]}/,'_'). # _ SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'|'). # | SiSU not really special sisu character but done, also LaTeX gsub(/#{Mx[:gl_o]}#058#{Mx[:gl_c]}/,':'). # : SiSU not really special sisu character but done, also LaTeX - gsub(/#{Mx[:gl_o]}#094#{Mx[:gl_c]}|\^/,'^'). # ^ SiSU not really special sisu character but done, also LaTeX + gsub(/#{Mx[:gl_o]}#094#{Mx[:gl_c]}|\^/,'^'). # ^ SiSU not really special sisu character but done, also LaTeX ##watch placement, problem sequence ^ gsub(/&atild;<\/font><\/sup>/,' '). - gsub(/\\copy(right|mark)?/,'<=copymark>') # ok problem with superscript + gsub(/\\copy(right|mark)?/,'<=copymark>') # ok problem with superscript end - def xetex_special_characters_1(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list + def xetex_special_characters_1(str,is=:default) # ~ ^ $ & % _ { } #LaTeX special characters - KEEP list word=str.scan(/\S+|\n/) #unless line =~/^(?:@\S|%+\s)/ para_array=[] str=if word @@ -1245,9 +1245,9 @@ module SiSU_TeX_Pdf end w=w.gsub(/#{Mx[:gl_o]}#lt#{Mx[:gl_c]}/,'<').gsub(/#{Mx[:gl_o]}#gt#{Mx[:gl_c]}/,'>'). gsub(/[\\]?~/,'<=tilde>'). - gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,' \newline '). #watch - gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>'). #126 usual - gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'\pipe') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX + gsub(/[#{Mx[:br_line]}#{Mx[:br_paragraph]}]/,' \newline '). #watch + gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/,'<=tilde>'). #126 usual + gsub(/\\?\||#{Mx[:gl_o]}#124#{Mx[:gl_c]}/,'\pipe') #unless is=='code' #unless w=~/<~\d+;(?:[ohmu]|[0-6]:)\d+;\w\d+>/ # | SiSU not really special sisu character but done, also LaTeX if w !~/#{Mx[:rel_o]}/ \ and w !~/#{Mx[:gl_o]}#/ w=w.gsub(/\#/,'<=hash>') @@ -1264,8 +1264,8 @@ module SiSU_TeX_Pdf gsub(/#{Mx[:br_eof]}/,''). gsub(/#{Mx[:br_endnotes]}/,'') #problem sequence -> - str=str.gsub(/&(?:nbsp);|#{Mx[:nbsp]}/,'\hardspace') unless is==:code # < SiSU special character also LaTeX - str=str.gsub(/&(?:lt|#060);/,'\lt'). # < SiSU special character also LaTeX + str=str.gsub(/&(?:nbsp);|#{Mx[:nbsp]}/,'\hardspace') unless is==:code # < SiSU special character also LaTeX + str=str.gsub(/&(?:lt|#060);/,'\lt'). # < SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#(?:gt|062)#{Mx[:gl_c]}/,'\gt'). # > SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#123#{Mx[:gl_c]}/,'\curlyopen'). # { SiSU special character also LaTeX gsub(/#{Mx[:gl_o]}#125#{Mx[:gl_c]}/,'\curlyclose'). # } SiSU special character also LaTeX diff --git a/lib/sisu/v6/xml_docbook5.rb b/lib/sisu/v6/xml_docbook5.rb index 84c2181c..98369836 100644 --- a/lib/sisu/v6/xml_docbook5.rb +++ b/lib/sisu/v6/xml_docbook5.rb @@ -110,7 +110,7 @@ module SiSU_XML_Docbook_Book class Scroll [#{o.ocn}] #{o.ln} #{o.obj}#{comment}" : "<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}#{comment}" end -- cgit v1.2.3 From f06613bb90d370053963d544b14ee7c3e8706671 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:33:11 -0400 Subject: v6: xml object citation numbering (docbook fictionbook) --- lib/sisu/v6/xml_docbook5.rb | 5 ++++- lib/sisu/v6/xml_fictionbook2.rb | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/sisu/v6/xml_docbook5.rb b/lib/sisu/v6/xml_docbook5.rb index 98369836..f5dba87a 100644 --- a/lib/sisu/v6/xml_docbook5.rb +++ b/lib/sisu/v6/xml_docbook5.rb @@ -113,6 +113,7 @@ module SiSU_XML_Docbook_Book @trans=SiSU_XML_Munge::Trans.new(md) @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(md.opt) @env=@particulars.env + @make ||=SiSU_Env::ProcessingSettings.new(md) end def songsheet @t='sisu' @@ -198,7 +199,9 @@ module SiSU_XML_Docbook_Book filename_docbook.puts head data.each_with_index do |o,i| if (defined? o.ocn and not o.ocn.nil?) - ocn="\n#{Dx[:ocn_o]}#{o.ocn}#{Dx[:ocn_c]}" + ocn=(@make.build.ocn?) \ + ? "\n#{Dx[:ocn_o]}#{o.ocn}#{Dx[:ocn_c]}" + : '' id=%{ id="o#{o.ocn}" } else ocn,id='','' diff --git a/lib/sisu/v6/xml_fictionbook2.rb b/lib/sisu/v6/xml_fictionbook2.rb index 7d86e9f9..d0ad4a7f 100644 --- a/lib/sisu/v6/xml_fictionbook2.rb +++ b/lib/sisu/v6/xml_fictionbook2.rb @@ -304,7 +304,12 @@ module SiSU_XML_Fictionbook doc_position=:head filename_fictionbook.puts head data.each_with_index do |o,i| - ocn=(defined? o.ocn and not o.ocn.nil?) ? "\n#{Dx[:ocn_o]}#{o.ocn}#{Dx[:ocn_c]}" : '' + ocn=if @make.build.ocn? + (defined? o.ocn and not o.ocn.nil?) \ + ? "\n#{Dx[:ocn_o]}#{o.ocn}#{Dx[:ocn_c]}" + : '' + else '' + end if o.is ==:heading unless doc_position==:head filename_fictionbook.puts structure_build_tag_close(o.lc,h) -- cgit v1.2.3 From 388eef4bdb54053bcf6f0bf7fafc8cc2f9dc4481 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:35:13 -0400 Subject: sisu.org start using emacs:evil:org; update .gitignore * (emacs:evil mode gifts a "vim" of "alternative" powers! ;) heretic --- .gitignore | 4 +- data/doc/sisu/CHANGELOG_v5 | 2 + data/doc/sisu/CHANGELOG_v6 | 2 + sisu.org | 932 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 937 insertions(+), 3 deletions(-) create mode 100644 sisu.org diff --git a/.gitignore b/.gitignore index 6d13f762..34ee93ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ # git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): *~ +\#* *.gem *.gemspec diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index a03b1b0e..062b1e1b 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.3.5.orig.tar.xz sisu_5.3.5.orig.tar.xz sisu_5.3.5-1.dsc +* added sisu.org emacs:evil:org mode notes related to sisu development + %% 5.3.4.orig.tar.xz (2014-02-14:06/5) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_5.3.4 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_5.3.4-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index a2541dc2..a8250d21 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.0.5.orig.tar.xz sisu_6.0.5.orig.tar.xz sisu_6.0.5-1.dsc +* added sisu.org emacs:evil:org mode notes related to sisu development + %% 6.0.4.orig.tar.xz (2014-02-14:06/5) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/sisu_6.0.4 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=shortlog;h=refs/tags/debian/sisu_6.0.4-1 diff --git a/sisu.org b/sisu.org new file mode 100644 index 00000000..724831bd --- /dev/null +++ b/sisu.org @@ -0,0 +1,932 @@ +#+PRIORITIES: A F E +(emacs:evil mode gifts a "vim" of "alternative" powers! ;) + +* Markup :sisu:markup: + +** sisu + +#% structure - headings, levels + * headings (A-D, 1-3) + * inline + 'A~ ' NOTE title level + 'B~ ' NOTE optional + 'C~ ' NOTE optional + 'D~ ' NOTE optional + '1~ ' NOTE chapter level + '2~ ' NOTE optional + '3~ ' NOTE optional + '4~ ' NOTE optional :consider: + * node + * parent + * children + +#% font face NOTE open & close marks, inline within paragraph + * emphasize '*{ ... }*' NOTE configure whether bold italics or underscore, default bold + * bold '!{ ... }!' + * italics '/{ ... }/' + * underscore '_{ ... }_' + * superscript '^{ ... }^' + * subscript ',{ ... },' + * strike '-{ ... }-' + * add '+{ ... }+' + * monospace '#{ ... }#' +#% para NOTE paragraph controls are at the start of a paragraph + * a para is a block of text separated from others by an empty line + * indent + * default, all '_1 ' up to '_9 ' + * first line hang '_1_0 ' + * first line indent further '_0_1 ' + * bullet + [levels 1-6] + '_* ' + '_1* ' + '_2* ' + * numbered list + [levels 1-3] + '# ' + +#% blocks NOTE text blocks that are not to be treated in the way that ordinary paragraphs would be + * code + * [type of markup if any] + * poem + * group + * alt + * tables +#% boxes + NOTE grouped text with code block type color & possibly default image, warning, tip, red, blue etc. decide [NB N/A not implemented] + +#% notes NOTE inline within paragraph at the location where the note reference is to occur + * footnotes '~{ ... }~' + * [bibliography] [NB N/A not implemented] + +#% links, linking + * links - external, web, url + * links - internal + +#% images [multimedia?] + * images + * [base64 inline] [N/A not implemented] + +#% object numbers + * ocn (object numbers) + automatically attributed to substantive objects, paragraphs, tables, blocks, verse (unless exclude marker provided) + +#% contents + * toc (table of contents) + autogenerated from structure/headings information + * index (book index) + built from hints in newline text following a paragraph and starting with ={} has identifying rules for main and subsidiary text + +#% breaks + * line break ' \\ ' inline + * page break, column break ' -\\- ' start of line, breaks a column, starts a new column, if using columns, else breaks the page, starts a new page. + * page break, page new ' =\\= ' start of line, breaks the page, starts a new page. + * horizontal '-..-' start of line, rule page (break) line across page (dividing paragraphs) + +#% book type index + +#% comment + * comment + +#% misc + * term & definition + +** proposals/additions + +*** TODO [#B] markup syntax code block, indicate syntax of code :feature: + ``` code:ruby + +*** TODO [#C] colored boxes round text :feature:ponder: + ``` box:red (select color of box) + ``` box:warn ``` box:tip (some default boxes? decide) + ``` box:red:"Warn" (select color and lead text of box, else instead + select color box & use regular single line bold markup ^!_ Warn$) + +*** TODO [#D] bibliography :feature:ponder: + +*** TODO speaker, as e.g. play (irc?) :feature:ponder: + ``` Ophelia: + ::Ophelia + +*** TODO [#F] time stamp (e.g. for irc, video text?):feature:ponder: + ``` 04:03 + ``` 04:03 ... 07:12 + ``` 04:03 + 03:09 + ``` 12:04:03 + ``` 12:04:03 ... 12:07:12 + ``` 12:04:03 + 03:09 + probably not worth the effort, as time stamp is an alternative + identifying number (to ocn, and ∴ sisu objects not ideal) + +*** TODO book index, alternative based on search within text + +** syntax hilighting + +*** vim +data/sisu/conf/editor-syntax-etc/vim/ +data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim + +*** emacs +data/sisu/conf/editor-syntax-etc/emacs/ +data/sisu/conf/editor-syntax-etc/emacs/sisu-mode.el + +* Document Abstraction :sisu:doc_abstr: + +** TODO [#D] XML middle layer? + +*** XMLda sisu + consder alternative sisu layer in XML + +*** TODO [#D] RelaxNG sisu + +* Output :sisu:output: + +** New outputs + +*** XML :xml: +%% xml, docbook.txt fictionbook.txt xldl.txt lml.txt tei.txt emacs.txt + + + + + + +xml editor vim emacs + +nXML plugin + + + + + +emacs.txt evil.txt + + + + +To validate a book.xml file using xmllint, run the following command: +$ xmllint --postvalid --xinclude --noout book.xml + +The default location where xmllint will look for the catalog file is +/etc/xml/catalog. Alternatively, you can set the environment variable +XML_CATALOG_FILES to define another default location for catalog +files. Once you’ve got the DTD and catalog set up locally, you can +validate as before: +$ xmllint --postvalid --xinclude --noout book.xml + +%% Docbook +docbook.txt + +%% Fictionbook +fictionbook.txt + +%% XLDL +xldl.txt + +%% Literature Markup Language +lml.txt + +%% Text Encoding Initiative +tei.txt + +**** TODO [#B] docbook :feature: + +***** urls +#% docbook book xml.txt + + + + + + + + + + + + + + + + + + + +***** rb file +lib/sisu/v6/xml_docbook5.rb + +***** transformations :transform:markup_docbook: +#% structure - headings, levels + [] sisu (A-C, 1-3) + [] collapsed (1-6) (decoration) + [] node (child, parent ...) + +#% font face + [] bold + [] italics + [] underscore + [] superscript + [] subscript + [] strike + [] add + +#% para + [] default + [] indent + [] default, all + [] first line hang or indent further + [] bullet + +#% blocks + + [] code + [] [type of markup if any] + [] poem + [] group + [] alt + [] tables + +#% notes + [] footnotes + [] [bibliography?] + +#% links, linking + [] links - external, web, url + [] links - internal + +#% images [multimedia?] + [] images + [] [base 64] + +#% object numbers + [] ocn (object numbers) + +#% contents + [] toc (table of contents) + + [] index (book index) + +#% misc + +**** TODO [#D] fictionbook :feature: + +***** urls +#% fictionbook xml.txt + + + + + + + + + + +***** rb file +lib/sisu/v6/xml_fictionbook2.rb + +***** transformations :transformations:markup_fictionbok: #% +#% structure - headings, levels + [] sisu (A-C, 1-3) + [] collapsed (1-6) (decoration) + [] node (child, parent ...) + +#% font face + [] bold + [] italics + [] underscore + [] superscript + [] subscript + [] strike + [] add + [] monospace + +#% para + [] default + [] indent + [] default, all + [] first line hang or indent further + [] bullet + +#% blocks + [] code + [] [type of markup if any] + [] poem + [] group + [] alt + [] tables + +#% notes + [] footnotes + [] [bibliography?] + +#% links, linking + [] links - external, web, url + [] links - internal + +#% images [multimedia?] + [] images + [] [base 64] + +#% object numbers + [] ocn (object numbers) + +#% contents + [] toc (table of contents) + [] index (book index) + +#% breaks + [] line break + [] horizontal rule + [] column break + [] page break + +#% comment + [] comment + +#% misc + + + + + + + + + + + + +**** TODO [#D] XLDL :feature: + +***** urls +%% xml.txt xldl - novels, stories, poems +Name: XLDL - an XML doctype for novels, stories, poems, playsName: XLDL - an XML doctype for novels, stories, poems, plays + + + + +**** TODO [#E] Literature Markup Language - :feature: + +***** urls +%% Literature Markup Language - + +"It is assumed, that there are three quite different techniques to provide text, +respectively three types of text, this is prose and poetry and code (for +example source code of computer programs or from markup languages)." +Suggestions and Ideas for Literature Markup Language - 1.1 + + +**** TODO [#E] TEI Lite (Text Encoding Initiative) :feature: + +***** urls +%% TEI Lite (Text Encoding Initiative) + + + +*** Text :txt: + +sisu_markup.txt asciidoc.txt markdown.txt textile.txt rst.txt + +**** TODO [#D] asciidoc :feature: + +***** urls +#% asciidoc + + + + + +cheatsheets + + + + + + + + + + +***** rb file +lib/sisu/v6/txt_asaciidoc.rb + +***** transformations :transformations:markup_asciidoc: #% +#% structure - headings, levels + [] sisu (A-C, 1-3) + [] collapsed (1-4) (decoration) + [] inline + '== ' + '=== ' + '==== ' + '===== ' + '' + '' + [] underscore + '-' + '~' + '^' + '+' + '' ['.' proposed] + '' ['.' proposed] + [] node (child, parent ...) + +#% font face + [open & close marks] + [] bold + '*' + [] italics + '_' + [] underscore + '' + [] superscript + '^' + [] subscript + '~' + [] strike + '-' + [] add + [] monospace + '+' + '`' pass markup through unchanged, monospace code + +#% para + [] default + [] indent + [] default, all + [] first line hang or indent further + [] bullet + [levels 1-6] + '*' + '**' + '***' + '****' + '*****' + '*******' + [] numbered list + [levels 1-3] + '. ' number + '.. ' lower alpha + '... ' lower roman + '.... ' upper alpha + '..... ' upper roman + +#% blocks + [] code + [source,perl] + ---- + code here + ---- + [] [type of markup if any] + [] poem + [] group + ---- + grouped text here, actually a listing block + ---- + [] alt + [] tables + +#% notes + [] footnotes + [] [bibliography?] + +#% links, linking + [] links - external, web, url + http://google.com[Google Search] + [] links - internal + +#% images [multimedia?] + [] images + [] [base 64] + +#% object numbers + [] ocn (object numbers) + +#% contents + [] toc (table of contents) + [] index (book index) + +#% breaks + [] line break + "+\n" + forced + + line break + [] horizontal rule + [] column break + [] page break + +#% comment + [] comment + // + +#% misc + + [] term & definition +Term 1:: Definition 1 +Term 2:: Definition 2 +[horizontal] + Term 2.1;; + Definition 2.1 + Term 2.2;; + Definition 2.2 + +**** TODO [#E] markdown :feature: + +***** urls +#% markdown + + + + + + + +Markdown supports two styles of headers, Setext and atx +Setext + + +atx + + + + + + + + + + + + + + +#% pandoc markdown + + + + + + + +#% multimarkdown + + +#% markdown pandoc v multimarkdown + + +#% rST v markdown + + +***** rb file +lib/sisu/v6/txt_markdown.rb + +***** transformations :transformations:markup_markdown: #% +#% structure - headings, levels + [] sisu (A-C, 1-3) + [] collapsed (1-6) (decoration) + [inline 1-5] + '#' + '##' + '###' + '####' + '#####' + '######' + [underscore 1-5] + '=' + '-' + #'~' + #'^' + #'+' + [] node (child, parent ...) + +#% font face + [open & close marks] + [] bold + '**' + [] italics + '*' + [] underscore + '' + [] superscript + '' + [] subscript + '' + [] strike + '' + [] add + [] monospace + '`' + +#% para + [] default + [] indent + [] default, all + [] first line hang or indent further + [] bullet + '*' + [] numbered list + '0.' + +#% blocks + [] code + ' ' #indent at least 4 spaces + [] [type of markup if any] + [] poem + [] group + [] alt + [] tables + +#% notes + [] footnotes + [] [bibliography?] + +#% links, linking + [] links - external, web, url + [] links - internal + +#% images [multimedia?] + [] images + [] [base 64] + +#% object numbers + [] ocn (object numbers) + +#% contents + [] toc (table of contents) + [] index (book index) + +#% breaks + [] line break + [] horizontal rule + (three or more asterisks hypens or underscores) + * * * + *** + ***** + - - - + ___ + [] column break + [] page break + +#% misc + +**** TODO [#F] rst :feature: + +***** urls +#% rST + + + + + + + + +#% rST v markdown + + +***** rb file +lib/sisu/v6/txt_rst.rb + +***** transformations :transformations:markup_rst: #% +#% structure - headings, levels + [] sisu (A-C, 1-3) + [] collapsed (1-6) (decoration) + [inline] + N/A + [underscore] + Titles are underlined (or over- and underlined) with a printing + nonalphanumeric 7-bit ASCII character. Recommended choices are + "= - ` : ' " ~ ^ _ * + # < >". The underline/overline must be at + least as long as the title text. + '=' + '-' + '`' + ':' + "'" + '"' + + [] node (child, parent ...) + +#% font face + [] bold + '**' + [] italics + '*' + [] underscore + '+' + [] superscript + '^' + [] subscript + [] strike + '-' + [] add + [] monospace + '``' + +#% para + [] default + [] indent + [] default, all + [] first line hang or indent further + [] bullet + "-", "*" or "+" + '-' + [] numbered list + '#.' + +#% blocks + [] code + [] [type of markup if any] + [] poem + [] group + [] alt + [] tables + +#% notes + [] footnotes + [binary] + Footnote references, like [5]_. + Note that footnotes may get + rearranged, e.g., to the bottom of + the "page". + .. [5] A numerical footnote. + -- + Autonumbered footnotes are + possible, like using [#]_ and [#]_. + .. [#] This is the first one. + .. [#] This is the second one. + + [] [bibliography?] + +#% links, linking + [] links - external, web, url + Typical result + External hyperlinks, like Python_. + .. _Python: + or + External hyperlinks, like `Python + `_. + [] links - internal + Internal crossreferences, like example_. + .. _example: + + This is an example crossreference target. + -- + Titles are targets, too + ======================= + Implict references, like `Titles are + targets, too`_. + +#% images [multimedia?] + [] images + [] [base 64] + +#% object numbers + [] ocn (object numbers) + +#% contents + [] toc (table of contents) + [] index (book index) + +#% breaks + [] line break + [] horizontal rule + [] column break + [] page break + +#% misc + +**** TODO [#F] textile :feature: + +***** urls +#% textile + +v2.4 + +v2 + + +***** rb file +lib/sisu/v6/txt_textile.rb + +***** transformations :transformations:markup_textile: #% +#% structure - headings, levels + [] sisu (A-C, 1-3) + [] collapsed (1-6) (decoration) + [inline] + h1(#id). An HTML first-level heading + h2. An HTML second-level heading + h3. An HTML third-level heading + h4. An HTML fourth-level heading + h5. An HTML fifth-level heading + h6. An HTML sixth-level heading + [underscore] + N/A + + [] node (child, parent ...) + +#% font face + [] bold + *bold text* + [] italics + _italic text_ + [] underscore + +underlined text+ + [] superscript + ^TM^ + [] subscript + ~subscript~ + [] strike + -strikethrough text- + [] add + +#% para + [] default + [] indent + [] default, all + [] first line hang or indent further + [] bullet + * bulleted list + ** 2-level + +#% blocks + [] code + [] [type of markup if any] + [] poem + [] group + [] alt + [] tables + |Table | with two columns | + |and two | rows | + +#% notes + [] footnotes + Text with a link to some reference[1] + fn1. Footnote explanation + [] [bibliography?] + +#% links, linking + [] links - external, web, url + "(classname)link text(title tooltip)":link_address + "Link to Wikipedia":http://www.wikipedia.org + [] links - internal + +#% images [multimedia?] + [] images + !http://commons.wikimedia.org/wiki/Special:Filepath/Wikipedia-logo-en.png! + !imageurl(alt text)! + [] [base 64] + +#% object numbers + [] ocn (object numbers) + +#% contents + [] toc (table of contents) + [] index (book index) + +#% breaks + [] line break + [] horizontal rule + [] column break + [] page break + +#% misc + [] *_bold italic text_* + [] *-bold strikethrough text-* + [] *_-bold italic strikethrough text-_* + [] *+bold underlined text+* + [] *_+italic underlined text+_ + [] *_+bold italic underlined text+_ + [] *_-+bold italic strikethrough underlined text+-_* + %{font-size:18pt}font size% + %{color:red}text in red% + # Chapter 1 + +#% notes +heading inline only +footnotes uses marker and endnote, check + +** Improvements + +*** HTML + +*** XML + +*** --strict mode (html w3c compliant ocn etc.) + +* Code (ruby) :sisu:code: + +** code enhancements :enhance: + +*** TODO [#D] directory & path, use ruby directory tools + +*** TODO [#D] document url shortcut, allow addition of alternative dir stub +(e.g. viral Spiral) + +** code refactoring :refactor: + +*** ruby 2.1 + +**** DONE make sure sisu works + +*** TODO [#C] refactor ruby :ongoing: -- cgit v1.2.3 From e170f0f6d0b15c76d845df3ec056056d1d6d9d3a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:37:01 -0400 Subject: sisu.org introduce a bug list * primarily DBT (Daniel's welcome bug flood) --- sisu.org | 830 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 830 insertions(+) diff --git a/sisu.org b/sisu.org index 724831bd..5473352f 100644 --- a/sisu.org +++ b/sisu.org @@ -930,3 +930,833 @@ footnotes uses marker and endnote, check **** DONE make sure sisu works *** TODO [#C] refactor ruby :ongoing: + +** bugs :bug: + +*** misc, unclassified + +**** TODO [#B] sisu should give warning when part of minimal essential structure is missing :processing:fix: + +work through testing for as many of these as possible + +minimal content/structure requirement: +[metadata] + @title: + @creator: +[levels] + A~ (level A [title]) + 1~ (at least one level 1 [segment/(chapter)]) +test what happens in the absence of each + +structure rules (document heirarchy, heading levels): + + there are two sets of heading levels ABCD (title & parts if any) and 123 (segment & subsegments if any) + sisu has the fllowing levels: + + A~ [title] . required (== 1) followed by B~ or 1~ + B~ [part] * followed by C~ or 1~ + C~ [subpart] * followed by D~ or 1~ + D~ [subsubpart] * followed by 1~ + 1~ [segment (chapter)] + required (>= 1) followed by text or 2~ + text * followed by more text or 1~, 2~ or relevant part *(B~ if none other used; if C~ is last used: C~ or B~; if D~ is used: D~, C~ or B~) + 2~ [subsegment] * followed by text or 3~ + text * followed by more text or 1~, 2~ or 3~ or relevant part, see *() + 3~ [subsubsegment] * followed by text + text * followed by more text or 1~, 2~ or 3~ or relevant part, see *() + + * level A~ is the tile and is mandatory + * there can only be one level A~ + * heading levels BCD, are optional and there may be several of each + (where all three are used corresponding to e.g. Book Part Section) + * sublevels that are used must follow each other sequentially (alphabetically), + * heading levels A~ B~ C~ D~ are followed by other heading levels rather than substantive text + which may be the subsequent sequential (alphabetic) heading part level + or a heading (segment) level 1~ + * there must be at least one heading (segment) level 1~ + (the level on which the text is segmented, in a book would correspond to the Chapter level) + * additional heading levels 1~ 2~ 3~ are optional and there may be several of each + * heading levels 1~ 2~ 3~ are followed by text (which may be followed by the same heading level) + and/or the next lower numeric heading level (followed by text) + or indeed return to the relevant part level + (as a corollary to the rules above substantive text/ content + must be preceded by a level 1~ (2~ or 3~) heading) + +there must be a title, level A +creator field absent: crash, no warnings given +title missing: +level A missing: +no level 1: + +**** TODO [#B] victory chals discussed parsing problem caused by use of open-close markers around url + +**** TODO [#B] exclude heading where possible marker '-#' not distinguished from unnumbered heading '~#' + + * ~# is general & means no ocn (for any object to which it is applied) + * -# is relevant only for 1~ dummy headings & instructs that they should be + removed from output where possible + * where -# is used on any other objects, it is treated the same way as ~# + +**** TODO [#B] collapsed level work out logic where dummy lev1 heading + + * exclude heading where lev1 '-#' + * means subsequent headings & text belong to parent heading (of lev1 -#) 1 level up + * ponder + +*** DBT Outstanding bugs -- Normal bugs; Unclassified (2 bugs) :debian:dbt:normal: + + +**** TODO [#B] #744360 [n|u] sisu: includes do not work properly :processing:fix: + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: includes do not work properly +Date: Sun, 13 Apr 2014 12:38:59 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +using this in foo.ssm: + + :A~ foo + + :B~ bar + + << bar/baz.ssi + +and this in baz.ssi: + + 1~ foo bar baz + +then everything works. + +using the more natural foo.ssm: + + :A~ foo + + << bar/baz.ssi + +and baz.ssi: + + :B~ bar + + 1~ foo bar baz + +makes ':B~ bar' being ignored in the output (pdf) entirely. + +Regards, +Daniel + +**** TODO [#B] #744378 [n|u] sisu: --no-manifest not working anymore + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: --no-manifest not working anymore +Date: Sun, 13 Apr 2014 16:12:13 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +when running sisu-pdf with --no-manifest, the output (pdf) still +contains the sisu manifest at the end of the document. + +Regards, +Daniel + +**** TODO ONGOING #746740 [n|u] manpages incomplete + +Date: Sat, 03 May 2014 08:45:49 +0200 +From: Daniel Baumann +Subject: manpages incomplete +Package: sisu +Version: 5.3.4-1 +Tag: upstream +Severity: normal + +sisu supports options like --verbose or --no-manifest, but they are not +listed in the sisu manpage. + +**** TODO #746742 [n|u] please implement --no-metadata similar to --no-manifest + +Date: Sun, 13 Apr 2014 16:12:13 +0200 +From: Daniel Baumann +Subject: --no-manifest not working anymore +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +when running sisu-pdf with --no-manifest, the output (pdf) still +contains the sisu manifest at the end of the document. + +Regards, +Daniel + +*** DBT Outstanding bugs -- Wishlist items; Unclassified (24 bugs) :debian:dbt:wishlist: + +**** TODO [#D] #744352 [w|u] sisu output: aligning margin numbers when using 'code' + + +From: Daniel Baumann +To: 744352@bugs.debian.org +Subject: Re: sisu output: too many margin numbers +Date: Sun, 13 Apr 2014 17:27:10 +0200 +retitle 744352 sisu output: aligning margin numbers when using 'code' +severity 744352 wishlist +thanks + +sorry, i've looked wrongly at the output, the problem is simply an +aligning issue. it looks like that: + + foo bar. [1] + [2] + baz + + foo bar baz. [3] + +rather than: + + foo bar. [1] + + baz [2] + + foo bar baz. [3] + +Regards, +Daniel + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: too many margin numbers +Date: Sun, 13 Apr 2014 12:28:14 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +when using the following code: + +foo bar. + +code{ + + baz + +}code + +foo bar baz. + +the result in the output (pdf) is: + +foo bar. [1] + [2] +baz [3] + [4] +foo bar baz. [5] + +the '[n]' designates the margin number at the right site of the page. + +the problem is that sisu gives margin numbers to *empty* lines, which is +wrong. margin numbers should only be assigned to actual content. + +Regards, +Daniel + +**** TODO [#D] #744353 [w|u] sisu output: please do not use typewriter for urls + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: please do not use typewriter for urls +Date: Sun, 13 Apr 2014 12:28:27 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +when using urls in sisu like this: + + http://example.org + +sisu then creates in the output (pdf) links like this: + + + +where as '' is written in typewriter font +(monospace). please don't do that automagically since it's desturbing +the visual flow when reading. If the users wants that, he should be able +to configure it. + +Regards, +Daniel + +**** TODO [#C] #744354 [w|u] sisu output: please do not add '<' and '>' around urls + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: please do not add '<' and '>' around links +Date: Sun, 13 Apr 2014 12:28:37 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +when using urls in sisu like this: + + http://example.org + +sisu then creates in the output (pdf) links like this: + + + +Please do not automagically add a '<' and '>' around urls. If the user +wants them, he would add one. + +Regards, +Daniel + +**** TODO [#C] #744355 [w|u] vim syntaxhighlighting: includes and directories + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: vim syntaxhighlighting: includes and directories +Date: Sun, 13 Apr 2014 12:28:46 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +When using includes like this: + + << foo.ssi + +then vim correctly displays the line in blue. + +However, when using includes in a subdirectory like this: + + << bar/foo.ssi + +then vim doesn't use any colors at all. + +Regards, +Daniel + +**** TODO [#C] #744356 [w|u] vim syntaxhighlighting: urls and tags + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: vim syntaxhighlighting: urls and tags +Date: Sun, 13 Apr 2014 12:28:56 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +When using an URL at the end of a sentence like this: + + Foo bar baz http://example.org. + +then vim properly highlights the url in blue. + +this also works properly when a second sentence after it, like: + + Foo bar baz http://example.org. Foo bar baz http://example.org. + +it works with html tag as well, like this: + + Foo bar baz http://example.org.
Foo bar baz http://example.org. + +but it doesn't work if there's no space: + + Foo bar baz http://example.org.
Foo bar baz http://example.org. + +then, the string 'http://www.gnu.org/licenses/.<' is shown red. + +Regards, +Daniel + +**** TODO [#C] #744357 [w|u] sisu output: please create mailto links automatically + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: please create mailto links automatically +Date: Sun, 13 Apr 2014 12:29:12 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +When using urls like: + + http://example.org + +in sisu, the output (pdf) contains a hyperlink to http://example.org +automatically, which is nice. + +please also create mailto links when using email adresses like: + + john.doe@example.org + +Regards, +Daniel + +**** TODO [#C] #744358 [w|u] sisu output: please do not add ';' after \:copyright: + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: please do not add ';' after :copyright: +Date: Sun, 13 Apr 2014 12:29:20 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +When using: + + :copyright: foo bar baz. + +sisu generates the following in the output format (pdf): + + foo bar baz.; + +Please do not automagically add a semicolon (;). If the user wants a +semicolon, he would add one. + +Regards, +Daniel + +**** TODO [#B] #744379 [w|u] sisu: missing includes doesn't give an error + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: missing includes doesn't give an error +Date: Sun, 13 Apr 2014 16:14:46 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +When using includes (*.ssi) in a sisu master document (*.ssm) like: + + << foo.ssi + +and that to be included file foo.ssi (for whatever reason) doesn't +exist, sisu doesn't error out but include '<< foo.ssi' literally as a +string in the output (pdf). + +Regards, +Daniel + +**** TODO [#D] #744381 [w|u] sisu syntax: inconsistency \:copyright: and \:license: + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: inconsistency between :copyright: and :license: +Date: Sun, 13 Apr 2014 16:26:55 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +when using ':copyright: foo', then the output contains 'foo'. + +when using ':license: foo', then the output contains 'License: foo'. + +this is inconsistent. either both should have a 'prefix' in the output, +or neither should have one (i'd prefere the latter). + +Regards, +Daniel + +**** TODO [#B] #744383 [w|u] sisu syntax: :B and :C result in the same formatting + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu syntax: :B and :C result in the same formatting +Date: Sun, 13 Apr 2014 16:32:07 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +when using :A, :B, and :C in sisu, in the output (pdf) both :B and :C +are formatted identically. + +imho :C should be 'smaller' than :B. + +or, as an analogy with html: i would expect that :A equals

, :B +equals

, and :C equals

. currently, (in that analogy), :B and :C +both equal

. + +Regards, +Daniel + +**** TODO [#C] #744384 [w|u] sisu syntax: relies on empty lines + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu syntax: relies on empty lines +Date: Sun, 13 Apr 2014 16:34:46 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +the following snipped: + + :C~ foo bar + << foo-bar.ssi + +means that the include is ignored entirely. apparently sisu relies on +having an empty line in between like this: + + :C~ foo bar + + << foo-bar.ssi + +Regards, +Daniel + +**** TODO [#B] #744386 [w|u] sisu syntax: 1~ and 2~ result in the same formatting + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu syntax: 1~ and 2~ result in the same formatting +Date: Sun, 13 Apr 2014 16:43:51 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +similar as with #744383, the same also applies for 1~ and 2~ - they +should be different in the output format (pdf here). + +Regards, +Daniel + +**** TODO [#B] #744390 [w|u] sisu: empty sections are ignored + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu: empty sections are ignored +Date: Sun, 13 Apr 2014 17:09:32 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist + +if you have the following sisu syntax: + + :B~ foo + + 1~ foo1 + + foo1. + + 1~ foo2 + + foo2. + + :B~ bar + + 1~ bar1 + + 1~ bar2 + + :B~ baz + + 1~ baz1 + + 1~ baz2 + +then anything (including and) after ':B~ bar' is ignored entirely. + +**** TODO [#C] #744391 [w|u] sisu output: no color on a4 portrait + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu output: please use (blue) color for links +Date: Sun, 13 Apr 2014 17:23:37 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +it would be nice if links (urls and emails) would be colored blue to +mark them visually as links. this behaviour is somewhat the lowest +common denominator in browsers (if you use html without any css that is). + +Regards, +Daniel + +From: Daniel Baumann +To: 744391@bugs.debian.org +Subject: Re: sisu output: please use (blue) color for links +Date: Sun, 13 Apr 2014 17:35:33 +0200 +retitle 744391 sisu output: no color on a4 portrait +thanks + +now this is strange.. turns out that (yes, i have colors enabled in +sisurc) the portrait a4 pdf has no colors at all, while the landscape a4 +pdf does indeed have colors (red for toc, blue for links). + +Regards, +Daniel + +**** TODO [#D] #744395 [w|u] sisu output: half-page title page in landscape output + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu output: half-page title page in landscape output +Date: Sun, 13 Apr 2014 17:38:03 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +in a4 landscape output, there's always two pages on one page, which is +nice; except for the title page which spans over the whole page. + +it would be nice if the first page would be consistent to the same +scheme like the rest of the document - spanning only over the half of +the page. + +Regards, +Daniel + +**** TODO [#C] #744396 [w|u] sisu output: "european" toc indenting + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu output: "european" toc indenting +Date: Sun, 13 Apr 2014 17:40:53 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +by default, latex uses the following indenting in the TOC: + + 1. foo + 1.1 bar1 + 1.1.1 baz + 1.2 bar2 + +there's a latex option that i don't remember off-hand to have the +indenting like it's common in europe: + + 1. foo + 1.1 bar1 + 1.1.1 baz + 1.2 bar2 + +it would be nice if sisu could let the used decide which indenting style +to use for TOCs. + +Regards, +Daniel + +**** TODO [#B] #744399 [w|u] sisu syntax: :A smaller formatted than :B + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu syntax: :A smaller formatted than :B +Date: Sun, 13 Apr 2014 17:49:26 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +in a document like this: + +:A~ foo + +:B~ bar + +the :A~ 'title' is formated 'smaller' (not bold, smaller font size) than +the :B~ 'title' on the first page of the actual document (means, first +page after TOC). + +Regards, +Daniel + +**** TODO [#C] #744402 [w|u] sisu: support sha512 + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu: support sha512 +Date: Sun, 13 Apr 2014 18:06:56 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +sisu uses sha256 when using sha as digest, please support sha512. + +it would be even nicer if you could specify the actual digest like +'sha512', 'sha256', etc. rather than just 'sha'. + +Regards, +Daniel + +**** TODO [#C] #744405 [w|u] sisu: set default font size + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu: set default font size +Date: Sun, 13 Apr 2014 18:29:46 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +in sisurc, one can set the default fonts. it would be nice to be also +able to set the default font size. + +Regards, +Daniel + +**** TODO [#C] #744407 [w|u] sisu: possibility to influence content/formating of the title page + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu: possibility to influence content/formating of the title page +Date: Sun, 13 Apr 2014 18:32:14 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +by default, the title page (in the pdf output) shows @title and @creator. + +it would be nice if there would be a possibility to influence the +formatting (e.g. to have the title written in bold), and to have +additional possibilities to influence the content on the title page +(like the date or version, an url, or other text strings). + +Regards, +Daniel + +**** TODO [#C] #744408 [w|u] sisu: support more than one level of includes/nested includes + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu: support more than one level of includes/nested includes +Date: Sun, 13 Apr 2014 18:39:23 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +currently, it's possible to use only one ssm file which itself includes +one or more ssi files. + +it would be nice if the ssm could include an 'intermediate' ssi, which +then includes further ssi files. this is very handy for larger documents. + +Regards, +Daniel + +**** TODO [#C] #744409 [w|u] sisu output: urls in code blocks are not linkified + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu output: urls in code blocks are not linkified +Date: Sun, 13 Apr 2014 18:41:09 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +it would be nice if urls written withiin code{...}code blocks would also +be automatically transformed into a link within the output (html). + +Regards, +Daniel + +**** TODO [#C] #744541 [w|u] sisu: urls in @creator broken + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu: urls in @creator broken +Date: Sun, 13 Apr 2014 18:45:35 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +first, if you have an url within @creator, like: + + @creator: foo bar http://example.org + +the generation fails (pdf output). + +as a workaround, i put the url into parenthesis, like: + + @creator: foo bar (http://example.org) + +but then, it would be nice if that url would be automatically +transformed into a link in the output format (pdf). + +Regards, +Daniel + +**** TODO [#C] #744685 [w|u] sisu output: copy&past-able wrapped code blocks + + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu output: copy&past-able wrapped code blocks +Date: Sun, 13 Apr 2014 19:04:01 +0200 +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +if a line within a 'code{...}code' block is longer and needs to be +wrapped, sisu indicates the wrapping with an 'arrow' (←) symbol, which +is nice. + +it would be even nicer if the arrow would not 'selectable', so that when +you mark the line spanning over two lines with your mouse, the arrow is +not selected and thus not copy&pasted. + +i don't know how to do this, but it's possible within pdfs, as can be +seen in lots of pdfs in the internet. + +Regards, +Daniel + +**** TODO [#C] #744734 [w|u] sisu output: replace all occurences of (C) rather than the first only + +From: Daniel Baumann +To: Debian Bug Tracking System +Subject: sisu output: replace all occurences of (C) rather than the first only +Date: Mon, 14 Apr 2014 06:11:13 +0200 + +Package: sisu +Version: 5.3.4-1 +Severity: wishlist +Tags: upstream + +if you have a '(C)' in :copyright:, it is automatically replaced with a +copyright symbol, which is nice, however, it sisu does that with the +first occurence only. + +so if you use: + + :copyright: (C) john doe
(C) jane doe + +then the second occurence is not replaced and that combination looks +very ugly. i suggest you replace all occurences of '(C)' to the +copyright symbol automatically. + +Regards, +Daniel -- cgit v1.2.3 From 5b6073188a8859780b69c0300958dc7219dcc340 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:41:02 -0400 Subject: =?UTF-8?q?v5=20v6:=20ao=5Fsyntax,=20address=20possible=20manual?= =?UTF-8?q?=20use=20of=20url=20delimiters=E3=80=8C=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/doc/sisu/CHANGELOG_v5 | 2 ++ data/doc/sisu/CHANGELOG_v6 | 2 ++ lib/sisu/v5/ao_syntax.rb | 2 +- lib/sisu/v6/ao_syntax.rb | 2 +- sisu.org | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 062b1e1b..9cae41da 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.3.5.orig.tar.xz sisu_5.3.5.orig.tar.xz sisu_5.3.5-1.dsc +* ao_syntax, address possible manual use of url delimiters「」 + * added sisu.org emacs:evil:org mode notes related to sisu development %% 5.3.4.orig.tar.xz (2014-02-14:06/5) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index a8250d21..a412da59 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.0.5.orig.tar.xz sisu_6.0.5.orig.tar.xz sisu_6.0.5-1.dsc +* ao_syntax, address possible manual use of url delimiters「」 + * added sisu.org emacs:evil:org mode notes related to sisu development %% 6.0.4.orig.tar.xz (2014-02-14:06/5) diff --git a/lib/sisu/v5/ao_syntax.rb b/lib/sisu/v5/ao_syntax.rb index cdcb3883..8ff90ae0 100644 --- a/lib/sisu/v5/ao_syntax.rb +++ b/lib/sisu/v5/ao_syntax.rb @@ -333,7 +333,7 @@ module SiSU_AO_Syntax dob end def fontface(dob) - leader=/^|#{Mx[:gl_c]}|\s+|['"]|[#{Mx[:nbsp]}#{Mx[:fa_o_c]}#{Mx[:fa_c]}#{Mx[:lnk_o]}#{Mx[:br_nl]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:tc_c]}#{Mx[:tc_p]}]|[\(\[\{]|[、。]|\>/ + leader=/^|#{Mx[:gl_c]}|\s+|['"]|[#{Mx[:nbsp]}#{Mx[:fa_o_c]}#{Mx[:fa_c]}#{Mx[:lnk_o]}#{Mx[:br_nl]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:tc_c]}#{Mx[:tc_p]}]|[\(\[\{]|[、。「」]|\>/ dob=fontface_lines(dob,leader) dob.obj=dob.obj.gsub(/(#{leader})\*\{(.+?)\}\*/m, "\\1#{@emph[:o]}\\2#{@emph[:c]}"). #emphasis diff --git a/lib/sisu/v6/ao_syntax.rb b/lib/sisu/v6/ao_syntax.rb index e3777f50..8a13e406 100644 --- a/lib/sisu/v6/ao_syntax.rb +++ b/lib/sisu/v6/ao_syntax.rb @@ -333,7 +333,7 @@ module SiSU_AO_Syntax dob end def fontface(dob) - leader=/^|#{Mx[:gl_c]}|\s+|['"]|[#{Mx[:nbsp]}#{Mx[:fa_o_c]}#{Mx[:fa_c]}#{Mx[:lnk_o]}#{Mx[:br_nl]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:tc_c]}#{Mx[:tc_p]}]|[\(\[\{]|[、。]|\>/ + leader=/^|#{Mx[:gl_c]}|\s+|['"]|[#{Mx[:nbsp]}#{Mx[:fa_o_c]}#{Mx[:fa_c]}#{Mx[:lnk_o]}#{Mx[:br_nl]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:tc_c]}#{Mx[:tc_p]}]|[\(\[\{]|[、。「‹«¿¡]|\>/ dob=fontface_lines(dob,leader) dob.obj=dob.obj.gsub(/(#{leader})\*\{(.+?)\}\*/m, "\\1#{@emph[:o]}\\2#{@emph[:c]}"). #emphasis diff --git a/sisu.org b/sisu.org index 5473352f..f7f19b68 100644 --- a/sisu.org +++ b/sisu.org @@ -987,7 +987,7 @@ title missing: level A missing: no level 1: -**** TODO [#B] victory chals discussed parsing problem caused by use of open-close markers around url +**** DONE (5.3.5::6.0.5) [#B] victory chals discussed parsing problem caused by use of open-close markers around url **** TODO [#B] exclude heading where possible marker '-#' not distinguished from unnumbered heading '~#' -- cgit v1.2.3 From 080d49e6f9ae8d88d90a0a79024d81b1f280d00e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:43:04 -0400 Subject: syntax hilighting, line break without spaces
flagged as error, close * for line breaks in sisu markup use \\ instead of
* the case described is meant to be flagged as an error * close bug, no action taken further explanation in sisu.org * (Closes: #744356) re-open if necessary --- sisu.org | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sisu.org b/sisu.org index f7f19b68..11a60aaa 100644 --- a/sisu.org +++ b/sisu.org @@ -1238,7 +1238,7 @@ then vim doesn't use any colors at all. Regards, Daniel -**** TODO [#C] #744356 [w|u] vim syntaxhighlighting: urls and tags +**** DONE PASS [#C] #744356 [w|u] vim syntaxhighlighting: urls and tags :discuss:close: From: Daniel Baumann @@ -1272,6 +1272,20 @@ then, the string 'http://www.gnu.org/licenses/.<' is shown red. Regards, Daniel +***** NOTES/COMMENTS + +this is meant to be flagged as an error, +(red indicates error, and is an error will not parse correctly) +even if the sisu parser works in the flagged case there is no promise that it will in future + +use of angle bracket markers (html markers) in sisu markup is depreciated. +for line-break use \\ instead, +for which there should be surrounding spaces or a preceding space and end of line; +if
is still used there should be a space after the url - which sisu should remove in output. + +would like to close without further action +re-open if necessary + **** TODO [#C] #744357 [w|u] sisu output: please create mailto links automatically -- cgit v1.2.3 From fbe2d78acfde858fbff2a7e153c303435c86f5ac Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:50:25 -0400 Subject: syntax hilighting, includes with files in subdirectories fix * (Closes: #744355) --- data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim | 4 +--- sisu.org | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim b/data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim index bee822db..d88720f4 100644 --- a/data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim +++ b/data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim @@ -30,9 +30,7 @@ if !exists("sisu_no_identifiers") syn match sisu_number contains=@NoSpell "[0-9a-f]\{32\}\|[0-9a-f]\{64\}" syn match sisu_link contains=@NoSpell "\(_\?https\?://\|\.\.\/\)\S\+" syn match sisu_link " \*\~\S\+" - syn match sisu_action "^<:insert\d\+>" - syn match sisu_require contains=@NoSpell "^<<\s*[a-zA-Z0-9^._-]\+\.ss[it]$" - syn match sisu_require contains=@NoSpell "^<<{[a-zA-Z0-9^._-]\+\.ss[it]}$" + syn match sisu_require contains=@NoSpell "^<<\s*[a-zA-Z0-9^./_-]\+\.ss[it]$" syn match sisu_structure "^:A\~$" "% "Document Sub Headers: diff --git a/sisu.org b/sisu.org index 11a60aaa..53940424 100644 --- a/sisu.org +++ b/sisu.org @@ -1212,7 +1212,7 @@ wants them, he would add one. Regards, Daniel -**** TODO [#C] #744355 [w|u] vim syntaxhighlighting: includes and directories +**** DONE (5.3.5::6.0.5) [#C] #744355 [w|u] vim syntaxhighlighting: includes and directories :syntaxhi:fix: From: Daniel Baumann @@ -1238,6 +1238,10 @@ then vim doesn't use any colors at all. Regards, Daniel +***** NOTES/COMMENTS + +done + **** DONE PASS [#C] #744356 [w|u] vim syntaxhighlighting: urls and tags :discuss:close: -- cgit v1.2.3 From b28cf1c5cf4be19a5869ddfabf83e0b81f778860 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:54:28 -0400 Subject: v5 v6: composite, fix includes, provide extra newline after inserted comment * (Closes: #744360) [n|u] sisu: includes do not work properly --- data/doc/sisu/CHANGELOG_v5 | 3 +++ data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v5/composite.rb | 2 +- lib/sisu/v6/composite.rb | 2 +- sisu.org | 8 +++++++- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 9cae41da..12c16c8a 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -40,6 +40,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.3.5.orig.tar.xz * ao_syntax, address possible manual use of url delimiters「」 +* composite, fix includes, provide extra newline after inserted comment + (Closes: #744360) "includes do not work properly" + * added sisu.org emacs:evil:org mode notes related to sisu development %% 5.3.4.orig.tar.xz (2014-02-14:06/5) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index a412da59..92e8413e 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -30,6 +30,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * ao_syntax, address possible manual use of url delimiters「」 +* composite, fix includes, provide extra newline after inserted comment + (Closes: #744360) "includes do not work properly" + * added sisu.org emacs:evil:org mode notes related to sisu development %% 6.0.4.orig.tar.xz (2014-02-14:06/5) diff --git a/lib/sisu/v5/composite.rb b/lib/sisu/v5/composite.rb index 9e7ccb5c..cd281e26 100644 --- a/lib/sisu/v5/composite.rb +++ b/lib/sisu/v5/composite.rb @@ -132,7 +132,7 @@ module SiSU_Assemble def insertion(fni,insert_array) file={ prepared: [], images: [] } rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ - file[:prepared] << "\n% |#{fni}|@|^|>>ok\n" + file[:prepared] << "\n% |#{fni}|@|^|>>ok\n\n" @code_flag=false insert_array.each do |i| @code_flag=if i =~/^code\{/ then true diff --git a/lib/sisu/v6/composite.rb b/lib/sisu/v6/composite.rb index ebbd14f6..02e9543e 100644 --- a/lib/sisu/v6/composite.rb +++ b/lib/sisu/v6/composite.rb @@ -132,7 +132,7 @@ module SiSU_Assemble def insertion(fni,insert_array) file={ prepared: [], images: [] } rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ - file[:prepared] << "\n% |#{fni}|@|^|>>ok\n" + file[:prepared] << "\n% |#{fni}|@|^|>>ok\n\n" @code_flag=false insert_array.each do |i| @code_flag=if i =~/^code\{/ then true diff --git a/sisu.org b/sisu.org index 53940424..358fa0b9 100644 --- a/sisu.org +++ b/sisu.org @@ -1005,7 +1005,7 @@ no level 1: *** DBT Outstanding bugs -- Normal bugs; Unclassified (2 bugs) :debian:dbt:normal: -**** TODO [#B] #744360 [n|u] sisu: includes do not work properly :processing:fix: +**** DONE (5.3.5::6.0.5) [#B] #744360 [n|u] sisu: includes do not work properly :processing:fix: From: Daniel Baumann @@ -1047,6 +1047,12 @@ makes ':B~ bar' being ignored in the output (pdf) entirely. Regards, Daniel +***** NOTES/COMMENTS + +it appears both give faulty text, though in different ways + +fixed + **** TODO [#B] #744378 [n|u] sisu: --no-manifest not working anymore -- cgit v1.2.3 From 90d3eab4409a446adfc16f23da215855cba7ea6b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 21:03:25 -0400 Subject: v5 v6: composite (inserts), missing includes doesn't give an error, fix * (Closes: #744379) see sisu.org for comment --- data/doc/sisu/CHANGELOG_v5 | 3 +++ data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v5/composite.rb | 9 +++++---- lib/sisu/v6/composite.rb | 14 ++++++-------- sisu.org | 20 +++++++++++++++++++- 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 12c16c8a..0b357d41 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -43,6 +43,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.3.5.orig.tar.xz * composite, fix includes, provide extra newline after inserted comment (Closes: #744360) "includes do not work properly" +* composite (inserts), missing includes doesn't give an error, fix + (Closes: #744379) see sisu.org for comment + * added sisu.org emacs:evil:org mode notes related to sisu development %% 5.3.4.orig.tar.xz (2014-02-14:06/5) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 92e8413e..b4b0311d 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -33,6 +33,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * composite, fix includes, provide extra newline after inserted comment (Closes: #744360) "includes do not work properly" +* composite (inserts), missing includes doesn't give an error, fix + (Closes: #744379) see sisu.org for comment + * added sisu.org emacs:evil:org mode notes related to sisu development %% 6.0.4.orig.tar.xz (2014-02-14:06/5) diff --git a/lib/sisu/v5/composite.rb b/lib/sisu/v5/composite.rb index cd281e26..adc88e52 100644 --- a/lib/sisu/v5/composite.rb +++ b/lib/sisu/v5/composite.rb @@ -141,11 +141,11 @@ module SiSU_Assemble end if not @code_flag \ and i !~/^%+\s/ - i=i.gsub(/^([123]|:?[ABC])~\? /,'% [conditional heading:] \1~ ') #off conditional heading (consider syntax) + i=i.gsub(/^([123]|:?[ABCD])~\? /,'% [conditional heading:] \1~ ') #off conditional heading (consider syntax) if i =~/^@\S+?:/ i=i.gsub(/\n/m,"\n% "). gsub(/\n%\s+$/m,''). - gsub(/^@\S+?:/m,"\n% [imported header:] ") #off imported headers + gsub(/^@\S+?:/m,"\n% [imported header:] ") #off imported headers end end file[:prepared] << i @@ -171,6 +171,7 @@ module SiSU_Assemble or para =~/^(?:<<\s*)\|(\S+?)\|@\|.+?\|(?:req(?:quire)?\b|\s*\})?/ \ or para =~/^r\{(.+?)\}/ #depreciated loadfile=$1.strip + src_ssm=@opt.fns.sub(/\.ssm\.sst/,'.ssm') if (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) @@ -200,7 +201,7 @@ module SiSU_Assemble file[:prepared] else cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires an invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end else tuned_file << para @@ -255,7 +256,7 @@ module SiSU_Assemble @ssm << loadfile else cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires an invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end end diff --git a/lib/sisu/v6/composite.rb b/lib/sisu/v6/composite.rb index 02e9543e..79603e26 100644 --- a/lib/sisu/v6/composite.rb +++ b/lib/sisu/v6/composite.rb @@ -141,11 +141,11 @@ module SiSU_Assemble end if not @code_flag \ and i !~/^%+\s/ - i=i.gsub(/^([123]|:?[ABC])~\? /,'% [conditional heading:] \1~ ') #off conditional heading (consider syntax) + i=i.gsub(/^([123]|:?[ABCD])~\? /,'% [conditional heading:] \1~ ') #off conditional heading (consider syntax) if i =~/^@\S+?:/ i=i.gsub(/\n/m,"\n% "). gsub(/\n%\s+$/m,''). - gsub(/^@\S+?:/m,"\n% [imported header:] ") #off imported headers + gsub(/^@\S+?:/m,"\n% [imported header:] ") #off imported headers end end file[:prepared] << i @@ -166,11 +166,9 @@ module SiSU_Assemble tuned_file,imagedir=[],[] SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Composite Document',"[#{@opt.f_pth[:lng_is]}] #{@opt.fno}").grey_title_hi unless @opt.act[:quiet][:set]==:on data.each do |para| - if para =~/^<<\s+(\S+?\.ss[it])$/ \ - or para =~/^<<\{(\S+?\.ss[it])\}$/ \ - or para =~/^(?:<<\s*)\|(\S+?)\|@\|.+?\|(?:req(?:quire)?\b|\s*\})?/ \ - or para =~/^r\{(.+?)\}/ #depreciated + if para =~/^<<\s+(\S+?\.ss[it])$/ loadfile=$1.strip + src_ssm=@opt.fns.sub(/\.ssm\.sst/,'.ssm') if (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) @@ -200,7 +198,7 @@ module SiSU_Assemble file[:prepared] else cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires an invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end else tuned_file << para @@ -255,7 +253,7 @@ module SiSU_Assemble @ssm << loadfile else cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires an invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" para end end diff --git a/sisu.org b/sisu.org index 358fa0b9..22174f23 100644 --- a/sisu.org +++ b/sisu.org @@ -1346,7 +1346,7 @@ semicolon, he would add one. Regards, Daniel -**** TODO [#B] #744379 [w|u] sisu: missing includes doesn't give an error +**** DONE (5.3.5::6.0.5) [#B] #744379 [w|u] sisu: missing includes doesn't give an error :processing:fix: From: Daniel Baumann @@ -1368,6 +1368,24 @@ string in the output (pdf). Regards, Daniel +***** NOTES/COMMENTS + +5.3.4-1 writes the following to the screen: +"ERROR test.ssm.sst requires invalid or non-existent file: foo.ssi" + +and unsatisfactorily within the text output it writes no error message but the include instruction: + +"<< foo.ssi" + +5.3.5, the current "fix"/ solution, is to add an error message within the text rather than to stop processing with an error. +In addition to (i) slightly modified (you could say corrected) to the following: + +"ERROR test.ssm requires an invalid or non-existent file: foo.ssi" + +the following is written within the text output: + +"<< foo.ssi [ERROR test.ssm requires an invalid or non-existent file: foo.ssi]" + **** TODO [#D] #744381 [w|u] sisu syntax: inconsistency \:copyright: and \:license: -- cgit v1.2.3 From d5b2fa8c360d4f790f72dbcf3058e7eaa06c60fd Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 21:07:03 -0400 Subject: v5 v6: metadata, pdf, remove link to manifest page where --no-manifest is used * (Closes: #744378) --- data/doc/sisu/CHANGELOG_v5 | 3 +++ data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v5/shared_metadata.rb | 11 ++++++++--- lib/sisu/v6/shared_metadata.rb | 11 ++++++++--- sisu.org | 6 +++++- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 0b357d41..c25d71ee 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -46,6 +46,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.3.5.orig.tar.xz * composite (inserts), missing includes doesn't give an error, fix (Closes: #744379) see sisu.org for comment +* metadata, pdf, remove link to manifest page where --no-manifest is used + (Closes: #744378) + * added sisu.org emacs:evil:org mode notes related to sisu development %% 5.3.4.orig.tar.xz (2014-02-14:06/5) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index b4b0311d..8eea049c 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -36,6 +36,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * composite (inserts), missing includes doesn't give an error, fix (Closes: #744379) see sisu.org for comment +* metadata, pdf, remove link to manifest page where --no-manifest is used + (Closes: #744378) + * added sisu.org emacs:evil:org mode notes related to sisu development %% 6.0.4.orig.tar.xz (2014-02-14:06/5) diff --git a/lib/sisu/v5/shared_metadata.rb b/lib/sisu/v5/shared_metadata.rb index b7ba2f1f..da396040 100644 --- a/lib/sisu/v5/shared_metadata.rb +++ b/lib/sisu/v5/shared_metadata.rb @@ -886,6 +886,8 @@ WOK def initialize(md) @md=md @br="\\\\\n" + @make=SiSU_Env::ProcessingSettings.new(md) + @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure end def meta_para(tag,inf,sc=true) inf=((inf.is_a?(String) && sc) ? spec_char(inf) : inf) @@ -906,9 +908,12 @@ WOK l=SiSU_Env::StandardiseLanguage.new(@md.opt.lng).language language=l[:n] tr=SiSU_Translate::Source.new(@md,language) - tag="Document Manifest @" - inf="#{@br}#{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest}" - meta << meta_para(tag,inf) + if @make.build.links_to_manifest? \ + and not @o_str.dump_or_redirect? + tag="Document Manifest @" + inf="#{@br}#{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest}" + meta << meta_para(tag,inf) + end if defined? @md.title.full \ and @md.title.full=~/\S+/ tag,inf=tr.full_title,@md.title.full diff --git a/lib/sisu/v6/shared_metadata.rb b/lib/sisu/v6/shared_metadata.rb index 546eb788..c2fe06b9 100644 --- a/lib/sisu/v6/shared_metadata.rb +++ b/lib/sisu/v6/shared_metadata.rb @@ -886,6 +886,8 @@ WOK def initialize(md) @md=md @br="\\\\\n" + @make=SiSU_Env::ProcessingSettings.new(md) + @o_str ||=SiSU_Env::ProcessingSettings.new(md).output_dir_structure end def meta_para(tag,inf,sc=true) inf=((inf.is_a?(String) && sc) ? spec_char(inf) : inf) @@ -906,9 +908,12 @@ WOK l=SiSU_Env::StandardiseLanguage.new(@md.opt.lng).language language=l[:n] tr=SiSU_Translate::Source.new(@md,language) - tag="Document Manifest @" - inf="#{@br}#{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest}" - meta << meta_para(tag,inf) + if @make.build.links_to_manifest? \ + and not @o_str.dump_or_redirect? + tag="Document Manifest @" + inf="#{@br}#{@md.file.output_path.manifest.url}/#{@md.file.base_filename.manifest}" + meta << meta_para(tag,inf) + end if defined? @md.title.full \ and @md.title.full=~/\S+/ tag,inf=tr.full_title,@md.title.full diff --git a/sisu.org b/sisu.org index 22174f23..5563b713 100644 --- a/sisu.org +++ b/sisu.org @@ -1053,7 +1053,7 @@ it appears both give faulty text, though in different ways fixed -**** TODO [#B] #744378 [n|u] sisu: --no-manifest not working anymore +**** DONE (5.3.5::6.0.5) [#B] #744378 [n|u] sisu: --no-manifest not working anymore :check: From: Daniel Baumann @@ -1070,6 +1070,10 @@ contains the sisu manifest at the end of the document. Regards, Daniel +***** NOTES/COMMENTS + +fix, metadata page in pdf should not contain link to manifest where --no-manifest flag is used + **** TODO ONGOING #746740 [n|u] manpages incomplete Date: Sat, 03 May 2014 08:45:49 +0200 -- cgit v1.2.3 From 58020c13d503a6c8724ac4a2f26b8d33f0a0c6f5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 21:10:22 -0400 Subject: v5: digests cleaning --- data/doc/sisu/CHANGELOG_v5 | 2 + lib/sisu/v5/digests.rb | 158 +++++---------------------------------------- 2 files changed, 18 insertions(+), 142 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index c25d71ee..41771585 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -49,6 +49,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.3.5.orig.tar.xz * metadata, pdf, remove link to manifest page where --no-manifest is used (Closes: #744378) +* digests, cleaning + * added sisu.org emacs:evil:org mode notes related to sisu development %% 5.3.4.orig.tar.xz (2014-02-14:06/5) diff --git a/lib/sisu/v5/digests.rb b/lib/sisu/v5/digests.rb index 3acd51eb..b3dd40bd 100644 --- a/lib/sisu/v5/digests.rb +++ b/lib/sisu/v5/digests.rb @@ -71,7 +71,7 @@ module SiSU_DigestView @fnb=@opt.fnb @@endnotes_para=[] @@dg=nil - @dg=@@dg ||=SiSU_Env::InfoEnv.new.digest.type + @dg=@@dg ||=SiSU_Env::InfoEnv.new.digest(opt).type @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt) end def read @@ -114,8 +114,8 @@ module SiSU_DigestView @particulars=particulars @data,@env,@md=@particulars.ao_array,@particulars.env,@particulars.md SiSU_Env::FileOp.new(@md).mkdir - @@dg ||=@env.digest.type - @@dl ||=@env.digest.length + @@dg ||=@env.digest(@md.opt).type + @@dl ||=@env.digest(@md.opt).length @dg,@dl=@@dg,@@dl l=SiSU_Env::StandardiseLanguage.new(@md.opt.lng).language @language=l[:n] @@ -158,135 +158,6 @@ module SiSU_DigestView txt=txt.gsub(/([()])/,"\\\\\\1") end def message_digest - data=@data - sys=SiSU_Env::SystemCall.new - @p=[] - @g,@v,@r='','','' - data.each do |para| - x=nil - y,para_endnotes=[],[] - if para =~/#{Mx[:id_o]}~(\d+);(?:(?:\w|[0-6]:)\d+);(?:\w\d+)#{Mx[:id_c]}#{Mx[:id_o]}([0-9a-f]{#{@dl}}):([0-9a-f]{#{@dl}})#{Mx[:id_c]}/ - ocn,d_clean,d_all=$1,$2,$3 - @ocn=ocn unless ocn.to_i==0 - para=para.gsub(/#{Mx[:fa_bold_o]}(.+?)#{Mx[:fa_bold_c]}/,'\1'). - gsub(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'\1'). - gsub(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'\1') - if para=~/#{Mx[:en_a_o]}[\d*+]+.+?#{Mx[:id_o]}[0-9a-f]{#{@dl}}#{Mx[:id_c]}#{Mx[:en_a_c]}/ - para_endnotes << para.scan(/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]})([\d*+]+).+?#{Mx[:id_o]}([0-9a-f]{#{@dl}})#{Mx[:id_c]}(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/) - end - images=[] - if para !~/^%+\s/ \ - and para =~/(?:^|[^_\\])#{Mx[:lnk_o]}(\S+\.(png|jpg|gif))\s.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image)/ - images=para.scan(/(?:^|[^_\\])#{Mx[:lnk_o]}(\S+\.(?:png|jpg|gif))\s.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image)/).flatten - else nil - end - x=case para - when /^#{Mx[:meta_o]}title#{Mx[:meta_c]}/ - "\n" << ' '*0 << '@' << ' '*9 - when /^#{Mx[:meta_o]}subtitle#{Mx[:meta_c]}/ - "\n" << ' '*1 << '@' << ' '*8 - when /^#{Mx[:lv_o]}1:/ #fix Mx[:lv_o] - "\n" << ' '*2 << ':A ' << ' '*6 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - when /^#{Mx[:lv_o]}2:/ #fix Mx[:lv_o] - "\n" << ' '*3 << ':B ' << ' '*5 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - when /^#{Mx[:lv_o]}3:/ #fix Mx[:lv_o] - "\n" << ' '*4 << ':C ' << ' '*4 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - when /^#{Mx[:lv_o]}4:/ #fix Mx[:lv_o] - "\n" << ' '*5 << '1' << ' '*4 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - when /^#{Mx[:lv_o]}5:/ #fix Mx[:lv_o] - "\n" << ' '*6 << '2' << ' '*3 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - when /^#{Mx[:lv_o]}6:/ #fix Mx[:lv_o] - "\n" << ' '*7 << '3' << ' '*2 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - else - if para =~/MD5\(\S+?\.sst\)=\s*([0-9a-f]{#{@dl}})<\/u>/ #watch - @n,@s=/MD5\((\S+?\.sst)\)=\s*([0-9a-f]{#{@dl}})<\/u>/.match(para)[1,2] - end - x=unless ocn =~ /^0$/ - if images \ - and images.length > 0 # then get path of image & produce digest - @image_name,@image_dgst,@img=[],[],[] - images.each do |i| - image_source=if FileTest.file?("#{@env.path.image_source_include_local}/#{i}") - @env.path.image_source_include_local - elsif FileTest.file?("#{@env.path.image_source_include_remote}/#{i}") - @env.path.image_source_include_remote - elsif FileTest.file?("#{@env.path.image_source_include}/#{i}") - @env.path.image_source_include - else - SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],"ERROR - image:", %{"#{i}" missing}, "search locations: #{@env.path.image_source_include_local}, #{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.act[:quiet][:set]==:on - nil - end - @img << /\S+\.(png|jpg|gif)/.match(i)[1] - not_found_msg='image not found' - if image_source - para_image = image_source + '/' + i - @image_name << i - @image_dgst << (@dg =~/^sha(?:2|256)$/) \ - ? sys.sha256(para_image) - : sys.md5(para_image) - else - @image_name << ' '*16 + i + ' [image missing]' - @image_dgst << '' - @image_dgst[1]=not_found_msg + ' '*(32-not_found_msg.length) - end - end - line= "\n" + ' '*9 + ' - ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all + "\n" - line_image=[] - c=0 - @image_name.each do |ok| - line_image << %{ #{@img[c]} #{@image_dgst[c][1]} #{@image_name[c]}} - c +=1 - end - line=line + line_image.join("\n") - else "\n" + ' '*9 + ' - ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all - end - else - prefix='' - metad=[@tr.full_title,@tr.author,@tr.translator,@tr.illustrator,@tr.prepared_by,@tr.digitized_by,@tr.description,@tr.subject,@tr.abstract,@tr.publisher,@tr.contributor,@tr.date_created,@tr.date_issued,@tr.date_available,@tr.date_modified,@tr.date_valid,@tr.date,@tr.type,@tr.format,@tr.rights,@tr.identifier,@tr.source,@tr.language,@tr.language_original,@tr.relation,@tr.coverage,@tr.keywords,@tr.comments,@tr.cls_loc,@tr.cls_dewey,@tr.cls_gutenberg,@tr.cls_isbn,@tr.prefix_a,@tr.prefix_b,@tr.sourcefile,@tr.sourcefile_digest,@tr.last_generated,@tr.sisu_version,@tr.ruby_version,@tr.sc_number,@tr.sc_date,'Generated by: ','Ruby version: '] - metad.each do |n| - m=rgx_txt(n) - if m=~/\S+/ \ - and para=~/^#{m}:/ - x,o=0,18 - while x < 2; o = o + 2 - x=o - n.length - end - space=' '*x - prefix="#{n.downcase}#{space}" - break - else prefix=' '*9 - end - end - m_title=rgx_txt(@tr.full_title) - m_author=rgx_txt(@tr.author) - m_sourcefile_digest=rgx_txt(@tr.sourcefile_digest) - m_sisu_version=rgx_txt(@tr.sisu_version) - m_last_generated=rgx_txt(@tr.last_generated) - m_ruby_version=rgx_txt(@tr.ruby_version) - case para - when /#{m_title}: / - @t=/#{m_title}: (.+?)#{Mx[:id_o]}~\d;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@dl}}:[0-9a-f]{#{@dl}}#{Mx[:id_c]}/.match(para)[1].gsub(/<\/?u>/,'').strip - when /#{m_author}: / - @c=/#{m_author}: (.+?)#{Mx[:id_o]}~\d;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@dl}}:[0-9a-f]{#{@dl}}#{Mx[:id_c]}/.match(para)[1].gsub(/<\/?u>/,'').strip - when /#{m_sourcefile_digest}.+?/ #watch - dgst_extra="\n" << ' '*21 << 'source' << ' '*4 << @md.dgst[1] << ' '*34 << @md.fns - when /#{m_sisu_version}: / - @v=/#{m_sisu_version}: (.+?)#{Mx[:id_o]}~\d;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@dl}}:[0-9a-f]{#{@dl}}#{Mx[:id_c]}/.match(para)[1].gsub(/<\/?u>/,'').strip - when /#{m_last_generated}: / - @g=/#{m_last_generated}: (.+?)#{Mx[:id_o]}~\d;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@dl}}:[0-9a-f]{#{@dl}}#{Mx[:id_c]}/.match(para)[1].gsub(/<\/?u>/,'').strip - when /#{m_ruby_version}: / - @r=/#{m_ruby_version}: (.+?)#{Mx[:id_o]}~\d;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@dl}}:[0-9a-f]{#{@dl}}#{Mx[:id_c]}/.match(para)[1].gsub(/<\/?u>/,'').strip - end - dgst_extra ||='' - "\n" << prefix << ' - ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all << dgst_extra << "\n" - end - end - para_endnotes[0].each { |e| y << "\n" + ' '*(28-e[0].length) + "[#{e[0].to_s}] #{e[1].to_s}" } if para_endnotes[0] - if y; digests(x,y) - else digests(x) - end - end - end manifest="#{@env.url.root}/#{@md.fnb}/sisu_manifest.html" a=%{ocn digest clean (no markup/notes),#{@sp*33}digest all (includes markup & endnotes)\n} description("#{@md.title.full}\n") @@ -340,18 +211,20 @@ module SiSU_DigestView data.each do |t_o| if t_o.is==:heading x=case t_o.ln - when 1 then l[1] +=1 #fix Mx[:lv_o] + when 1 then l[0] +=1 #fix Mx[:lv_o] ' '*0 << ':A' - when 2 then l[2] +=1 #fix Mx[:lv_o] + when 1 then l[1] +=1 #fix Mx[:lv_o] ' '*1 << ':B' - when 3 then l[3] +=1 #fix Mx[:lv_o] + when 2 then l[2] +=1 #fix Mx[:lv_o] ' '*2 << ':C' + when 3 then l[3] +=1 #fix Mx[:lv_o] + ' '*3 << ':D' when 4 then l[4] +=1 #fix Mx[:lv_o] - ' '*3 << '1' + ' '*4 << '1' when 5 then l[5] +=1 #fix Mx[:lv_o] - ' '*4 << '2' + ' '*5 << '2' when 6 then l[6] +=1 #fix Mx[:lv_o] - ' '*5 << '3' + ' '*6 << '3' else nil end end @@ -363,9 +236,10 @@ module SiSU_DigestView ao_structure_summary("document structure[*]\n") [0,1,2,3,4,5,6].each do |y| v=case y - when 1 then ':A' - when 2 then ':B' - when 3 then ':C' + when 0 then ':A' + when 1 then ':B' + when 2 then ':C' + when 3 then ':D' when 4 then '1 ' when 5 then '2 ' when 6 then '3 ' @@ -374,7 +248,7 @@ module SiSU_DigestView end ao_structure_summary("objects (ocn) = #{ocn}\n") ao_structure_summary("endnotes = #{endnotes}\n") - ao_structure_summary(" [*] number of headers (@) and of each heading level (:A to :C and 1 to 3)\n") + ao_structure_summary(" [*] number of headers (@) and of each heading level (:A to :D and 1 to 3)\n") end def supplementary if defined? @md.sc_number \ -- cgit v1.2.3 From 3ea16523f1a3cbbdcd451a3845725417ee2141d8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 21:22:19 -0400 Subject: v6: digests sha512 option implemented * options sha512 sha256 md5 * command line --sha512 * rcconf.yml ['defsault']['digest'] = sha512 * (Closes: #744402) --- README | 6 + data/doc/sisu/CHANGELOG_v5 | 3 + data/doc/sisu/CHANGELOG_v6 | 6 + .../markup-samples/manual/en/sisu_commands.sst | 6 + lib/sisu/v5/constants.rb | 6 +- lib/sisu/v6/ao_doc_objects.rb | 22 +-- lib/sisu/v6/ao_hash_digest.rb | 24 ++- lib/sisu/v6/constants.rb | 6 +- lib/sisu/v6/db_columns.rb | 4 +- lib/sisu/v6/digests.rb | 216 ++++++--------------- lib/sisu/v6/manifest.rb | 14 +- lib/sisu/v6/options.rb | 8 + lib/sisu/v6/param.rb | 13 +- lib/sisu/v6/qrcode.rb | 17 +- lib/sisu/v6/shared_markup_alt.rb | 20 +- lib/sisu/v6/sysenv.rb | 53 +++-- lib/sisu/v6/urls.rb | 2 +- man/man1/sisu.1 | 6 + sisu.org | 7 +- 19 files changed, 222 insertions(+), 217 deletions(-) diff --git a/README b/README index 2fbe3bf8..303784c8 100644 --- a/README +++ b/README @@ -628,6 +628,12 @@ copies sisu output files to remote host using scp. This requires that sisurc.yml has been provided with information on hostname and username, and that you have your "keys" and ssh agent in place. Also see --rsync. Alias -r +*--sha256* +set hash digest where used to sha256 + +*--sha512* +set hash digest where used to sha512 + *--sqlite --[instruction] [filename]* database type set to /SQLite/, this produces one of two possible databases, without additional database related instructions it produces a discreet diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 41771585..7c079186 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -49,6 +49,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.3.5.orig.tar.xz * metadata, pdf, remove link to manifest page where --no-manifest is used (Closes: #744378) +* constants, db table sizes synced with v6, not needed by v5 but keeps tables + compatible + * digests, cleaning * added sisu.org emacs:evil:org mode notes related to sisu development diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 8eea049c..4c2bf375 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -39,6 +39,12 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * metadata, pdf, remove link to manifest page where --no-manifest is used (Closes: #744378) +* digests, digests sha512 option implemented + * options sha512 sha256 md5 + * command line --sha512 + * rcconf.yml ['defsault']['digest'] = sha512 + (Closes: #744402) + * added sisu.org emacs:evil:org mode notes related to sisu development %% 6.0.4.orig.tar.xz (2014-02-14:06/5) diff --git a/data/doc/sisu/markup-samples/manual/en/sisu_commands.sst b/data/doc/sisu/markup-samples/manual/en/sisu_commands.sst index c1a0788a..19ce3db5 100644 --- a/data/doc/sisu/markup-samples/manual/en/sisu_commands.sst +++ b/data/doc/sisu/markup-samples/manual/en/sisu_commands.sst @@ -321,6 +321,12 @@ generate examples of (naive) cgi search form for SQLite or PgSQL depends on your !_ --scp [filename/wildcard] \\ copies sisu output files to remote host using scp. This requires that sisurc.yml has been provided with information on hostname and username, and that you have your "keys" and ssh agent in place. Also see --rsync. Alias -r +!_ --sha256 \\ +set hash digest where used to sha256 + +!_ --sha512 \\ +set hash digest where used to sha512 + !_ --sqlite --[instruction] [filename] \\ database type set to SQLite, this produces one of two possible databases, without additional database related instructions it produces a discreet SQLite file for the document processed; with additional instructions it produces a common SQLite database of all processed documents that (come from the same document preparation directory and as a result) share the same output directory base path (possible instructions include: --createdb; --create; --dropall; --import [filename]; --update [filename]; --remove [filename]); see database section below. Alias -d diff --git a/lib/sisu/v5/constants.rb b/lib/sisu/v5/constants.rb index d47d9a7e..748051b6 100644 --- a/lib/sisu/v5/constants.rb +++ b/lib/sisu/v5/constants.rb @@ -260,8 +260,8 @@ else } end Db={ - name_prefix: "SiSU#{SiSU_is[:version_dir]}a_", - name_prefix_db: "sisu_#{SiSU_is[:version_dir]}a_", + name_prefix: "SiSU#{SiSU_is[:version_dir]}b_", + name_prefix_db: "sisu_#{SiSU_is[:version_dir]}b_", col_title: 800, col_title_part: 400, col_title_edition: 10, @@ -276,7 +276,7 @@ Db={ col_library: 30, col_small: 16, col_filename: 256, - col_digest: 64, + col_digest: 128, col_filesize: 10, col_info_note: 2500, } diff --git a/lib/sisu/v6/ao_doc_objects.rb b/lib/sisu/v6/ao_doc_objects.rb index 15e949c4..8dbdedc3 100644 --- a/lib/sisu/v6/ao_doc_objects.rb +++ b/lib/sisu/v6/ao_doc_objects.rb @@ -94,7 +94,7 @@ module SiSU_AO_DocumentStructure tag= h[:tag] || ((defined? o.tag) ? o.tag : nil) #String, metadata type/tag obj= h[:obj] || ((defined? o.obj) ? o.obj : nil) #String, text content tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use - digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5 + digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 @of,@is,@tag,@obj,@digest,@tmp=of,is,tag,obj,digest,tmp self end @@ -164,7 +164,7 @@ module SiSU_AO_DocumentStructure else h[:autonum_] end note_= h[:note_] || ((defined? o.note_) ? o.note_ : false) #Bool, endnotes/footnotes? (processing optimization) - digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5 + digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use @of,@is,@lv,@ln,@lc,@name,@tags,@obj,@idx,@ocn,@odv,@osp,@node,@parent,@toc_,@ocn_,@note_,@autonum_,@digest,@tmp=of,is,lv,ln,lc,name,tags,obj,idx,ocn,odv,osp,node,parent,toc_,ocn_,note_,autonum_,digest,tmp self @@ -201,7 +201,7 @@ module SiSU_AO_DocumentStructure ocn_=if h[:ocn_].nil? then ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider else h[:ocn_] end - digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5 + digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use @of,@is,@name,@tags,@obj,@indent,@hang,@bullet_,@idx,@ocn,@odv,@osp,@parent,@image_,@note_,@ocn_,@digest,@tmp=of,is,name,tags,obj,indent,hang,bullet_,idx,ocn,odv,osp,parent,image_,note_,ocn_,digest,tmp self @@ -225,7 +225,7 @@ module SiSU_AO_DocumentStructure ocn_=if h[:ocn_].nil? then ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider else h[:ocn_] end - digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5 + digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use @of,@is,@name,@tags,@obj,@indent,@hang,@bullet_,@idx,@ocn,@odv,@osp,@parent,@image_,@note_,@ocn_,@digest,@tmp=of,is,name,tags,obj,indent,hang,bullet_,idx,ocn,odv,osp,parent,image_,note_,ocn_,digest,tmp self @@ -254,7 +254,7 @@ module SiSU_AO_DocumentStructure else h[:ocn_] end num= h[:num] || ((defined? o.num) ? o.num : nil) - digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5 + digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use @of,@is,@tags,@obj,@idx,@ocn,@odv,@osp,@parent,@number_,@note_,@ocn_,@num,@digest,@tmp=of,is,tags,obj,idx,ocn,odv,osp,parent,number_,note_,ocn_,num,digest,tmp self @@ -274,7 +274,7 @@ module SiSU_AO_DocumentStructure else h[:ocn_] end num= h[:num] || ((defined? o.num) ? o.num : nil) - digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5 + digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use @of,@is,@tags,@obj,@idx,@ocn,@odv,@osp,@parent,@note_,@ocn_,@num,@digest,@tmp=of,is,tags,obj,idx,ocn,odv,osp,parent,note_,ocn_,num,digest,tmp self @@ -294,7 +294,7 @@ module SiSU_AO_DocumentStructure else h[:ocn_] end num= h[:num] || ((defined? o.num) ? o.num : nil) - digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5 + digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use @of,@is,@tags,@obj,@idx,@ocn,@odv,@osp,@parent,@note_,@ocn_,@num,@digest,@tmp=of,is,tags,obj,idx,ocn,odv,osp,parent,note_,ocn_,num,digest,tmp self @@ -314,7 +314,7 @@ module SiSU_AO_DocumentStructure else h[:ocn_] end num= h[:num] || ((defined? o.num) ? o.num : nil) - digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5 + digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use @of,@is,@tags,@obj,@idx,@ocn,@odv,@osp,@parent,@note_,@ocn_,@num,@digest,@tmp=of,is,tags,obj,idx,ocn,odv,osp,parent,note_,ocn_,num,digest,tmp self @@ -333,7 +333,7 @@ module SiSU_AO_DocumentStructure else h[:ocn_] end num= h[:num] || ((defined? o.num) ? o.num : nil) - digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5 + digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use @of,@is,@tags,@obj,@idx,@ocn,@odv,@osp,@parent,@note_,@ocn_,@num,@digest,@tmp=of,is,tags,obj,idx,ocn,odv,osp,parent,note_,ocn_,num,digest,tmp @h=nil @@ -365,7 +365,7 @@ module SiSU_AO_DocumentStructure else h[:ocn_] end num= h[:num] || ((defined? o.num) ? o.num : nil) - digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5 + digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use @of,@is,@tags,@cols,@widths,@obj,@idx,@ocn,@odv,@osp,@parent,@head_,@note_,@ocn_,@num,@digest,@tmp=of,is,tags,cols,widths,obj,idx,ocn,odv,osp,parent,head_,note_,ocn_,num,digest,tmp self @@ -393,7 +393,7 @@ module SiSU_AO_DocumentStructure ocn_=if h[:ocn_].nil? then ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider else h[:ocn_] end - digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, either sha256 or md5 + digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use @of,@is,@tags,@obj,@size,@idx,@ocn,@odv,@osp,@parent,@note_,@ocn_,@digest,@tmp=of,is,tags,obj,size,idx,ocn,odv,osp,parent,note_,ocn_,digest,tmp self diff --git a/lib/sisu/v6/ao_hash_digest.rb b/lib/sisu/v6/ao_hash_digest.rb index ce45b9e4..257902f4 100644 --- a/lib/sisu/v6/ao_hash_digest.rb +++ b/lib/sisu/v6/ao_hash_digest.rb @@ -65,7 +65,7 @@ module SiSU_AO_Hash class ObjectDigest def initialize(md,data,env=nil) @md,@data,@env=md,data,env - @env ||=SiSU_Env::InfoEnv.new(@md.fns) + @env ||=SiSU_Env::InfoEnv.new(@md.fns,@md) end def object_digest # 1. clean/stripped text without any markup, paragraph, headings etc. without endnotes @@ -74,11 +74,11 @@ module SiSU_AO_Hash # [digests should not include other digests] data=@data.compact @tuned_file=[] - sha_ =(@env.digest.type=='sha256' ? true : false) + sha_ =@env.digest(@md.opt).type begin sha_ ? (require 'digest/sha2') : (require 'digest/md5') rescue LoadError - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error((sha_ ? 'digest/sha2' : 'digest/md5') + ' NOT FOUND') + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error(sha_ + ' NOT FOUND') end data.each do |t_o| unless t_o.obj.is_a?(Array) @@ -88,11 +88,16 @@ module SiSU_AO_Hash && t_o.of !=:comment \ && t_o.of !=:layout) \ && t_o.ocn.is_a?(Fixnum) - if sha_ + case sha_ + when :sha512 + for hash_class in [ Digest::SHA512 ] + @tuned_file << stamped(t_o,hash_class) + end + when :sha256 for hash_class in [ Digest::SHA256 ] @tuned_file << stamped(t_o,hash_class) end - else + when :md5 for hash_class in [ Digest::MD5 ] @tuned_file << stamped(t_o,hash_class) end @@ -111,10 +116,15 @@ module SiSU_AO_Hash if en_plus =~/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/ t_o_txt,en_open,en_txt,en_close=/(.*?)(#{Mx[:en_a_o]}|#{Mx[:en_b_o]})(.+?)(#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/m.match(en_plus)[1..4] stripped_en=SiSU_TextRepresentation::Alter.new(en_txt).strip_clean_of_markup - digest_en_strip=if @env.digest.type =~/sha256/ + digest_en_strip=case @env.digest(@md.opt).type + when :sha512 + Digest::SHA512.hexdigest(stripped_en) + when :sha256 Digest::SHA256.hexdigest(stripped_en) - else + when :md5 Digest::MD5.hexdigest(stripped_en) + else + Digest::SHA256.hexdigest(stripped_en) end t_o_txt + en_open + en_txt + Mx[:id_o] + digest_en_strip + Mx[:id_c] + en_close else STDERR.puts "Error Exception - problem encountered with:\n#{en_plus}" #arbitrary exception, tidy up diff --git a/lib/sisu/v6/constants.rb b/lib/sisu/v6/constants.rb index 0f76ed59..be60431e 100644 --- a/lib/sisu/v6/constants.rb +++ b/lib/sisu/v6/constants.rb @@ -260,8 +260,8 @@ else } end Db={ - name_prefix: "SiSU#{SiSU_is[:version_dir]}a_", - name_prefix_db: "sisu_#{SiSU_is[:version_dir]}a_", + name_prefix: "SiSU#{SiSU_is[:version_dir]}b_", + name_prefix_db: "sisu_#{SiSU_is[:version_dir]}b_", col_title: 800, col_title_part: 400, col_title_edition: 10, @@ -276,7 +276,7 @@ Db={ col_library: 30, col_small: 16, col_filename: 256, - col_digest: 64, + col_digest: 128, col_filesize: 10, col_info_note: 2500, } diff --git a/lib/sisu/v6/db_columns.rb b/lib/sisu/v6/db_columns.rb index 1b21cf96..8dd14ddb 100644 --- a/lib/sisu/v6/db_columns.rb +++ b/lib/sisu/v6/db_columns.rb @@ -1843,7 +1843,7 @@ module SiSU_DbColumns end def src_fingerprint def name - 'src_fingerprint' #hash/digest, sha256 or md5 + 'src_fingerprint' #hash/digest, sha512, sha256 or md5 end def create_column "#{name} VARCHAR(#{Db[:col_digest]}) NULL," @@ -1851,7 +1851,7 @@ module SiSU_DbColumns end def column_comment %{COMMENT ON COLUMN metadata_and_text.#{name} - IS 'sisu markup source text fingerprint, hash digest sha256 (or md5)';} + IS 'sisu markup source text fingerprint, hash digest sha512, sha256 or md5';} end def tuple if defined? @md.dgst \ diff --git a/lib/sisu/v6/digests.rb b/lib/sisu/v6/digests.rb index 1fa2c80f..24ddc32e 100644 --- a/lib/sisu/v6/digests.rb +++ b/lib/sisu/v6/digests.rb @@ -71,7 +71,7 @@ module SiSU_DigestView @fnb=@opt.fnb @@endnotes_para=[] @@dg=nil - @dg=@@dg ||=SiSU_Env::InfoEnv.new.digest.type + @dg=@@dg ||=SiSU_Env::InfoEnv.new.digest(opt).type @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt) end def read @@ -108,14 +108,19 @@ module SiSU_DigestView private class Scroll \1'). - gsub(/#{Mx[:fa_italics_o]}(.+?)#{Mx[:fa_italics_c]}/,'\1'). - gsub(/#{Mx[:fa_underscore_o]}(.+?)#{Mx[:fa_underscore_c]}/,'\1') - if para=~/#{Mx[:en_a_o]}[\d*+]+.+?#{Mx[:id_o]}[0-9a-f]{#{@dl}}#{Mx[:id_c]}#{Mx[:en_a_c]}/ - para_endnotes << para.scan(/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]})([\d*+]+).+?#{Mx[:id_o]}([0-9a-f]{#{@dl}})#{Mx[:id_c]}(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/) - end - images=[] - if para !~/^%+\s/ \ - and para =~/(?:^|[^_\\])#{Mx[:lnk_o]}(\S+\.(png|jpg|gif))\s.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image)/ - images=para.scan(/(?:^|[^_\\])#{Mx[:lnk_o]}(\S+\.(?:png|jpg|gif))\s.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|image)/).flatten - else nil - end - x=case para - when /^#{Mx[:meta_o]}title#{Mx[:meta_c]}/ - "\n" << ' '*0 << '@' << ' '*9 - when /^#{Mx[:meta_o]}subtitle#{Mx[:meta_c]}/ - "\n" << ' '*1 << '@' << ' '*8 - when /^#{Mx[:lv_o]}1:/ #fix Mx[:lv_o] - "\n" << ' '*2 << ':A ' << ' '*6 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - when /^#{Mx[:lv_o]}2:/ #fix Mx[:lv_o] - "\n" << ' '*3 << ':B ' << ' '*5 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - when /^#{Mx[:lv_o]}3:/ #fix Mx[:lv_o] - "\n" << ' '*4 << ':C ' << ' '*4 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - when /^#{Mx[:lv_o]}4:/ #fix Mx[:lv_o] - "\n" << ' '*5 << '1' << ' '*4 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - when /^#{Mx[:lv_o]}5:/ #fix Mx[:lv_o] - "\n" << ' '*6 << '2' << ' '*3 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - when /^#{Mx[:lv_o]}6:/ #fix Mx[:lv_o] - "\n" << ' '*7 << '3' << ' '*2 << '- ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all - else - if para =~/MD5\(\S+?\.sst\)=\s*([0-9a-f]{#{@dl}})<\/u>/ #watch - @n,@s=/MD5\((\S+?\.sst)\)=\s*([0-9a-f]{#{@dl}})<\/u>/.match(para)[1,2] - end - x=unless ocn =~ /^0$/ - if images \ - and images.length > 0 # then get path of image & produce digest - @image_name,@image_dgst,@img=[],[],[] - images.each do |i| - image_source=if FileTest.file?("#{@env.path.image_source_include_local}/#{i}") - @env.path.image_source_include_local - elsif FileTest.file?("#{@env.path.image_source_include_remote}/#{i}") - @env.path.image_source_include_remote - elsif FileTest.file?("#{@env.path.image_source_include}/#{i}") - @env.path.image_source_include - else - SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],"ERROR - image:", %{"#{i}" missing}, "search locations: #{@env.path.image_source_include_local}, #{@env.path.image_source_include_remote} and #{@env.path.image_source_include}").error2 unless @md.opt.act[:quiet][:set]==:on - nil - end - @img << /\S+\.(png|jpg|gif)/.match(i)[1] - not_found_msg='image not found' - if image_source - para_image = image_source + '/' + i - @image_name << i - @image_dgst << (@dg =~/^sha(?:2|256)$/) \ - ? sys.sha256(para_image) - : sys.md5(para_image) - else - @image_name << ' '*16 + i + ' [image missing]' - @image_dgst << '' - @image_dgst[1]=not_found_msg + ' '*(32-not_found_msg.length) - end - end - line= "\n" + ' '*9 + ' - ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all + "\n" - line_image=[] - c=0 - @image_name.each do |ok| - line_image << %{ #{@img[c]} #{@image_dgst[c][1]} #{@image_name[c]}} - c +=1 - end - line=line + line_image.join("\n") - else "\n" + ' '*9 + ' - ' + ocn + ' '*(10-ocn.length) + d_clean + ' ' + d_all - end - else - prefix='' - metad=[@tr.full_title,@tr.author,@tr.translator,@tr.illustrator,@tr.prepared_by,@tr.digitized_by,@tr.description,@tr.subject,@tr.abstract,@tr.publisher,@tr.contributor,@tr.date_created,@tr.date_issued,@tr.date_available,@tr.date_modified,@tr.date_valid,@tr.date,@tr.type,@tr.format,@tr.rights,@tr.identifier,@tr.source,@tr.language,@tr.language_original,@tr.relation,@tr.coverage,@tr.keywords,@tr.comments,@tr.cls_loc,@tr.cls_dewey,@tr.cls_gutenberg,@tr.cls_isbn,@tr.prefix_a,@tr.prefix_b,@tr.sourcefile,@tr.sourcefile_digest,@tr.last_generated,@tr.sisu_version,@tr.ruby_version,@tr.sc_number,@tr.sc_date,'Generated by: ','Ruby version: '] - metad.each do |n| - m=rgx_txt(n) - if m=~/\S+/ \ - and para=~/^#{m}:/ - x,o=0,18 - while x < 2; o = o + 2 - x=o - n.length - end - space=' '*x - prefix="#{n.downcase}#{space}" - break - else prefix=' '*9 - end - end - m_title=rgx_txt(@tr.full_title) - m_author=rgx_txt(@tr.author) - m_sourcefile_digest=rgx_txt(@tr.sourcefile_digest) - m_sisu_version=rgx_txt(@tr.sisu_version) - m_last_generated=rgx_txt(@tr.last_generated) - m_ruby_version=rgx_txt(@tr.ruby_version) - case para - when /#{m_title}: / - @t=/#{m_title}: (.+?)#{Mx[:id_o]}~\d;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@dl}}:[0-9a-f]{#{@dl}}#{Mx[:id_c]}/.match(para)[1].gsub(/<\/?u>/,'').strip - when /#{m_author}: / - @c=/#{m_author}: (.+?)#{Mx[:id_o]}~\d;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@dl}}:[0-9a-f]{#{@dl}}#{Mx[:id_c]}/.match(para)[1].gsub(/<\/?u>/,'').strip - when /#{m_sourcefile_digest}.+?/ #watch - dgst_extra="\n" << ' '*21 << 'source' << ' '*4 << @md.dgst[1] << ' '*34 << @md.fns - when /#{m_sisu_version}: / - @v=/#{m_sisu_version}: (.+?)#{Mx[:id_o]}~\d;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@dl}}:[0-9a-f]{#{@dl}}#{Mx[:id_c]}/.match(para)[1].gsub(/<\/?u>/,'').strip - when /#{m_last_generated}: / - @g=/#{m_last_generated}: (.+?)#{Mx[:id_o]}~\d;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@dl}}:[0-9a-f]{#{@dl}}#{Mx[:id_c]}/.match(para)[1].gsub(/<\/?u>/,'').strip - when /#{m_ruby_version}: / - @r=/#{m_ruby_version}: (.+?)#{Mx[:id_o]}~\d;(?:\w|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}[0-9a-f]{#{@dl}}:[0-9a-f]{#{@dl}}#{Mx[:id_c]}/.match(para)[1].gsub(/<\/?u>/,'').strip - end - dgst_extra ||='' - "\n" << prefix << ' - ' << ocn << ' '*(10-ocn.length) << d_clean << ' ' << d_all << dgst_extra << "\n" - end - end - para_endnotes[0].each { |e| y << "\n" + ' '*(28-e[0].length) + "[#{e[0].to_s}] #{e[1].to_s}" } if para_endnotes[0] - if y; digests(x,y) - else digests(x) - end - end - end manifest="#{@env.url.root}/#{@md.fnb}/sisu_manifest.html" - a=%{ocn digest clean (no markup/notes),#{@sp*33}digest all (includes markup & endnotes)\n} description("#{@md.title.full}\n") description("#{@md.author}\n") description("#{@md.fns}\n") @@ -300,39 +181,51 @@ module SiSU_DigestView description("Sourcefile digest: #{@md.dgst[1]}\n") description(" source filename: #{@md.fns}\n") description("available outputs: #{manifest}\n") - #description(" time generated: #{@g}\n") - #description(" SiSU version used: #{@v}\n") - #description(" Ruby version used: #{@r}\n") description("------------\n") description("Document Digests\n") - description(a) end def ao_structure + a=%{\nocn digests (#{@dg}) clean text (stripped markup)} + digests_clean(a) data=@data endnotes=nil data.each do |t_o| dgst=SiSU_TextRepresentation::ModifiedTextPlusHashDigest.new(@md,t_o).composite.dgst if dgst if t_o.is==:heading - digests("#{@sp*0}#{dgst[:ocn]}#{@sp*(8-dgst[:ocn].to_s.length)}#{dgst[:dgst_stripped_txt]} #{dgst[:dgst_markedup_txt]} #{dgst[:is]} #{t_o.lv}") + digests_clean("#{@sp*0}#{dgst[:ocn]}#{@sp*(8-dgst[:ocn].to_s.length)}#{dgst[:dgst_stripped_txt]} #{dgst[:is]} #{t_o.lv}") elsif t_o.is==:heading_insert - digests("#{@sp*0}[#{dgst[:ocn]}]#{@sp*(6-dgst[:ocn].to_s.length)}#{dgst[:dgst_stripped_txt]} #{dgst[:dgst_markedup_txt]} #{dgst[:is]} #{t_o.lv}") + digests_clean("#{@sp*0}[#{dgst[:ocn]}]#{@sp*(6-dgst[:ocn].to_s.length)}#{dgst[:dgst_stripped_txt]} #{dgst[:is]} #{t_o.lv}") else - digests("#{@sp*0}#{dgst[:ocn]}#{@sp*(8-dgst[:ocn].to_s.length)}#{dgst[:dgst_stripped_txt]} #{dgst[:dgst_markedup_txt]} #{dgst[:is]}") + digests_clean("#{@sp*0}#{dgst[:ocn]}#{@sp*(8-dgst[:ocn].to_s.length)}#{dgst[:dgst_stripped_txt]} #{dgst[:is]}") if dgst[:images] dgst[:images].each do |img| - digests("#{@sp*8}#{img[:img_dgst]}#{@sp*66}#{img[:img_type]} #{img[:img_name]}") + digests_clean("#{@sp*8}#{img[:img_dgst]}#{@sp*66}#{img[:img_type]} #{img[:img_name]}") end end end if dgst[:endnotes] dgst[:endnotes].each do |en| - digests("#{@sp*8}#{en[:note_dgst]}#{@sp*66}note [#{en[:note_number]}]") + digests_clean("#{@sp*8}#{en[:note_dgst]} note [#{en[:note_number]}]") endnotes=en[:note_number] end end end end + b=%{\nocn object (#{@dg}) digests (object includes its markup & endnotes (if any))} + digests_with_markup(b) + data.each do |t_o| + dgst=SiSU_TextRepresentation::ModifiedTextPlusHashDigest.new(@md,t_o).composite.dgst + if dgst + if t_o.is==:heading + digests_with_markup("#{@sp*0}#{dgst[:ocn]}#{@sp*(8-dgst[:ocn].to_s.length)}#{dgst[:dgst_markedup_txt]} #{dgst[:is]} #{t_o.lv}") + elsif t_o.is==:heading_insert + digests_with_markup("#{@sp*0}[#{dgst[:ocn]}]#{@sp*(6-dgst[:ocn].to_s.length)}#{dgst[:dgst_markedup_txt]} #{dgst[:is]} #{t_o.lv}") + else + digests_with_markup("#{@sp*0}#{dgst[:ocn]}#{@sp*(8-dgst[:ocn].to_s.length)}#{dgst[:dgst_markedup_txt]} #{dgst[:is]}") + end + end + end l=Hash.new(0) ocn=nil ao_structure_tree("------------\n") @@ -340,18 +233,20 @@ module SiSU_DigestView data.each do |t_o| if t_o.is==:heading x=case t_o.ln - when 1 then l[1] +=1 #fix Mx[:lv_o] + when 0 then l[0] +=1 ' '*0 << ':A' - when 2 then l[2] +=1 #fix Mx[:lv_o] + when 1 then l[1] +=1 ' '*1 << ':B' - when 3 then l[3] +=1 #fix Mx[:lv_o] + when 2 then l[2] +=1 ' '*2 << ':C' - when 4 then l[4] +=1 #fix Mx[:lv_o] - ' '*3 << '1' - when 5 then l[5] +=1 #fix Mx[:lv_o] - ' '*4 << '2' - when 6 then l[6] +=1 #fix Mx[:lv_o] - ' '*5 << '3' + when 3 then l[3] +=1 + ' '*3 << ':D' + when 4 then l[4] +=1 + ' '*4 << '1' + when 5 then l[5] +=1 + ' '*5 << '2' + when 6 then l[6] +=1 + ' '*6 << '3' else nil end end @@ -363,9 +258,10 @@ module SiSU_DigestView ao_structure_summary("document structure[*]\n") [0,1,2,3,4,5,6].each do |y| v=case y - when 1 then ':A' - when 2 then ':B' - when 3 then ':C' + when 0 then ':A' + when 1 then ':B' + when 2 then ':C' + when 3 then ':D' when 4 then '1 ' when 5 then '2 ' when 6 then '3 ' @@ -374,7 +270,7 @@ module SiSU_DigestView end ao_structure_summary("objects (ocn) = #{ocn}\n") ao_structure_summary("endnotes = #{endnotes}\n") - ao_structure_summary(" [*] number of headers (@) and of each heading level (:A to :C and 1 to 3)\n") + ao_structure_summary(" [*] number of headers (@) and of each heading level (:A to :D and 1 to 3)\n") end def supplementary if defined? @md.sc_number \ diff --git a/lib/sisu/v6/manifest.rb b/lib/sisu/v6/manifest.rb index 1d6bc6a9..27b90eda 100644 --- a/lib/sisu/v6/manifest.rb +++ b/lib/sisu/v6/manifest.rb @@ -123,7 +123,7 @@ module SiSU_Manifest ? './image' : %{#{@f.path_rel_links.html_scroll_2}_sisu/image_sys} @base_path=@f.output_path.manifest.dir - @@dg ||=SiSU_Env::InfoEnv.new.digest.type + @@dg ||=SiSU_Env::InfoEnv.new(md.fns,md).digest(md.opt).type @dg=@@dg l=SiSU_Env::StandardiseLanguage.new(md.opt.lng).language @language=l[:n] @@ -165,9 +165,15 @@ module SiSU_Manifest end def summarize_sources(id,file,pth,rel,url) sys=SiSU_Env::SystemCall.new - dgst=(@dg =~/^sha(?:2|256)$/) \ - ? sys.sha256("#{pth}/#{file}") - : sys.md5("#{pth}/#{file}") + dgst=case @dg + when :sha512 + sys.sha512("#{pth}/#{file}") + when :sha256 + sys.sha256("#{pth}/#{file}") + when :md5 + sys.md5("#{pth}/#{file}") + else + end if (@md.opt.act[:verbose][:set]==:on \ || @md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) diff --git a/lib/sisu/v6/options.rb b/lib/sisu/v6/options.rb index aacfcbe6..115281c7 100644 --- a/lib/sisu/v6/options.rb +++ b/lib/sisu/v6/options.rb @@ -968,6 +968,14 @@ module SiSU_Commandline || mod.inspect =~/"--hash-digests"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } + act[:hash_digest_algo]=if mod.inspect =~/"--hash-(?:sha)?512"/ + :sha512 + elsif mod.inspect =~/"--hash-(?:sha)?256"/ + :sha256 + elsif mod.inspect =~/"--hash-md5"/ + :md5 + else :na + end act[:sample_search_form]=(cmd =~/F/ \ || mod.inspect =~/"--sample-search-form"/) \ ? { bool: true, set: :on } diff --git a/lib/sisu/v6/param.rb b/lib/sisu/v6/param.rb index e3eaebae..9d310f7c 100644 --- a/lib/sisu/v6/param.rb +++ b/lib/sisu/v6/param.rb @@ -1281,14 +1281,23 @@ module SiSU_Param if @sys.openssl !=false \ and FileTest.file?(@env.source_file_with_path) @dgst=[] - if @env.digest.type =~/sha256/ + case @env.digest(@opt).type + when :sha512 + dgst=@sys.sha512(@env.source_file_with_path) + @dgst=dgst[1].length==128 ? dgst : nil + puts 'check document (sha512) digest' if not @dgst + when :sha256 dgst=@sys.sha256(@env.source_file_with_path) @dgst=dgst[1].length==64 ? dgst : nil puts 'check document (sha256) digest' if not @dgst - else + when :md5 dgst=@sys.md5(@env.source_file_with_path) @dgst=dgst[1].length==32 ? dgst : nil puts 'check document (md5) digest' if not @dgst + else + dgst=@sys.sha256(@env.source_file_with_path) + @dgst=dgst[1].length==64 ? dgst : nil + puts 'check document (sha256) digest' if not @dgst end elsif not FileTest.file?(@env.source_file_with_path) #puts SiSU_Utils::CodeMarker.new(__LINE__,__FILE__).set(:fuchsia) diff --git a/lib/sisu/v6/qrcode.rb b/lib/sisu/v6/qrcode.rb index 067d3d64..73feaf3f 100644 --- a/lib/sisu/v6/qrcode.rb +++ b/lib/sisu/v6/qrcode.rb @@ -80,7 +80,7 @@ module SiSU_QRcode end def read begin - @env=SiSU_Env::InfoEnv.new(@opt.fns) + @env=SiSU_Env::InfoEnv.new(@opt.fns,@opt) @md=SiSU_Param::Parameters.new(@opt).get xbrowser=@env.program.web_browser browser=@env.program.console_web_browser @@ -111,12 +111,12 @@ module SiSU_QRcode def initialize(md) @manifest={ txt: [], txt_title: [] } @md,@fns=md,md.fns - @env=SiSU_Env::InfoEnv.new(@md.fns) + @env=SiSU_Env::InfoEnv.new(@md.fns,@md.opt) @fnb=@md.fnb @base_url="#{@env.url.root}/#{@fnb}" @f=SiSU_Env::FileOp.new(@md) @base_path=@f.output_path.manifest.dir - @@dg ||=SiSU_Env::InfoEnv.new.digest.type + @@dg ||=SiSU_Env::InfoEnv.new.digest(@md.opt).type @dg=@@dg l=SiSU_Env::StandardiseLanguage.new(@md.opt.lng).language @language=l[:n] @@ -167,9 +167,14 @@ WOK end def summarize_sources(id,file,pth,rel,url) sys=SiSU_Env::SystemCall.new - dgst=(@dg =~/^sha(?:2|256)$/) \ - ? (sys.sha256("#{pth}/#{file}")) - : (sys.md5("#{pth}/#{file}")) + dgst=case @dg + when :sha512 + (sys.sha516("#{pth}/#{file}")) #check + when :md5 + (sys.md5("#{pth}/#{file}")) + else + (sys.sha256("#{pth}/#{file}")) + end if (@md.opt.act[:verbose][:set]==:on \ || @md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) diff --git a/lib/sisu/v6/shared_markup_alt.rb b/lib/sisu/v6/shared_markup_alt.rb index 4971dde0..3bf3c7e4 100644 --- a/lib/sisu/v6/shared_markup_alt.rb +++ b/lib/sisu/v6/shared_markup_alt.rb @@ -207,20 +207,32 @@ module SiSU_TextRepresentation @t_o,@s=x,x.obj.dup end @env ||=SiSU_Env::InfoEnv.new(@md.fns) - @sha_ =((@env.digest.type =='sha256') ? true : false) + @sha_ = @env.digest(@md.opt).type begin - @sha_ ? (require 'digest/sha2') : (require 'digest/md5') + case @sha_ + when :sha512 + require 'digest/sha2' + when :sha256 + require 'digest/sha2' + when :md5 + require 'digest/md5' + end rescue LoadError SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).error((@sha_ ? 'digest/sha2' : 'digest/md5') + ' NOT FOUND') end end def digest(txt) d=nil - if @sha_ + case @sha_ + when :sha512 + for hash_class in [ Digest::SHA512 ] + d=hash_class.hexdigest(txt) + end + when :sha256 for hash_class in [ Digest::SHA256 ] d=hash_class.hexdigest(txt) end - else + when :md5 for hash_class in [ Digest::MD5 ] d=hash_class.hexdigest(txt) end diff --git a/lib/sisu/v6/sysenv.rb b/lib/sisu/v6/sysenv.rb index ece3ca79..bc3f1a74 100644 --- a/lib/sisu/v6/sysenv.rb +++ b/lib/sisu/v6/sysenv.rb @@ -214,7 +214,7 @@ module SiSU_Env MULTILINGUAL => false, BUNDLE => false, CONCORD_MAX => 260000, - DIGEST => 'sha256', + DIGEST => :sha256, WEBSERV_HOST_CGI => 'http://localhost', WEBSERV_PORT_CGI => 8081, #8111,8123,8081 POSTGRESQL_USER => @@user, #'ralph', # change user !!! @@ -806,6 +806,19 @@ module SiSU_Env false end end + def sha512(filename) #sha dgst + program='openssl' + program_ref="\n\t\tsha digest requested" + if program_found?(program) + pwd=Dir.pwd + Dir.chdir(File.dirname(filename)) + dgst=%x{openssl dgst -sha512 #{File.basename(filename)}}.strip #use file name without file path + Dir.chdir(pwd) + dgst.scan(/\S+/) + else SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).warn("#{program} is not installed #{program_ref}") + false + end + end def psql #psql program='psql' program_ref="\n\t\tpsql requested" @@ -2715,27 +2728,41 @@ WOK end self end - def digest + def digest_conf? + if defined? @rc['default']['digest'] \ + and @rc['default']['digest'] != nil + case @rc['default']['digest'] + when /^sha(?:5|512)?$/ then :sha512 + when /^sha(?:2|256)?$/ then :sha256 + when /^md5$/ then :md5 + else :sha256 + end + else :sha256 + end + end + def digest(opt=nil) + @opt=opt def type - if defined? @rc['default']['digest'] \ - and @rc['default']['digest'] != nil - case @rc['default']['digest'] - when /^sha(?:2|256)?$/ then 'sha256' - when /^md5$/ then 'md5' - else 'sha256' + if @opt + case @opt.act[:hash_digest_algo] + when :sha512 then :sha512 + when :sha256 then :sha256 + when :md5 then :md5 + else digest_conf? end - else 'sha256' + else digest_conf? end end def length - case digest.type - when /sha256/ then 64 - when /md5/ then 32 + case digest(@opt).type + when :sha512 then 128 + when :sha256 then 64 + when :md5 then 32 else 64 end end def pattern - "[0-9a-f]{#{digest.length}}" #/[0-9a-f]{#{digest.length}}/ + "[0-9a-f]{#{digest(@opt).length}}" #/[0-9a-f]{#{digest.length}}/ end self end diff --git a/lib/sisu/v6/urls.rb b/lib/sisu/v6/urls.rb index 5327a9bb..29671dca 100644 --- a/lib/sisu/v6/urls.rb +++ b/lib/sisu/v6/urls.rb @@ -107,7 +107,7 @@ module SiSU_Urls 'I --texinfo (Info file)'=>'info', 'i --manpage (manpage)'=>'manpage', 'm --ao (Document Abstraction)'=>'ao', - 'N --hash-digests (Digests md5/sha256)'=>@fn[:digest], + 'N --hash-digests (Digests sha512/sha256/md5)'=>@fn[:digest], 'o --odt (ODF:ODT - Open Document)'=>@fn[:odf], 'p --pdf (PDF landscape)'=>@fn[:pdf_l], 'p --pdf (PDF portrait)'=>@fn[:pdf_p], diff --git a/man/man1/sisu.1 b/man/man1/sisu.1 index c3229e00..17a79977 100644 --- a/man/man1/sisu.1 +++ b/man/man1/sisu.1 @@ -534,6 +534,12 @@ copies sisu output files to remote host using scp. This requires that sisurc.yml has been provided with information on hostname and username, and that you have your "keys" and ssh agent in place. Also see --rsync. Alias -r .TP +.B --sha256 +set hash digest where used to sha256 +.TP +.B --sha512 +set hash digest where used to sha512 +.TP .B --sqlite --[instruction] [filename] database type set to .I SQLite, diff --git a/sisu.org b/sisu.org index 5563b713..63b82949 100644 --- a/sisu.org +++ b/sisu.org @@ -1627,7 +1627,7 @@ page after TOC). Regards, Daniel -**** TODO [#C] #744402 [w|u] sisu: support sha512 +**** DONE (6.0.5) [#C] #744402 [w|u] sisu: support sha512 :implement: From: Daniel Baumann @@ -1647,6 +1647,11 @@ it would be even nicer if you could specify the actual digest like Regards, Daniel +***** NOTES/COMMENTS + +implemented +document command line option --sha512 + **** TODO [#C] #744405 [w|u] sisu: set default font size -- cgit v1.2.3 From 369b764eb0eca1c2aae7b2dd8a53a7eadbeb902d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 21:27:06 -0400 Subject: v5 v6: param, metadata add 'Copyright:' tag to output related to copyright * (Closes: #744381) syntax: inconsistency \:copyright: and \:license: --- data/doc/sisu/CHANGELOG_v5 | 3 +++ data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v5/param.rb | 2 +- lib/sisu/v6/param.rb | 2 +- sisu.org | 10 +++++++++- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 7c079186..7447e4fc 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -46,6 +46,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.3.5.orig.tar.xz * composite (inserts), missing includes doesn't give an error, fix (Closes: #744379) see sisu.org for comment +* param, metadata add 'Copyright:' tag to output related to copyright + (Closes: #744381) syntax: inconsistency \:copyright: and \:license: + * metadata, pdf, remove link to manifest page where --no-manifest is used (Closes: #744378) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 4c2bf375..3def58df 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -36,6 +36,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * composite (inserts), missing includes doesn't give an error, fix (Closes: #744379) see sisu.org for comment +* param, metadata add 'Copyright:' tag to output related to copyright + (Closes: #744381) syntax: inconsistency \:copyright: and \:license: + * metadata, pdf, remove link to manifest page where --no-manifest is used (Closes: #744378) diff --git a/lib/sisu/v5/param.rb b/lib/sisu/v5/param.rb index ba75bfb0..1167d5ee 100644 --- a/lib/sisu/v5/param.rb +++ b/lib/sisu/v5/param.rb @@ -568,7 +568,7 @@ module SiSU_Param and copyright.text \ and not copyright.text.empty? v=sep(copyright.text) - s +=copyright.text + v + s +='Copyright: ' + copyright.text + v end if defined? copyright.translation \ and copyright.translation \ diff --git a/lib/sisu/v6/param.rb b/lib/sisu/v6/param.rb index 9d310f7c..7cbb6ba7 100644 --- a/lib/sisu/v6/param.rb +++ b/lib/sisu/v6/param.rb @@ -568,7 +568,7 @@ module SiSU_Param and copyright.text \ and not copyright.text.empty? v=sep(copyright.text) - s +=copyright.text + v + s +='Copyright: ' + copyright.text + v end if defined? copyright.translation \ and copyright.translation \ diff --git a/sisu.org b/sisu.org index 63b82949..2c6795f4 100644 --- a/sisu.org +++ b/sisu.org @@ -1390,7 +1390,7 @@ the following is written within the text output: "<< foo.ssi [ERROR test.ssm requires an invalid or non-existent file: foo.ssi]" -**** TODO [#D] #744381 [w|u] sisu syntax: inconsistency \:copyright: and \:license: +**** DONE (5.3.5::6.0.5) [#D] #744381 [w|u] sisu syntax: inconsistency \:copyright: and \:license: :metadata: From: Daniel Baumann @@ -1411,6 +1411,14 @@ or neither should have one (i'd prefere the latter). Regards, Daniel +***** NOTES/COMMENTS + +Under rights there are a series of sub-categories starting with copyright, that +need to be distinguished. Until now started distinguishing after after +Copyright. For consistency have add the prefix 'Copyright' to the output. +Preference to omit noted, but this solution is consistent with options +provided. Bug closed, re-open if necessary. + **** TODO [#B] #744383 [w|u] sisu syntax: :B and :C result in the same formatting -- cgit v1.2.3 From d5b13ca5b8d041c13ef8fa8f8fe4764a9e24166b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 21:32:33 -0400 Subject: v6: param, metadata rights, line-breaks instead of semicolons separating rights * (Closes: #744358) remove trailing semicolon after :copyright: --- data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v6/param.rb | 25 +++++++++++-------------- lib/sisu/v6/shared_metadata.rb | 11 +++++++++++ sisu.org | 6 +++++- 4 files changed, 30 insertions(+), 15 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 3def58df..26f2bcef 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -39,6 +39,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * param, metadata add 'Copyright:' tag to output related to copyright (Closes: #744381) syntax: inconsistency \:copyright: and \:license: +* param, remove trailing semicolon after :copyright: + (Closes: #744358) + * metadata, pdf, remove link to manifest page where --no-manifest is used (Closes: #744378) diff --git a/lib/sisu/v6/param.rb b/lib/sisu/v6/param.rb index 7cbb6ba7..60c9bb54 100644 --- a/lib/sisu/v6/param.rb +++ b/lib/sisu/v6/param.rb @@ -500,12 +500,9 @@ module SiSU_Param @h=build_hash(a) def copyright def text #you may wish to expand to take from all - s=if @h['copyright'] - @h['copyright'] - elsif @h['text'] - @h['text'] - elsif @h['main'] - @h['main'] + s=if @h['copyright'] then @h['copyright'] + elsif @h['text'] then @h['text'] + elsif @h['main'] then @h['main'] else SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'WARNING Document Copyright missing; provide @rights: :copyright:').warn unless @opt.act[:quiet][:set]==:on '' @@ -558,7 +555,7 @@ module SiSU_Param validate_length(s,l,n) end def sep(str) - (str =~/https?:\/\/\S+$/) ? ' ;' : ';' + ' \\\\ ' end def all s=if @h['all'] then @h['all'] @@ -574,36 +571,36 @@ module SiSU_Param and copyright.translation \ and not copyright.translation.empty? v=sep(copyright.translation) - s +='\\\\ translation ' + copyright.translation + v + s +='translation: ' + copyright.translation + v end if defined? copyright.illustrations \ and copyright.illustrations \ and not copyright.illustrations.empty? v=sep(copyright.illustrations) - s +='\\\\ illustrations ' + copyright.illustrations + v + s +='illustrations: ' + copyright.illustrations + v end if defined? copyright.photographs \ and copyright.photographs \ and not copyright.photographs.empty? v=sep(copyright.photographs) - s +='\\\\ photographs ' + copyright.photographs + v + s +='photographs: ' + copyright.photographs + v end if defined? copyright.digitization \ and copyright.digitization \ and not copyright.digitization.empty? v=sep(copyright.digitization) - s +='\\\\ digitization ' + copyright.digitization + v + s +='digitization: ' + copyright.digitization + v end if defined? copyright.audio \ and copyright.audio \ and not copyright.audio.empty? v=sep(copyright.audio) - s +='\\\\ audio ' + copyright.audio + v + s +='audio: ' + copyright.audio + v end if defined? copyright.license \ and copyright.license \ and not copyright.license.empty? - s +='\\\\ License: ' + copyright.license + s +='License: ' + copyright.license end if s.empty? SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'WARNING Document Rights information missing; provide @rights: :copyright:').warn unless @opt.act[:quiet][:set]==:on @@ -611,7 +608,7 @@ module SiSU_Param l,n=Db[:col_info_note],'rights.all' validate_length(s,l,n) end - s + s=s.gsub(/ [\\]+\s+$/,'') end s end diff --git a/lib/sisu/v6/shared_metadata.rb b/lib/sisu/v6/shared_metadata.rb index c2fe06b9..1fa57fa7 100644 --- a/lib/sisu/v6/shared_metadata.rb +++ b/lib/sisu/v6/shared_metadata.rb @@ -735,6 +735,13 @@ module SiSU_Metadata end @s end + def br + if @s \ + and @s.is_a?(String) + @s=@s.gsub(/(?:#{Mx[:br_line]}|\\\\)+/,'
') + end + @s + end def utf8 if @s \ and @s.is_a?(String) @@ -752,6 +759,7 @@ module SiSU_Metadata def xml_sax def meta_para inf_xml=char_enc(@inf).utf8 + inf_xml=char_enc(inf_xml).br < #{Ax[:tab]}#{@tag.capitalize}: @@ -769,6 +777,7 @@ WOK def xml_dom def meta_para inf_xml=char_enc(@inf).utf8 + inf_xml=char_enc(inf_xml).br < #{Ax[:tab]*2}#{@tag.capitalize}: @@ -786,6 +795,7 @@ WOK def xhtml_scroll def meta_para inf_xml=char_enc(@inf).utf8 + inf_xml=char_enc(inf_xml).br < #{Ax[:tab]}#{@tag.capitalize}: @@ -805,6 +815,7 @@ WOK def meta_para inf_xml=char_enc(@inf).amp inf_xml=char_enc(inf_xml).utf8 + inf_xml=char_enc(inf_xml).br %{

#{@tag}: #{inf_xml}

} diff --git a/sisu.org b/sisu.org index 2c6795f4..dec830af 100644 --- a/sisu.org +++ b/sisu.org @@ -1325,7 +1325,7 @@ please also create mailto links when using email adresses like: Regards, Daniel -**** TODO [#C] #744358 [w|u] sisu output: please do not add ';' after \:copyright: +**** DONE (6.0.5) [#C] #744358 [w|u] sisu output: please do not add ';' after \:copyright: :output:fix: From: Daniel Baumann @@ -1350,6 +1350,10 @@ semicolon, he would add one. Regards, Daniel +***** NOTES/COMMENTS + +fix copyright, remove trailing semi-colon + **** DONE (5.3.5::6.0.5) [#B] #744379 [w|u] sisu: missing includes doesn't give an error :processing:fix: -- cgit v1.2.3 From 1716ccd079dc399190804ede2b2b08bf19c0a3b3 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 21:38:34 -0400 Subject: v6: texpdf, (internal coding) use symbols to identify page orientation --- data/doc/sisu/CHANGELOG_v6 | 2 ++ lib/sisu/v6/texpdf.rb | 16 ++++++++-------- lib/sisu/v6/texpdf_format.rb | 21 +++++++++++---------- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 26f2bcef..0643255a 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -51,6 +51,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * rcconf.yml ['defsault']['digest'] = sha512 (Closes: #744402) +* texpdf, (internal coding) use symbols to identify page orientation + * added sisu.org emacs:evil:org mode notes related to sisu development %% 6.0.4.orig.tar.xz (2014-02-14:06/5) diff --git a/lib/sisu/v6/texpdf.rb b/lib/sisu/v6/texpdf.rb index 97961701..b3636154 100644 --- a/lib/sisu/v6/texpdf.rb +++ b/lib/sisu/v6/texpdf.rb @@ -746,12 +746,12 @@ module SiSU_TeX title=@md.title.full.gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}|#{Mx[:br_paragraph]}|\\\\/,' - ') #no line splitting in heading neither html nor latex @md.papersize_array.each do |ps| if @md.opt.act[:pdf_p][:set]==:on - txt_obj={ txt: "#{home}: - #{title}", paper_size: ps, orientation: 'portrait' } + txt_obj={ txt: "#{home}: - #{title}", paper_size: ps, orientation: :portrait } orient_portrait=SiSU_TeX_Pdf::FormatHead.new(@md,txt_obj) @@tex_head[ps][:p]=orient_portrait.document_head_with_orientation(@codeblock_box) end if @md.opt.act[:pdf_l][:set]==:on - txt_obj={ txt: "#{home}: - #{title}", paper_size: ps, orientation: 'landscape' } + txt_obj={ txt: "#{home}: - #{title}", paper_size: ps, orientation: :landscape } orient_landscape=SiSU_TeX_Pdf::FormatHead.new(@md,txt_obj) @@tex_head[ps][:l]=orient_landscape.document_head_with_orientation(@codeblock_box) end @@ -843,30 +843,30 @@ module SiSU_TeX \\renewcommand{\\contentsname}{#{@translate.contents}} \\tableofcontents WOK - toc_pb={ l: @tex_ml.newpage('landscape'), p: @tex_ml.newpage('portrait') } + toc_pb={ l: @tex_ml.newpage(:landscape), p: @tex_ml.newpage(:portrait) } else toc='' toc_pb={ l: '', p: '' } end if @md.opt.act[:pdf_l][:set]==:on x[:l] =<<-WOK -#{@tex_ml.newpage('landscape')} +#{@tex_ml.newpage(:landscape)} \\pagestyle{fancy} #{toc}#{toc_pb[:l]} \\pagenumbering{arabic} #{@tex_ml.paraskip_normal} -#{@tex_ml.newpage('landscape')} +#{@tex_ml.newpage(:landscape)} WOK end if @md.opt.act[:pdf_p][:set]==:on x[:p] =<<-WOK -#{@tex_ml.newpage('portrait')} +#{@tex_ml.newpage(:portrait)} \\pagestyle{fancy} #{toc}#{toc_pb[:p]} -#{@tex_ml.newpage('portrait')} +#{@tex_ml.newpage(:portrait)} \\pagenumbering{arabic} #{@tex_ml.paraskip_normal} -#{@tex_ml.newpage('portrait')} +#{@tex_ml.newpage(:portrait)} WOK end @tex_file << x diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index c1bd0f1c..ea5f383f 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -920,7 +920,7 @@ module SiSU_TeX_Pdf def tex_head_paper_dimensions d={} case @layout - when /portrait/ + when :portrait d[:papertype],d[:fontsize]='a4paper','11pt' d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='0mm','0mm','-12pt' d[:headheight],d[:headsep],d[:columnsep]='12pt','35pt','' @@ -950,7 +950,7 @@ module SiSU_TeX_Pdf d[:papertype],d[:fontsize]='a4paper','12pt' d[:textheight],d[:textwidth]=@tx.a4.portrait.h,@tx.a4.portrait.w end - when /landscape/ + when :landscape d[:papertype],d[:fontsize]='a4paper','11pt' d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='6mm','6mm','-12mm' d[:headheight],d[:headsep],d[:columnsep]='12pt','20pt','40pt' @@ -980,22 +980,22 @@ module SiSU_TeX_Pdf end def tex_head_paper case @layout - when /portrait/ + when :portrait tex_head_paper_portrait(tex_head_paper_dimensions) - when /landscape/ + when :landscape tex_head_paper_landscape(tex_head_paper_dimensions) end end def tex_head_pdftex_dvi color=case @layout - when /portrait/ + when :portrait <<-WOK colorlinks=true, urlcolor=myblack, filecolor=myblack, linkcolor=myblack, WOK - when /landscape/ + when :landscape <<-WOK colorlinks=true, urlcolor=myblue, % \\href{...}{...} external url @@ -1003,8 +1003,9 @@ module SiSU_TeX_Pdf linkcolor=myred, % \\href{...} and \\pageref{...} WOK end - if @layout =~/portrait|landscape/ - <<-WOK + if @layout == :portrait \ + or @layout == :landscape + <<-WOK \\usepackage{alltt} \\usepackage{thumbpdf} \\usepackage[#{@tex2pdf}, @@ -1484,11 +1485,11 @@ module SiSU_TeX_Pdf #BOOK standard dimensions - 229x156 def newpage(orientation) case orientation - when /landscape/ # using longtable latex package + when :landscape # using longtable latex package <<-WOK \\clearpage WOK - when /portrait/ + when :portrait <<-WOK \\newpage WOK -- cgit v1.2.3 From 09fc878f67e525519901fdf8aec9a615984bab95 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 21:41:53 -0400 Subject: v6: texpdf, (internal coding) fontface, rename texpdf_font texpdf_fontface --- data/doc/sisu/CHANGELOG_v6 | 4 ++- lib/sisu/v6/sysenv.rb | 46 ++++++++++++------------- lib/sisu/v6/texpdf_format.rb | 80 ++++++++++++++++++++++---------------------- 3 files changed, 66 insertions(+), 64 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 0643255a..4ab122dd 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -51,7 +51,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * rcconf.yml ['defsault']['digest'] = sha512 (Closes: #744402) -* texpdf, (internal coding) use symbols to identify page orientation +* texpdf, (internal coding) + * use symbols to identify page orientation + * renaming related to fontface * added sisu.org emacs:evil:org mode notes related to sisu development diff --git a/lib/sisu/v6/sysenv.rb b/lib/sisu/v6/sysenv.rb index bc3f1a74..fd36691e 100644 --- a/lib/sisu/v6/sysenv.rb +++ b/lib/sisu/v6/sysenv.rb @@ -1880,51 +1880,51 @@ WOK # fc-list :outline -f "%{family}\n" # fc-list :lang=ja def main - (defined? @rc['default']['texpdf_font']) \ - && (@rc['default']['texpdf_font']=~/\S{3,}/) \ - ? @rc['default']['texpdf_font'] + (defined? @rc['default']['texpdf_fontface']) \ + && (@rc['default']['texpdf_fontface']=~/\S{3,}/) \ + ? @rc['default']['texpdf_fontface'] : 'Liberation Sans' end def sans # not used - (defined? @rc['default']['texpdf_font_sans']) \ - && (@rc['default']['texpdf_font_sans']=~/\S{3,}/) \ - ? @rc['default']['texpdf_font_sans'] + (defined? @rc['default']['texpdf_fontface_sans']) \ + && (@rc['default']['texpdf_fontface_sans']=~/\S{3,}/) \ + ? @rc['default']['texpdf_fontface_sans'] : 'Liberation Sans' end def serif # not used - (defined? @rc['default']['texpdf_font_serif']) \ + (defined? @rc['default']['texpdf_fontface_serif']) \ && (@rc['default']['texpdf_font_serif']=~/\S{3,}/) \ - ? @rc['default']['texpdf_font_serif'] + ? @rc['default']['texpdf_fontface_serif'] : 'Liberation Serif' end def mono - (defined? @rc['default']['texpdf_font_mono']) \ - && (@rc['default']['texpdf_font_mono']=~/\S{3,}/) \ - ? @rc['default']['texpdf_font_mono'] + (defined? @rc['default']['texpdf_fontface_mono']) \ + && (@rc['default']['texpdf_fontface_mono']=~/\S{3,}/) \ + ? @rc['default']['texpdf_fontface_mono'] : 'Liberation Mono' end def cjk - (defined? @rc['default']['texpdf_font_cjk']) \ - && (@rc['default']['texpdf_font_cjk']=~/\S{3,}/) \ - ? @rc['default']['texpdf_font_cjk'] + (defined? @rc['default']['texpdf_fontface_cjk']) \ + && (@rc['default']['texpdf_fontface_cjk']=~/\S{3,}/) \ + ? @rc['default']['texpdf_fontface_cjk'] : 'IPAGothic' # 'IPAGothic' # 'IPAMincho' # 'TakaoMincho' # 'VL Gothic' end def cjk_zh - (defined? @rc['default']['texpdf_font_cjk_zh']) \ - && (@rc['default']['texpdf_font_cjk_zh']=~/\S{3,}/) \ - ? @rc['default']['texpdf_font_cjk_zh'] + (defined? @rc['default']['texpdf_fontface_cjk_zh']) \ + && (@rc['default']['texpdf_fontface_cjk_zh']=~/\S{3,}/) \ + ? @rc['default']['texpdf_fontface_cjk_zh'] : 'IPAGothic' end def cjk_ja - (defined? @rc['default']['texpdf_font_cjk_ja']) \ - && (@rc['default']['texpdf_font_cjk_ja']=~/\S{3,}/) \ - ? @rc['default']['texpdf_font_cjk_ja'] + (defined? @rc['default']['texpdf_fontface_cjk_ja']) \ + && (@rc['default']['texpdf_fontface_cjk_ja']=~/\S{3,}/) \ + ? @rc['default']['texpdf_fontface_cjk_ja'] : 'IPAGothic' end def cjk_ko - (defined? @rc['default']['texpdf_font_cjk_ko']) \ - && (@rc['default']['texpdf_font_cjk_ko']=~/\S{3,}/) \ - ? @rc['default']['texpdf_font_cjk_ko'] + (defined? @rc['default']['texpdf_fontface_cjk_ko']) \ + && (@rc['default']['texpdf_fontface_cjk_ko']=~/\S{3,}/) \ + ? @rc['default']['texpdf_fontface_cjk_ko'] : 'IPAGothic' end self diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index ea5f383f..f7e18dc8 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -771,50 +771,50 @@ module SiSU_TeX_Pdf { mainlang: mainlang, otherlang: otherlang } end def tex_head_encode - texpdf_font=if defined? @md.make.texpdf_font.main \ - and not @md.make.texpdf_font.main.nil? \ - and @md.make.texpdf_font.main=~/\S{3,}/ - @md.make.texpdf_font.main + texpdf_fontface=if defined? @md.make.texpdf_fontface.main \ + and not @md.make.texpdf_fontface.main.nil? \ + and @md.make.texpdf_fontface.main=~/\S{3,}/ + @md.make.texpdf_fontface.main else @env.font.texpdf.main end - texpdf_font_sans=if defined? @md.make.texpdf_font.sans \ - and not @md.make.texpdf_font.sans.nil? \ - and @md.make.texpdf_font.sans=~/\S{3,}/ # not used - @md.make.texpdf_font.sans + texpdf_fontface_sans=if defined? @md.make.texpdf_fontface.sans \ + and not @md.make.texpdf_fontface.sans.nil? \ + and @md.make.texpdf_fontface.sans=~/\S{3,}/ # not used + @md.make.texpdf_fontface.sans else @env.font.texpdf.sans end - texpdf_font_serif=if defined? @md.make.texpdf_font.serif \ - and not @md.make.texpdf_font.serif.nil? \ - and @md.make.texpdf_font.serif=~/\S{3,}/ # not used - @md.make.texpdf_font.serif + texpdf_fontface_serif=if defined? @md.make.texpdf_fontface.serif \ + and not @md.make.texpdf_fontface.serif.nil? \ + and @md.make.texpdf_fontface.serif=~/\S{3,}/ # not used + @md.make.texpdf_fontface.serif else @env.font.texpdf.serif end - texpdf_font_mono=if defined? @md.make.texpdf_font.mono \ - and not @md.make.texpdf_font.mono.nil? \ - and @md.make.texpdf_font.mono=~/\S{3,}/ - @md.make.texpdf_font.mono + texpdf_fontface_mono=if defined? @md.make.texpdf_fontface.mono \ + and not @md.make.texpdf_fontface.mono.nil? \ + and @md.make.texpdf_fontface.mono=~/\S{3,}/ + @md.make.texpdf_fontface.mono else @env.font.texpdf.mono end - texpdf_font_cjk=if @md.opt.lng =~/zh/ \ - and defined? @md.make.texpdf_font.cjk_zh \ - and not @md.make.texpdf_font.cjk_zh.nil? \ - and @md.make.texpdf_font.cjk_zh=~/\S{3,}/ - @md.make.texpdf_font.cjk_zh + texpdf_fontface_cjk=if @md.opt.lng =~/zh/ \ + and defined? @md.make.texpdf_fontface.cjk_zh \ + and not @md.make.texpdf_fontface.cjk_zh.nil? \ + and @md.make.texpdf_fontface.cjk_zh=~/\S{3,}/ + @md.make.texpdf_fontface.cjk_zh elsif @md.opt.lng =~/ja/ \ - and defined? @md.make.texpdf_font.cjk_ja \ - and not @md.make.texpdf_font.cjk_ja.nil? \ - and @md.make.texpdf_font.cjk_ja=~/\S{3,}/ - @md.make.texpdf_font.cjk_ja + and defined? @md.make.texpdf_fontface.cjk_ja \ + and not @md.make.texpdf_fontface.cjk_ja.nil? \ + and @md.make.texpdf_fontface.cjk_ja=~/\S{3,}/ + @md.make.texpdf_fontface.cjk_ja elsif @md.opt.lng =~/ko/ \ - and defined? @md.make.texpdf_font.cjk_ko \ - and not @md.make.texpdf_font.cjk_ko.nil? \ - and @md.make.texpdf_font.cjk_ko=~/\S{3,}/ - @md.make.texpdf_font.cjk_ko + and defined? @md.make.texpdf_fontface.cjk_ko \ + and not @md.make.texpdf_fontface.cjk_ko.nil? \ + and @md.make.texpdf_fontface.cjk_ko=~/\S{3,}/ + @md.make.texpdf_fontface.cjk_ko elsif @md.opt.lng =~/(?:zh|ja|ko)/ \ - and defined? @md.make.texpdf_font.cjk \ - and not @md.make.texpdf_font.cjk.nil? \ - and @md.make.texpdf_font.cjk=~/\S{3,}/ - @md.make.texpdf_font.cjk + and defined? @md.make.texpdf_fontface.cjk \ + and not @md.make.texpdf_fontface.cjk.nil? \ + and @md.make.texpdf_fontface.cjk=~/\S{3,}/ + @md.make.texpdf_fontface.cjk else case @md.opt.lng when /zh/ then @env.font.texpdf.cjk_zh @@ -832,22 +832,22 @@ module SiSU_TeX_Pdf <<-WOK \\usepackage{ucs, fontspec, xltxtra, xunicode, xeCJK} \\setmainCJKlanguage{#{tex_head_lang[:mainlang]}} -\\setCJKmainfont{#{texpdf_font_cjk}} +\\setCJKmainfont{#{texpdf_fontface_cjk}} \\XeTeXlinebreaklocale "#{tex_head_lang[:mainlang]}" \\XeTeXlinebreakskip = 0pt plus 1pt \\setotherlanguage{#{tex_head_lang[:otherlang]}} -\\setmainfont{#{texpdf_font}} -\\setmonofont[Scale=0.85]{#{texpdf_font_mono}} +\\setmainfont{#{texpdf_fontface}} +\\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}} WOK else <<-WOK \\usepackage{polyglossia, ucs, fontspec, xltxtra, xunicode} \\setmainlanguage{#{tex_head_lang[:mainlang]}} \\setotherlanguage{#{tex_head_lang[:otherlang]}} -\\setmainfont{#{texpdf_font}} -\\setmonofont[Scale=0.85]{#{texpdf_font_mono}} -% \\setsansfont{#{texpdf_font_sans}} -% \\setromanfont{#{texpdf_font_serif}} +\\setmainfont{#{texpdf_fontface}} +\\setmonofont[Scale=0.85]{#{texpdf_fontface_mono}} +% \\setsansfont{#{texpdf_fontface_sans}} +% \\setromanfont{#{texpdf_fontface_serif}} WOK end when /pdf/ -- cgit v1.2.3 From 2b2e66c1b6c44ecb55e98ea4316b51f32c51ee80 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 21:50:42 -0400 Subject: v6: texpdf, headings and table of contents representation * (Closes: #744386) 1~ and 2~ result in the same formatting 1~ 2~ & 3~ now differentiated, see discussion in sisu.org under #744383 * (Closes: #744399) :A smaller formatted than :B A~ B~ C~ now the same size, see discussion in sisu.org under #744383 * #744383 :B and :C result in the same formatting, issue explained see sisu.org --- data/doc/sisu/CHANGELOG_v6 | 2 + lib/sisu/v6/texpdf.rb | 22 +++++--- lib/sisu/v6/texpdf_format.rb | 122 ++++++++++++++++++++++--------------------- sisu.org | 86 ++++++++++++++++++++++++++++-- 4 files changed, 162 insertions(+), 70 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 4ab122dd..792cb089 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -55,6 +55,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * use symbols to identify page orientation * renaming related to fontface +* texpdf, headings and table of contents + * added sisu.org emacs:evil:org mode notes related to sisu development %% 6.0.4.orig.tar.xz (2014-02-14:06/5) diff --git a/lib/sisu/v6/texpdf.rb b/lib/sisu/v6/texpdf.rb index b3636154..5654e6df 100644 --- a/lib/sisu/v6/texpdf.rb +++ b/lib/sisu/v6/texpdf.rb @@ -594,20 +594,26 @@ module SiSU_TeX case dob.is when :heading case dob.ln - when 1..3 - tst.heading_major + when 0 + tst.title_level_A + when 1 + tst.section_heading_level_B + when 2 + tst.section_heading_level_C + when 3 + tst.section_heading_level_D when 4 - tst.level4 + tst.heading_level_1 when 5 - tst.level5 + tst.heading_level_2 when 6 - tst.level6 + tst.heading_level_3 else dob end when :heading_insert br="\n\\\\\n" if dob.name=='book_index' - h=tst.heading_major + h=tst.section_heading_level_B heading="\\clearpage\n" + h.tmp idx_arr=[] idx=SiSU_Particulars::CombinedSingleton.instance.get_idx_raw(@md.opt).raw_idx @@ -628,10 +634,10 @@ module SiSU_TeX dob.tmp={ l: l, p: p } elsif dob.ln==2 \ and dob.obj=~/Metadata\b/ - tst.heading_major + tst.section_heading_level_B elsif dob.ln==4 \ and dob.obj=~/Metadata\b/ - h=tst.level4 + h=tst.heading_level_1 metadata=SiSU_Metadata::TeX_Metadata.new(@md).metadata_tex dob.tmp=h.tmp + ' ' + '\begin{scriptsize}' + metadata.join(br) + '\end{scriptsize}' else dob.tmp='' # dob.tmp={ l: '', p: '' } diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index f7e18dc8..015a9934 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -219,95 +219,99 @@ module SiSU_TeX_Pdf else '' end end - def heading_major + def remove_footnotes(cont_ln) + cont_ln=if cont_ln =~/\\[Ff]ootnote/m + cont_ln.gsub(/\s*\\[Ff]ootnote\[\d+\]\{%\s+.+?\}\s*/m,' '). + gsub(/\s*\\[Ff]ootnote[A]\{[*+]+\d*\}\{%\S+.+?\}\s*/m,' ') + else cont_ln + end + end + def title_level_A dob=@dob - title=@md.title.full dob.tmp=dob.tmp.strip if dob.tmp dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2'). gsub(/#{Mx[:url_o]}|#{Mx[:url_c]}/,'') cont_ln=dob.tmp.dup cont_ln=cont_ln.gsub(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2'). gsub(@@tex_pattern_margin_number,'') - clearp=(dob.lv =~/B/ && dob.obj =='Metadata') ? "\\clearpage\n" : '' - if dob.tmp =~/\\[Ff]ootnote/ #and dob =~/^[1-6]#{Tex[:tilde]}/ # removing footnotes from headings! - cont_ln=cont_ln.gsub(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' '). - gsub(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ') - end + cont_ln=remove_footnotes(cont_ln) + titleset='' dob.tmp=dob.tmp.gsub(/^(.*)\n?$/m, - "#{clearp}\\part*{\\1} -\\addcontentsline{toc}{section}{#{cont_ln}} -\\markboth{#{title}}\n") + "#{titleset}\\part*{\\1} +\\markboth{#{@md.title.full}}\n") dob end - def level4 - dob=@dob + def section_heading_level(dob) dob.tmp=dob.tmp.strip if dob.tmp dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2'). gsub(/#{Mx[:url_o]}|#{Mx[:url_c]}/,'') cont_ln=dob.tmp.dup cont_ln=cont_ln.gsub(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2'). - gsub(@@tex_pattern_margin_number,''). - gsub(/#{Tex[:backslash]*2}/,"#{Tex[:backslash]*4}"). # added w42 - gsub(/\\footnote\[\d+\]\{%.+?\\end\{scriptsize\}\s*\}/m,''). #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22 - gsub(/\\Footnote[A]\{[*+]+\d*\}\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22 - title=@md.title.full - if dob.name =~/endnotes/ - dob.tmp=dob.tmp.gsub(/.+/m,'') - end - if dob.tmp =~/\\footnote/ #and dob =~/^[1-6]#{Tex[:tilde]}/ # removing footnotes from headings! - cont_ln=cont_ln.gsub(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' '). - gsub(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ') - end - dob.tmp=dob.tmp.gsub(/^(.*)?\n?$/m,"\\subsubsection*{\\1} -\\addcontentsline{toc}{subsection}{#{cont_ln}} -\\markright{#{title}}") + gsub(@@tex_pattern_margin_number,'') + cont_ln=remove_footnotes(cont_ln) + dob.tmp=dob.tmp.gsub(/^(.*)\n?$/m, + "\\clearpage +\\part*{\\1} +\\addcontentsline{toc}{part}{#{cont_ln}} +\\markboth{#{@md.title.full}}\n") dob end - def level5 - dob=@dob - # there is a problem here with creation of headers does not do what you would want it to header starts with a * and is not in bold work on \\@txt*, same for next section 2002w46 - dob.tmp=dob.tmp.strip if dob.tmp - dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2'). - gsub(/#{Mx[:url_o]}|#{Mx[:url_c]}/,'') - cont_ln=dob.tmp.dup - cont_ln=cont_ln.gsub(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2'). - gsub(@@tex_pattern_margin_number,''). - gsub(/\\footnote\[\d+\]\{%.+?\\end\{scriptsize\}\s*\}/m,''). #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22 - gsub(/\\Footnote[A]\{[*+]+\d*\}\{%.+?\\end\{scriptsize\}\s*\}/m,''). #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22 - gsub(/\\\&/,' and ') #revisit: tmp bugfix 200507, substitutes & with 'and' in toc, needed e.g. for AT&T, see ffa - if dob.tmp =~/\\footnote/ #and dob =~/^[1-6]#{Tex[:tilde]}/ # removing footnotes from headings! - cont_ln=cont_ln.gsub(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' '). - gsub(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ') + def heading_sublevels(dob,sublev) + if sublev==:lev1 + sect='section' + tocadd=%{\\addcontentsline{toc}{section}} + pre='' + post='' + headadd=%{\n\\markright{#{@md.title.full}}} + elsif sublev==:lev2 + sect='subsection' + tocadd=%{\\addcontentsline{toc}{subsection}} + pre='' + post=" \\\\\n" + headadd='' + elsif sublev==:lev3 + sect='subsubsection' + tocadd=%{\\addcontentsline{toc}{subsubsection}} + pre='' #pre='~~~~' + post=" \\\\\n" + headadd='' end - dob.tmp=dob.tmp.gsub(/^(.*)?\n?$/m, - "\\subsubsection*{\\1} -\\addcontentsline{toc}{subsubsection}{#{cont_ln} \\\\ -}") - dob - end - def level6 - dob=@dob - # there is a problem here with creation of headers does not do what you would want it to header starts with a * and is not in bold work on \\sub@txt*, same for previous section 2002w46 dob.tmp=dob.tmp.strip if dob.tmp dob.tmp=dob.tmp.gsub(/\\begin\{(bfseries|itshape)\}(.+?)\\end\{\1\}/m,'\2'). gsub(/#{Mx[:url_o]}|#{Mx[:url_c]}/,'') cont_ln=dob.tmp.dup cont_ln=cont_ln.gsub(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2'). gsub(@@tex_pattern_margin_number,''). + gsub(/#{Tex[:backslash]*2}/,"#{Tex[:backslash]*4}"). # added w42 gsub(/\\footnote\[\d+\]\{%.+?\\end\{scriptsize\}\s*\}/m,''). #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22 gsub(/\\Footnote[A]\{[*+]+\d*\}\{%.+?\\end\{scriptsize\}\s*\}/m,'') #arbitrary bugfix, revisit should not be necessary, eg. wta.1994 2004w22 - if dob.tmp =~/\\footnote/ #and dob =~/^[1-6]#{Tex[:tilde]}/ # removing footnotes from headings! - cont_ln=cont_ln.gsub(/\s*\\footnote\[\d+\]\{%\n .+? \}\s*/,' '). - gsub(/\s*\\Footnote[A]\{[*+]+\d*\}\{%\n .+? \}\s*/,' ') + if dob.name =~/endnotes/ + dob.tmp=dob.tmp.gsub(/.+/m,'') end + cont_ln=remove_footnotes(cont_ln) dob.tmp=dob.tmp.gsub(/^(.*)?\n?$/m, - "\\subsubsection*{\\1} -\\addcontentsline{toc}{subsubsection}{~~~~#{cont_ln} \\\\ -}") - #dob.tmp.gsub(/^(.*)?\n?$/m, - # '\subsubsection*{\1}') + "\\#{sect}*{\\1} +#{tocadd}{#{pre}#{cont_ln}#{post}}#{headadd}") dob end + def section_heading_level_B + section_heading_level(@dob) + end + def section_heading_level_C + section_heading_level(@dob) + end + def section_heading_level_D + section_heading_level(@dob) + end + def heading_level_1 + heading_sublevels(@dob,:lev1) + end + def heading_level_2 + heading_sublevels(@dob,:lev2) + end + def heading_level_3 + heading_sublevels(@dob,:lev3) + end def hang case @dob.indent when /0/ diff --git a/sisu.org b/sisu.org index dec830af..7ee24682 100644 --- a/sisu.org +++ b/sisu.org @@ -1423,7 +1423,7 @@ Copyright. For consistency have add the prefix 'Copyright' to the output. Preference to omit noted, but this solution is consistent with options provided. Bug closed, re-open if necessary. -**** TODO [#B] #744383 [w|u] sisu syntax: :B and :C result in the same formatting +**** DONE (6.0.5) [#B] #744383 [w|u] sisu syntax: :B and :C result in the same formatting :output:fix: (partial solution) From: Daniel Baumann @@ -1446,6 +1446,68 @@ both equal

. Regards, Daniel +***** NOTES/COMMENTS + +this is in part an artifact of LaTeX not having as many document heading levels +and trying to take advantage of the behavior of existing levels rather than +customizing further + +look for a solution, possibly overriding the default font sizes for each + +The current settings were chosen because, there are not enough levels and I +find too many different font sizes disconcerting, especially running sisu over +a wide variety of document types + +the following levels are available in LaTeX + +\part +\chapter +\section +\subsection +\subsubsection + +the levels in sisu are + +A [title] +B [part] +C [subpart] +D [subsubpart] +1 [segment (chapter)] +2 [subsegment] +3 [subsubsegment] + +sisu current mapping: + +level A [title] +level B C D \part (it is up to the user to make part levels visually distinguishable e.g. Book Part Section) +[skipped \chapter] +[skipped \section] +level 1 \subsection +level 2 \subsubsection +level 3 \subsubsection + +the reason for skipping section was the default configuration and resulting +fact that it made for a table of contents that takes more space + +sisu new mapping: + +level A [title] +level B C D \part (it is up to the user to make part levels visually distinguishable e.g. Book Part Section) +[skipped \chapter] +level 1 \section +level 2 \subsection +level 3 \subsubsection + +levels B C & D are the same size, + it is up to the user to make part levels visually distinguishable + e.g. Book Part Section +levels 1 2 & 3 are now distinguished + +(Closes #744386) sisu syntax: 1~ and 2~ result in the same formatting +(under consideration & yet to be done #744383) sisu syntax: :B and :C result in the same formatting +(touches ) +override part font size settings for different levels (B C D) + **** TODO [#C] #744384 [w|u] sisu syntax: relies on empty lines @@ -1472,7 +1534,7 @@ having an empty line in between like this: Regards, Daniel -**** TODO [#B] #744386 [w|u] sisu syntax: 1~ and 2~ result in the same formatting +**** DONE (6.0.5) [#B] #744386 [w|u] sisu syntax: 1~ and 2~ result in the same formatting :output:pdf:fix: (see #744383) From: Daniel Baumann @@ -1489,6 +1551,12 @@ should be different in the output format (pdf here). Regards, Daniel +***** NOTES/COMMENTS + +1~ 2~ 3~ are now differentiated + +deal with under #744383 + **** TODO [#B] #744390 [w|u] sisu: empty sections are ignored @@ -1614,7 +1682,7 @@ to use for TOCs. Regards, Daniel -**** TODO [#B] #744399 [w|u] sisu syntax: :A smaller formatted than :B +**** DONE (6.0.5) [#B] #744399 [w|u] sisu syntax: :A smaller formatted than :B :output:fix: (see #744383) (partial solution) From: Daniel Baumann @@ -1639,6 +1707,18 @@ page after TOC). Regards, Daniel +***** NOTES/COMMENTS + +for pdf + +now is same size see #744383 + +\part (level A B C D) +\chapter (skipped) +\section (level 1) +\subsection (level 2) +\subsubsection (level 3) + **** DONE (6.0.5) [#C] #744402 [w|u] sisu: support sha512 :implement: -- cgit v1.2.3 From df9e4219258cd799a11be6f2d18f2af5b88d8352 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 21:56:28 -0400 Subject: v6: texpdf, pdf default font size configurable (cli & sisurc.yml) (no fractions) * --pdf-fontsize-12 --pdf-fontsize-8 * default: texpdf_fontsize: 12 * (Closes: #744405) --- data/doc/sisu/CHANGELOG_v6 | 6 ++++++ lib/sisu/v6/options.rb | 4 ++++ lib/sisu/v6/sysenv.rb | 22 +++++++++++++++++++++ lib/sisu/v6/texpdf_format.rb | 47 +++++++++++++++++++++++++++++++------------- sisu.org | 17 +++++++++++++++- 5 files changed, 81 insertions(+), 15 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 792cb089..969ceb7e 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -57,6 +57,12 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * texpdf, headings and table of contents +* texpdf, pdf default font size configurable (cli & sisurc.yml) (no fractions) + --pdf-fontsize-12 --pdf-fontsize-8 + default: + texpdf_fontsize: 12 + (Closes: #744405) + * added sisu.org emacs:evil:org mode notes related to sisu development %% 6.0.4.orig.tar.xz (2014-02-14:06/5) diff --git a/lib/sisu/v6/options.rb b/lib/sisu/v6/options.rb index 115281c7..462d9166 100644 --- a/lib/sisu/v6/options.rb +++ b/lib/sisu/v6/options.rb @@ -968,6 +968,10 @@ module SiSU_Commandline || mod.inspect =~/"--hash-digests"/) \ ? { bool: true, set: :on } : { bool: false, set: :na } + act[:pdf_font_size]=if mod.inspect =~/"--(?:pdf-)?font-?size[=-](\d{1,2})(?:pt)?"/ + $1 + else :na + end act[:hash_digest_algo]=if mod.inspect =~/"--hash-(?:sha)?512"/ :sha512 elsif mod.inspect =~/"--hash-(?:sha)?256"/ diff --git a/lib/sisu/v6/sysenv.rb b/lib/sisu/v6/sysenv.rb index fd36691e..6136d248 100644 --- a/lib/sisu/v6/sysenv.rb +++ b/lib/sisu/v6/sysenv.rb @@ -1875,6 +1875,15 @@ WOK "#{source_file_path}/#{file}" end def font + def size(pt=nil) + if pt && pt != :na + pt + elsif defined? @rc['default']['fontsize'] \ + && @rc['default']['fontsize']=~/\d{1,2}/ + @rc['default']['fontsize'] + else :na + end + end def texpdf # you may wish to check selected font against available fonts: # fc-list :outline -f "%{family}\n" @@ -1927,6 +1936,19 @@ WOK ? @rc['default']['texpdf_fontface_cjk_ko'] : 'IPAGothic' end + def size(pt=nil) + if pt && pt != :na + pt + elsif (defined? @rc['default']['texpdf_fontsize']) \ + && (@rc['default']['texpdf_fontsize']=~/\d{1,2}/) + @rc['default']['texpdf_fontsize'] + elsif (defined? @rc['default']['fontsize']) \ + && (@rc['default']['fontsize']=~/\d{1,2}/) + @rc['default']['fontsize'] + else + :na + end + end self end self diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index 015a9934..56bb1c0b 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -923,60 +923,79 @@ module SiSU_TeX_Pdf end def tex_head_paper_dimensions d={} + fontsize_set=if defined? @env.font.texpdf.size(@md.opt.act[:pdf_font_size]) \ + and not @env.font.texpdf.size(@md.opt.act[:pdf_font_size]).nil? + @env.font.texpdf.size(@md.opt.act[:pdf_font_size]) + else :na + end case @layout when :portrait - d[:papertype],d[:fontsize]='a4paper','11pt' + fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize]='a4paper',fontsize d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='0mm','0mm','-12pt' d[:headheight],d[:headsep],d[:columnsep]='12pt','35pt','' d[:marginparsep],d[:marginparwidth]='4mm','8mm' case @ps #@md.papersize when /a4/i #European default, SiSU default - d[:papertype],d[:fontsize]='a4paper','12pt' + fontsize=(fontsize_set==:na) ? '12pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize]='a4paper',fontsize d[:textheight],d[:textwidth]=@tx.a4.portrait.h,@tx.a4.portrait.w when /letter/i #U.S. default - d[:papertype],d[:fontsize]='letterpaper','12pt' + fontsize=(fontsize_set==:na) ? '12pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize]='letterpaper',fontsize d[:textheight],d[:textwidth]=@tx.letter.portrait.h,@tx.letter.portrait.w when /legal/i #U.S. alternative - d[:papertype],d[:fontsize]='legalpaper','12pt' + fontsize=(fontsize_set==:na) ? '12pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize]='legalpaper',fontsize d[:textheight],d[:textwidth]=@tx.legal.portrait.h,@tx.legal.portrait.w when /book|b5/i #book default - larger - d[:papertype],d[:fontsize]='b5paper','11pt' + fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize]='b5paper',fontsize d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='-4mm','-4mm','-36pt' d[:headheight],d[:headsep],d[:columnsep]='12pt','20pt','' d[:textheight],d[:textwidth]=@tx.b5.portrait.h,@tx.b5.portrait.w when /a5/i - d[:papertype],d[:fontsize]='a5paper','11pt' + fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize]='a5paper',fontsize d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='-4mm','-4mm','-36pt' d[:headheight],d[:headsep],d[:columnsep]='11pt','12pt','' d[:marginparsep],d[:marginparwidth]='4mm','6mm' d[:textheight],d[:textwidth]=@tx.a5.portrait.h,@tx.a5.portrait.w else #default currently A4 - d[:papertype],d[:fontsize]='a4paper','12pt' + fontsize=(fontsize_set==:na) ? '12pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize]='a4paper',fontsize d[:textheight],d[:textwidth]=@tx.a4.portrait.h,@tx.a4.portrait.w end when :landscape - d[:papertype],d[:fontsize]='a4paper','11pt' + fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize]='a4paper',fontsize d[:oddsidemargin],d[:evensidemargin],d[:topmargin]='6mm','6mm','-12mm' d[:headheight],d[:headsep],d[:columnsep]='12pt','20pt','40pt' d[:marginparsep],d[:marginparwidth]='4mm','8mm' case @ps #@md.papersize when /a4/i #European default, SiSU default - d[:papertype],d[:fontsize]='a4paper','11pt' + fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize]='a4paper',fontsize d[:textheight],d[:textwidth]=@tx.a4.landscape.h,@tx.a4.landscape.w when /letter/i #U.S. default - d[:papertype],d[:fontsize]='letterpaper','11pt' + fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize]='letterpaper',fontsize d[:textheight],d[:textwidth]=@tx.letter.landscape.h,@tx.letter.landscape.w when /legal/i #U.S. alternative - d[:papertype],d[:fontsize],d[:columnsep]='legalpaper','11pt','48pt' + fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize],d[:columnsep]='legalpaper',fontsize,'48pt' d[:textheight],d[:textwidth]=@tx.legal.landscape.h,@tx.legal.landscape.w when /book|b5/i #book default - larger - d[:papertype],d[:fontsize],d[:columnsep]='b5paper','11pt','35pt' + fontsize=(fontsize_set==:na) ? '11pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize],d[:columnsep]='b5paper',fontsize,'35pt' d[:textheight],d[:textwidth]=@tx.b5.landscape.h,@tx.b5.landscape.w when /a5/i - d[:papertype],d[:fontsize],d[:columnsep]='a5paper','10pt','32pt' + fontsize=(fontsize_set==:na) ? '10pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize],d[:columnsep]='a5paper',fontsize,'32pt' d[:textheight],d[:textwidth]=@tx.a5.landscape.h,@tx.a5.landscape.w else #default currently A4 - d[:papertype],d[:fontsize]='a4paper','12pt' + fontsize=(fontsize_set==:na) ? '12pt' : (fontsize_set + 'pt') + d[:papertype],d[:fontsize]='a4paper',fontsize d[:textheight],d[:textwidth]=@tx.a4.landscape.h,@tx.a4.landscape.w end end diff --git a/sisu.org b/sisu.org index 7ee24682..4db30823 100644 --- a/sisu.org +++ b/sisu.org @@ -1744,7 +1744,7 @@ Daniel implemented document command line option --sha512 -**** TODO [#C] #744405 [w|u] sisu: set default font size +**** DONE (6.0.5) [#C] #744405 [w|u] sisu: set default font size :configuration:pdf:implement: From: Daniel Baumann @@ -1762,6 +1762,21 @@ able to set the default font size. Regards, Daniel +***** NOTES/COMMENTS + +for pdf make configurable + +yaml.rc + +default: + texpdf_fontsize: 12 + +command-line + +--pdf-fontsize-12 +--pdf-fontsize-8 +etc. + **** TODO [#C] #744407 [w|u] sisu: possibility to influence content/formating of the title page -- cgit v1.2.3 From 9d76329a6203dbb2b48b926d764b3429ac04ea5c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 22:43:02 -0400 Subject: v6: texpdf, pdf colored hyperlinks configurable * --pdf-hyperlinks-color --pdf-hyperlinks-no-color or --pdf-hyperlinks-monochrome * ['default']['pdf_hyperlinks']='color' (other options switch hyperlink color off 'no-color' 'color-off' 'monochrome') * (Closes: #744391) no color on a4 portrait see discussion in sisu.org --- data/doc/sisu/CHANGELOG_v6 | 8 ++++++ lib/sisu/v6/options.rb | 6 ++++ lib/sisu/v6/sysenv.rb | 42 ++++++++++++++++++++++++++++ lib/sisu/v6/texpdf_format.rb | 66 +++++++++++++++++++++----------------------- sisu.org | 29 ++++++++++++++++++- 5 files changed, 116 insertions(+), 35 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 969ceb7e..c75ad615 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -55,6 +55,14 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * use symbols to identify page orientation * renaming related to fontface +* texpdf, pdf colored hyperlinks configurable (cli & sisurc.yml) + --pdf-hyperlinks-color │ + --pdf-hyperlinks-no-color or --pdf-hyperlinks-monochrome │ + default: + pdf_hyperlinks: 'color' │ + (other options switch hyperlink color off 'no-color' 'color-off' 'monochrome') │ + (Closes: #744391) no color on a4 portrait │ + * texpdf, headings and table of contents * texpdf, pdf default font size configurable (cli & sisurc.yml) (no fractions) diff --git a/lib/sisu/v6/options.rb b/lib/sisu/v6/options.rb index 462d9166..d7719ea4 100644 --- a/lib/sisu/v6/options.rb +++ b/lib/sisu/v6/options.rb @@ -972,6 +972,12 @@ module SiSU_Commandline $1 else :na end + act[:pdf_hyperlink_colors]=if mod.inspect =~/"--pdf-hyperlinks-(?:mono(?:chrome)?|no-color)"/ + :mono + elsif mod.inspect =~/"--pdf-hyperlinks-color"/ + :color + else :na + end act[:hash_digest_algo]=if mod.inspect =~/"--hash-(?:sha)?512"/ :sha512 elsif mod.inspect =~/"--hash-(?:sha)?256"/ diff --git a/lib/sisu/v6/sysenv.rb b/lib/sisu/v6/sysenv.rb index 6136d248..8c819d9b 100644 --- a/lib/sisu/v6/sysenv.rb +++ b/lib/sisu/v6/sysenv.rb @@ -1874,6 +1874,48 @@ WOK file=@fns.gsub(/\.ssm(?:\.sst)?/,'.ssm.sst') "#{source_file_path}/#{file}" end + def texpdf_hyperlinks(cli) + @cli=cli + @hyplnks=if cli != :na + cli + elsif (defined? @rc['default']['pdf_hyperlinks']) \ + && (@rc['default']['pdf_hyperlinks']=~/color/) + :color + elsif (defined? @rc['default']['pdf_hyperlinks']) \ + && (@rc['default']['pdf_hyperlinks']=~/(?:no-color|color-off|mono(?:chrome)?)/) + :mono + else :na + end + def landscape + if @cli != :na + @cli + elsif (defined? @rc['default']['pdf_hyperlinks_landscape']) \ + && (@rc['default']['pdf_hyperlinks_landscape']=~/color/) + :color + elsif (defined? @rc['default']['pdf_hyperlinks_landscape']) \ + && (@rc['default']['pdf_hyperlinks_landscape']=~/(?:no-color|color-off|mono(?:chrome)?)/) + :mono + elsif @hyplnks != :na + @hyplnks + else :na + end + end + def portrait + if @cli != :na + @cli + elsif (defined? @rc['default']['pdf_hyperlinks_portrait']) \ + && (@rc['default']['pdf_hyperlinks_portrait']=~/color/) + :color + elsif (defined? @rc['default']['pdf_hyperlinks_portrait']) \ + && (@rc['default']['pdf_hyperlinks_portrait']=~/(?:no-color|color-off|mono(?:chrome)?)/) + :mono + elsif @hyplnks != :na + @hyprlnks + else :na + end + end + self + end def font def size(pt=nil) if pt && pt != :na diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index 56bb1c0b..47829581 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -1009,30 +1009,50 @@ module SiSU_TeX_Pdf tex_head_paper_landscape(tex_head_paper_dimensions) end end - def tex_head_pdftex_dvi - color=case @layout - when :portrait + def hyperlinks_monochrome <<-WOK colorlinks=true, urlcolor=myblack, filecolor=myblack, linkcolor=myblack, - WOK - when :landscape + WOK + end + def hyperlinks_colored <<-WOK colorlinks=true, urlcolor=myblue, % \\href{...}{...} external url - filecolor=mygreen, % \\href{...} local file + filecolor=mygreen, % \\href{...} local file linkcolor=myred, % \\href{...} and \\pageref{...} - WOK + WOK + end + def hyperlinks_color? + case @layout + when :portrait then hyperlinks_monochrome + if @env.texpdf_hyperlinks(@md.opt.act[:pdf_hyperlink_colors]).portrait != :na + case @env.texpdf_hyperlinks(@md.opt.act[:pdf_hyperlink_colors]).portrait + when :color then hyperlinks_colored + when :mono then hyperlinks_monochrome + else p __LINE__.to_s + ':error' + end + else hyperlinks_monochrome + end + when :landscape + if @env.texpdf_hyperlinks(@md.opt.act[:pdf_hyperlink_colors]).landscape != :na + case @env.texpdf_hyperlinks(@md.opt.act[:pdf_hyperlink_colors]).landscape + when :color then hyperlinks_colored + when :mono then hyperlinks_monochrome + else p __LINE__.to_s + ':error' + end + else hyperlinks_colored + end end - if @layout == :portrait \ - or @layout == :landscape - <<-WOK + end + def tex_head_pdftex + <<-WOK \\usepackage{alltt} \\usepackage{thumbpdf} \\usepackage[#{@tex2pdf}, - #{color.strip} + #{hyperlinks_color?.strip} pdftitle={#{@txt}}, pdfauthor={#{@author}}, pdfsubject={#{@subject}}, @@ -1068,28 +1088,6 @@ module SiSU_TeX_Pdf \\usepackage{url} %\\usepackage{breakurl} WOK - elsif @txt =~/dvi/ - <<-WOK -\\usepackage{alltt} - #{color.strip} - pageanchor=true, - plainpages=true, - pagebackref, - bookmarks=true, - bookmarksopen=true, - plainpages=false, -] -{hyperref} -\\usepackage[usenames]{color} -\\definecolor{myblack}{rgb}{0,0,0} -\\definecolor{myred}{rgb}{0.75,0,0} -\\definecolor{mygreen}{rgb}{0,0.5,0} -\\definecolor{myblue}{rgb}{0,0,0.5} -\\definecolor{mywhite}{rgb}{1,1,1} -\\usepackage{url} -%\\usepackage{breakurl} - WOK - end end def tex_head_codeblock(codeblock_box_type) codeblock_box=if codeblock_box_type=='listings' @@ -1127,7 +1125,7 @@ module SiSU_TeX_Pdf <<-WOK #{tex_head_paper} #{tex_head_encode} -#{tex_head_pdftex_dvi} +#{tex_head_pdftex} #{tex_head_misc} #{tex_head_codeblock(codeblock_box_type)} \\setcounter{secnumdepth}{2} diff --git a/sisu.org b/sisu.org index 4db30823..426ad58a 100644 --- a/sisu.org +++ b/sisu.org @@ -1594,7 +1594,7 @@ if you have the following sisu syntax: then anything (including and) after ':B~ bar' is ignored entirely. -**** TODO [#C] #744391 [w|u] sisu output: no color on a4 portrait +**** DONE (6.0.5) [#C] #744391 [w|u] sisu output: no color on a4 portrait :output:pdf:contemplate: From: Daniel Baumann @@ -1627,6 +1627,33 @@ pdf does indeed have colors (red for toc, blue for links). Regards, Daniel +***** NOTES/COMMENTS + +background: +portrait was provided for print/paper copy and is great for that in monochrome +(without grays for colored links), +landscape better matching a screen for visual presentations, color affecting the landscape only + +solution: +make configurable by cli & rc file +make both (portrait & landscape colors) configurable +either as hyperlinks monochrome or colored +overriding existing default which remains as described + +document +cli: +--pdf-hyperlinks-no-color or --pdf-hyperlinks-mono +--pdf-hyperlinks-color + +rc: + +default: + pdf_hyperlinks: *[possible values] + pdf_hyperlinks_portrait: *[possible values] + pdf_hyperlinks_landscape: *[possible values] + + * 'color' or ('mono' or 'no-color' or 'color-off') + **** TODO [#D] #744395 [w|u] sisu output: half-page title page in landscape output -- cgit v1.2.3 From 4c27c79289f5c59f2c350249519379192785c2a1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 22:48:09 -0400 Subject: v6: texpdf, for urls switch to sans serif (small fontsize) * instead of typewriter, latex default * (Closes: #744353) --- data/doc/sisu/CHANGELOG_v6 | 4 ++++ lib/sisu/v6/texpdf_format.rb | 1 + sisu.org | 17 ++++++++++++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index c75ad615..f97b9a30 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -71,6 +71,10 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz texpdf_fontsize: 12 (Closes: #744405) +* texpdf, for urls switch to sans serif (small fontsize), + instead of typewriter, latex default + (Closes: #744353) + * added sisu.org emacs:evil:org mode notes related to sisu development %% 6.0.4.orig.tar.xz (2014-02-14:06/5) diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index 47829581..a16b39b9 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -1086,6 +1086,7 @@ module SiSU_TeX_Pdf \\definecolor{myblue}{rgb}{0,0,0.5} \\definecolor{mywhite}{rgb}{1,1,1} \\usepackage{url} +\\urlstyle{sf} %\\usepackage{breakurl} WOK end diff --git a/sisu.org b/sisu.org index 426ad58a..5a68959d 100644 --- a/sisu.org +++ b/sisu.org @@ -1171,7 +1171,7 @@ wrong. margin numbers should only be assigned to actual content. Regards, Daniel -**** TODO [#D] #744353 [w|u] sisu output: please do not use typewriter for urls +**** DONE (6.0.5) [#D] #744353 [w|u] sisu output: please do not use typewriter for urls :output:consider: From: Daniel Baumann @@ -1198,6 +1198,21 @@ to configure it. Regards, Daniel +***** NOTES/COMMENTS + +monospace for url outputs in pdf + +this is default behavior of the latex url package (it uses tt typewriter font) +it is possible to modify the font to sf class or tm/rm class, & I now default to sf +this means when the sisu default sf is used there will be no difference in typeface, +but when times roman or other is used, urls will be in sf instead of that font, +(instead of the latex default typewriter) + +it provides a visual cue even when output is monochrome, without color +(and is in some way related to #744391 sisu output: no color on a4 portrait) +however, it is worth noting here that urls are printed in a smaller font so as +to fit more on a line of text + **** TODO [#C] #744354 [w|u] sisu output: please do not add '<' and '>' around urls From: Daniel Baumann -- cgit v1.2.3 From 41d62d53264b7af387361e27bc5d1ff874e9d3fa Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 22:52:04 -0400 Subject: v6: texpdf, '&' in heading breaks toc (now removed from toc (not heading)), bug * revisit, bug --- data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v6/texpdf_format.rb | 3 +++ 2 files changed, 6 insertions(+) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index f97b9a30..b6522a34 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -75,6 +75,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz instead of typewriter, latex default (Closes: #744353) +* texpdf, & in heading breaks toc, now & is removed from toc not heading, + broken + * added sisu.org emacs:evil:org mode notes related to sisu development %% 6.0.4.orig.tar.xz (2014-02-14:06/5) diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index a16b39b9..eab84823 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -235,6 +235,7 @@ module SiSU_TeX_Pdf cont_ln=cont_ln.gsub(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2'). gsub(@@tex_pattern_margin_number,'') cont_ln=remove_footnotes(cont_ln) + cont_ln=cont_ln.gsub(/\{[\\]+(&)\}/,'\\1') titleset='' dob.tmp=dob.tmp.gsub(/^(.*)\n?$/m, "#{titleset}\\part*{\\1} @@ -249,6 +250,7 @@ module SiSU_TeX_Pdf cont_ln=cont_ln.gsub(/\\begin\{(monosp)\}(.+?)\\end\{\1\}/m,'\2'). gsub(@@tex_pattern_margin_number,'') cont_ln=remove_footnotes(cont_ln) + cont_ln=cont_ln.gsub(/\{[\\]+(&)\}/,'\\1') dob.tmp=dob.tmp.gsub(/^(.*)\n?$/m, "\\clearpage \\part*{\\1} @@ -289,6 +291,7 @@ module SiSU_TeX_Pdf dob.tmp=dob.tmp.gsub(/.+/m,'') end cont_ln=remove_footnotes(cont_ln) + cont_ln=cont_ln.gsub(/\{[\\]+(&)\}/,'\\1') dob.tmp=dob.tmp.gsub(/^(.*)?\n?$/m, "\\#{sect}*{\\1} #{tocadd}{#{pre}#{cont_ln}#{post}}#{headadd}") -- cgit v1.2.3 From f9fb402000465b36c2be03ca3d61c8820d7d9169 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 22:54:25 -0400 Subject: v6: texpdf, mailto markup links set for normal text objects * (Closes: #744357) but testing required --- data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v6/texpdf_format.rb | 4 ++-- sisu.org | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index b6522a34..445328ab 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -75,6 +75,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz instead of typewriter, latex default (Closes: #744353) +* texpdf, mailto markup links set for normal text objects + (Closes: #744357) but testing required + * texpdf, & in heading breaks toc, now & is removed from toc not heading, broken diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index eab84823..a0955478 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -69,8 +69,8 @@ module SiSU_TeX_Pdf @brace_url=SiSU_Viz::Defaults.new.url_decoration end def bare_urls - @dob.obj=@dob.obj.gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@\S+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, - "#{@brace_url.tex_open}\\1#{@brace_url.tex_close}") + @dob.obj=@dob.obj.gsub(/#{Mx[:url_o]}([a-zA-Z0-9._-]+\@[a-zA-Z0-9_-]+?\.[a-zA-Z0-9._-]+)#{Mx[:url_c]}/, + "#{@brace_url.tex_open}\\begin{scriptsize}\\email{\\1}#{@brace_url.tex_close}") @dob.tmp=@dob.tmp.gsub(/(^|[^\\])_/m,'\1\_'). #watch may not work gsub(/(^|[^#{Mx[:lnk_c]}])#{Mx[:url_o]}_?(?:\\?_)?(\S+?)#{Mx[:url_c]}/m, "\\1#{@brace_url.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{@brace_url.tex_close}") diff --git a/sisu.org b/sisu.org index 5a68959d..950d0514 100644 --- a/sisu.org +++ b/sisu.org @@ -1315,7 +1315,7 @@ if
is still used there should be a space after the url - which sisu shoul would like to close without further action re-open if necessary -**** TODO [#C] #744357 [w|u] sisu output: please create mailto links automatically +**** DONE (6.0.5) [#C] #744357 [w|u] sisu output: please create mailto links automatically From: Daniel Baumann @@ -1340,6 +1340,11 @@ please also create mailto links when using email adresses like: Regards, Daniel +***** NOTES/COMMENTS + +for pdf fix/implement mailto links +done but requires further testing & possibly refinement + **** DONE (6.0.5) [#C] #744358 [w|u] sisu output: please do not add ';' after \:copyright: :output:fix: -- cgit v1.2.3 From 62c48aca4793f8f9b9af4114a6ba84a0a477f789 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 22:56:57 -0400 Subject: v6: texpdf, urls in creator cause breakage * (Closes: #744541) --- data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v6/texpdf_format.rb | 33 ++++++++++++++++++++++++--------- sisu.org | 6 +++++- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 445328ab..d2bcea38 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -78,6 +78,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * texpdf, mailto markup links set for normal text objects (Closes: #744357) but testing required +* texpdf, urls in creator cause breakage + (Closes: #744541) + * texpdf, & in heading breaks toc, now & is removed from toc not heading, broken diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index a0955478..e680bc00 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -1051,13 +1051,18 @@ module SiSU_TeX_Pdf end end def tex_head_pdftex + author=if defined? @md.creator.author \ + and @md.creator.author=~/\S+/ + SiSU_TeX_Pdf::SpecialCharacters.new(@md,@md.creator.author).special_characters_safe_no_urls + else '' + end <<-WOK \\usepackage{alltt} \\usepackage{thumbpdf} \\usepackage[#{@tex2pdf}, #{hyperlinks_color?.strip} pdftitle={#{@txt}}, - pdfauthor={#{@author}}, + pdfauthor={#{author}}, pdfsubject={#{@subject}}, pdfkeywords={#{@keywords}}, pageanchor=true, @@ -1341,14 +1346,17 @@ module SiSU_TeX_Pdf gsub(/§/u,'\S'). #latex: space between next character not preserved? #str.gsub(/§ /,'\S ') gsub(/£/u,'\pounds'). gsub(//,' '). - gsub(/<\/a>/,' '). - gsub(/((?:^|\s)#{Mx[:lnk_c]})#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, - '\1\begin{scriptsize}\url{\2}\end{scriptsize}\3'). #special case \{ e.g. \}http://url - gsub(/#{Mx[:url_o]}\\_(\S+?)#{Mx[:url_c]}/, - '\begin{scriptsize}\url{\1}\end{scriptsize}'). #special case \{ e.g. \}http://url - gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, - '\begin{scriptsize}\\url{\1}\end{scriptsize}') #specially escaped url no decoration - unless is==:code + gsub(/<\/a>/,' ') + unless is==:no_urls + str=str.gsub(/((?:^|\s)#{Mx[:lnk_c]})#{Mx[:url_o]}(\S+?)#{Mx[:url_c]}/, + '\1\begin{scriptsize}\url{\2}\end{scriptsize}\3'). #special case \{ e.g. \}http://url + gsub(/#{Mx[:url_o]}\\_(\S+?)#{Mx[:url_c]}/, + '\begin{scriptsize}\url{\1}\end{scriptsize}'). #special case \{ e.g. \}http://url + gsub(/#{Mx[:url_o]}_(\S+?)#{Mx[:url_c]}/, + '\begin{scriptsize}\\url{\1}\end{scriptsize}') #specially escaped url no decoration + end + if is !=:code \ + and is !=:no_urls str=str.gsub(/(^|#{Mx[:gl_c]}|\s)((?:https?|file|ftp):\/\/\S+?\.[^'"\s]+?)([;.,]?(?=\s|$))/, "\\1#{@brace_url.tex_open}\\begin{scriptsize}\\url{\\2}\\end{scriptsize}#{@brace_url.tex_close}\\3") #url matching with decoration positive lookahead, sequence issue with { linked }http://url cannot use \b at start end @@ -1438,6 +1446,13 @@ module SiSU_TeX_Pdf str=special_characters_safe_close(str) unless str.nil? @txt=str end + def special_characters_safe_no_urls + str,is=@txt,:no_urls + str=xetex_special_characters_1(str,is) unless str.nil? + str=xetex_special_characters_2(str,is) unless str.nil? # remove this to start with, causes issues + str=special_characters_safe_close(str) unless str.nil? + @txt=str + end def characters_code_listings #special characters - some substitutions are sequence sensitive, rearrange with care. str,is=@txt,@is str=xetex_code_listings(str,is) unless str.nil? diff --git a/sisu.org b/sisu.org index 950d0514..bf474691 100644 --- a/sisu.org +++ b/sisu.org @@ -1885,7 +1885,7 @@ be automatically transformed into a link within the output (html). Regards, Daniel -**** TODO [#C] #744541 [w|u] sisu: urls in @creator broken +**** DONE (6.0.5) [#C] #744541 [w|u] sisu: urls in @creator broken From: Daniel Baumann @@ -1913,6 +1913,10 @@ transformed into a link in the output format (pdf). Regards, Daniel +***** NOTES/COMMENTS + +pdf, fix + **** TODO [#C] #744685 [w|u] sisu output: copy&past-able wrapped code blocks -- cgit v1.2.3 From f408992e0acf1a962478886fd968dd71f47b115e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 23:03:31 -0400 Subject: v6: ao, document markup structure check, skip processing file on major error * with error message & text at location of failure --- README | 111 ++++-- data/doc/sisu/CHANGELOG_v6 | 3 + .../sisu/markup-samples/manual/en/sisu_markup.sst | 76 ++++ lib/sisu/v5/param.rb | 6 +- lib/sisu/v6/ao_doc_str.rb | 88 ++++- lib/sisu/v6/composite.rb | 6 +- lib/sisu/v6/hub.rb | 226 ++++++----- lib/sisu/v6/param.rb | 9 +- man/man1/sisu.1 | 432 +++++++++++++++------ sisu.org | 8 +- 10 files changed, 702 insertions(+), 263 deletions(-) diff --git a/README b/README index 303784c8..ef26c287 100644 --- a/README +++ b/README @@ -948,6 +948,75 @@ or if for a particular version: sisu --query-0.38 +MARKUP RULES, DOCUMENT STRUCTURE AND METADATA REQUIREMENTS +.......................................................... + +minimal content/structure requirement: + +[metadata] + +A~ (level A [title]) +1~ (at least one level 1 [segment/(chapter)]) + + +structure rules (document heirarchy, heading levels): + +there are two sets of heading levels ABCD (title & parts if any) and 123 +(segment & subsegments if any) + +sisu has the fllowing levels: + +A~ [title] . + required (== 1) followed by B~ or 1~ +B~ [part] * + followed by C~ or 1~ +C~ [subpart] * + followed by D~ or 1~ +D~ [subsubpart] * + followed by 1~ +1~ [segment (chapter)] + + required (>= 1) followed by text or 2~ +text * + followed by more text or 1~, 2~ + or relevant part *() +2~ [subsegment] * + followed by text or 3~ +text * + followed by more text or 1~, 2~ or 3~ + or relevant part, see *() +3~ [subsubsegment] * + followed by text +text * + followed by more text or 1~, 2~ or 3~ or relevant part, see *() + +*(B~ if none other used; + if C~ is last used: C~ or B~; + if D~ is used: D~, C~ or B~) + + +* level A~ is the tile and is mandatory +* there can only be one level A~ +* heading levels BCD, are optional and there may be several of each + (where all three are used corresponding to e.g. Book Part Section) + * sublevels that are used must follow each other sequentially + (alphabetically), +* heading levels A~ B~ C~ D~ are followed by other heading levels rather + than substantive text + which may be the subsequent sequential (alphabetic) heading part level + or a heading (segment) level 1~ +* there must be at least one heading (segment) level 1~ + (the level on which the text is segmented, in a book would correspond + to the Chapter level) +* additional heading levels 1~ 2~ 3~ are optional and there may be several + of each +* heading levels 1~ 2~ 3~ are followed by text (which may be followed by + the same heading level) + and/or the next lower numeric heading level (followed by text) + or indeed return to the relevant part level + (as a corollary to the rules above substantive text/ content + must be preceded by a level 1~ (2~ or 3~) heading) + + MARKUP EXAMPLES ............... @@ -2011,9 +2080,9 @@ Page breaks are only relevant and honored in some output formats. A page break or a new page may be inserted manually using the following markup on a line on its own: -page new =\= or ╋ breaks the page, starts a new page. +page new =\= breaks the page, starts a new page. -page break -\- or ┼ breaks a column, starts a new column, if using columns, +page break -\- breaks a column, starts a new column, if using columns, else breaks the page, starts a new page. page break line across page -..- draws a dividing line, dividing paragraphs @@ -2022,19 +2091,11 @@ page break: -\\- -or - -<:pb> - page (break) new: =\\= -or - -<:pn> - page (break) line across page (dividing paragraphs): @@ -2191,8 +2252,8 @@ Configure substitution in _sisu/sisu_document_make Creator: Ralph Amissah - Rights: Copyright (C) Ralph Amissah 2014;\\ License: GPL 3 (part of SiSU - documentation) + Rights: Copyright: Copyright (C) Ralph Amissah 2014 \\ License: GPL 3 + (part of SiSU documentation) Subject: ebook, epublishing, electronic book, electronic publishing, electronic document, electronic citation, data structure, @@ -2213,31 +2274,21 @@ Configure substitution in _sisu/sisu_document_make Filetype: SiSU text insert 5.0, Source digest: SHA256(README.ssm.sst)= - e9ee6379dcf3a05c2b0ae19f091f7e2b1579d7b8a683996a8c53eb57249497c4 + e6badfab7c24f0b217e1ab3b2d8cebb70a7fa9f1a8af9f907f029aa19fca3e74 - Generated by: Generated by: SiSU 6.0.4 of 2014w06/5 (2014-02-14) + Generated by: Generated by: SiSU 6.0.5 of 2014w15/3 (2014-04-16) - Ruby version: ruby 2.1.0p0 (2013-12-25) [i386-linux-gnu] + Ruby version: ruby 2.1.1p76 (2014-02-24) [i386-linux-gnu] - Document (ao) last generated: 2014-02-14 00:05:38 -0500 + Document (ao) last generated: 2014-05-08 16:40:57 -0400 ============================================================================== plaintext (plain text): - http://niu/manual/en/txt/README.txt - -Other versions of this document: - -manifest: - http://niu/manual/en/manifest/README.html - -at: - http://niu/manual - - + README -* Generated by: SiSU 6.0.4 of 2014w06/5 (2014-02-14) -* Ruby version: ruby 2.1.0p0 (2013-12-25) [i386-linux-gnu] -* Last Generated on: 2014-02-14 00:05:39 -0500 +* Generated by: SiSU 6.0.5 of 2014w15/3 (2014-04-16) +* Ruby version: ruby 2.1.1p76 (2014-02-24) [i386-linux-gnu] +* Last Generated on: 2014-05-08 16:40:59 -0400 * SiSU http://www.sisudoc.org/ diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index d2bcea38..be37cbe6 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.0.5.orig.tar.xz sisu_6.0.5.orig.tar.xz sisu_6.0.5-1.dsc +* ao, document structure check, stop processing on major error + (with error message & text at location of failure) + * ao_syntax, address possible manual use of url delimiters「」 * composite, fix includes, provide extra newline after inserted comment diff --git a/data/doc/sisu/markup-samples/manual/en/sisu_markup.sst b/data/doc/sisu/markup-samples/manual/en/sisu_markup.sst index be6d7b9d..e3eefbac 100644 --- a/data/doc/sisu/markup-samples/manual/en/sisu_markup.sst +++ b/data/doc/sisu/markup-samples/manual/en/sisu_markup.sst @@ -65,6 +65,82 @@ or if for a particular version: _1 sisu --query-0.38 +2~ Markup Rules, document structure and metadata requirements + +minimal content/structure requirement: + +[metadata] + +@title: + +@creator: + +[levels] + +``` code +A~ (level A [title]) +1~ (at least one level 1 [segment/(chapter)]) +``` + +structure rules (document heirarchy, heading levels): + +there are two sets of heading levels ABCD (title & parts if any) and 123 (segment & subsegments if any) + +sisu has the fllowing levels: + +``` code +A~ [title] . + required (== 1) followed by B~ or 1~ +B~ [part] * + followed by C~ or 1~ +C~ [subpart] * + followed by D~ or 1~ +D~ [subsubpart] * + followed by 1~ +1~ [segment (chapter)] + + required (>= 1) followed by text or 2~ +text * + followed by more text or 1~, 2~ + or relevant part *() +2~ [subsegment] * + followed by text or 3~ +text * + followed by more text or 1~, 2~ or 3~ + or relevant part, see *() +3~ [subsubsegment] * + followed by text +text * + followed by more text or 1~, 2~ or 3~ or relevant part, see *() + +*(B~ if none other used; + if C~ is last used: C~ or B~; + if D~ is used: D~, C~ or B~) +``` + +``` code +* level A~ is the tile and is mandatory +* there can only be one level A~ +* heading levels BCD, are optional and there may be several of each + (where all three are used corresponding to e.g. Book Part Section) + * sublevels that are used must follow each other sequentially + (alphabetically), +* heading levels A~ B~ C~ D~ are followed by other heading levels rather + than substantive text + which may be the subsequent sequential (alphabetic) heading part level + or a heading (segment) level 1~ +* there must be at least one heading (segment) level 1~ + (the level on which the text is segmented, in a book would correspond + to the Chapter level) +* additional heading levels 1~ 2~ 3~ are optional and there may be several + of each +* heading levels 1~ 2~ 3~ are followed by text (which may be followed by + the same heading level) + and/or the next lower numeric heading level (followed by text) + or indeed return to the relevant part level + (as a corollary to the rules above substantive text/ content + must be preceded by a level 1~ (2~ or 3~) heading) +``` + 2~ Markup Examples 3~ Online diff --git a/lib/sisu/v5/param.rb b/lib/sisu/v5/param.rb index 1167d5ee..adc9350f 100644 --- a/lib/sisu/v5/param.rb +++ b/lib/sisu/v5/param.rb @@ -1311,7 +1311,7 @@ module SiSU_Param if @en[:note] > 0 \ and @en[:sum] > 0 if @en[:sum] > 0 - else SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'*WARN* both endnote styles used',"~{ #{@en[:sum]} }~ and ^~ #{@en[:mark]}").warn unless @opt.act[:unless][:set]==:on + else SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'*WARN* both endnote styles used',"~{ #{@en[:sum]} }~ and ^~ #{@en[:mark]}").warn unless @opt.act[:quiet][:set]==:on end end if @en[:mark] != @en[:note] \ @@ -1328,7 +1328,7 @@ module SiSU_Param and @opt.inspect =~/P/ #@title=Md.new('Text Insert',@opt,@env).title else - SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'WARNING: Document Title missing','please provide @title:').warn unless @opt.act[:unless][:set]==:on + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'WARNING: Document Title missing','please provide @title:').warn unless @opt.act[:quiet][:set]==:on end end if @author !~/[\S]/ @@ -1336,7 +1336,7 @@ module SiSU_Param and @opt.inspect =~/P/ #@creator=SiSU_Param::Md.new('Text Insert',@opt,@env).creator else - SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'WARNING: Document Author missing','please provide @creator: :author:').warn unless @opt.act[:unless][:set]==:on + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'WARNING: Document Author missing','please provide @creator: :author:').warn unless @opt.act[:quiet][:set]==:on end end @struct={} diff --git a/lib/sisu/v6/ao_doc_str.rb b/lib/sisu/v6/ao_doc_str.rb index d8c012fd..3eb4a804 100644 --- a/lib/sisu/v6/ao_doc_str.rb +++ b/lib/sisu/v6/ao_doc_str.rb @@ -847,18 +847,43 @@ module SiSU_AO_DocumentStructureExtract if status==:error node_ln=/^([0-6])/.match(node)[1].to_i node_parent_ln=/^([0-6])/.match(node_parent)[1].to_i - puts %{current level: #{structure_info.lv[node_ln]} (possible parent levels: #{structure_info.possible_parents(structure_info.lv[node_ln])}) + 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 end end end def warning_incorrect_parent_level_or_level(txt) - puts %{warning, -#{txt} -has incorrect level and/or parent level} + puts %{ERROR. There is an error in markup of heading levels either here or in the parent heading. +The current header reads: +"#{txt}" +has incorrect level and/or parent level +--} + end + def required_headers_present? + unless (defined? @md.title \ + and @md.title.full) + STDERR.puts %{required header missing: + +@title: +SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}" +} + $process_document = :skip + end + unless (defined? @md.creator.author \ + and @md.creator.author) + STDERR.puts %{required header missing: + +@creator: + :author: anonymous? +SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}" +} + $process_document = :skip + end end def ocn #and auto segment numbering increment + required_headers_present? data=@data @o_array=[] node=ocn=ocn_dv=ocn_sp=ocnh=ocnh0=ocnh1=ocnh2=ocnh3=ocnh4=ocnh5=ocnh6=ocno=ocnp=ocnt=ocnc=ocng=ocni=ocnu=0 # h heading, o other, t table, g group, i image @@ -866,6 +891,7 @@ has incorrect level and/or parent level} parent=node1=node2=node3=node4=node5=node6=nil node0='0:0;0' @collapsed_lv0=0 + @lev_occurences={ a: 0, b: 0, c: 0, d: 0, l1: 0, l2: 0, l3: 0 } data.each do |dob| h={} if (dob.obj !~ regex_exclude_ocn_and_node || dob.is==:code) \ @@ -875,7 +901,7 @@ has incorrect level and/or parent level} && dob.ocn_ #dob.ln now is determined, and set earlier, check how best to remove this --> if dob.is==:heading - ln=case dob.lv + @ln=ln=case dob.lv when 'A' then 0 when 'B' then 1 when 'C' then 2 @@ -905,11 +931,13 @@ has incorrect level and/or parent level} end if ln==0 \ or ln=~@md.lv0 + @lev_occurences[:a] += 1 if not dob.obj =~/~#|-#/ ocn_flag=true ocnh0+=1 #heading node0="0:#{ocnh0};#{ocn}" else + #document_structure_check_info(node0,node0,:error) #fix ocn_flag=false node0="0:0;0" end @@ -919,11 +947,13 @@ has incorrect level and/or parent level} node,ocn_sp,parent=node0,"h#{ocnh}",'ROOT' elsif ln==1 \ or ln=~@md.lv1 + @lev_occurences[:b] += 1 if not dob.obj =~/~#|-#/ ocn_flag=true ocnh1+=1 #heading node1="1:#{ocnh1};#{ocn}" else + #document_structure_check_info(node0,node0,:error) #fix ocn_flag=false node1="1:0;0" end @@ -932,6 +962,7 @@ has incorrect level and/or parent level} @collapsed_lv1=@collapsed_lv0+1 node0 else + warning_incorrect_parent_level_or_level(dob.obj) document_structure_check_info(node0,node0,:error) node0 end @@ -939,11 +970,13 @@ has incorrect level and/or parent level} node,ocn_sp,parent=node1,"h#{ocnh}",node0 #FIX elsif ln==2 \ or ln=~@md.lv2 + @lev_occurences[:c] += 1 if not dob.obj =~/~#|-#/ ocn_flag=true ocnh2+=1 node2="2:#{ocnh2};#{ocn}" else + #document_structure_check_info(node0,node0,:error) #fix ocn_flag=false node2="2:0;0" end @@ -952,6 +985,7 @@ has incorrect level and/or parent level} @collapsed_lv2=@collapsed_lv1+1 node1 else + warning_incorrect_parent_level_or_level(dob.obj) document_structure_check_info(node2,node0,:error) node0 end @@ -959,11 +993,13 @@ has incorrect level and/or parent level} node,ocn_sp=node2,"h#{ocnh}" elsif ln==3 \ or ln=~@md.lv3 + @lev_occurences[:d] += 1 if not dob.obj =~/~#|-#/ ocn_flag=true ocnh3+=1 node3="3:#{ocnh3};#{ocn}" else + #document_structure_check_info(node0,node0,:error) #fix ocn_flag=false node3="3:0;0" end @@ -988,6 +1024,7 @@ or this level should be level :B~ rather than #{dob.lv}} node,ocn_sp=node3,"h#{ocnh}" elsif ln==4 \ or ln=~@md.lv4 + @lev_occurences[:l1] += 1 if not dob.obj =~/~#|-#/ ocn_flag=true ocnh4+=1 @@ -1021,6 +1058,7 @@ or this level should be level :B~ rather than #{dob.lv}} node,ocn_sp=node4,"h#{ocnh}" elsif ln==5 \ or ln=~@md.lv5 + @lev_occurences[:l2] += 1 if not dob.obj =~/~#|-#/ ocn_flag=true ocnh5+=1 @@ -1049,6 +1087,7 @@ or this level should be level :B~ rather than #{dob.lv}} @collapsed_lv5=@collapsed_lv1+1 node1 else + warning_incorrect_parent_level_or_level(dob.obj) document_structure_check_info(node5,node0,:error) node0 end @@ -1056,6 +1095,7 @@ or this level should be level :B~ rather than #{dob.lv}} node,ocn_sp=node5,"h#{ocnh}" elsif ln==6 \ or ln=~@md.lv6 + @lev_occurences[:l3] += 1 if not dob.obj =~/~#|-#/ ocn_flag=true ocnh6+=1 @@ -1092,6 +1132,7 @@ or this level should be 5~ rather #{dob.lv}" #level 6 @collapsed_lv6=@collapsed_lv1+1 node1 else + warning_incorrect_parent_level_or_level(dob.obj) document_structure_check_info(node6,node0,:error) node0 end @@ -1099,6 +1140,29 @@ or this level should be 5~ rather #{dob.lv}" #level 6 node,ocn_sp=node6,"h#{ocnh}" end else + unless @lev_occurences[:l1] > 0 + STDERR.puts %{Substantive text objects must follow a level 1~ heading and there are none at this point in processing: #{@lev_occurences[:l1]} +} + end + unless @ln >= 4 + lev=case @ln + when 0 then 'A' + when 1 then 'B' + when 2 then 'C' + when 3 then 'D' + when 4 then '1' + when 5 then '2' + when 6 then '3' + when 7 then '4' + when 8 then '5' + when 9 then '6' + end + 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 + end if not dob.obj =~/~#|-#/ ocn_flag=true else @@ -1177,6 +1241,18 @@ or this level should be 5~ rather #{dob.lv}" #level 6 end @o_array << dob end + unless @lev_occurences[:a] == 1 + 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 + 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 + end @o_array end end diff --git a/lib/sisu/v6/composite.rb b/lib/sisu/v6/composite.rb index 79603e26..2afff1bf 100644 --- a/lib/sisu/v6/composite.rb +++ b/lib/sisu/v6/composite.rb @@ -198,7 +198,8 @@ module SiSU_Assemble file[:prepared] else cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires an invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfile}"} + $process_document = :skip; break #remove this line to continue processing documents that have missing include files para end else tuned_file << para @@ -253,7 +254,8 @@ module SiSU_Assemble @ssm << loadfile else cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - STDERR.puts "\t #{cX.fuchsia}ERROR#{cX.off} #{cX.brown}#{@opt.fns}#{cX.off} #{cX.fuchsia}requires an invalid or non-existent file:#{cX.off} #{cX.brown}#{loadfile}#{cX.off}" + STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfile}"} + $process_document = :skip; break #remove this line to continue processing documents that have missing include files para end end diff --git a/lib/sisu/v6/hub.rb b/lib/sisu/v6/hub.rb index 35e9140d..736fa8bc 100644 --- a/lib/sisu/v6/hub.rb +++ b/lib/sisu/v6/hub.rb @@ -264,12 +264,26 @@ module SiSU @msg,@msgs='',nil @tell=lambda { SiSU_Screen::Ansi.new(@opt.cmd,@msg,"#{@msgs.inspect if @msgs}") } end + def remove_skipped_files_if_any_from_processing_files_array + if @remove_faulty_markup_files_array.length > 0 + @opt.files = (@opt.files - @remove_faulty_markup_files_array) + end + end + def print_error_message_if_files_skipped + if @remove_faulty_markup_files_array.length > 0 + puts '---' + STDERR.puts 'ERROR with file(s), did not process: ' + @remove_faulty_markup_files_array.join(',') + end + end def do_loops + @remove_faulty_markup_files_array=[] if @opt.act[:zap][:set]==:on #% --zap, -Z do_loop_files_on_given_option_pre end do_each_file_loop_options + remove_skipped_files_if_any_from_processing_files_array do_loop_files_on_given_option_post + print_error_message_if_files_skipped end def do_each_file_loop_options @opt.files.each_with_index do |fno,i| @@ -290,6 +304,7 @@ module SiSU end @env=SiSU_Env::InfoEnv.new(@opt.fns) if @opt.act[:ao][:set]==:on #% --ao --dal, -m + $process_document = :ok unless @opt.act[:po4a][:set]==:on # --po4a, -P if @opt.fno =~ /\.ssm$/ require_relative 'composite' # composite.rb #pre-processing @@ -299,112 +314,117 @@ module SiSU SiSU_AO::Source.new(@opt).read end end - if @opt.act[:qrcode][:set]==:on #% --qrcode, -Q - require_relative 'qrcode' # qrcode.rb - SiSU_QRcode::Source.new(@opt).read - end - if @opt.act[:hash_digests][:set]==:on #% --hash-digests, -N digest tree - require_relative 'digests' # digests.rb - SiSU_DigestView::Source.new(@opt).read - end - if @opt.act[:txt][:set]==:on #% --txt, -t -a - require_relative 'txt_plain' # txt_plain.rb - SiSU_Txt_Plain::Source.new(@opt).read - end - if @opt.act[:txt_textile][:set]==:on #% --textile - require_relative 'txt_textile' # txt_textile.rb - SiSU_Txt_Textile::Source.new(@opt).read - end - if @opt.act[:txt_asciidoc][:set]==:on #% --asciidoc - require_relative 'txt_asciidoc' # txt_asciidoc.rb - SiSU_Txt_AsciiDoc::Source.new(@opt).read - end - if @opt.act[:txt_markdown][:set]==:on #% --markdown - require_relative 'txt_markdown' # txt_markdown.rb - SiSU_Txt_Markdown::Source.new(@opt).read - end - if @opt.act[:txt_rst][:set]==:on #% --rst, --rest - require_relative 'txt_rst' # txt_rst.rb - SiSU_Txt_rST::Source.new(@opt).read - end - if @opt.act[:html][:set]==:on #% --html, -h -H - require_relative 'html' # html.rb - SiSU_HTML::Source.new(@opt).read - else - if @opt.act[:html_seg][:set]==:on #% --html-seg (-h -H) - require_relative 'html' # html.rb - SiSU_HTML::Source.new(@opt).read + if $process_document == :ok + if @opt.act[:qrcode][:set]==:on #% --qrcode, -Q + require_relative 'qrcode' # qrcode.rb + SiSU_QRcode::Source.new(@opt).read + end + if @opt.act[:hash_digests][:set]==:on #% --hash-digests, -N digest tree + require_relative 'digests' # digests.rb + SiSU_DigestView::Source.new(@opt).read end - if @opt.act[:html_scroll][:set]==:on #% --html-scroll (-h -H) - require_relative 'html' # html.rb + if @opt.act[:txt][:set]==:on #% --txt, -t -a + require_relative 'txt_plain' # txt_plain.rb + SiSU_Txt_Plain::Source.new(@opt).read + end + if @opt.act[:txt_textile][:set]==:on #% --textile + require_relative 'txt_textile' # txt_textile.rb + SiSU_Txt_Textile::Source.new(@opt).read + end + if @opt.act[:txt_asciidoc][:set]==:on #% --asciidoc + require_relative 'txt_asciidoc' # txt_asciidoc.rb + SiSU_Txt_AsciiDoc::Source.new(@opt).read + end + if @opt.act[:txt_markdown][:set]==:on #% --markdown + require_relative 'txt_markdown' # txt_markdown.rb + SiSU_Txt_Markdown::Source.new(@opt).read + end + if @opt.act[:txt_rst][:set]==:on #% --rst, --rest + require_relative 'txt_rst' # txt_rst.rb + SiSU_Txt_rST::Source.new(@opt).read + end + if @opt.act[:html][:set]==:on #% --html, -h -H + require_relative 'html' # html.rb SiSU_HTML::Source.new(@opt).read + else + if @opt.act[:html_seg][:set]==:on #% --html-seg (-h -H) + require_relative 'html' # html.rb + SiSU_HTML::Source.new(@opt).read + end + if @opt.act[:html_scroll][:set]==:on #% --html-scroll (-h -H) + require_relative 'html' # html.rb + SiSU_HTML::Source.new(@opt).read + end end - end - if @opt.act[:concordance][:set]==:on #% --concordance, -w - require_relative 'concordance' # concordance.rb - SiSU_Concordance::Source.new(@opt).read - end - if @opt.act[:epub][:set]==:on #% --epub, -e - require_relative 'xhtml_epub2' # xhtml_epub2.rb - SiSU_XHTML_EPUB2::Source.new(@opt).read - end - if @opt.act[:odt][:set]==:on #% --odt, -o opendocument - require_relative 'xml_odf_odt' # xml_odf_odt.rb - SiSU_XML_ODF_ODT::Source.new(@opt).read - end - if @opt.act[:xhtml][:set]==:on #% --xhtml, -b xhtml - require_relative 'xhtml' # xhtml.rb - SiSU_XHTML::Source.new(@opt).read - end - if @opt.act[:xml_scaffold_structure_sisu][:set]==:on #% --xml-scaffold --xml-scaffold-sisu - require_relative 'xml_scaffold_structure_sisu' # xml_scaffold_structure_sisu.rb - SiSU_XML_Scaffold_Structure_Sisu::Source.new(@opt).read - end - if @opt.act[:xml_scaffold_structure_collapse][:set]==:on #% --xml-scaffold-collapse - require_relative 'xml_scaffold_structure_collapsed' # xml_scaffold_structure_collapsed.rb - SiSU_XML_Scaffold_Structure_Collapse::Source.new(@opt).read - end - if @opt.act[:xml_docbook_book][:set]==:on #% --xml-docbook - require_relative 'xml_docbook5' # xml_docbook5.rb - SiSU_XML_Docbook_Book::Source.new(@opt).read - end - if @opt.act[:xml_fictionbook][:set]==:on #% --xml-fictionbook - require_relative 'xml_fictionbook2' # xml_fictionbook2.rb - SiSU_XML_Fictionbook::Source.new(@opt).read - end - if @opt.act[:xml_sax][:set]==:on #% --xml-sax, -x xml sax type - require_relative 'xml_sax' # xml_sax.rb - SiSU_XML_SAX::Source.new(@opt).read - end - if @opt.act[:xml_dom][:set]==:on #% --xml-dom, -X xml dom type - require_relative 'xml_dom' # xml_dom.rb - SiSU_XML_DOM::Source.new(@opt).read - end - if @opt.act[:pdf][:set]==:on \ - or @opt.act[:pdf_p][:set]==:on \ - or @opt.act[:pdf_l][:set]==:on #% --pdf-l --pdf, -p latex/ texpdf - require_relative 'texpdf' # texpdf.rb - SiSU_TeX::Source.new(@opt).read - end - if @opt.act[:manpage][:set]==:on #% --manpage, -i - require_relative 'manpage' # manpage.rb - SiSU_Manpage::Source.new(@opt).read - end - if @opt.act[:texinfo][:set]==:on #% --texinfo, -I - require_relative 'texinfo' # texinfo.rb - SiSU_TexInfo::Source.new(@opt).read - end - if @opt.act[:sqlite_discrete][:set]==:on #% --sqlite, -d DB sqlite - require_relative 'dbi_discrete' # dbi_discrete.rb - SiSU_DBI_Discrete::SQL.new(@opt).build - end - if @opt.act[:manifest][:set]==:on #% --manifest, -y - require_relative 'manifest' # manifest.rb - ((@opt.act[:sisupod][:set]==:on \ - || @opt.act[:share_source][:set]==:on) \ - && @opt.files.length < 2 ) \ - ? nil - : SiSU_Manifest::Source.new(@opt).read + if @opt.act[:concordance][:set]==:on #% --concordance, -w + require_relative 'concordance' # concordance.rb + SiSU_Concordance::Source.new(@opt).read + end + if @opt.act[:epub][:set]==:on #% --epub, -e + require_relative 'xhtml_epub2' # xhtml_epub2.rb + SiSU_XHTML_EPUB2::Source.new(@opt).read + end + if @opt.act[:odt][:set]==:on #% --odt, -o opendocument + require_relative 'xml_odf_odt' # xml_odf_odt.rb + SiSU_XML_ODF_ODT::Source.new(@opt).read + end + if @opt.act[:xhtml][:set]==:on #% --xhtml, -b xhtml + require_relative 'xhtml' # xhtml.rb + SiSU_XHTML::Source.new(@opt).read + end + if @opt.act[:xml_scaffold_structure_sisu][:set]==:on #% --xml-scaffold --xml-scaffold-sisu + require_relative 'xml_scaffold_structure_sisu' # xml_scaffold_structure_sisu.rb + SiSU_XML_Scaffold_Structure_Sisu::Source.new(@opt).read + end + if @opt.act[:xml_scaffold_structure_collapse][:set]==:on #% --xml-scaffold-collapse + require_relative 'xml_scaffold_structure_collapsed' # xml_scaffold_structure_collapsed.rb + SiSU_XML_Scaffold_Structure_Collapse::Source.new(@opt).read + end + if @opt.act[:xml_docbook_book][:set]==:on #% --xml-docbook + require_relative 'xml_docbook5' # xml_docbook5.rb + SiSU_XML_Docbook_Book::Source.new(@opt).read + end + if @opt.act[:xml_fictionbook][:set]==:on #% --xml-fictionbook + require_relative 'xml_fictionbook2' # xml_fictionbook2.rb + SiSU_XML_Fictionbook::Source.new(@opt).read + end + if @opt.act[:xml_sax][:set]==:on #% --xml-sax, -x xml sax type + require_relative 'xml_sax' # xml_sax.rb + SiSU_XML_SAX::Source.new(@opt).read + end + if @opt.act[:xml_dom][:set]==:on #% --xml-dom, -X xml dom type + require_relative 'xml_dom' # xml_dom.rb + SiSU_XML_DOM::Source.new(@opt).read + end + if @opt.act[:pdf][:set]==:on \ + or @opt.act[:pdf_p][:set]==:on \ + or @opt.act[:pdf_l][:set]==:on #% --pdf-l --pdf, -p latex/ texpdf + require_relative 'texpdf' # texpdf.rb + SiSU_TeX::Source.new(@opt).read + end + if @opt.act[:manpage][:set]==:on #% --manpage, -i + require_relative 'manpage' # manpage.rb + SiSU_Manpage::Source.new(@opt).read + end + if @opt.act[:texinfo][:set]==:on #% --texinfo, -I + require_relative 'texinfo' # texinfo.rb + SiSU_TexInfo::Source.new(@opt).read + end + if @opt.act[:sqlite_discrete][:set]==:on #% --sqlite, -d DB sqlite + require_relative 'dbi_discrete' # dbi_discrete.rb + SiSU_DBI_Discrete::SQL.new(@opt).build + end + if @opt.act[:manifest][:set]==:on #% --manifest, -y + require_relative 'manifest' # manifest.rb + ((@opt.act[:sisupod][:set]==:on \ + || @opt.act[:share_source][:set]==:on) \ + && @opt.files.length < 2 ) \ + ? nil + : SiSU_Manifest::Source.new(@opt).read + end + else + @remove_faulty_markup_files_array << fno + $process_document=:ok end end end diff --git a/lib/sisu/v6/param.rb b/lib/sisu/v6/param.rb index 60c9bb54..19769027 100644 --- a/lib/sisu/v6/param.rb +++ b/lib/sisu/v6/param.rb @@ -1115,7 +1115,8 @@ module SiSU_Param && @creator.author.is_a?(String)) \ ? " #{@creator.author}" : '' - title=%{"#{@title.full.gsub(/(

|

|
|
)/,'')}",} + title=@title.full.gsub(/\s*(?:

|

|
|
)\s*/,' '). + gsub(/~\{.+?\}~/,'') SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Parameters',%{#{title}#{creator}}).txt_grey if @opt.act[:verbose][:set]==:on end if not @book_idx \ @@ -1317,7 +1318,7 @@ module SiSU_Param if @en[:note] > 0 \ and @en[:sum] > 0 if @en[:sum] > 0 - else SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'*WARN* both endnote styles used',"~{ #{@en[:sum]} }~ and ^~ #{@en[:mark]}").warn unless @opt.act[:unless][:set]==:on + else SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'*WARN* both endnote styles used',"~{ #{@en[:sum]} }~ and ^~ #{@en[:mark]}").warn unless @opt.act[:quiet][:set]==:on end end if @en[:mark] != @en[:note] \ @@ -1334,7 +1335,7 @@ module SiSU_Param and @opt.inspect =~/P/ #@title=Md.new('Text Insert',@opt,@env).title else - SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'WARNING: Document Title missing','please provide @title:').warn unless @opt.act[:unless][:set]==:on + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'WARNING: Document Title missing','please provide @title:').warn unless @opt.act[:quiet][:set]==:on end end if @author !~/[\S]/ @@ -1342,7 +1343,7 @@ module SiSU_Param and @opt.inspect =~/P/ #@creator=SiSU_Param::Md.new('Text Insert',@opt,@env).creator else - SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'WARNING: Document Author missing','please provide @creator: :author:').warn unless @opt.act[:unless][:set]==:on + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'WARNING: Document Author missing','please provide @creator: :author:').warn unless @opt.act[:quiet][:set]==:on end end @struct={} diff --git a/man/man1/sisu.1 b/man/man1/sisu.1 index 17a79977..eb43129c 100644 --- a/man/man1/sisu.1 +++ b/man/man1/sisu.1 @@ -1,4 +1,4 @@ -.TH "sisu" "1" "2014-02-14" "6.0.4" "SiSU" +.TH "sisu" "1" "2014-05-12" "6.0.5" "SiSU" .br .SH NAME .br @@ -97,6 +97,7 @@ Homepages: .SH DESCRIPTION + .BR .B SiSU @@ -124,7 +125,6 @@ and ) , which share text object numbers ("object citation numbering") and the same document structure information. For more see: or - .SH DOCUMENT PROCESSING COMMAND FLAGS .TP @@ -740,10 +740,13 @@ strips output text of editor endnotes[^*2] denoted by asterisk sign strips output text of editor endnotes[^+1] denoted by dagger/plus sign .SH DATABASE COMMANDS + .BR + .B dbi - database interface .BR + .B -D or --pgsql set for .I PostgreSQL @@ -838,9 +841,9 @@ or wildcard] .BR consider -u for appended url info or -v for verbose output - .SH COMMAND LINE WITH FLAGS - BATCH PROCESSING + .BR In the data directory run sisu -mh filename or wildcard eg. "sisu -h cisg.sst" or "sisu -h *.{sst,ssm}" to produce html version of all documents. @@ -849,17 +852,17 @@ or "sisu -h *.{sst,ssm}" to produce html version of all documents. Running sisu (alone without any flags, filenames or wildcards) brings up the interactive help, as does any sisu command that is not recognised. Enter to escape. - .SH HELP .SH SISU MANUAL + .BR The most up to date information on sisu should be contained in the sisu_manual, available at: .BR - + .BR The manual can be generated from source, found respectively, either within the @@ -867,26 +870,26 @@ The manual can be generated from source, found respectively, either within the tarball or installed locally at: .BR -\./data/doc/sisu/markup-samples/sisu_manual + ./data/doc/sisu/markup-samples/sisu_manual .BR -/usr/share/doc/sisu/markup-samples/sisu_manual + /usr/share/doc/sisu/markup-samples/sisu_manual .BR move to the respective directory and type e.g.: .BR -sisu sisu_manual.ssm - + sisu sisu_manual.ssm .SH SISU MAN PAGES + .BR If .B SiSU is installed on your system usual man commands should be available, try: .BR -man sisu + man sisu .BR Most @@ -924,13 +927,16 @@ An online version of the sisu man page is available here: * sisu.1 [^2] .SH SISU BUILT-IN INTERACTIVE HELP, [DISCONTINUED] + .BR This fell out of date and has been discontinued. .SH INTRODUCTION TO SISU MARKUP[^3] .SH SUMMARY + .BR + .B SiSU source documents are .I plaintext @@ -968,10 +974,10 @@ primary outline of the document structure. Markup of substantive text includes: * footnotes/endnotes .BR -* linked text and images + * linked text and images .BR -* paragraph actions, such as indent, bulleted, numbered-lists, etc. + * paragraph actions, such as indent, bulleted, numbered-lists, etc. .BR Some interactive help on markup is available, by typing sisu and selecting @@ -981,23 +987,100 @@ markup or sisu --help markup To check the markup in a file: .BR -sisu --identify [filename].sst + sisu --identify [filename].sst .BR For brief descriptive summary of markup history .BR -sisu --query-history + sisu --query-history .BR or if for a particular version: .BR -sisu --query-0.38 + sisu --query-0.38 +.SH MARKUP RULES, DOCUMENT STRUCTURE AND METADATA REQUIREMENTS + + +.BR +minimal content/structure requirement: + +.BR +[metadata] +.nf +A~ (level A [title]) +1~ (at least one level 1 [segment/(chapter)]) +.fi + + +.BR +structure rules (document heirarchy, heading levels): + +.BR +there are two sets of heading levels ABCD (title & parts if any) and 123 +(segment & subsegments if any) + +.BR +sisu has the fllowing levels: +.nf +A~ [title] . + required (== 1) followed by B~ or 1~ +B~ [part] * + followed by C~ or 1~ +C~ [subpart] * + followed by D~ or 1~ +D~ [subsubpart] * + followed by 1~ +1~ [segment (chapter)] + + required (>= 1) followed by text or 2~ +text * + followed by more text or 1~, 2~ + or relevant part *() +2~ [subsegment] * + followed by text or 3~ +text * + followed by more text or 1~, 2~ or 3~ + or relevant part, see *() +3~ [subsubsegment] * + followed by text +text * + followed by more text or 1~, 2~ or 3~ or relevant part, see *() + +*(B~ if none other used; + if C~ is last used: C~ or B~; + if D~ is used: D~, C~ or B~) +.fi + +.nf +* level A~ is the tile and is mandatory +* there can only be one level A~ +* heading levels BCD, are optional and there may be several of each + (where all three are used corresponding to e.g. Book Part Section) + * sublevels that are used must follow each other sequentially + (alphabetically), +* heading levels A~ B~ C~ D~ are followed by other heading levels rather + than substantive text + which may be the subsequent sequential (alphabetic) heading part level + or a heading (segment) level 1~ +* there must be at least one heading (segment) level 1~ + (the level on which the text is segmented, in a book would correspond + to the Chapter level) +* additional heading levels 1~ 2~ 3~ are optional and there may be several + of each +* heading levels 1~ 2~ 3~ are followed by text (which may be followed by + the same heading level) + and/or the next lower numeric heading level (followed by text) + or indeed return to the relevant part level + (as a corollary to the rules above substantive text/ content + must be preceded by a level 1~ (2~ or 3~) heading) +.fi + .SH MARKUP EXAMPLES .SH ONLINE + .BR Online markup examples are available together with the respective outputs produced from or from @@ -1011,16 +1094,15 @@ markup and the respective output produced: .BR an alternative presentation of markup syntax: /usr/share/doc/sisu/on_markup.txt.gz - .SH INSTALLED + .BR With .B SiSU installed sample skins may be found in: /usr/share/doc/sisu/markup-samples (or equivalent directory) and if sisu -markup-samples is installed also under: /usr/share/doc/sisu/markup-samples-non-free - .SH MARKUP OF HEADERS @@ -1033,17 +1115,16 @@ Note: the first line of a document may include information on the markup version used in the form of a comment. Comments are a percentage mark at the start of a paragraph (and as the first character in a line of text) followed by a space and the comment: - .nf % this would be a comment .fi .SH SAMPLE HEADER + .BR This current document is loaded by a master document that has a header similar to this one: - .nf % SiSU master 4.0 @@ -1100,6 +1181,7 @@ to this one: .SH AVAILABLE HEADERS + .BR Header tags appear at the beginning of a document and provide meta information on the document (such as the @@ -1111,7 +1193,8 @@ by once space :subheadername: All meta tags are available .BR -.B @indentifier: + +.B @identifier: information or instructions .BR @@ -1125,7 +1208,6 @@ structure, and can be useful to know. .BR This is a sample header - .nf % SiSU 2.0 [declared file-type identifier with markup version] .fi @@ -1216,6 +1298,7 @@ This is a sample header .SH HEADING LEVELS + .BR Heading levels are :A~ ,:B~ ,:C~ ,1~ ,2~ ,3~ ... :A - :C being part / section headings, followed by other heading levels, and 1 -6 being headings followed by @@ -1223,19 +1306,23 @@ substantive text or sub-headings. :A~ usually the title :A~? conditional level 1 heading (used where a stand-alone document may be imported into another) .BR + .B :A~ [heading text] Top level heading [this usually has similar content to the title @title: ] NOTE: the heading levels described here are in 0.38 notation, see heading .BR + .B :B~ [heading text] Second level heading [this is a heading level divider] .BR + .B :C~ [heading text] Third level heading [this is a heading level divider] .BR + .B 1~ [heading text] Top level heading preceding substantive text of document or sub-heading 2, the heading level that would normally be marked 1. or 2. or 3. etc. in a document, @@ -1244,16 +1331,17 @@ segments, names are provided automatically if none are given (a number), otherwise takes the form 1~my_filename_for_this_segment .BR + .B 2~ [heading text] Second level heading preceding substantive text of document or sub-heading 3 , the heading level that would normally be marked 1.1 or 1.2 or 1.3 or 2.1 etc. in a document. .BR + .B 3~ [heading text] Third level heading preceding substantive text of document, that would normally be marked 1.1.1 or 1.1.2 or 1.2.1 or 2.1.1 etc. in a document - .nf 1~filename level 1 heading, @@ -1262,7 +1350,9 @@ be marked 1.1.1 or 1.1.2 or 1.2.1 or 2.1.1 etc. in a document .SH FONT ATTRIBUTES + .BR + .B markup example: .nf normal text, *{emphasis}*, !{bold text}!, /{italics}/, _{underscore}_, "{citation}", @@ -1291,7 +1381,9 @@ _{underscore}_ #{monospace}# .fi + .BR + .B resulting output: .BR @@ -1308,13 +1400,16 @@ monospace normal text .BR + .B emphasis [note: can be configured to be represented by bold, italics or underscore] .BR + .B bold text .BR + .I italics .BR @@ -1337,10 +1432,11 @@ normal text .BR monospace - .SH INDENTATION AND BULLETS + .BR + .B markup example: .nf ordinary paragraph @@ -1352,7 +1448,9 @@ _2 indent paragraph two steps _9 indent paragraph nine steps .fi + .BR + .B resulting output: .BR @@ -1368,6 +1466,7 @@ ordinary paragraph indent paragraph nine steps .BR + .B markup example: .nf _* bullet text @@ -1377,7 +1476,9 @@ _1* bullet text, first indent _2* bullet text, two step indent .fi + .BR + .B resulting output: .BR @@ -1393,6 +1494,7 @@ _2* bullet text, two step indent Numbered List (not to be confused with headings/titles, (document structure)) .BR + .B markup example: .nf # numbered list numbered list 1., 2., 3, etc. @@ -1402,7 +1504,9 @@ _# numbered list numbered list indented a., b., c., d., etc. .SH HANGING INDENTS + .BR + .B markup example: .nf _0_1 first line no indent, @@ -1414,7 +1518,9 @@ rest of paragraph no indent in each case level may be 0-9 .fi + .BR + .B resulting output: .BR @@ -1442,15 +1548,16 @@ paragraph no indent first line indented, rest of paragraph no indent in each case level may be 0-9 .BR + .B live-build A collection of scripts used to build customized .B Debian - Livesystems. .I live-build was formerly known as live-helper, and even earlier known as live-package. .BR + .B live-build A collection of scripts used to build customized @@ -1458,40 +1565,46 @@ in each case level may be 0-9 Livesystems. .I live-build was formerly known as live-helper, and even earlier known as live-package. - .SH FOOTNOTES / ENDNOTES + .BR Footnotes and endnotes are marked up at the location where they would be indicated within a text. They are automatically numbered. The output type determines whether footnotes or endnotes will be produced .BR -.B markup example: +.B markup example: .nf ~{ a footnote or endnote }~ .fi + .BR + .B resulting output: .BR [^5] .BR + .B markup example: .nf normal text~{ self contained endnote marker & endnote in one }~ continues .fi + .BR + .B resulting output: .BR normal text[^6] continues .BR + .B markup example: .nf normal text ~{* unnumbered asterisk footnote/endnote, insert multiple asterisks if required }~ continues @@ -1499,7 +1612,9 @@ normal text ~{* unnumbered asterisk footnote/endnote, insert multiple asterisks normal text ~{** another unnumbered asterisk footnote/endnote }~ continues .fi + .BR + .B resulting output: .BR @@ -1509,15 +1624,17 @@ normal text [^*] continues normal text [^**] continues .BR -.B markup example: +.B markup example: .nf normal text ~[* editors notes, numbered asterisk footnote/endnote series ]~ continues normal text ~[+ editors notes, numbered plus symbol footnote/endnote series ]~ continues .fi + .BR + .B resulting output: .BR @@ -1527,6 +1644,7 @@ normal text [^*3] continues normal text [^+2] continues .BR + .B Alternative endnote pair notation for footnotes/endnotes: .nf % note the endnote marker "~^" @@ -1536,13 +1654,14 @@ normal text~^ continues ^~ endnote text following the paragraph in which the marker occurs .fi + .BR the standard and pair notation cannot be mixed in the same document - .SH LINKS .SH NAKED URLS WITHIN TEXT, DEALING WITH URLS + .BR urls found within text are marked up automatically. A url within text is automatically hyperlinked to itself and by default decorated with angled @@ -1551,12 +1670,15 @@ passed as normal text), or escaped by a preceding underscore (in which case the decoration is omitted). .BR + .B markup example: .nf normal text http://www.sisudoc.org/ continues .fi + .BR + .B resulting output: .BR @@ -1566,6 +1688,7 @@ normal text continues An escaped url without decoration .BR + .B markup example: .nf normal text _http://www.sisudoc.org/ continues @@ -1573,7 +1696,9 @@ normal text _http://www.sisudoc.org/ continues deb _http://www.jus.uio.no/sisu/archive unstable main non-free .fi + .BR + .B resulting output: .BR @@ -1587,6 +1712,7 @@ where a code block is used there is neither decoration nor hyperlinking, code blocks are discussed later in this document .BR + .B resulting output: .nf deb http://www.jus.uio.no/sisu/archive unstable main non-free @@ -1595,16 +1721,20 @@ deb-src http://www.jus.uio.no/sisu/archive unstable main non-free .SH LINKING TEXT + .BR To link text or an image to a url the markup is as follows .BR + .B markup example: .nf about { SiSU }http://url.org markup .fi + .BR + .B resulting output: .BR @@ -1615,12 +1745,15 @@ A shortcut notation is available so the url link may also be provided automatically as a footnote .BR + .B markup example: .nf about {~^ SiSU }http://url.org markup .fi + .BR + .B resulting output: .BR @@ -1630,12 +1763,15 @@ aboutSiSU [^7] markup Internal document links to a tagged location, including an ocn .BR + .B markup example: .nf about { text links }#link_text .fi + .BR + .B resulting output: .BR @@ -1645,22 +1781,26 @@ about ⌠text links⌡⌈link_text⌋ Shared document collection link .BR + .B markup example: .nf about { SiSU book markup examples }:SiSU/examples.html .fi + .BR + .B resulting output: .BR about ⌠ .B SiSU book markup examples⌡⌈:SiSU/examples.html⌋ - .SH LINKING IMAGES + .BR + .B markup example: .nf { tux.png 64x80 }image @@ -1674,7 +1814,9 @@ book markup examples⌡⌈:SiSU/examples.html⌋ {~^ ruby_logo.png "Ruby" }http://www.ruby-lang.org/en/ .fi + .BR + .B resulting output: .BR @@ -1691,6 +1833,7 @@ and Ruby" ruby_logo.png 70x90 "Ruby" [^8] .BR + .B linked url footnote shortcut .nf {~^ [text to link] }http://url.org @@ -1704,6 +1847,7 @@ ruby_logo.png 70x90 "Ruby" [^8] text marker *~name .fi + .BR note at a heading level the same is automatically achieved by providing names to headings 1, 2 and 3 i.e. 2~[name] and 3~[name] or in the case of @@ -1711,7 +1855,9 @@ auto-heading numbering, without further intervention. .SH LINK SHORTCUT FOR MULTIPLE VERSIONS OF A SISU DOCUMENT IN THE SAME DIRECTORY TREE + .BR + .B markup example: .nf !_ /{"Viral Spiral"}/, David Bollier @@ -1719,7 +1865,9 @@ TREE { "Viral Spiral", David Bollier [3sS]}viral_spiral.david_bollier.sst .fi + .BR + .B .I "Viral Spiral", David Bollier @@ -1743,10 +1891,12 @@ David Bollier .SH TABLES + .BR Tables may be prepared in two either of two forms .BR + .B markup example: .nf table{ c3; 40; 30; 30; @@ -1762,16 +1912,19 @@ column three of row two, and so on }table .fi + .BR -.B resulting output: +.B resulting output: This is a table|this would become column two of row one|column three of row one is here』And here begins another row|column two of row two|column three of row two, and so on』 + .BR a second form may be easier to work with in cases where there is not much information in each column .BR + .B markup example: [^10] .nf @@ -1788,20 +1941,25 @@ No. of articles, all languages | 25| 19,000| 138,000| 490,000| 862,0 * Contributed at least ten times; ** at least 5 times in last month; *** more than 100 times in last month. .fi + .BR + .B resulting output: .BR + .B Table 3.1: Contributors to Wikipedia, January 2001 - June 2005 |Jan. 2001|Jan. 2002|Jan. 2003|Jan. 2004|July 2004|June 2006』Contributors*|10|472|2,188|9,653|25,011|48,721』Active contributors**|9|212|846|3,228|8,442|16,945』Very active contributors***|0|31|190|692|1,639|3,016』No. of English language articles|25|16,000|101,000|190,000|320,000|630,000』No. of articles, all languages|25|19,000|138,000|490,000|862,000|1,600,000』 + .BR * Contributed at least ten times; ** at least 5 times in last month; *** more than 100 times in last month. - .SH POEM + .BR + .B basic markup: .nf poem{ @@ -1813,7 +1971,9 @@ poem{ Each verse in a poem is given an object number. .fi + .BR + .B markup example: .nf poem{ @@ -1866,7 +2026,9 @@ poem{ }poem .fi + .BR + .B resulting output: `Fury said to a mouse, That he @@ -1913,9 +2075,12 @@ poem{ to death."' + .SH GROUP + .BR + .B basic markup: .nf group{ @@ -1927,7 +2092,9 @@ group{ A group is treated as an object and given a single object number. .fi + .BR + .B markup example: .nf group{ @@ -1980,7 +2147,9 @@ group{ }group .fi + .BR + .B resulting output: `Fury said to a mouse, That he @@ -2029,6 +2198,7 @@ group{ .SH CODE + .BR Code tags code{ ... }code (used as with other group tags described above) are used to escape regular sisu markup, and have been used extensively within this @@ -2042,6 +2212,7 @@ A code-block is treated as an object and given a single object number. [an option to number each line of code may be considered at some later time] .BR + .B use of code tags instead of poem compared, resulting output: .nf `Fury said to a @@ -2090,12 +2261,12 @@ option to number each line of code may be considered at some later time] death."' .fi + .BR From .B SiSU 2.7.7 on you can number codeblocks by placing a hash after the opening code tag code{# as demonstrated here: - .nf 1 | `Fury said to a 2 | mouse, That he @@ -2147,11 +2318,11 @@ code{# as demonstrated here: .SH LINE-BREAKS + .BR To break a line within a "paragraph object", two backslashes \e\e with a space before and a space or newline after them may be used. - .nf To break a line within a "paragraph object", two backslashes \e\e with a space before @@ -2159,6 +2330,7 @@ and a space or newline after them \e\e may be used. .fi + .BR The html break br enclosed in angle brackets (though undocumented) is available in versions prior to 3.0.13 and 2.9.7 (it remains available for the time being, @@ -2168,16 +2340,17 @@ but is depreciated). To draw a dividing line dividing paragraphs, see the section on page breaks. .SH PAGE BREAKS + .BR Page breaks are only relevant and honored in some output formats. A page break or a new page may be inserted manually using the following markup on a line on its own: .BR -page new =\e= or breaks the page, starts a new page. +page new =\e= breaks the page, starts a new page. .BR -page break -\e- or breaks a column, starts a new column, if using columns, +page break -\- breaks a column, starts a new column, if using columns, else breaks the page, starts a new page. .BR @@ -2187,17 +2360,13 @@ page break line across page -..- draws a dividing line, dividing paragraphs page break: .nf -\e\e- - -or -<:pb> .fi + .BR page (break) new: .nf =\e\e= -or -<:pn> .fi @@ -2209,6 +2378,7 @@ page (break) line across page (dividing paragraphs): .SH BOOK INDEX + .BR To make an index append to paragraph the book index term relates to it, using an equal sign and curly braces. @@ -2221,27 +2391,28 @@ Sub-terms are separated from the main term by a colon. ={Main term:sub-term} .fi + .BR The index syntax starts on a new line, but there should not be an empty line between paragraph and index markup. .BR The structure of the resulting index would be: - .nf Main term, 1 sub-term, 1 .fi + .BR Several terms may relate to a paragraph, they are separated by a semicolon. If the term refers to more than one paragraph, indicate the number of paragraphs. - .nf Paragraph containing main term, second term and sub-term. ={first term; second term: sub-term} .fi + .BR The structure of the resulting index would be: .nf @@ -2250,6 +2421,7 @@ The structure of the resulting index would be: sub-term, 1 .fi + .BR If multiple sub-terms appear under one paragraph, they are separated under the main term heading from each other by a pipe symbol. @@ -2263,6 +2435,7 @@ main term heading from each other by a pipe symbol. A paragraph that continues discussion of the first sub-term .fi + .BR The plus one in the example provided indicates the first sub-term spans one additional paragraph. The logical structure of the resulting index would be: @@ -2275,6 +2448,7 @@ additional paragraph. The logical structure of the resulting index would be: .SH COMPOSITE DOCUMENTS MARKUP + .BR It is possible to build a document by creating a master document that requires other documents. The documents required may be complete documents that could be @@ -2296,13 +2470,13 @@ to processing with the same prefix and the suffix .BR basic markup for importing a document into a master document - .nf << filename1.sst << filename2.ssi .fi + .BR The form described above should be relied on. Within the .I Vim @@ -2340,12 +2514,13 @@ the next debian will be Configure substitution in _sisu/sisu_document_make .SH SISU FILETYPES + .BR + .B SiSU has .I plaintext and binary filetypes, and can process either type of document. - .SH .SST .SSM .SSI MARKED UP PLAIN TEXT .TP @@ -2362,28 +2537,30 @@ contents of which are like regular text except these are marked .ssi and are not processed. .BR + .B SiSU processing can be done directly against a sisu documents; which may be located locally or on a remote server for which a url is provided. .BR + .B SiSU source markup can be shared with the command: .BR sisu -s [filename] - .SH SISU TEXT - REGULAR FILES (.SST) + .BR The most common form of document in .B SiSU, see the section on .B SiSU markup. - .SH SISU MASTER FILES (.SSM) + .BR Composite documents which incorporate other .B SiSU @@ -2411,6 +2588,7 @@ Note: a secondary file of the composite document is built prior to processing with the same prefix and the suffix ._sst [^11] .SH SISU INSERT FILES (.SSI) + .BR Inserts are documents prepared solely for the purpose of being incorporated into one or more master documents. They resemble regular @@ -2421,6 +2599,7 @@ processor. Making a file a .ssi file is a quick and convenient way of flagging that it is not intended that the file should be processed on its own. .SH SISUPOD, ZIPPED BINARY CONTAINER (SISUPOD.ZIP, .SSP) + .BR A sisupod is a zipped .B SiSU @@ -2428,7 +2607,6 @@ text file or set of .B SiSU text files and any associated images that they contain (this will be extended to include sound and multimedia-files) - .TP .B SiSU .I plaintext @@ -2460,6 +2638,7 @@ Alternatively, make a pod of the contents of a whole directory: sisu -S .BR + .B SiSU processing can be done directly against a sisupod; which may be located locally or on a remote server for which a url is provided. @@ -2469,14 +2648,15 @@ or on a remote server for which a url is provided. .BR - .SH CONFIGURATION .SH CONFIGURATION FILES .SH CONFIG.YML + .BR + .B SiSU configration parameters are adjusted in the configuration file, which can be used to override the defaults set. This includes such things as which directory @@ -2489,6 +2669,7 @@ The configuration file is a yaml file, which means indentation is significant. .BR + .B SiSU resource configuration is determined by looking at the following files if they exist: @@ -2526,9 +2707,9 @@ access details. If .B SiSU is installed a sample sisurc.yml may be found in /etc/sisu/sisurc.yml - .SH SISU_DOCUMENT_MAKE + .BR Most sisu document headers relate to metadata, the exception is the @make: header which provides processing related information. The default contents of @@ -2558,9 +2739,9 @@ The search order is as for resource configuration: .BR A sample sisu_document_make can be found in the _sisu/ directory under along with the provided sisu markup samples. - .SH CSS - CASCADING STYLE SHEETS (FOR HTML, XHTML AND XML) + .BR CSS files to modify the appearance of .B SiSU @@ -2578,18 +2759,22 @@ directory _sisu/css or equivalent will result in the default file of that name being overwritten. .BR + .I HTML: html. css .BR + .I XML DOM: dom.css .BR + .I XML SAX: sax.css .BR + .I XHTML: xhtml. css @@ -2599,16 +2784,17 @@ The default homepage may use homepage.css or html. css .BR Under consideration is to permit the placement of a CSS file with a different name in directory _sisu/css directory or equivalent.[^12] - .SH ORGANISING CONTENT - DIRECTORY STRUCTURE AND MAPPING + .BR + .B SiSU v3 has new options for the source directory tree, and output directory structures of which there are 3 alternatives. - .SH DOCUMENT SOURCE DIRECTORY + .BR The document source directory is the directory in which sisu processing commands are given. It contains the sisu source files (.sst .ssm .ssi), or (for @@ -2621,7 +2807,8 @@ supported by XeTeX polyglosia. .SH GENERAL DIRECTORIES .nf -\./subject_name/ + ./subject_name/ + % files stored at this level e.g. sisu_manual.sst or % for sisu v3 may be under language sub-directories % e.g. @@ -2643,6 +2830,7 @@ supported by XeTeX polyglosia. .SH OUTPUT DIRECTORY ROOT + .BR The output directory root can be set in the sisurc.yml file. Under the root, subdirectories are made for each directory in which a document set resides. If @@ -2668,13 +2856,12 @@ directory named after each institution, and these would be output to the same output directory. Skins could be associated with each institution on a directory basis and resulting documents will take on the appropriate different appearance. - .SH ALTERNATIVE OUTPUT STRUCTURES + .BR There are 3 possibile output structures described as being, by language, by filetype or by filename, the selection is made in sisurc.yml - .nf #% output_dir_structure_by: language; filetype; or filename output_dir_structure_by: language #(language & filetype, preferred?) @@ -2684,6 +2871,7 @@ output_dir_structure_by: language #(language & filetype, preferred?) .SH BY LANGUAGE + .BR The by language directory structure places output files @@ -2696,7 +2884,6 @@ Its selection is configured in sisurc.yml .BR output_dir_structure_by: language - .nf |-- en |-- epub @@ -2726,11 +2913,12 @@ output_dir_structure_by: language `-- xsd .fi + .BR #by: language subject_dir/en/manifest/filename.html - .SH BY FILETYPE + .BR The by filetype directory structure separates output files by filetype, all html files in one directory pdfs in another and so on. Filenames are given a @@ -2741,7 +2929,6 @@ Its selection is configured in sisurc.yml .BR output_dir_structure_by: filetype - .nf |-- epub |-- hashes @@ -2770,11 +2957,12 @@ output_dir_structure_by: filetype `-- xml .fi + .BR #by: filetype subject_dir/html/filename/manifest.en.html - .SH BY FILENAME + .BR The by filename directory structure places most output of a particular file (the different filetypes) in a common directory. @@ -2784,7 +2972,6 @@ Its selection is configured in sisurc.yml .BR output_dir_structure_by: filename - .nf |-- epub |-- po4a @@ -2806,9 +2993,9 @@ output_dir_structure_by: filename `-- viral_spiral.david_bollier .fi + .BR #by: filename subject_dir/filename/manifest.en.html - .SH REMOTE DIRECTORIES .nf @@ -2865,7 +3052,9 @@ output_dir_structure_by: filename .SH HOMEPAGES + .BR + .B SiSU is about the ability to auto-generate documents. Home pages are regarded as custom built items, and are not created by @@ -2888,9 +3077,9 @@ option) Document sets are contained in directories, usually organised by site or subject. Each directory can/should have its own homepage. See the section on directory structure and organisation of content. - .SH HOME PAGE AND OTHER CUSTOM BUILT PAGES IN A SUB-DIRECTORY + .BR Custom built pages, including the home page index.html may be placed within the configuration directory _sisu/home/ in any of the locations that is searched @@ -2898,11 +3087,12 @@ for the configuration directory, namely ./_sisu ; ~/_sisu ; /etc/sisu From there they are copied to the root of the output directory with the command: .BR -sisu -CC + sisu -CC .SH MARKUP AND OUTPUT EXAMPLES .SH MARKUP EXAMPLES + .BR Current markup examples and document output samples are provided off or and in the sisu @@ -2912,9 +3102,9 @@ Current markup examples and document output samples are provided off For some documents hardly any markup at all is required at all, other than a header, and an indication that the levels to be taken into account by the program in generating its output are. - .SH SISU MARKUP SAMPLES + .BR A few additional sample books prepared as sisu markup samples, output formats to be generated using @@ -2931,116 +3121,138 @@ that the original substantive text remain unchanged, and sometimes that the works be used only non-commercially. .BR + .I Accelerando, Charles Stross (2005) accelerando.charles_stross.sst .BR + .I Alice's Adventures in Wonderland, Lewis Carroll (1865) alices_adventures_in_wonderland.lewis_carroll.sst .BR + .I CONTENT, Cory Doctorow (2008) content.cory_doctorow.sst .BR + .I Democratizing Innovation, Eric von Hippel (2005) democratizing_innovation.eric_von_hippel.sst .BR + .I Down and Out in the Magic Kingdom, Cory Doctorow (2003) down_and_out_in_the_magic_kingdom.cory_doctorow.sst .BR + .I For the Win, Cory Doctorow (2010) for_the_win.cory_doctorow.sst .BR + .I Free as in Freedom - Richard Stallman's Crusade for Free Software, Sam Williams (2002) free_as_in_freedom.richard_stallman_crusade_for_free_software.sam_williams.sst .BR + .I Free as in Freedom 2.0 - Richard Stallman and the Free Software Revolution, Sam Williams (2002), Richard M. Stallman (2010) free_as_in_freedom_2.richard_stallman_and_the_free_software_revolution.sam_williams.richard_stallman.sst .BR + .I Free Culture - How Big Media Uses Technology and the Law to Lock Down Culture and Control Creativity, Lawrence Lessig (2004) free_culture.lawrence_lessig.sst .BR + .I Free For All - How Linux and the Free Software Movement Undercut the High Tech Titans, Peter Wayner (2002) free_for_all.peter_wayner.sst .BR + .I GNU GENERAL PUBLIC LICENSE v2, Free Software Foundation (1991) gpl2.fsf.sst .BR + .I GNU GENERAL PUBLIC LICENSE v3, Free Software Foundation (2007) gpl3.fsf.sst .BR + .I Gulliver's Travels, Jonathan Swift (1726 / 1735) gullivers_travels.jonathan_swift.sst .BR + .I Little Brother, Cory Doctorow (2008) little_brother.cory_doctorow.sst .BR + .I The Cathederal and the Bazaar, Eric Raymond (2000) the_cathedral_and_the_bazaar.eric_s_raymond.sst .BR + .I The Public Domain - Enclosing the Commons of the Mind, James Boyle (2008) the_public_domain.james_boyle.sst .BR + .I The Wealth of Networks - How Social Production Transforms Markets and Freedom, Yochai Benkler (2006) the_wealth_of_networks.yochai_benkler.sst .BR + .I Through the Looking Glass, Lewis Carroll (1871) through_the_looking_glass.lewis_carroll.sst .BR + .I Two Bits - The Cultural Significance of Free Software, Christopher Kelty (2008) two_bits.christopher_kelty.sst .BR + .I UN Contracts for International Sale of Goods, UN (1980) un_contracts_international_sale_of_goods_convention_1980.sst .BR + .I Viral Spiral, David Bollier (2008) viral_spiral.david_bollier.sst - .SH SISU SEARCH - INTRODUCTION + .BR + .B SiSU output can easily and conveniently be indexed by a number of standalone indexing tools, such as Lucene, Hyperestraier. @@ -3050,24 +3262,25 @@ Because the document structure of sites created is clearly defined, and the text .I object citation system is available hypothetically at least, for all forms of output, it is possible -to search the sql database, and either read results from that database, or just -as simply map the results to the html output, which has richer text markup. +to search the sql database, and either read results from that database, or map +the results to the html or other output, which has richer text markup. .BR -In addition to this -.B SiSU -has the ability to populate a relational sql type database with documents at an -object level, with objects numbers that are shared across different output -types, which make them searchable with that degree of granularity. Basically, -your match criteria is met by these documents and at these locations within -each document, which can be viewed within the database directly or in various -output formats. +.B SiSU +can populate a relational sql type database with documents at an object level, +including objects numbers that are shared across different output types. Making +a document corpus searchable with that degree of granularity. Basically, your +match criteria is met by these documents and at these locations within each +document, which can be viewed within the database directly or in various output +formats. .SH SQL .SH POPULATING SQL TYPE DATABASES + .BR + .B SiSU feeds sisu markupd documents into sql type databases .I PostgreSQL @@ -3082,25 +3295,25 @@ should they so choose). All site texts/documents are (currently) streamed to four tables: .BR -* one containing semantic (and other) headers, including, title, author, + * one containing semantic (and other) headers, including, title, author, subject, (the .I Dublin Core. ..); .BR -* another the substantive texts by individual "paragraph" (or object) - along + * another the substantive texts by individual "paragraph" (or object) - along with structural information, each paragraph being identifiable by its paragraph number (if it has one which almost all of them do), and the substantive text of each paragraph quite naturally being searchable (both in formatted and clean text versions for searching); and .BR -* a third containing endnotes cross-referenced back to the paragraph from + * a third containing endnotes cross-referenced back to the paragraph from which they are referenced (both in formatted and clean text versions for searching). .BR -* a fourth table with a one to one relation with the headers table contains + * a fourth table with a one to one relation with the headers table contains full text versions of output, eg. pdf, html, xml, and .I ascii. @@ -3132,18 +3345,19 @@ database and have headings in which search content appears, or to search only headings etc. (as the .I Dublin Core is incorporated it is easy to make use of that as well). - .SH POSTGRESQL .SH NAME + .BR + .B SiSU - Structured information, Serialized Units - a document publishing system, postgresql dependency package - .SH DESCRIPTION + .BR Information related to using postgresql with sisu (and related to the sisu_postgresql dependency package, which is a dummy package to install @@ -3152,16 +3366,17 @@ dependencies needed for to populate a postgresql database, this being part of .B SiSU - man sisu) . - .SH SYNOPSIS + .BR -sisu -D [instruction] [filename/wildcard if required] + sisu -D [instruction] [filename/wildcard if required] .BR -sisu -D --pg --[instruction] [filename/wildcard if required] + sisu -D --pg --[instruction] [filename/wildcard if required] .SH COMMANDS + .BR Mappings to two databases are provided by default, postgresql and sqlite, the same commands are used within sisu to construct and populate databases however @@ -3169,9 +3384,9 @@ same commands are used within sisu to construct and populate databases however alternatively --sqlite or --pgsql may be used .BR + .B -D or --pgsql may be used interchangeably. - .SH CREATE AND DESTROY DATABASE .TP @@ -3179,50 +3394,44 @@ may be used interchangeably. initial step, creates required relations (tables, indexes) in existing (postgresql) database (a database should be created manually and given the same name as working directory, as requested) (rb.dbi) - .TP .B sisu -D --createdb creates database where no database existed before - .TP .B sisu -D --create creates database tables where no database tables existed before - .TP .B sisu -D --Dropall destroys database (including all its content)! kills data and drops tables, indexes and database associated with a given directory (and directories of the same name). - .TP .B sisu -D --recreate destroys existing database and builds a new empty database structure - .SH IMPORT AND REMOVE DOCUMENTS .TP .B sisu -D --import -v [filename/wildcard] populates database with the contents of the file. Imports documents(s) specified to a postgresql database (at an object level). - .TP .B sisu -D --update -v [filename/wildcard] updates file contents in database - .TP .B sisu -D --remove -v [filename/wildcard] removes specified document from postgresql database. - .SH SQLITE .SH NAME + .BR + .B SiSU - Structured information, Serialized Units - a document publishing system. - .SH DESCRIPTION + .BR Information related to using sqlite with sisu (and related to the sisu_sqlite dependency package, which is a dummy package to install dependencies needed for @@ -3230,17 +3439,17 @@ dependency package, which is a dummy package to install dependencies needed for to populate an sqlite database, this being part of .B SiSU - man sisu) . - .SH SYNOPSIS + .BR sisu -d [instruction] [filename/wildcard if required] .BR sisu -d --(sqlite|pg) --[instruction] [filename/wildcard if required] - .SH COMMANDS + .BR Mappings to two databases are provided by default, postgresql and sqlite, the same commands are used within sisu to construct and populate databases however @@ -3248,9 +3457,9 @@ same commands are used within sisu to construct and populate databases however alternatively --sqlite or --pgsql may be used .BR + .B -d or --sqlite may be used interchangeably. - .SH CREATE AND DESTROY DATABASE .TP @@ -3258,40 +3467,32 @@ may be used interchangeably. initial step, creates required relations (tables, indexes) in existing (sqlite) database (a database should be created manually and given the same name as working directory, as requested) (rb.dbi) - .TP .B sisu -d --createdb creates database where no database existed before - .TP .B sisu -d --create creates database tables where no database tables existed before - .TP .B sisu -d --dropall destroys database (including all its content)! kills data and drops tables, indexes and database associated with a given directory (and directories of the same name). - .TP .B sisu -d --recreate destroys existing database and builds a new empty database structure - .SH IMPORT AND REMOVE DOCUMENTS .TP .B sisu -d --import -v [filename/wildcard] populates database with the contents of the file. Imports documents(s) specified to an sqlite database (at an object level). - .TP .B sisu -d --update -v [filename/wildcard] updates file contents in database - .TP .B sisu -d --remove -v [filename/wildcard] removes specified document from sqlite database. - .SH INTRODUCTION .SH SETUP SEARCH FORM @@ -3346,6 +3547,7 @@ A sample setup for nginx is provided that assumes data will be stored under .SH SEARCH - DATABASE FRONTEND SAMPLE, UTILISING DATABASE AND SISU FEATURES, INCLUDING OBJECT CITATION NUMBERING (BACKEND CURRENTLY POSTGRESQL) + .BR Sample search frontend [^15] A small database and sample query front-end (search from) that makes use of the citation system, .I @@ -3353,6 +3555,7 @@ object citation numbering to demonstrates functionality.[^16] .BR + .B SiSU can provide information on which documents are matched and at what locations within each document the matches are found. These results are relevant across @@ -3375,7 +3578,6 @@ Note you may set results either for documents matched and object number locations within each matched document meeting the search criteria; or display the names of the documents matched along with the objects (paragraphs) that meet the search criteria.[^17] - .TP .B sisu -F --webserv-webrick builds a cgi web search frontend for the database created @@ -3392,11 +3594,13 @@ Postgresql current db set: SiSU_sisu port: 5432 dbi connect: DBI:Pg:database=SiSU_sisu;port=5432 + sqlite current db set: /home/ralph/sisu_www/sisu/sisu_sqlite.db dbi connect DBI:SQLite:/home/ralph/sisu_www/sisu/sisu_sqlite.db .fi + .BR Note on databases built @@ -3412,12 +3616,10 @@ used. [otherwise a manual mapping for the collection is necessary] .B sisu -F generates a sample search form, which must be copied to the web-server cgi directory - .TP .B sisu -F --webserv-webrick generates a sample search form for use with the webrick server, which must be copied to the web-server cgi directory - .TP .B sisu -W starts the webrick server which should be available wherever sisu is properly @@ -3426,17 +3628,18 @@ installed .BR The generated search form must be copied manually to the webserver directory as instructed - .SH SISU_WEBRICK .SH NAME + .BR + .B SiSU - Structured information, Serialized Units - a document publishing system - .SH SYNOPSIS + .BR sisu_webrick [port] @@ -3445,9 +3648,9 @@ or .BR sisu -W [port] - .SH DESCRIPTION + .BR sisu_webrick is part of .B SiSU @@ -3463,18 +3666,18 @@ is in use and they exist). The default port for sisu_webrick is set to 8081, this may be modified in the yaml file: ~/.sisu/sisurc.yml a sample of which is provided as /etc/sisu/sisurc.yml (or in the equivalent directory on your system). - .SH SUMMARY OF MAN PAGE + .BR sisu_webrick, may be started on it's own with the command: sisu_webrick [port] or using the sisu command with the -W flag: sisu -W [port] .BR where no port is given and settings are unchanged the default port is 8081 - .SH DOCUMENT PROCESSING COMMAND FLAGS + .BR sisu -W [port] starts .B Ruby @@ -3482,9 +3685,9 @@ Webrick web-server, serving .B SiSU output directories, on the port provided, or if no port is provided and the defaults have not been changed in ~/.sisu/sisurc.yaml then on port 8081 - .SH SUMMARY OF FEATURES + .BR * sparse/minimal markup (clean utf-8 source texts). Documents are prepared in a single @@ -3656,6 +3859,7 @@ Syntax highlighting for markup is available for a number of text editors. .BR + .B SiSU is less about document layout than about finding a way with little markup to be able to construct an abstract representation of a document that makes it diff --git a/sisu.org b/sisu.org index bf474691..9ba0f8be 100644 --- a/sisu.org +++ b/sisu.org @@ -935,7 +935,7 @@ footnotes uses marker and endnote, check *** misc, unclassified -**** TODO [#B] sisu should give warning when part of minimal essential structure is missing :processing:fix: +**** DONE (6.0.5) [#B] sisu should give warning when part of minimal essential structure is missing :processing:fix: work through testing for as many of these as possible @@ -987,6 +987,12 @@ title missing: level A missing: no level 1: +***** NOTES/COMMENTS + +revisit, + * check logic, add to if possible + * tidy, inelegant solution + **** DONE (5.3.5::6.0.5) [#B] victory chals discussed parsing problem caused by use of open-close markers around url **** TODO [#B] exclude heading where possible marker '-#' not distinguished from unnumbered heading '~#' -- cgit v1.2.3 From d6f28e09d7517df9e15c375f61a2e481bda534f1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 23:06:54 -0400 Subject: v6: ao_images, reduce warnings when ruby RMagic absent as program used directly * reduced dependency on ruby RMagic library (as some time way back had issues) --- lib/sisu/v6/ao_images.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/sisu/v6/ao_images.rb b/lib/sisu/v6/ao_images.rb index 05bc8e63..030dbd19 100644 --- a/lib/sisu/v6/ao_images.rb +++ b/lib/sisu/v6/ao_images.rb @@ -66,7 +66,7 @@ module SiSU_AO_Images require 'RMagick' include Magick rescue LoadError - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('RMagic NOT FOUND') + #SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('RMagic NOT FOUND') end def initialize(md,data) @md,@data=md,data @@ -83,8 +83,7 @@ module SiSU_AO_Images @rmgk=false end else - if (@md.opt.act[:verbose][:set]==:on \ - || @md.opt.act[:verbose_plus][:set]==:on \ + if (@md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],'*WARN* use of RMagick is not enabled in sisurc.yml').warn end @@ -111,8 +110,7 @@ module SiSU_AO_Images img=Magick::ImageList.new("#{image_path}/#{image}") img_col,img_row=img.columns,img.rows else - if (@md.opt.act[:verbose][:set]==:on \ - || @md.opt.act[:verbose_plus][:set]==:on \ + if (@md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new(@md.opt.act[:color_state][:set],'*WARN* RMagick not present, will attempt to use imagemagick (identify) directly').warn end -- cgit v1.2.3 From 57f00b948ff59e7154df74ad3fac7d93041833b6 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 23:09:20 -0400 Subject: v5 v6: bin/sisu, ensure return to start dir --- bin/sisu | 6 +++--- data/doc/sisu/CHANGELOG_v5 | 2 ++ data/doc/sisu/CHANGELOG_v6 | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/sisu b/bin/sisu index ff3cf258..c53438f3 100644 --- a/bin/sisu +++ b/bin/sisu @@ -21,7 +21,7 @@ class Orient self end def sisu_called_from_directory - Dir.pwd + @@sisu_called_from_directory ||= Dir.pwd end def sisu_run_from if processing.called_as == processing.file_full_path \ @@ -221,8 +221,6 @@ class Orient Dir.chdir(markup_dir) $sisu_document_markup_directory_base_fixed_path=Dir.pwd.gsub(/\/(?:#{language_list.regex})$/,'') SiSU::HubMaster.new(argv_sub) - Dir.chdir(sisu_called_from_directory) - system("cd #{sisu_called_from_directory}") elsif markup_dir =~/https?:/ markup_file.each do |mf| (FileTest.file?(mf)) \ @@ -234,6 +232,8 @@ class Orient SiSU::HubMaster.new(argv_sub) else p "Error directory specified #{markup_dir} not found" end + Dir.chdir(sisu_called_from_directory) + system("cd #{sisu_called_from_directory}") end else $sisu_document_markup_directory=Dir.pwd.gsub(/\/$/,'') diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 7447e4fc..8126efab 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.3.5.orig.tar.xz sisu_5.3.5.orig.tar.xz sisu_5.3.5-1.dsc +* sisu, ensure return to start dir + * ao_syntax, address possible manual use of url delimiters「」 * composite, fix includes, provide extra newline after inserted comment diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index be37cbe6..1d3a5c6e 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.0.5.orig.tar.xz sisu_6.0.5.orig.tar.xz sisu_6.0.5-1.dsc +* sisu, ensure return to start dir + * ao, document structure check, stop processing on major error (with error message & text at location of failure) -- cgit v1.2.3 From cd4b4e42386f781c14e5c8c945d11e7c08cf98c5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 23:13:42 -0400 Subject: v6: ao, heading with no ocn, distinguish ~# from -# * ~# is general & means no ocn (for any object to which it is applied) * -# is relevant only for 1~ dummy headings & instructs that they should be removed from output where possible * applied so far to pdf, odt & plaintext --- data/doc/sisu/CHANGELOG_v6 | 5 +++ lib/sisu/v6/ao_doc_objects.rb | 16 ++++++--- lib/sisu/v6/ao_doc_str.rb | 80 ++++++++++++++++++++----------------------- lib/sisu/v6/ao_numbering.rb | 2 +- lib/sisu/v6/texpdf_format.rb | 22 ++++++++---- lib/sisu/v6/txt_plain.rb | 5 ++- lib/sisu/v6/xml_odf_odt.rb | 7 ++-- sisu.org | 2 +- 8 files changed, 80 insertions(+), 59 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 1d3a5c6e..a103a9ed 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -35,6 +35,11 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.0.5.orig.tar.xz * ao_syntax, address possible manual use of url delimiters「」 +* ao, heading with no ocn, distinguish ~# from -# + * ~# is general & means no ocn (for any object to which it is applied) + * -# is relevant only for 1~ dummy headings & instructs that they should be + removed from output where possible, applied so far to pdf, odt & plaintext + * composite, fix includes, provide extra newline after inserted comment (Closes: #744360) "includes do not work properly" diff --git a/lib/sisu/v6/ao_doc_objects.rb b/lib/sisu/v6/ao_doc_objects.rb index 8dbdedc3..9555ab5e 100644 --- a/lib/sisu/v6/ao_doc_objects.rb +++ b/lib/sisu/v6/ao_doc_objects.rb @@ -100,10 +100,10 @@ module SiSU_AO_DocumentStructure end end class ObjectHeading - attr_accessor :obj,:is,:tags,:of,:lv,:ln,:lc,:toc_,:name,:idx,:ocn,:odv,:osp,:node,:parent,:ocn_,:note_,:autonum_,:digest,:tmp + attr_accessor :obj,:is,:tags,:of,:lv,:ln,:lc,:use_,:name,:idx,:ocn,:odv,:osp,:node,:parent,:ocn_,:note_,:autonum_,:digest,:tmp def initialize @of=:para - @is=@obj=@lv=@ln=@lc=@toc_=@name=@idx=@size=@ocn=@odv=@osp=@node=@parent=@ocn_=@note_=@autonum_=@digest=@tmp=nil + @is=@obj=@lv=@ln=@lc=@use_=@name=@idx=@size=@ocn=@odv=@osp=@node=@parent=@ocn_=@note_=@autonum_=@digest=@tmp=nil @tags=[] end def heading_ln(lv) @@ -156,7 +156,15 @@ module SiSU_AO_DocumentStructure lv= h[:lv] || ((defined? o.lv) ? o.lv : nil) #Alpha-numeric, document structure as used in markup, A-D then 1-6 ln= h[:ln] || ((defined? o.ln) ? o.ln : nil) #Integer, document structure level, for convenience in processing 1-9 lc= h[:lc] || ((defined? o.lc) ? o.lc : nil) #Integer, document structure collapsed level, convenience (collapse sisu's dual level document structure for markup with simple linear structure) - toc_= h[:toc_] || ((defined? o.toc_) ? o.toc_ : false) #Bool, do not include in toc, (relevant to headings) + use_=if lv \ + and lv == '1' + h[:use_] || ((defined? o.use_) ? o.use_ : :ok) + elsif not lv.empty? \ + and lv =~ /[A-D2-3]/ + :ok + else + h[:use_] || ((defined? o.use_) ? o.use_ : :ok) + end ocn_=if h[:ocn_].nil? then ((defined? o.ocn_) ? o.ocn_ : true) #Bool? no ocn, non-substantive content, do not include in toc #consider else h[:ocn_] end @@ -166,7 +174,7 @@ module SiSU_AO_DocumentStructure note_= h[:note_] || ((defined? o.note_) ? o.note_ : false) #Bool, endnotes/footnotes? (processing optimization) digest= h[:digest] || ((defined? o.digest) ? o.digest : nil) #hash digests, sha512, sha256 or md5 tmp= h[:tmp] || ((defined? o.tmp) ? o.tmp : nil) #available for processing, empty after use - @of,@is,@lv,@ln,@lc,@name,@tags,@obj,@idx,@ocn,@odv,@osp,@node,@parent,@toc_,@ocn_,@note_,@autonum_,@digest,@tmp=of,is,lv,ln,lc,name,tags,obj,idx,ocn,odv,osp,node,parent,toc_,ocn_,note_,autonum_,digest,tmp + @of,@is,@lv,@ln,@lc,@name,@tags,@obj,@idx,@ocn,@odv,@osp,@node,@parent,@use_,@ocn_,@note_,@autonum_,@digest,@tmp=of,is,lv,ln,lc,name,tags,obj,idx,ocn,odv,osp,node,parent,use_,ocn_,note_,autonum_,digest,tmp self end def heading_insert(h,o=nil) diff --git a/lib/sisu/v6/ao_doc_str.rb b/lib/sisu/v6/ao_doc_str.rb index 3eb4a804..d060d89c 100644 --- a/lib/sisu/v6/ao_doc_str.rb +++ b/lib/sisu/v6/ao_doc_str.rb @@ -234,10 +234,10 @@ module SiSU_AO_DocumentStructureExtract @@flag[:ocn]=:on {flag: :ocn_on} when /[~]/ - @@flag[:ocn]=:off_headings_substantive - {flag: :ocn_off, mod: :headings_substantive} - when /[-]/ - @@flag[:ocn]=:off_headings_exclude + @@flag[:ocn]=:ocn_off_headings_keep + {flag: :ocn_off, mod: :headings_keep} + when /[-]/ #of particular relevance with level 1~ which is required to precede substantive text & used e.g. in html segmented text + @@flag[:ocn]=:ocn_off_headings_dummy_lev1 {flag: :ocn_off, mod: :headings_exclude} else @@flag[:ocn]=:on @@ -286,12 +286,14 @@ module SiSU_AO_DocumentStructureExtract obj=$1 note=endnote_test?(obj) obj,tags=extract_tags(obj) - if @@flag[:ocn]==:off_headings_exclude \ - or @@flag[:ocn]==:off_headings_substantive + if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + or @@flag[:ocn]==:ocn_off_headings_keep unless obj =~ /[~-][#]\s*$/ - if @@flag[:ocn]==:off_headings_exclude + if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + and t_o =~/^1\~\S*\s+/m obj << ' -#' - elsif @@flag[:ocn]==:off_headings_substantive + elsif @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + or @@flag[:ocn]==:ocn_off_headings_keep obj << ' ~#' end end @@ -302,12 +304,14 @@ module SiSU_AO_DocumentStructureExtract name,obj=$1,$2 note=endnote_test?(obj) obj,tags=extract_tags(obj) - if @@flag[:ocn]==:off_headings_exclude \ - or @@flag[:ocn]==:off_headings_substantive + if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + or @@flag[:ocn]==:ocn_off_headings_keep unless obj =~ /[~-][#]\s*$/ - if @@flag[:ocn]==:off_headings_exclude + if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + and t_o =~/^1\~\S*\s+/m obj << ' -#' - elsif @@flag[:ocn]==:off_headings_substantive + elsif @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + or @@flag[:ocn]==:ocn_off_headings_keep obj << ' ~#' end end @@ -318,12 +322,14 @@ module SiSU_AO_DocumentStructureExtract name,obj=$1,$2 note=endnote_test?(obj) obj,tags=extract_tags(obj,name) - if @@flag[:ocn]==:off_headings_exclude \ - or @@flag[:ocn]==:off_headings_substantive + if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + or @@flag[:ocn]==:ocn_off_headings_keep unless obj =~ /[~-][#]\s*$/ - if @@flag[:ocn]==:off_headings_exclude + if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + and t_o =~/^1\~\S*\s+/m obj << ' -#' - elsif @@flag[:ocn]==:off_headings_substantive + elsif @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + or @@flag[:ocn]==:ocn_off_headings_keep obj << ' ~#' end end @@ -345,8 +351,8 @@ module SiSU_AO_DocumentStructureExtract note=endnote_test?(obj) obj,tags=extract_tags(obj) unless obj=~/\A\s*\Z/m - if @@flag[:ocn]==:off_headings_exclude \ - or @@flag[:ocn]==:off_headings_substantive + if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + or @@flag[:ocn]==:ocn_off_headings_keep unless obj =~ /[~-][#]\s*$/ obj << ' ~#' end @@ -368,8 +374,8 @@ module SiSU_AO_DocumentStructureExtract note=endnote_test?(obj) obj,tags=extract_tags(obj) unless obj=~/\A\s*\Z/m - if @@flag[:ocn]==:off_headings_exclude \ - or @@flag[:ocn]==:off_headings_substantive + if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + or @@flag[:ocn]==:ocn_off_headings_keep unless obj =~ /[~-][#]\s*$/ obj << ' ~#' end @@ -391,8 +397,8 @@ module SiSU_AO_DocumentStructureExtract image=image_test(t_o) note=endnote_test?(t_o) obj,tags=extract_tags(t_o) - if @@flag[:ocn]==:off_headings_exclude \ - or @@flag[:ocn]==:off_headings_substantive + if @@flag[:ocn]==:ocn_off_headings_dummy_lev1 \ + or @@flag[:ocn]==:ocn_off_headings_keep unless obj =~ /[~-][#]\s*$/ obj << ' ~#' end @@ -1193,9 +1199,15 @@ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} dob.ln,dob.node,dob.ocn,dob.ocn_,dob.odv,dob.osp,dob.parent,dob.lc=ln,node,ocn,ocn_flag,ocn_dv,ocn_sp,parent,collapsed_level else ocnu+=1 - dob.obj=dob.obj.gsub(/#{Mx[:fa_o]}[~-]##{Mx[:fa_c]}/,'') if dob.obj - ocn_dv,ocn_sp="u#{ocnu}","u#{ocnu}" - dob.ln,dob.node,dob.ocn,dob.ocn_,dob.odv,dob.osp,dob.parent,dob.lc=ln,node,nil,ocn_flag,ocn_dv,ocn_sp,parent,collapsed_level + heading_use=:ok + if dob.obj=~/#{Mx[:pa_non_object_no_heading]}/ + dob.obj=dob.obj.gsub(/#{Mx[:pa_non_object_no_heading]}/,'') + heading_use=:ok + elsif dob.obj=~/#{Mx[:pa_non_object_dummy_heading]}/ + dob.obj=dob.obj.gsub(/#{Mx[:pa_non_object_dummy_heading]}/,'') + heading_use=:dummy + end + dob.ln,dob.node,dob.ocn,dob.ocn_,dob.use_,dob.odv,dob.osp,dob.parent,dob.lc=ln,node,nil,ocn_flag,heading_use,ocn_dv,ocn_sp,parent,collapsed_level end else if dob.of !=:meta \ @@ -1212,24 +1224,6 @@ SKIPPED processing file: [#{@md.opt.lng}] "#{@md.fns}"} end end h - elsif dob.obj=~/#{Mx[:pa_non_object_no_heading]}/ - dob.obj=dob.obj.gsub(/#{Mx[:pa_non_object_no_heading]}/,'') - if dob.is==:para - h={ obj: dob.obj, ocn_: false, ocn: nil, hang: dob.hang, indent: dob.indent, bullet_: dob.bullet_, tags: dob.tags, parent: dob.parent } - dob=SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h,dob) - elsif dob.is==:heading - h={ obj: dob.obj, ocn_: false, ocn: nil, toc_: true, parent: dob.parent } - dob=SiSU_AO_DocumentStructure::ObjectHeading.new.heading(h,dob) - end - elsif dob.obj=~/#{Mx[:pa_non_object_dummy_heading]}/ - dob.obj=dob.obj.gsub(/#{Mx[:pa_non_object_dummy_heading]}/,'') - if dob.is==:para - h={ obj: dob.obj, ocn_: false, ocn: nil, hang: dob.hang, indent: dob.indent, bullet_: dob.bullet_, tags: dob.tags, parent: dob.parent } - dob=SiSU_AO_DocumentStructure::ObjectPara.new.paragraph(h,dob) - elsif dob.is==:heading - h={ obj: dob.obj, ocn_: false, ocn: nil, toc_: false, parent: dob.parent } - dob=SiSU_AO_DocumentStructure::ObjectHeading.new.heading(h,dob) - end else dob end if dob.is==:code \ diff --git a/lib/sisu/v6/ao_numbering.rb b/lib/sisu/v6/ao_numbering.rb index acb2351a..e04befb0 100644 --- a/lib/sisu/v6/ao_numbering.rb +++ b/lib/sisu/v6/ao_numbering.rb @@ -167,7 +167,7 @@ module SiSU_AO_Numbering @subnumber=0 if dob.ln==no1 end if dob.ln.to_s =~/^[0-6]/ \ - and not dob.toc_ \ + and not dob.use_ ==:dummy \ and dob.obj !~/#{Mx[:fa_o]}(?:~#|-#)#{Mx[:fa_c]}/ # <-- fix if dob.ln==no1 t_no1+=1; t_no2=0; t_no3=0 diff --git a/lib/sisu/v6/texpdf_format.rb b/lib/sisu/v6/texpdf_format.rb index e680bc00..ce027718 100644 --- a/lib/sisu/v6/texpdf_format.rb +++ b/lib/sisu/v6/texpdf_format.rb @@ -258,20 +258,24 @@ module SiSU_TeX_Pdf \\markboth{#{@md.title.full}}\n") dob end - def heading_sublevels(dob,sublev) - if sublev==:lev1 + def heading_dev_null(dob) + dob.tmp,dob.obj='','' + dob + end + def heading_sublevels(dob) + if dob.lv=='1' sect='section' tocadd=%{\\addcontentsline{toc}{section}} pre='' post='' headadd=%{\n\\markright{#{@md.title.full}}} - elsif sublev==:lev2 + elsif dob.lv=='2' sect='subsection' tocadd=%{\\addcontentsline{toc}{subsection}} pre='' post=" \\\\\n" headadd='' - elsif sublev==:lev3 + elsif dob.lv=='3' sect='subsubsection' tocadd=%{\\addcontentsline{toc}{subsubsection}} pre='' #pre='~~~~' @@ -307,13 +311,17 @@ module SiSU_TeX_Pdf section_heading_level(@dob) end def heading_level_1 - heading_sublevels(@dob,:lev1) + if not @dob.use_ == :dummy + heading_sublevels(@dob) + else + heading_dev_null(@dob) + end end def heading_level_2 - heading_sublevels(@dob,:lev2) + heading_sublevels(@dob) end def heading_level_3 - heading_sublevels(@dob,:lev3) + heading_sublevels(@dob) end def hang case @dob.indent diff --git a/lib/sisu/v6/txt_plain.rb b/lib/sisu/v6/txt_plain.rb index 1aa08f0e..a56f5ac9 100644 --- a/lib/sisu/v6/txt_plain.rb +++ b/lib/sisu/v6/txt_plain.rb @@ -384,7 +384,10 @@ WOK when 1 then wrapped.upcase << break_line << decorate.heading_underscore.l1*times + p_num << break_line*2 when 2 then wrapped.upcase << break_line << decorate.heading_underscore.l2*times + p_num << break_line*2 when 3 then wrapped.upcase << break_line << decorate.heading_underscore.l3*times + p_num << break_line*2 - when 4 then wrapped.upcase << break_line << decorate.heading_underscore.l4*times + p_num << break_line*2 + when 4 + unless dob.use_ == :dummy + wrapped.upcase << break_line << decorate.heading_underscore.l4*times + p_num << break_line*2 + end when 5 then wrapped.upcase << break_line << decorate.heading_underscore.l5*times + p_num << break_line*2 when 6 then wrapped.upcase << break_line << decorate.heading_underscore.l6*times + p_num << break_line*2 end diff --git a/lib/sisu/v6/xml_odf_odt.rb b/lib/sisu/v6/xml_odf_odt.rb index 0457ad7d..0fe880c0 100644 --- a/lib/sisu/v6/xml_odf_odt.rb +++ b/lib/sisu/v6/xml_odf_odt.rb @@ -209,8 +209,11 @@ module SiSU_XML_ODF_ODT end end @@docstart=false - dob.tmp=dob.obj - dob.obj=%{#{breakpage}#{p_num[:set_ref]}#{set_bookmark_tag(dob)}#{dob.obj}#{p_num[:display]}} + if dob.use_ != :dummy + dob.tmp=dob.obj + dob.obj=%{#{breakpage}#{p_num[:set_ref]}#{set_bookmark_tag(dob)}#{dob.obj}#{p_num[:display]}} + else dob.tmp,dob.obj='','' + end dob end def toc(dob,p_num) diff --git a/sisu.org b/sisu.org index 9ba0f8be..ff348dea 100644 --- a/sisu.org +++ b/sisu.org @@ -995,7 +995,7 @@ revisit, **** DONE (5.3.5::6.0.5) [#B] victory chals discussed parsing problem caused by use of open-close markers around url -**** TODO [#B] exclude heading where possible marker '-#' not distinguished from unnumbered heading '~#' +**** TODO UNDERWAY (6.0.5) [#B] exclude heading where possible marker '-#' not distinguished from unnumbered heading '~#' * ~# is general & means no ocn (for any object to which it is applied) * -# is relevant only for 1~ dummy headings & instructs that they should be -- cgit v1.2.3 From e2f6efc6f18a86b8a5e2da1bcd9ffc6f84a6d389 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 23:18:54 -0400 Subject: documentation, notes, update --- README | 11 +- .../markup-samples/manual/en/sisu_commands.sst | 8 +- man/man1/sisu.1 | 10 +- sisu.org | 137 +++++++++++++++++++++ 4 files changed, 152 insertions(+), 14 deletions(-) diff --git a/README b/README index ef26c287..ffa05093 100644 --- a/README +++ b/README @@ -113,6 +113,7 @@ ruby setup.rb setup #[as root:] ruby setup.rb install + further information: @@ -737,12 +738,12 @@ on its own, provides *SiSU* version information *-v [filename/wildcard]* see --verbose -*--v3 [filename/wildcard]* -invokes the sisu v3 document parser/generator. You may run sisu3 instead. +*--v5 [filename/wildcard]* +invokes the sisu v5 document parser/generator. You may run sisu5 instead. This +is the current default and is normally omitted. -*--v4 [filename/wildcard]* -invokes the sisu v4 document parser/generator. This is the default and is -normally omitted. +*--v6 [filename/wildcard]* +invokes the sisu v6 document parser/generator. You may run sisu6 instead. *--verbose [filename/wildcard]* provides verbose output of what is being generated, where output is placed (and diff --git a/data/doc/sisu/markup-samples/manual/en/sisu_commands.sst b/data/doc/sisu/markup-samples/manual/en/sisu_commands.sst index 19ce3db5..356f38e1 100644 --- a/data/doc/sisu/markup-samples/manual/en/sisu_commands.sst +++ b/data/doc/sisu/markup-samples/manual/en/sisu_commands.sst @@ -390,11 +390,11 @@ on its own, provides SiSU version information !_ -v [filename/wildcard] \\ see --verbose -!_ --v3 [filename/wildcard] \\ -invokes the sisu v3 document parser/generator. You may run sisu3 instead. +!_ --v5 [filename/wildcard] \\ +invokes the sisu v5 document parser/generator. You may run sisu5 instead. This is the current default and is normally omitted. -!_ --v4 [filename/wildcard] \\ -invokes the sisu v4 document parser/generator. This is the default and is normally omitted. +!_ --v6 [filename/wildcard] \\ +invokes the sisu v6 document parser/generator. You may run sisu6 instead. !_ --verbose [filename/wildcard] \\ provides verbose output of what is being generated, where output is placed (and error messages if any), as with -u flag provides a url mapping of files created for each of the processing flag requests. Alias -v diff --git a/man/man1/sisu.1 b/man/man1/sisu.1 index eb43129c..3e85a9db 100644 --- a/man/man1/sisu.1 +++ b/man/man1/sisu.1 @@ -653,12 +653,12 @@ version information .B -v [filename/wildcard] see --verbose .TP -.B --v3 [filename/wildcard] -invokes the sisu v3 document parser/generator. You may run sisu3 instead. +.B --v5 [filename/wildcard] +invokes the sisu v5 document parser/generator. You may run sisu5 instead. This +is the current default and is normally omitted. .TP -.B --v4 [filename/wildcard] -invokes the sisu v4 document parser/generator. This is the default and is -normally omitted. +.B --v6 [filename/wildcard] +invokes the sisu v6 document parser/generator. You may run sisu6 instead. .TP .B --verbose [filename/wildcard] provides verbose output of what is being generated, where output is placed (and diff --git a/sisu.org b/sisu.org index ff348dea..0ddb2d2d 100644 --- a/sisu.org +++ b/sisu.org @@ -1008,6 +1008,30 @@ revisit, * means subsequent headings & text belong to parent heading (of lev1 -#) 1 level up * ponder + +**** TODO [#B] sisu 5.3.4-1 marked for autoremoval from debian testing on 2014-06-10, for depending on ruby-dbi + +sisu 5.3.4-1 is marked for autoremoval from testing on 2014-06-10 +It (build-)depends on packages with these RC bugs: +746081: ruby-dbi: FTBFS: ERROR: Test "ruby2.1" failed: wrong number of arguments (3 for 1..2) + +***** NOTES/COMMENTS + +debian/control, remove dependency on ruby-dbi, contained in sisu-postgresql and sisu-sqlite + +Result, status of next sisu release + * sisu-sqlite works fine, depends on ruby-sqlite3 + * sisu-postgresql is broken till fixed to work with ruby-pg (or ruby-dbi fixed) + * sample cgi search froms (cgi database query forms) are broken till + +**** TODO [#B] sisu-postgresql, fix + + * fix to work with ruby-pg (or if issue resolved reinstate ruby-dbi) + +**** TODO [#B] sisu sample cgi database query forms, fix + + * fix for sqlite3 & pg (as they currently depend on ruby-dbi) + *** DBT Outstanding bugs -- Normal bugs; Unclassified (2 bugs) :debian:dbt:normal: @@ -1093,6 +1117,17 @@ Severity: normal sisu supports options like --verbose or --no-manifest, but they are not listed in the sisu manpage. +***** NOTES/COMMENTS + +documentation for sisu does lag a bit and has omissions, but I think you will +find that --verbose is documented, and --no-* options are listed under --exc-* +to which there is a pointer --no-manifest works but is actually +--no-links-to-manifest and is listed under aliases --exc-links-to-manifest and +--exc-manifest-links + +Will leave bug open as a reminder that updating is necessary and as there are +no doubt numerous issues for which this could be (re)opened + **** TODO #746742 [n|u] please implement --no-metadata similar to --no-manifest Date: Sun, 13 Apr 2014 16:12:13 +0200 @@ -1177,6 +1212,24 @@ wrong. margin numbers should only be assigned to actual content. Regards, Daniel +***** NOTES/COMMENTS + +issue with pdf, look again, consider, +this is cosmetic, a fix should be found, but is not striaghtforward +alignment issue for code blocks not so easy to fix in some outputs, have so far ignored +this is an issue with other types of text block as well + +reason why this has not been addressed especially with code blocks: +the easiest fix would be to place the numbering at the end of the first line of a code block +however, as it is now, if you copy & paste a block of code you should get the code +if numbering is moved down to the first line, a copy of the code block will inlcude the +extraneous (to the code) object number +which is to my mind a bigger problem + +That said re pdf, LaTeX XeTeX are flexible, it may be possible to drop the ocn +at the start of a code block lower on its line so that it is closer to the code +that follows + **** DONE (6.0.5) [#D] #744353 [w|u] sisu output: please do not use typewriter for urls :output:consider: @@ -1243,6 +1296,13 @@ wants them, he would add one. Regards, Daniel +***** NOTES/COMMENTS + +is sisu default behavior, +would need to make configurable +url_visual_delimiters: '<>' +look into later + **** DONE (5.3.5::6.0.5) [#C] #744355 [w|u] vim syntaxhighlighting: includes and directories :syntaxhi:fix: @@ -1560,6 +1620,21 @@ having an empty line in between like this: Regards, Daniel +***** NOTES/COMMENTS + +consider, + +(i) as a general observation, sisu relies on emptly lines to identify separate objects + such as headings, paragraphs (and indeed insertions) + +(ii) a heading need not be on a single line (so << would be part of that heading) +this means sisu should be able to work identifying headings in wrapped texts +(e.g. where the text is wrapped at 80 and the heading is longer than that) + +there has been no rule to the contrary (i.e. that headings should be on a single text line) + +consider, should there be such a rule? + **** DONE (6.0.5) [#B] #744386 [w|u] sisu syntax: 1~ and 2~ result in the same formatting :output:pdf:fix: (see #744383) @@ -1620,6 +1695,13 @@ if you have the following sisu syntax: then anything (including and) after ':B~ bar' is ignored entirely. +***** NOTES/COMMENTS + +further info, have not yet been able to duplicate, +seemed to work (checked pdf & html (scroll & seg)) +was not able to reproduce +will look again + **** DONE (6.0.5) [#C] #744391 [w|u] sisu output: no color on a4 portrait :output:pdf:contemplate: @@ -1702,6 +1784,18 @@ the page. Regards, Daniel +***** NOTES/COMMENTS + +think about, should be fairly easily done, but am reluctant + +note the page numbering in landscape, the two landscape columns are given a single page number +it is really a landscape two column per-page text, provided primarily for screen viewing or +other convenience if found + +(many viewers provide two page per screen presentations, which would result in an effect similar to the one requested +the issue I guess might arise in that they are not printable on a single page? ... +but then the current settings are arguably justified) + **** TODO [#C] #744396 [w|u] sisu output: "european" toc indenting @@ -1735,6 +1829,10 @@ to use for TOCs. Regards, Daniel +***** NOTES/COMMENTS + +will look at: should be possible; requires a configuration option + **** DONE (6.0.5) [#B] #744399 [w|u] sisu syntax: :A smaller formatted than :B :output:fix: (see #744383) (partial solution) @@ -1852,6 +1950,10 @@ additional possibilities to influence the content on the title page Regards, Daniel +***** NOTES/COMMENTS + +consider, work on possibly, later + **** TODO [#C] #744408 [w|u] sisu: support more than one level of includes/nested includes @@ -1873,6 +1975,29 @@ then includes further ssi files. this is very handy for larger documents. Regards, Daniel +***** NOTES/COMMENTS + +consider, +I have to date deliberately tried to keep it easy to follow documents & not have too much depth ... +The idea of recursive includes is un-attractive (messy for a document) + +.ssm currently can contain .sst or .ssi +.sst files can be processed independently, +.ssi files are only insertions & cannot + +allowing .ssi to also include other .ssi or .sst could lead to recursive .ssi +allowing .ssm to also include other .ssm .ssi or .sst could lead to recursive .ssm + +stopping after an additional level of includes seems arbitrary, and possibly prone to error if you are dealing with many documents + +a possibility would be to have another file extension to flag the role of the file, +.ssmi (not very attractive) might do it +(providing visual cue signalling its role as both a master file and an insertion/included file that cannot be processed independently) +a .ssmi file must be included in a .ssm file +a .ssmi file (like .ssm) permits the inclusion only of .sst or .ssi files + +will work on eventually + **** TODO [#C] #744409 [w|u] sisu output: urls in code blocks are not linkified @@ -1891,6 +2016,11 @@ be automatically transformed into a link within the output (html). Regards, Daniel +***** NOTES/COMMENTS + +consider, so far code blocks are pretty much untouched ... not tampered with, +this could be done though + **** DONE (6.0.5) [#C] #744541 [w|u] sisu: urls in @creator broken @@ -1949,6 +2079,13 @@ seen in lots of pdfs in the internet. Regards, Daniel +***** NOTES/COMMENTS + +find out how and implement, further feedback on appropriate xetex tools welcome + +[Note: if can be applied to random characters, use may be of interest for +object numbers as well!] + **** TODO [#C] #744734 [w|u] sisu output: replace all occurences of (C) rather than the first only From: Daniel Baumann -- cgit v1.2.3