From 26ec305bd7a61e54556042523d3650e712f235e0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 11 Jul 2014 00:00:16 -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 | 4 ++-- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index eba3b432..8363130b 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.5.0.orig.tar.xz (2014-07-11:27/5) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.5.0 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.5.0-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_5.5.0.orig.tar.xz + sisu_5.5.0.orig.tar.xz + sisu_5.5.0-1.dsc + %% 5.4.5.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.4.5 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.4.5-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index eef28547..00ff460b 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.1.0.orig.tar.xz (2014-07-11:27/5) +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.1.0 +http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.1.0-1 +http://www.jus.uio.no/sisu/pkg/src/sisu_6.1.0.orig.tar.xz + sisu_6.1.0.orig.tar.xz + sisu_6.1.0-1.dsc + %% 6.0.11.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.0.11 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.0.11-1 diff --git a/data/sisu/v5/v/version.yml b/data/sisu/v5/v/version.yml index 281ad1fd..2e045c3e 100644 --- a/data/sisu/v5/v/version.yml +++ b/data/sisu/v5/v/version.yml @@ -1,5 +1,5 @@ --- :project: SiSU -:version: 5.4.5 -:date_stamp: 2014w27/1 -:date: "2014-07-07" +:version: 5.5.0 +:date_stamp: 2014w27/5 +:date: "2014-07-11" diff --git a/data/sisu/v6/v/version.yml b/data/sisu/v6/v/version.yml index 8670e0fe..7231ab70 100644 --- a/data/sisu/v6/v/version.yml +++ b/data/sisu/v6/v/version.yml @@ -1,5 +1,5 @@ --- :project: SiSU -:version: 6.0.11 -:date_stamp: 2014w27/1 -:date: "2014-07-07" +:version: 6.1.0 +:date_stamp: 2014w27/5 +:date: "2014-07-11" diff --git a/rbuild b/rbuild index 46ac3a1a..7e3380bf 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.4.5' -SiSU_version_next_unstable = '6.0.11' +SiSU_version_next_stable = '5.5.0' +SiSU_version_next_unstable = '6.1.0' #% rake file SiSU_version_generic_next_stable = '5.4.x' SiSU_version_generic_next_unstable = '6.0.x' -- cgit v1.2.3 From d1c4bb34715672c50a646b11007191ef91fcc287 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 11 Jul 2014 00:03:26 -0400 Subject: v5 v6: ao_numbering, auto name segment, extract "number" from heading, fix --- data/doc/sisu/CHANGELOG_v5 | 3 +++ data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v5/ao_numbering.rb | 4 ++-- lib/sisu/v6/ao_numbering.rb | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 8363130b..7eed7c3d 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.5.0.orig.tar.xz sisu_5.5.0.orig.tar.xz sisu_5.5.0-1.dsc +* ao_numbering, + * auto name segment, extract "number" from heading, fix + %% 5.4.5.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.4.5 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.4.5-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 00ff460b..98358c7e 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.1.0.orig.tar.xz sisu_6.1.0.orig.tar.xz sisu_6.1.0-1.dsc +* ao_numbering, + * auto name segment, extract "number" from heading, fix + %% 6.0.11.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.0.11 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.0.11-1 diff --git a/lib/sisu/v5/ao_numbering.rb b/lib/sisu/v5/ao_numbering.rb index 278ea514..d213ca4d 100644 --- a/lib/sisu/v5/ao_numbering.rb +++ b/lib/sisu/v5/ao_numbering.rb @@ -326,7 +326,7 @@ module SiSU_AO_Numbering if possible_seg_name =~/^[0-9]+$/m \ and possible_seg_name.to_i <= heading_num_is.to_i prefix + leading_zeros_fixed_width_number(possible_seg_name) - elsif possible_seg_name =~/^[\d.,:-]+$/m + elsif possible_seg_name =~/^[0-9][\d.,:-]*$/m possible_seg_name=possible_seg_name. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') @@ -369,7 +369,7 @@ module SiSU_AO_Numbering @md.set_heading_seg=true end if dob.name !~/^\S+/ \ - and dob.obj =~/^\s*(?:\S+\s+)?([\d.,:-]+)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name + and dob.obj =~/^\s*(?:\S+\s+)?([0-9][0-9.,:-]*)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name possible_seg_name=$1 possible_seg_name= auto_seg_name(possible_seg_name,heading_num_is,:extract) diff --git a/lib/sisu/v6/ao_numbering.rb b/lib/sisu/v6/ao_numbering.rb index ffafbf9c..ef85bbd6 100644 --- a/lib/sisu/v6/ao_numbering.rb +++ b/lib/sisu/v6/ao_numbering.rb @@ -326,7 +326,7 @@ module SiSU_AO_Numbering if possible_seg_name =~/^[0-9]+$/m \ and possible_seg_name.to_i <= heading_num_is.to_i prefix + leading_zeros_fixed_width_number(possible_seg_name) - elsif possible_seg_name =~/^[\d.,:-]+$/m + elsif possible_seg_name =~/^[0-9][\d.,:-]*$/m possible_seg_name=possible_seg_name. gsub(/(?:[:,-]|\W)/,'.'). gsub(/\.$/,'') @@ -369,7 +369,7 @@ module SiSU_AO_Numbering @md.set_heading_seg=true end if dob.name !~/^\S+/ \ - and dob.obj =~/^\s*(?:\S+\s+)?([\d.,:-]+)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name + and dob.obj =~/^\s*(?:\S+\s+)?([0-9][0-9.,:-]*)/m #heading starts with a recognised numeric or word followed by a recognised numeric construct, use that as name possible_seg_name=$1 possible_seg_name= auto_seg_name(possible_seg_name,heading_num_is,:extract) -- cgit v1.2.3 From 561b66275f186fcf8f3ed6e697e560f28354d38c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 11 Jul 2014 00:05:23 -0400 Subject: v5 v6: ao_numbering, check that all auto given number based seg names are unique --- data/doc/sisu/CHANGELOG_v5 | 1 + data/doc/sisu/CHANGELOG_v6 | 1 + lib/sisu/v5/ao_numbering.rb | 10 +++++++++- lib/sisu/v6/ao_numbering.rb | 10 +++++++++- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 7eed7c3d..ca6fecf2 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -40,6 +40,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.5.0.orig.tar.xz * ao_numbering, * auto name segment, extract "number" from heading, fix + * check that all auto given number based seg names are unique %% 5.4.5.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.4.5 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 98358c7e..a1e1de70 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -30,6 +30,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.1.0.orig.tar.xz * ao_numbering, * auto name segment, extract "number" from heading, fix + * check that all auto given number based seg names are unique %% 6.0.11.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.0.11 diff --git a/lib/sisu/v5/ao_numbering.rb b/lib/sisu/v5/ao_numbering.rb index d213ca4d..dc6ec4dd 100644 --- a/lib/sisu/v5/ao_numbering.rb +++ b/lib/sisu/v5/ao_numbering.rb @@ -67,6 +67,7 @@ module SiSU_AO_Numbering def initialize(md,data) @md,@data=md,data @obj=@type=@ocn=@lv=@name=@index=@comment=nil + @chosen_seg_names=[] end def number_of_segments? if @@segments_count==0 @@ -323,7 +324,7 @@ module SiSU_AO_Numbering possible_seg_name=possible_seg_name. gsub(/\.$/,'') end - if possible_seg_name =~/^[0-9]+$/m \ + chosen_seg_name=if possible_seg_name =~/^[0-9]+$/m \ and possible_seg_name.to_i <= heading_num_is.to_i prefix + leading_zeros_fixed_width_number(possible_seg_name) elsif possible_seg_name =~/^[0-9][\d.,:-]*$/m @@ -333,6 +334,13 @@ module SiSU_AO_Numbering prefix + possible_seg_name else prefix + possible_seg_name.to_s end + @chosen_seg_names << chosen_seg_name + if @chosen_seg_names.compact.uniq.length == @chosen_seg_names.compact.length #checks that all auto given seg names are unique + chosen_seg_name + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark("duplicated auto segment name: #{chosen_seg_name}; manually name level 1 segments '1~given_name'") + exit + end end def name_para_seg_filename(data) #segment naming, remaining # paragraph name/numbering rules diff --git a/lib/sisu/v6/ao_numbering.rb b/lib/sisu/v6/ao_numbering.rb index ef85bbd6..5b2137e7 100644 --- a/lib/sisu/v6/ao_numbering.rb +++ b/lib/sisu/v6/ao_numbering.rb @@ -67,6 +67,7 @@ module SiSU_AO_Numbering def initialize(md,data) @md,@data=md,data @obj=@type=@ocn=@lv=@name=@index=@comment=nil + @chosen_seg_names=[] end def number_of_segments? if @@segments_count==0 @@ -323,7 +324,7 @@ module SiSU_AO_Numbering possible_seg_name=possible_seg_name. gsub(/\.$/,'') end - if possible_seg_name =~/^[0-9]+$/m \ + chosen_seg_name=if possible_seg_name =~/^[0-9]+$/m \ and possible_seg_name.to_i <= heading_num_is.to_i prefix + leading_zeros_fixed_width_number(possible_seg_name) elsif possible_seg_name =~/^[0-9][\d.,:-]*$/m @@ -333,6 +334,13 @@ module SiSU_AO_Numbering prefix + possible_seg_name else prefix + possible_seg_name.to_s end + @chosen_seg_names << chosen_seg_name + if @chosen_seg_names.compact.uniq.length == @chosen_seg_names.compact.length #checks that all auto given seg names are unique + chosen_seg_name + else + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:green).mark("duplicated auto segment name: #{chosen_seg_name}; manually name level 1 segments '1~given_name'") + exit + end end def name_para_seg_filename(data) #segment naming, remaining # paragraph name/numbering rules -- cgit v1.2.3 From cc3380a5050a839e4be9b5b12277cd83ce738d02 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 11 Jul 2014 00:07:04 -0400 Subject: v5 v6: ao_composite, variable name --- lib/sisu/v5/ao_composite.rb | 38 +++++++++++++++++++------------------- lib/sisu/v6/ao_composite.rb | 38 +++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/lib/sisu/v5/ao_composite.rb b/lib/sisu/v5/ao_composite.rb index a7d0e48c..b35b2419 100644 --- a/lib/sisu/v5/ao_composite.rb +++ b/lib/sisu/v5/ao_composite.rb @@ -174,19 +174,19 @@ module SiSU_Assemble ).grey_title_hi unless @opt.act[:quiet][:set]==:on fns_array.each do |para| if para =~/^<<\s+(\S+?\.ss[it])$/ - loadfile=$1.strip + loadfilename=$1.strip if (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], 'loading:', - loadfile, + loadfilename, ).txt_grey end - tuned_file << if loadfile =~ /(?:https?|file):\/\/\S+?\.ss[it]$/ # and NetTest + tuned_file << if loadfilename =~ /(?:https?|file):\/\/\S+?\.ss[it]$/ # and NetTest imagedir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.ss[it]$/. - match(loadfile).captures.join + + match(loadfilename).captures.join + '/_sisu/image' #watch begin require 'uri' @@ -197,20 +197,20 @@ module SiSU_Assemble error('uri, open-uri or pp NOT FOUND (LoadError)') end image_uri=URI.parse(imagedir) - insert=open(loadfile) + insert=open(loadfilename) insert_array=insert.dup insert.close - file=insertion(loadfile,insert_array) + file=insertion(loadfilename,insert_array) @@imager[image_uri] ||=[] @@imager[image_uri] << file[:images] file[:prepared] - elsif loadfile =~ /\.ss[it]$/ \ - and FileTest.file?(loadfile) - insert_array=IO.readlines(loadfile,'') - file=insertion(loadfile,insert_array) + elsif loadfilename =~ /\.ss[it]$/ \ + and FileTest.file?(loadfilename) + insert_array=IO.readlines(loadfilename,'') + file=insertion(loadfilename,insert_array) file[:prepared] else - STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfile}"} + STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfilename}"} $process_document = :skip; break #remove this line to continue processing documents that have missing include files para end @@ -256,23 +256,23 @@ module SiSU_Assemble @ssm=[@opt.fns] fns_array.each do |para| if para =~/^<<\s+(\S+?\.ss[it])$/ - loadfile=$1.strip + loadfilename=$1.strip if (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], 'loading:', - loadfile, + loadfilename, ).txt_grey end - tuned_file << if loadfile =~ /(?:https?|file):\/\/\S+?\.ss[it]$/ - @ssm << loadfile - elsif loadfile =~ /\.ss[it]$/ \ - and FileTest.file?(loadfile) - @ssm << loadfile + tuned_file << if loadfilename =~ /(?:https?|file):\/\/\S+?\.ss[it]$/ + @ssm << loadfilename + elsif loadfilename =~ /\.ss[it]$/ \ + and FileTest.file?(loadfilename) + @ssm << loadfilename else - STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfile}"} + STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfilename}"} $process_document = :skip; break #remove this line to continue processing documents that have missing include files para end diff --git a/lib/sisu/v6/ao_composite.rb b/lib/sisu/v6/ao_composite.rb index 2f864228..efe3815f 100644 --- a/lib/sisu/v6/ao_composite.rb +++ b/lib/sisu/v6/ao_composite.rb @@ -174,19 +174,19 @@ module SiSU_Assemble ).grey_title_hi unless @opt.act[:quiet][:set]==:on fns_array.each do |para| if para =~/^<<\s+(\S+?\.ss[it])$/ - loadfile=$1.strip + loadfilename=$1.strip if (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], 'loading:', - loadfile, + loadfilename, ).txt_grey end - tuned_file << if loadfile =~ /(?:https?|file):\/\/\S+?\.ss[it]$/ # and NetTest + tuned_file << if loadfilename =~ /(?:https?|file):\/\/\S+?\.ss[it]$/ # and NetTest imagedir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.ss[it]$/. - match(loadfile).captures.join + + match(loadfilename).captures.join + '/_sisu/image' #watch begin require 'uri' @@ -197,20 +197,20 @@ module SiSU_Assemble error('uri, open-uri or pp NOT FOUND (LoadError)') end image_uri=URI.parse(imagedir) - insert=open(loadfile) + insert=open(loadfilename) insert_array=insert.dup insert.close - file=insertion(loadfile,insert_array) + file=insertion(loadfilename,insert_array) @@imager[image_uri] ||=[] @@imager[image_uri] << file[:images] file[:prepared] - elsif loadfile =~ /\.ss[it]$/ \ - and FileTest.file?(loadfile) - insert_array=IO.readlines(loadfile,'') - file=insertion(loadfile,insert_array) + elsif loadfilename =~ /\.ss[it]$/ \ + and FileTest.file?(loadfilename) + insert_array=IO.readlines(loadfilename,'') + file=insertion(loadfilename,insert_array) file[:prepared] else - STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfile}"} + STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfilename}"} $process_document = :skip; break #remove this line to continue processing documents that have missing include files para end @@ -256,23 +256,23 @@ module SiSU_Assemble @ssm=[@opt.fns] fns_array.each do |para| if para =~/^<<\s+(\S+?\.ss[it])$/ - loadfile=$1.strip + loadfilename=$1.strip if (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], 'loading:', - loadfile, + loadfilename, ).txt_grey end - tuned_file << if loadfile =~ /(?:https?|file):\/\/\S+?\.ss[it]$/ - @ssm << loadfile - elsif loadfile =~ /\.ss[it]$/ \ - and FileTest.file?(loadfile) - @ssm << loadfile + tuned_file << if loadfilename =~ /(?:https?|file):\/\/\S+?\.ss[it]$/ + @ssm << loadfilename + elsif loadfilename =~ /\.ss[it]$/ \ + and FileTest.file?(loadfilename) + @ssm << loadfilename else - STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfile}"} + STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfilename}"} $process_document = :skip; break #remove this line to continue processing documents that have missing include files para end -- cgit v1.2.3 From 86ce218124eeca073621a153c5f3f830a90f1a74 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 11 Jul 2014 00:09:02 -0400 Subject: v5 v6: ao_composite, nested includes, .ssi (insert) can now include .ssi & .sst * .ssm can contain/include .sst or .ssi .sst files can be processed independently, they do not contain other files .ssi files have been only insertions of text & are not processed independently but as part of an ssm change proposed: .ssm unchanged, .sst unchanged, .ssi as before, but can include .sst or .ssi, so: files are only insertions & are not processed independently but as part of an .ssm or another .ssi i.e. as before with the addition that it like a .ssm can contain/include .sst or .ssi * requested feature, (Closes: #744408) User beware. In previous versions there has been a deliberate attempt to keep it easy to follow documents & not have to dig through different levels of includes, as this is more likely to lead to errors in markup. The idea of nested includes has not been attractive (messy for a document), however, this is now made possible, use with care * it is not as easy to see document structure at a glance, and structural errors may be introduced and will need to be taken care of (requiring document markup debugging) * allowing .ssi to also include other .ssi or .sst could lead to infinite recursion if an .ssi includes another which includes itself; stopping after an additional level of includes seems arbitrary, and possibly prone to error if you are dealing with many documents * requires testing * version bump, new behavior added to .ssi one of the 3 sisu filetypes --- data/doc/sisu/CHANGELOG_v5 | 29 +++++++++ data/doc/sisu/CHANGELOG_v6 | 29 +++++++++ data/doc/sisu/sisu.org | 15 ++++- lib/sisu/v5/ao_composite.rb | 143 ++++++++++++++++++++++++-------------------- lib/sisu/v6/ao_composite.rb | 143 ++++++++++++++++++++++++-------------------- 5 files changed, 226 insertions(+), 133 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index ca6fecf2..a87629fa 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -42,6 +42,35 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.5.0.orig.tar.xz * auto name segment, extract "number" from heading, fix * check that all auto given number based seg names are unique +* ao_composite, nested includes, .ssi (insert) can include .ssi & .sst +~ .ssm can contain/include .sst or .ssi + .sst files can be processed independently, they do not contain other files + .ssi files have been only insertions of text & are not processed independently + but as part of an ssm + change proposed: + .ssm unchanged, + .sst unchanged, + .ssi as before, but can include .sst or .ssi, so: + files are only insertions & are not processed independently but as part of an + .ssm or another .ssi + i.e. as before with the addition that it like a .ssm can contain/include + .sst or .ssi +~ requested feature, (Closes: #744408) + User beware. In previous versions there has been a deliberate attempt to keep + it easy to follow documents & not have to dig through different levels of + includes, as this is more likely to lead to errors in markup. + The idea of nested includes has not been attractive (messy for a document), + however, this is now made possible, use with care + ~ it is not as easy to see document structure at a glance, and structural + errors may be introduced and will need to be taken care of (requiring + document markup debugging) + ~ allowing .ssi to also include other .ssi or .sst could lead to infinite + recursion if an .ssi includes another which includes itself; stopping after + an additional level of includes seems arbitrary, and possibly prone to error + if you are dealing with many documents +~ requires testing +~ version bump, new behavior added to .ssi one of the 3 sisu filetypes + %% 5.4.5.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.4.5 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.4.5-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index a1e1de70..c4a7d1a9 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -32,6 +32,35 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.1.0.orig.tar.xz * auto name segment, extract "number" from heading, fix * check that all auto given number based seg names are unique +* ao_composite, nested includes, .ssi (insert) can include .ssi & .sst +~ .ssm can contain/include .sst or .ssi + .sst files can be processed independently, they do not contain other files + .ssi files have been only insertions of text & are not processed independently + but as part of an ssm + change proposed: + .ssm unchanged, + .sst unchanged, + .ssi as before, but can include .sst or .ssi, so: + files are only insertions & are not processed independently but as part of an + .ssm or another .ssi + i.e. as before with the addition that it like a .ssm can contain/include + .sst or .ssi +~ requested feature, (Closes: #744408) + User beware. In previous versions there has been a deliberate attempt to keep + it easy to follow documents & not have to dig through different levels of + includes, as this is more likely to lead to errors in markup. + The idea of nested includes has not been attractive (messy for a document), + however, this is now made possible, use with care + ~ it is not as easy to see document structure at a glance, and structural + errors may be introduced and will need to be taken care of (requiring + document markup debugging) + ~ allowing .ssi to also include other .ssi or .sst could lead to infinite + recursion if an .ssi includes another which includes itself; stopping after + an additional level of includes seems arbitrary, and possibly prone to error + if you are dealing with many documents +~ requires testing +~ version bump, new behavior added to .ssi one of the 3 sisu filetypes + %% 6.0.11.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.0.11 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.0.11-1 diff --git a/data/doc/sisu/sisu.org b/data/doc/sisu/sisu.org index 265abda9..8800572d 100644 --- a/data/doc/sisu/sisu.org +++ b/data/doc/sisu/sisu.org @@ -2247,15 +2247,24 @@ 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 +.ssm currently can contain/include .sst or .ssi .sst files can be processed independently, -.ssi files are only insertions & cannot +.ssi files are only insertions & are not processed independently but as part of an ssm + +change proposed +.ssm unchanged +.sst unchanged +.ssi as before, but can include .sst or .ssi, so: + files are only insertions & are not processed independently but as part of an .ssm or another .ssi + i.e. as before with the addition that it like a .ssm can contain/include .sst or .ssi + +this is pretty much as requested by wishlist 744408 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 +***** Discard 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) diff --git a/lib/sisu/v5/ao_composite.rb b/lib/sisu/v5/ao_composite.rb index b35b2419..5cdfaa81 100644 --- a/lib/sisu/v5/ao_composite.rb +++ b/lib/sisu/v5/ao_composite.rb @@ -101,9 +101,17 @@ module SiSU_Assemble begin pwd=Dir.pwd Dir.chdir(@opt.f_pth[:pth]) - fns_array=IO.readlines(@opt.fno,'') - assembled=insertions?(fns_array) - write(assembled) + if @opt.fno =~/\S+?\.ssm$/ + 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 + assembled=loadfile(@opt.fno) + #assembled=insertions?(fns_array) + write(assembled) + write(assembled) + end Dir.chdir(pwd) rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do @@ -112,6 +120,73 @@ module SiSU_Assemble ensure end end + def insert?(para) + if para =~ /^<<\s+((?:https?|file):\/\/\S+?\.ss[it])$/ # and NetTest + url($1.strip) + elsif para =~/^<<\s+(\S+?\.ss[it])$/ + loadfilename=$1.strip + insert_array=loadfile(loadfilename) + file=insertion(loadfilename,insert_array) + file[:prepared] + else para + end + end + def loadfile(loadfilename) + tuned_file=[] + begin + if FileTest.file?(loadfilename) + insert_array=IO.readlines(loadfilename,'') + if loadfilename =~/\S+?\.ss[im]$/ + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'loading:', + loadfilename, + ).txt_grey + end + insert_array.each do |para| + tuned_file << insert?(para) + end + elsif loadfilename =~/\S+?\.sst$/ + insert_array.each do |para| + tuned_file << para + end + end + end + tuned_file=tuned_file.flatten.compact + rescue + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + __LINE__.to_s + ':' + __FILE__ + end + ensure + end + end + def url(loadfilename) + if loadfilename =~ /((?:https?|file):\/\/\S+?\.ss[it])$/ # and NetTest + loadfilename=$1 + imagedir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.ss[it]$/. + match(loadfilename).captures.join + + '/_sisu/image' #watch + begin + require 'uri' + require 'open-uri' + require 'pp' + rescue LoadError + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error('uri, open-uri or pp NOT FOUND (LoadError)') + end + image_uri=URI.parse(imagedir) + insert=open(loadfilename) + insert_array=insert.dup + insert.close + file=insertion(loadfilename,insert_array) + @@imager[image_uri] ||=[] + @@imager[image_uri] << file[:images] + file[:prepared] + end + end def write(assembled) assembled_file=File.new("#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst",'w+') assembled.each {|a| assembled_file << a } @@ -165,68 +240,6 @@ module SiSU_Assemble end file end - def insertions?(fns_array) - 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 - fns_array.each do |para| - if para =~/^<<\s+(\S+?\.ss[it])$/ - loadfilename=$1.strip - if (@opt.act[:verbose][:set]==:on \ - || @opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - 'loading:', - loadfilename, - ).txt_grey - end - tuned_file << if loadfilename =~ /(?:https?|file):\/\/\S+?\.ss[it]$/ # and NetTest - imagedir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.ss[it]$/. - match(loadfilename).captures.join + - '/_sisu/image' #watch - begin - require 'uri' - require 'open-uri' - require 'pp' - rescue LoadError - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). - error('uri, open-uri or pp NOT FOUND (LoadError)') - end - image_uri=URI.parse(imagedir) - insert=open(loadfilename) - insert_array=insert.dup - insert.close - file=insertion(loadfilename,insert_array) - @@imager[image_uri] ||=[] - @@imager[image_uri] << file[:images] - file[:prepared] - elsif loadfilename =~ /\.ss[it]$/ \ - and FileTest.file?(loadfilename) - insert_array=IO.readlines(loadfilename,'') - file=insertion(loadfilename,insert_array) - file[:prepared] - else - STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfilename}"} - $process_document = :skip; break #remove this line to continue processing documents that have missing include files - para - end - else tuned_file << para - end - tuned_file=tuned_file.flatten.compact - end - if @@imager.length >0 - @@imager.each do |d,i| - i=i.flatten.uniq - image_info=d + i - download_images(image_info.flatten) - end - end - tuned_file - end end class CompositeFileList @@imager={} diff --git a/lib/sisu/v6/ao_composite.rb b/lib/sisu/v6/ao_composite.rb index efe3815f..078e8ece 100644 --- a/lib/sisu/v6/ao_composite.rb +++ b/lib/sisu/v6/ao_composite.rb @@ -101,9 +101,17 @@ module SiSU_Assemble begin pwd=Dir.pwd Dir.chdir(@opt.f_pth[:pth]) - fns_array=IO.readlines(@opt.fno,'') - assembled=insertions?(fns_array) - write(assembled) + if @opt.fno =~/\S+?\.ssm$/ + 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 + assembled=loadfile(@opt.fno) + #assembled=insertions?(fns_array) + write(assembled) + write(assembled) + end Dir.chdir(pwd) rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do @@ -112,6 +120,73 @@ module SiSU_Assemble ensure end end + def insert?(para) + if para =~ /^<<\s+((?:https?|file):\/\/\S+?\.ss[it])$/ # and NetTest + url($1.strip) + elsif para =~/^<<\s+(\S+?\.ss[it])$/ + loadfilename=$1.strip + insert_array=loadfile(loadfilename) + file=insertion(loadfilename,insert_array) + file[:prepared] + else para + end + end + def loadfile(loadfilename) + tuned_file=[] + begin + if FileTest.file?(loadfilename) + insert_array=IO.readlines(loadfilename,'') + if loadfilename =~/\S+?\.ss[im]$/ + if (@opt.act[:verbose][:set]==:on \ + || @opt.act[:verbose_plus][:set]==:on \ + || @opt.act[:maintenance][:set]==:on) + SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'loading:', + loadfilename, + ).txt_grey + end + insert_array.each do |para| + tuned_file << insert?(para) + end + elsif loadfilename =~/\S+?\.sst$/ + insert_array.each do |para| + tuned_file << para + end + end + end + tuned_file=tuned_file.flatten.compact + rescue + SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do + __LINE__.to_s + ':' + __FILE__ + end + ensure + end + end + def url(loadfilename) + if loadfilename =~ /((?:https?|file):\/\/\S+?\.ss[it])$/ # and NetTest + loadfilename=$1 + imagedir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.ss[it]$/. + match(loadfilename).captures.join + + '/_sisu/image' #watch + begin + require 'uri' + require 'open-uri' + require 'pp' + rescue LoadError + SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). + error('uri, open-uri or pp NOT FOUND (LoadError)') + end + image_uri=URI.parse(imagedir) + insert=open(loadfilename) + insert_array=insert.dup + insert.close + file=insertion(loadfilename,insert_array) + @@imager[image_uri] ||=[] + @@imager[image_uri] << file[:images] + file[:prepared] + end + end def write(assembled) assembled_file=File.new("#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst",'w+') assembled.each {|a| assembled_file << a } @@ -165,68 +240,6 @@ module SiSU_Assemble end file end - def insertions?(fns_array) - 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 - fns_array.each do |para| - if para =~/^<<\s+(\S+?\.ss[it])$/ - loadfilename=$1.strip - if (@opt.act[:verbose][:set]==:on \ - || @opt.act[:verbose_plus][:set]==:on \ - || @opt.act[:maintenance][:set]==:on) - SiSU_Screen::Ansi.new( - @opt.act[:color_state][:set], - 'loading:', - loadfilename, - ).txt_grey - end - tuned_file << if loadfilename =~ /(?:https?|file):\/\/\S+?\.ss[it]$/ # and NetTest - imagedir = /((?:https?|file):\/\/\S+?)\/[^\/]+?\.ss[it]$/. - match(loadfilename).captures.join + - '/_sisu/image' #watch - begin - require 'uri' - require 'open-uri' - require 'pp' - rescue LoadError - SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia). - error('uri, open-uri or pp NOT FOUND (LoadError)') - end - image_uri=URI.parse(imagedir) - insert=open(loadfilename) - insert_array=insert.dup - insert.close - file=insertion(loadfilename,insert_array) - @@imager[image_uri] ||=[] - @@imager[image_uri] << file[:images] - file[:prepared] - elsif loadfilename =~ /\.ss[it]$/ \ - and FileTest.file?(loadfilename) - insert_array=IO.readlines(loadfilename,'') - file=insertion(loadfilename,insert_array) - file[:prepared] - else - STDERR.puts %{SKIPPED processing file: [#{@opt.lng}] "#{@opt.fns}" it requires an invalid or non-existent file: "#{loadfilename}"} - $process_document = :skip; break #remove this line to continue processing documents that have missing include files - para - end - else tuned_file << para - end - tuned_file=tuned_file.flatten.compact - end - if @@imager.length >0 - @@imager.each do |d,i| - i=i.flatten.uniq - image_info=d + i - download_images(image_info.flatten) - end - end - tuned_file - end end class CompositeFileList @@imager={} -- cgit v1.2.3 From 3daec543362c334a4c6f4de33fc226401692a37e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 11 Jul 2014 00:12:48 -0400 Subject: v5 v6: src sisupod, cosmetic code arrangement --- lib/sisu/v5/src_shared.rb | 57 +++++++++++++++++++++++++++-------------- lib/sisu/v5/src_sisupod_make.rb | 15 ++++++++--- lib/sisu/v6/src_shared.rb | 57 +++++++++++++++++++++++++++-------------- lib/sisu/v6/src_sisupod_make.rb | 15 ++++++++--- 4 files changed, 100 insertions(+), 44 deletions(-) diff --git a/lib/sisu/v5/src_shared.rb b/lib/sisu/v5/src_shared.rb index 5338a18c..bbeebdc1 100644 --- a/lib/sisu/v5/src_shared.rb +++ b/lib/sisu/v5/src_shared.rb @@ -85,7 +85,7 @@ module SiSU_Source fnb: path_pod_fnb, pod: path_pod, doc: path_pod + '/' + Gt[:doc] + '/' + opt.lng, - po: path_pod + '/' + Gt[:po] + '/' + opt.lng, + po: path_pod + '/' + Gt[:po] + '/' + opt.lng, pot: path_pod + '/' + Gt[:pot], conf: path_pod + '/' + Gt[:conf], image: path_pod + '/' + Gt[:image], @@ -98,7 +98,11 @@ module SiSU_Source (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) \ - ? SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Assemble SiSU source',"[#{@opt.f_pth[:lng_is]}] #{@opt.fno}").green_hi_blue + ? SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'Assemble SiSU source', + "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}"). + green_hi_blue : '' end unless @opt.fns.empty? @@ -123,25 +127,25 @@ module SiSU_Source @rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ @rgx_doc_import=/^<<\s*(\S+?\.ss[ti])/ file_array=IO.readlines(@opt.fno,'') - images,doc_import=[],[] + images,doc_import_list=[],[] doc_import_dir=@opt.sub_location file_array.each do |f| #% work area if f !~/^%+\s/ - f=f.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) + f=f.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) if f !~/^%+\s/ \ and f =~@rgx_image images=images_extract(f,images) end if @opt.fno =~/\.ssm$/ - doc_import << f.scan(@rgx_doc_import) if f =~@rgx_doc_import + doc_import_list << f.scan(@rgx_doc_import) if f =~@rgx_doc_import end end end - if doc_import.length > 0 - doc_import=doc_import.uniq.flatten - doc_import.each do |fn| + if doc_import_list.length > 0 + doc_import_list=doc_import_list.uniq.flatten + doc_import_list.each do |fn| file_array=IO.readlines(fn,'') - file_array.each do |f| #% work area + file_array.each do |f| #% work area if f !~/^%+\s/ \ and f =~@rgx_image images=images_extract(f,images) @@ -153,7 +157,8 @@ module SiSU_Source unless FileTest.file?("#{@path_pod[:conf]}/#{gi.makefile_name}") if gi.makefile \ && FileTest.file?(gi.makefile) - FileUtils::mkdir_p(@path_pod[:conf]) unless FileTest.directory?(@path_pod[:conf]) + FileUtils::mkdir_p(@path_pod[:conf]) \ + unless FileTest.directory?(@path_pod[:conf]) FileUtils::cp(gi.makefile,"#{@path_pod[:conf]}/#{gi.makefile_name}") end #get images from makefile, consider placing in param @@ -181,18 +186,24 @@ module SiSU_Source images.each do |i| if FileTest.file?("#{images_pwd}/#{i}") FileUtils::cp("#{images_pwd}/#{i}","#{@path_pod[:image]}/#{i}") - else STDERR.puts %{\t*WARN* did not find image - "#{images_pwd}/#{i}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find image - "#{images_pwd}/#{i}" [#{__FILE__}:#{__LINE__}]} end end - else STDERR.puts %{\t*WARN* did not find - #{images_pwd} #{@path_pod[:image]} [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find - #{images_pwd} #{@path_pod[:image]} [#{__FILE__}:#{__LINE__}]} end end - if doc_import.length > 0 \ + if doc_import_list.length > 0 \ and @opt.fno =~/\.ssm$/ - doc_import.each do |f| + doc_import_list.each do |f| if FileTest.file?("#{@opt.base_path}#{doc_import_dir}/#{f}") FileUtils::cp("#{@opt.base_path}#{doc_import_dir}/#{f}","#{@path_pod[:doc]}/#{f}") - else STDERR.puts %{\t*WARN* did not find image - "#{@opt.base_path}#{doc_import_dir}/#{f}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find image - "#{@opt.base_path}#{doc_import_dir}/#{f}" [#{__FILE__}:#{__LINE__}]} end end end @@ -208,7 +219,9 @@ module SiSU_Source if FileTest.file?("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}") FileUtils::cp("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}", "#{@path_pod[:doc]}/#{f[:n]}") - else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} end else if FileTest.file?("#{@opt.base_path}/#{f[:f]}") @@ -225,7 +238,9 @@ module SiSU_Source FileUtils::cp("#{@opt.base_path}/#{f[:f]}", "#{@path_pod[:doc]}/#{f[:n]}") end - else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} end end end @@ -234,7 +249,9 @@ module SiSU_Source if FileTest.file?("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}") FileUtils::cp_r("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}", "#{@path_pod[:doc]}/#{f[:n]}") - else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} end else if FileTest.file?("#{@opt.base_path}/#{f[:f]}") @@ -251,7 +268,9 @@ module SiSU_Source FileUtils::cp("#{@opt.base_path}/#{f[:f]}", "#{@path_pod[:doc]}/#{f[:n]}") end - else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} end end end diff --git a/lib/sisu/v5/src_sisupod_make.rb b/lib/sisu/v5/src_sisupod_make.rb index 5ae7313f..4e9c83ba 100644 --- a/lib/sisu/v5/src_sisupod_make.rb +++ b/lib/sisu/v5/src_sisupod_make.rb @@ -75,13 +75,22 @@ module SiSU_Doc (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) \ - ? SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Assemble source for sisu document',"#{@opt.fns} -> file://#{pthinfo}").cyan_hi_blue - : SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Assemble source for sisu document',pthinfo).cyan_title_hi + ? SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'Assemble source for sisu document', + "#{@opt.fns} -> file://#{pthinfo}"). + cyan_hi_blue + : SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'Assemble source for sisu document', + pthinfo). + cyan_title_hi end end def sisupod_tar_xz begin - FileUtils::mkdir_p(@file.output_path.sisupod.dir) unless FileTest.directory?(@file.output_path.sisupod.dir) + FileUtils::mkdir_p(@file.output_path.sisupod.dir) \ + unless FileTest.directory?(@file.output_path.sisupod.dir) tree=((@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) \ diff --git a/lib/sisu/v6/src_shared.rb b/lib/sisu/v6/src_shared.rb index 4ce34473..ec021974 100644 --- a/lib/sisu/v6/src_shared.rb +++ b/lib/sisu/v6/src_shared.rb @@ -85,7 +85,7 @@ module SiSU_Source fnb: path_pod_fnb, pod: path_pod, doc: path_pod + '/' + Gt[:doc] + '/' + opt.lng, - po: path_pod + '/' + Gt[:po] + '/' + opt.lng, + po: path_pod + '/' + Gt[:po] + '/' + opt.lng, pot: path_pod + '/' + Gt[:pot], conf: path_pod + '/' + Gt[:conf], image: path_pod + '/' + Gt[:image], @@ -98,7 +98,11 @@ module SiSU_Source (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) \ - ? SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Assemble SiSU source',"[#{@opt.f_pth[:lng_is]}] #{@opt.fno}").green_hi_blue + ? SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'Assemble SiSU source', + "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}"). + green_hi_blue : '' end unless @opt.fns.empty? @@ -123,25 +127,25 @@ module SiSU_Source @rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ @rgx_doc_import=/^<<\s*(\S+?\.ss[ti])/ file_array=IO.readlines(@opt.fno,'') - images,doc_import=[],[] + images,doc_import_list=[],[] doc_import_dir=@opt.sub_location file_array.each do |f| #% work area if f !~/^%+\s/ - f=f.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) + f=f.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) if f !~/^%+\s/ \ and f =~@rgx_image images=images_extract(f,images) end if @opt.fno =~/\.ssm$/ - doc_import << f.scan(@rgx_doc_import) if f =~@rgx_doc_import + doc_import_list << f.scan(@rgx_doc_import) if f =~@rgx_doc_import end end end - if doc_import.length > 0 - doc_import=doc_import.uniq.flatten - doc_import.each do |fn| + if doc_import_list.length > 0 + doc_import_list=doc_import_list.uniq.flatten + doc_import_list.each do |fn| file_array=IO.readlines(fn,'') - file_array.each do |f| #% work area + file_array.each do |f| #% work area if f !~/^%+\s/ \ and f =~@rgx_image images=images_extract(f,images) @@ -153,7 +157,8 @@ module SiSU_Source unless FileTest.file?("#{@path_pod[:conf]}/#{gi.makefile_name}") if gi.makefile \ && FileTest.file?(gi.makefile) - FileUtils::mkdir_p(@path_pod[:conf]) unless FileTest.directory?(@path_pod[:conf]) + FileUtils::mkdir_p(@path_pod[:conf]) \ + unless FileTest.directory?(@path_pod[:conf]) FileUtils::cp(gi.makefile,"#{@path_pod[:conf]}/#{gi.makefile_name}") end #get images from makefile, consider placing in param @@ -181,18 +186,24 @@ module SiSU_Source images.each do |i| if FileTest.file?("#{images_pwd}/#{i}") FileUtils::cp("#{images_pwd}/#{i}","#{@path_pod[:image]}/#{i}") - else STDERR.puts %{\t*WARN* did not find image - "#{images_pwd}/#{i}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find image - "#{images_pwd}/#{i}" [#{__FILE__}:#{__LINE__}]} end end - else STDERR.puts %{\t*WARN* did not find - #{images_pwd} #{@path_pod[:image]} [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find - #{images_pwd} #{@path_pod[:image]} [#{__FILE__}:#{__LINE__}]} end end - if doc_import.length > 0 \ + if doc_import_list.length > 0 \ and @opt.fno =~/\.ssm$/ - doc_import.each do |f| + doc_import_list.each do |f| if FileTest.file?("#{@opt.base_path}#{doc_import_dir}/#{f}") FileUtils::cp("#{@opt.base_path}#{doc_import_dir}/#{f}","#{@path_pod[:doc]}/#{f}") - else STDERR.puts %{\t*WARN* did not find image - "#{@opt.base_path}#{doc_import_dir}/#{f}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find image - "#{@opt.base_path}#{doc_import_dir}/#{f}" [#{__FILE__}:#{__LINE__}]} end end end @@ -208,7 +219,9 @@ module SiSU_Source if FileTest.file?("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}") FileUtils::cp("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}", "#{@path_pod[:doc]}/#{f[:n]}") - else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} end else if FileTest.file?("#{@opt.base_path}/#{f[:f]}") @@ -225,7 +238,9 @@ module SiSU_Source FileUtils::cp("#{@opt.base_path}/#{f[:f]}", "#{@path_pod[:doc]}/#{f[:n]}") end - else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} end end end @@ -234,7 +249,9 @@ module SiSU_Source if FileTest.file?("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}") FileUtils::cp_r("#{@opt.base_path}#{doc_import_dir}/#{f[:f]}", "#{@path_pod[:doc]}/#{f[:n]}") - else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find - "#{@opt.base_path}#{doc_import_dir}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} end else if FileTest.file?("#{@opt.base_path}/#{f[:f]}") @@ -251,7 +268,9 @@ module SiSU_Source FileUtils::cp("#{@opt.base_path}/#{f[:f]}", "#{@path_pod[:doc]}/#{f[:n]}") end - else STDERR.puts %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} + else + STDERR.puts \ + %{\t*WARN* did not find - "#{@opt.base_path}/#{f[:f]}" [#{__FILE__}:#{__LINE__}]} end end end diff --git a/lib/sisu/v6/src_sisupod_make.rb b/lib/sisu/v6/src_sisupod_make.rb index ad58453d..ccac91f8 100644 --- a/lib/sisu/v6/src_sisupod_make.rb +++ b/lib/sisu/v6/src_sisupod_make.rb @@ -75,13 +75,22 @@ module SiSU_Doc (@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) \ - ? SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Assemble source for sisu document',"#{@opt.fns} -> file://#{pthinfo}").cyan_hi_blue - : SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Assemble source for sisu document',pthinfo).cyan_title_hi + ? SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'Assemble source for sisu document', + "#{@opt.fns} -> file://#{pthinfo}"). + cyan_hi_blue + : SiSU_Screen::Ansi.new( + @opt.act[:color_state][:set], + 'Assemble source for sisu document', + pthinfo). + cyan_title_hi end end def sisupod_tar_xz begin - FileUtils::mkdir_p(@file.output_path.sisupod.dir) unless FileTest.directory?(@file.output_path.sisupod.dir) + FileUtils::mkdir_p(@file.output_path.sisupod.dir) \ + unless FileTest.directory?(@file.output_path.sisupod.dir) tree=((@opt.act[:verbose][:set]==:on \ || @opt.act[:verbose_plus][:set]==:on \ || @opt.act[:maintenance][:set]==:on) \ -- cgit v1.2.3 From a93f8d5da9c2104ebd370ddfcc51021b5a858920 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 11 Jul 2014 00:14:36 -0400 Subject: v5 v6: src, sisupod composite source, nested includes --- data/doc/sisu/CHANGELOG_v5 | 3 +++ data/doc/sisu/CHANGELOG_v6 | 3 +++ lib/sisu/v5/src_shared.rb | 63 ++++++++++++++++++++++++++++++---------------- lib/sisu/v6/src_shared.rb | 63 ++++++++++++++++++++++++++++++---------------- 4 files changed, 90 insertions(+), 42 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index a87629fa..2cca5ac9 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -71,6 +71,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.5.0.orig.tar.xz ~ requires testing ~ version bump, new behavior added to .ssi one of the 3 sisu filetypes +* src, sisupod composite source, nested includes + follow rules for ao_composite (described above) + %% 5.4.5.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.4.5 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.4.5-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index c4a7d1a9..ae42efe7 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -61,6 +61,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.1.0.orig.tar.xz ~ requires testing ~ version bump, new behavior added to .ssi one of the 3 sisu filetypes +* src, sisupod composite source, nested includes + follow rules for ao_composite (described above) + %% 6.0.11.orig.tar.xz (2014-07-07:27/1) http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.0.11 http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.0.11-1 diff --git a/lib/sisu/v5/src_shared.rb b/lib/sisu/v5/src_shared.rb index bbeebdc1..a4b3a974 100644 --- a/lib/sisu/v5/src_shared.rb +++ b/lib/sisu/v5/src_shared.rb @@ -80,6 +80,7 @@ module SiSU_Source processing_sisupod.make path_pod=processing_sisupod.paths[:sisupod] path_pod_fnb=processing_sisupod.paths[:fnb] + @doc_import_list=[] FileUtils::mkdir_p(path_pod) unless FileTest.directory?(path_pod) @path_pod={ fnb: path_pod_fnb, @@ -107,12 +108,13 @@ module SiSU_Source end unless @opt.fns.empty? directories - pod_source_build #this needs to be built in case of multi-lingual for all of them, before single pass tar + file_array=IO.readlines(@opt.fno,'') + doc_import_list=pod_source_build(file_array) #this needs to be built in case of multi-lingual for all of them, before single pass tar + doc_import_list=[@opt.fno, doc_import_list].flatten + image_extraction(doc_import_list) + language_versions end end - def directories - SiSU_Env::InfoEnv.new.sisupod_v4(@opt) - end def images_extract(f,images) # consider using param info rgx_image=/(?:^|[^_\\])\{(?:\s*|\~\^\s+)(\S+?\.(?:png|jpg|gif)\b)/m if f !~/^%+\s/ \ @@ -121,31 +123,17 @@ module SiSU_Source end images.flatten end - def pod_source_build - @pwd=Dir.pwd + def image_extraction(doc_import_list) @rgx_rb_image=/["']\S*?([a-zA-Z0-9_-]+?\.(?:png|jpg|gif))["']/ @rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ - @rgx_doc_import=/^<<\s*(\S+?\.ss[ti])/ - file_array=IO.readlines(@opt.fno,'') - images,doc_import_list=[],[] doc_import_dir=@opt.sub_location - file_array.each do |f| #% work area - if f !~/^%+\s/ - f=f.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) - if f !~/^%+\s/ \ - and f =~@rgx_image - images=images_extract(f,images) - end - if @opt.fno =~/\.ssm$/ - doc_import_list << f.scan(@rgx_doc_import) if f =~@rgx_doc_import - end - end - end + images=[] if doc_import_list.length > 0 doc_import_list=doc_import_list.uniq.flatten doc_import_list.each do |fn| file_array=IO.readlines(fn,'') file_array.each do |f| #% work area + f=f.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) if f !~/^%+\s/ \ and f =~@rgx_image images=images_extract(f,images) @@ -207,7 +195,10 @@ module SiSU_Source end end end + end + def language_versions x=@env.document_language_versions_found #check multiple document language versions (param not used) + doc_import_dir=@opt.sub_location if x[:f] \ and x[:f].length > 0 #store multiple document language versions, sisupod x[:f].each do |f| @@ -277,6 +268,36 @@ module SiSU_Source end end #NB not all possibilies met, revisit, also in case of composite file may wish to add README end + def directories + SiSU_Env::InfoEnv.new.sisupod_v4(@opt) + end + def ssm_doc_import_list(f) + if @opt.fno =~/\.ssm$/ + doc_import_list=[] + doc_import_list << f.scan(@rgx_doc_import) if f =~@rgx_doc_import + doc_import_list.flatten.each do |i| + if i =~/.ssi/ + file_array=IO.readlines(i,'') + pod_source_build(file_array) + end + end + end + doc_import_list.uniq.flatten + end + def pod_source_build(file_array) + @pwd=Dir.pwd + @rgx_doc_import_list=/^<<\s*(\S+?\.ss[ti])/ + doc_import_list=[] + file_array.each do |f| #% work area + if f !~/^%+\s/ + if @opt.fno =~/\.ssm$/ + @doc_import_list << ssm_doc_import_list(f) + doc_import_list=@doc_import_list.flatten.uniq + end + end + end + doc_import_list + end end end __END__ diff --git a/lib/sisu/v6/src_shared.rb b/lib/sisu/v6/src_shared.rb index ec021974..cee7e1c5 100644 --- a/lib/sisu/v6/src_shared.rb +++ b/lib/sisu/v6/src_shared.rb @@ -80,6 +80,7 @@ module SiSU_Source processing_sisupod.make path_pod=processing_sisupod.paths[:sisupod] path_pod_fnb=processing_sisupod.paths[:fnb] + @doc_import_list=[] FileUtils::mkdir_p(path_pod) unless FileTest.directory?(path_pod) @path_pod={ fnb: path_pod_fnb, @@ -107,12 +108,13 @@ module SiSU_Source end unless @opt.fns.empty? directories - pod_source_build #this needs to be built in case of multi-lingual for all of them, before single pass tar + file_array=IO.readlines(@opt.fno,'') + doc_import_list=pod_source_build(file_array) #this needs to be built in case of multi-lingual for all of them, before single pass tar + doc_import_list=[@opt.fno, doc_import_list].flatten + image_extraction(doc_import_list) + language_versions end end - def directories - SiSU_Env::InfoEnv.new.sisupod_v4(@opt) - end def images_extract(f,images) # consider using param info rgx_image=/(?:^|[^_\\])\{(?:\s*|\~\^\s+)(\S+?\.(?:png|jpg|gif)\b)/m if f !~/^%+\s/ \ @@ -121,31 +123,17 @@ module SiSU_Source end images.flatten end - def pod_source_build - @pwd=Dir.pwd + def image_extraction(doc_import_list) @rgx_rb_image=/["']\S*?([a-zA-Z0-9_-]+?\.(?:png|jpg|gif))["']/ @rgx_image=/(?:^|[^_\\])\{\s*(\S+?\.(?:png|jpg|gif))/ - @rgx_doc_import=/^<<\s*(\S+?\.ss[ti])/ - file_array=IO.readlines(@opt.fno,'') - images,doc_import_list=[],[] doc_import_dir=@opt.sub_location - file_array.each do |f| #% work area - if f !~/^%+\s/ - f=f.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) - if f !~/^%+\s/ \ - and f =~@rgx_image - images=images_extract(f,images) - end - if @opt.fno =~/\.ssm$/ - doc_import_list << f.scan(@rgx_doc_import) if f =~@rgx_doc_import - end - end - end + images=[] if doc_import_list.length > 0 doc_import_list=doc_import_list.uniq.flatten doc_import_list.each do |fn| file_array=IO.readlines(fn,'') file_array.each do |f| #% work area + f=f.gsub(/<:=(\S+?)>/,'{ c_\1.png 14x14 }image') # embedded symbol (image) if f !~/^%+\s/ \ and f =~@rgx_image images=images_extract(f,images) @@ -207,7 +195,10 @@ module SiSU_Source end end end + end + def language_versions x=@env.document_language_versions_found #check multiple document language versions (param not used) + doc_import_dir=@opt.sub_location if x[:f] \ and x[:f].length > 0 #store multiple document language versions, sisupod x[:f].each do |f| @@ -277,6 +268,36 @@ module SiSU_Source end end #NB not all possibilies met, revisit, also in case of composite file may wish to add README end + def directories + SiSU_Env::InfoEnv.new.sisupod_v4(@opt) + end + def ssm_doc_import_list(f) + if @opt.fno =~/\.ssm$/ + doc_import_list=[] + doc_import_list << f.scan(@rgx_doc_import) if f =~@rgx_doc_import + doc_import_list.flatten.each do |i| + if i =~/.ssi/ + file_array=IO.readlines(i,'') + pod_source_build(file_array) + end + end + end + doc_import_list.uniq.flatten + end + def pod_source_build(file_array) + @pwd=Dir.pwd + @rgx_doc_import_list=/^<<\s*(\S+?\.ss[ti])/ + doc_import_list=[] + file_array.each do |f| #% work area + if f !~/^%+\s/ + if @opt.fno =~/\.ssm$/ + @doc_import_list << ssm_doc_import_list(f) + doc_import_list=@doc_import_list.flatten.uniq + end + end + end + doc_import_list + end end end __END__ -- cgit v1.2.3 From bf076ed40633fa31cc33e225c00e2dcb1f526ce8 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 11 Jul 2014 00:17:43 -0400 Subject: documention related --- README | 85 ++-------------------- .../markup-samples/manual/en/sisu_filetypes.sst | 2 +- .../sisu/markup-samples/manual/en/sisu_markup.sst | 2 +- .../markup-samples/manual/en/sisu_search_cgi.ssi | 1 + data/doc/sisu/sisu.org | 9 --- man/man1/sisu.1 | 23 ++++-- 6 files changed, 25 insertions(+), 97 deletions(-) diff --git a/README b/README index 9d0ce281..a4970509 100644 --- a/README +++ b/README @@ -112,7 +112,6 @@ ruby setup.rb setup #[as root:] ruby setup.rb install - further information: @@ -135,7 +134,6 @@ as root, Using apt-get: apt get install sisu-complete - (all sisu dependencies should be taken care of) If there are newer versions of *SiSU* upstream, they will be available by @@ -146,7 +144,6 @@ adding the following to your sources list /etc/apt/sources.list deb http://www.jus.uio.no/sisu/archive unstable main non-free deb-src http://www.jus.uio.no/sisu/archive unstable main non-free - The non-free section is for sisu markup samples provided, which contain authored works the substantive text of which cannot be changed, and which as a result do not meet the debian free software guidelines. @@ -192,14 +189,12 @@ graphicsmagick, keychain, openssh-client | lsh-client, po4a, qrencode, rake, ruby-rmagick, tidy, tree, vim-addon-manager Suggests: lv, calibre, pinfo, poedit, texinfo, trang - Package: sisu-complete Depends: ruby | ruby-interpreter, sisu (= ${source:Version}), sisu-pdf (= ${source:Version}), sisu-postgresql (= ${source:Version}), sisu-sqlite (= ${source:Version}) Description-en: installs all SiSU related packages - Package: sisu-pdf Depends: ruby | ruby-interpreter, sisu (= ${source:Version}), texlive-latex-base, texlive-fonts-recommended, texlive-generic-recommended, @@ -207,22 +202,18 @@ texlive-latex-recommended, texlive-latex-extra, texlive-math-extra, texlive-xetex, fonts-liberation, lmodern, latex-cjk-all, texlive-lang-cjk Suggests: evince | pdf-viewer - Package: sisu-postgresql Depends: ruby | ruby-interpreter, sisu (= ${source:Version}), postgresql, ruby-dbd-pg, ruby-dbi, ruby-fcgi Suggests: postgresql-contrib - Package: sisu-sqlite Depends: ruby | ruby-interpreter, sisu (= ${source:Version}), sqlite3, ruby-sqlite3, ruby-dbd-sqlite3, ruby-dbi, ruby-fcgi - Package: sisu-markup-samples Depends: sisu - COMMANDS ******** @@ -606,22 +597,15 @@ see --sisupod *-s [filename/wildcard]* see --source -*--sample-search-form [--db=(pgsql|sqlite)] [--webserv=webrick]* +*--sample-search-form [--db-(pg|sqlite)]* generate examples of (naive) cgi search form for /SQLite/ or PgSQL depends on your already having used sisu to populate an /SQLite/ or PgSQL database, (the /SQLite/ version scans the output directories for existing sisu_sqlite databases, so it is first necessary to create them, before generating the search form) see --sqlite & --pg and the database section below. Optional -additional parameters include: url location of webserver search form and db: ---webserv-search='[url]'; location of webserver output: ---webserv-output='[url]'; cgi search form link name: ---cgi-search-form-name='[name.cgi]'; for pgsql, database user: ---db-user='[username]'. If the optional parameter --webserv=webrick is passed, -the cgi examples created will be set up to use the default port set for use by -the webrick server, (otherwise the port is left blank and the system setting -used, usually 80). The samples are dumped in the present work directory which -must be writable, (with screen instructions given that they be copied to the -cgi-bin directory). Alias -F +additional parameters: --db-user='www-data'. The samples are dumped in the +present work directory which must be writable, (with screen instructions given +that they be copied to the cgi-bin directory). Alias -F *--scp [filename/wildcard]* copies sisu output files to remote host using scp. This requires that @@ -958,7 +942,6 @@ minimal content/structure requirement: 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 @@ -993,7 +976,6 @@ text * 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 @@ -1016,7 +998,6 @@ text * (as a corollary to the rules above substantive text/ content must be preceded by a level 1~ (2~ or 3~) heading) - MARKUP EXAMPLES ............... @@ -1061,7 +1042,6 @@ a space and the comment: % this would be a comment - SAMPLE HEADER ............. @@ -1120,7 +1100,6 @@ to this one: { SiSU Project @ Debian }http://qa.debian.org/developer.php?login=sisu@lists.sisudoc.org { SiSU @ Wikipedia }http://en.wikipedia.org/wiki/SiSU - AVAILABLE HEADERS ................. @@ -1143,19 +1122,16 @@ This is a sample header % SiSU 2.0 [declared file-type identifier with markup version] - @title: [title text] [this header is the only one that is mandatory] :subtitle: [subtitle if any] :language: English - @creator: :author: [Lastname, First names] :illustrator: [Lastname, First names] :translator: [Lastname, First names] :prepared_by: [Lastname, First names] - @date: :published: [year or yyyy-mm-dd] :created: [year or yyyy-mm-dd] @@ -1166,7 +1142,6 @@ This is a sample header :added_to_site: [year or yyyy-mm-dd] :translated: [year or yyyy-mm-dd] - @rights: :copyright: Copyright (C) [Year and Holder] :license: [Use License granted] @@ -1174,7 +1149,6 @@ This is a sample header :translation: [Name, Year] :illustrations: [Name, Year] - @classify: :topic_register: SiSU:markup sample:book;book:novel:fantasy :type: @@ -1185,16 +1159,13 @@ This is a sample header :loc: [Library of Congress classification] :dewey: [Dewey classification - @identify: :isbn: [ISBN] :oclc: - @links: { SiSU }http://www.sisudoc.org { FSF }http://www.fsf.org - @make: :num_top: 1 :headings: [text to match for each level @@ -1206,16 +1177,13 @@ This is a sample header :home_button_text: {SiSU}http://sisudoc.org; {git}http://git.sisudoc.org :footer: {SiSU}http://sisudoc.org; {git}http://git.sisudoc.org - @original: :language: [language] - @notes: :comment: :prefix: [prefix is placed just after table of contents] - MARKUP OF SUBSTANTIVE TEXT -------------------------- @@ -1253,7 +1221,6 @@ document % the primary division such as Chapter that is followed by substantive text, and may be further subdivided (this is the level on which by default html segments are made) - FONT ATTRIBUTES ............... @@ -1284,7 +1251,6 @@ _{underscore}_ #{monospace}# - *resulting output:* normal text, *emphasis*, *bold text*, /italics/, _underscore_, "citation", @@ -1326,7 +1292,6 @@ _2 indent paragraph two steps _9 indent paragraph nine steps - *resulting output:* ordinary paragraph @@ -1345,7 +1310,6 @@ _1* bullet text, first indent _2* bullet text, two step indent - *resulting output:* * bullet text @@ -1362,7 +1326,6 @@ Numbered List (not to be confused with headings/titles, (document structure)) _# numbered list numbered list indented a., b., c., d., etc. - HANGING INDENTS ............... @@ -1376,7 +1339,6 @@ rest of paragraph no indent in each case level may be 0-9 - *resulting output:* first line no indent, rest of paragraph indented one step; first line no @@ -1419,7 +1381,6 @@ determines whether footnotes or endnotes will be produced ~{ a footnote or endnote }~ - *resulting output:* [^5] @@ -1428,7 +1389,6 @@ determines whether footnotes or endnotes will be produced normal text~{ self contained endnote marker & endnote in one }~ continues - *resulting output:* normal text[^6] continues @@ -1439,7 +1399,6 @@ normal text ~{* unnumbered asterisk footnote/endnote, insert multiple asterisks normal text ~{** another unnumbered asterisk footnote/endnote }~ continues - *resulting output:* normal text [^*] continues @@ -1452,7 +1411,6 @@ normal text ~[* editors notes, numbered asterisk footnote/endnote series ]~ cont normal text ~[+ editors notes, numbered plus symbol footnote/endnote series ]~ continues - *resulting output:* normal text [^*3] continues @@ -1467,7 +1425,6 @@ normal text~^ continues ^~ endnote text following the paragraph in which the marker occurs - the standard and pair notation cannot be mixed in the same document LINKS @@ -1489,7 +1446,6 @@ decoration is omitted). normal text http://www.sisudoc.org/ continues - *resulting output:* normal text continues @@ -1502,7 +1458,6 @@ normal text _http://www.sisudoc.org/ continues deb _http://www.jus.uio.no/sisu/archive unstable main non-free - *resulting output:* normal text http://www.sisudoc.org/ continues @@ -1518,7 +1473,6 @@ deb http://www.jus.uio.no/sisu/archive unstable main non-free deb-src http://www.jus.uio.no/sisu/archive unstable main non-free - ---------------------------------------- LINKING TEXT @@ -1530,7 +1484,6 @@ To link text or an image to a url the markup is as follows about { SiSU }http://url.org markup - *resulting output:* about SiSU [link: ] markup @@ -1542,7 +1495,6 @@ automatically as a footnote about {~^ SiSU }http://url.org markup - *resulting output:* about SiSU [link: ] [^7] markup @@ -1553,7 +1505,6 @@ Internal document links to a tagged location, including an ocn about { text links }#link_text - *resulting output:* about text links @@ -1564,7 +1515,6 @@ Shared document collection link about { SiSU book markup examples }:SiSU/examples.html - *resulting output:* about *SiSU* book markup examples @@ -1585,7 +1535,6 @@ LINKING IMAGES {~^ ruby_logo.png "Ruby" }http://www.ruby-lang.org/en/ - *resulting output:* tux.png 64x80 [link: local image] @@ -1605,10 +1554,8 @@ ruby_logo.png 70x90 "Ruby" [link: ] [^8] % which produces hyper-linked text within a document/paragraph, with an endnote providing the url for the text location used in the hyperlink - text marker *~name - 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 auto-heading numbering, without further intervention. @@ -1626,7 +1573,6 @@ TREE { "Viral Spiral", David Bollier [3sS]}viral_spiral.david_bollier.sst - */"Viral Spiral"/, David Bollier* "Viral Spiral", David Bollier [link: ] @@ -1670,7 +1616,6 @@ column three of row two, and so on }table - *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』 @@ -1692,7 +1637,6 @@ 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. - *resulting output:* *Table 3.1: Contributors to Wikipedia, January 2001 - June 2005* @@ -1718,7 +1662,6 @@ poem{ Each verse in a poem is given an object number. - *markup example:* poem{ @@ -1770,7 +1713,6 @@ poem{ }poem - *resulting output:* `Fury said to a @@ -1834,7 +1776,6 @@ group{ A group is treated as an object and given a single object number. - *markup example:* group{ @@ -1886,7 +1827,6 @@ group{ }group - *resulting output:* `Fury said to a @@ -1996,7 +1936,6 @@ option to number each line of code may be considered at some later time] to death."' - From *SiSU* 2.7.7 on you can number codeblocks by placing a hash after the opening code tag # code{# # as demonstrated here: @@ -2063,7 +2002,6 @@ two backslashes \\ with a space before and a space or newline after them \\ may be used. - 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, but is depreciated). @@ -2091,17 +2029,14 @@ page break: -\\- - page (break) new: =\\= - page (break) line across page (dividing paragraphs): -..- - BOOK INDEX .......... @@ -2114,7 +2049,6 @@ Sub-terms are separated from the main term by a colon. Paragraph containing main term and sub-term. ={Main term:sub-term} - The index syntax starts on a new line, but there should not be an empty line between paragraph and index markup. @@ -2123,21 +2057,18 @@ The structure of the resulting index would be: Main term, 1 sub-term, 1 - 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. Paragraph containing main term, second term and sub-term. ={first term; second term: sub-term} - The structure of the resulting index would be: First term, 1, Second term, 1, sub-term, 1 - If multiple sub-terms appear under one paragraph, they are separated under the main term heading from each other by a pipe symbol. @@ -2149,7 +2080,6 @@ main term heading from each other by a pipe symbol. A paragraph that continues discussion of the first sub-term - 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: @@ -2158,7 +2088,6 @@ additional paragraph. The logical structure of the resulting index would be: second sub-term, 1, Another term, 1 - COMPOSITE DOCUMENTS MARKUP -------------------------- @@ -2171,8 +2100,8 @@ suffix *.ssm* Within this document you would provide information on the other documents that should be included within the text. These may be other documents that would be processed in a regular way, or markup bits prepared only for inclusion within a master document *.sst* regular markup file, or *.ssi* -(insert/information) A secondary file of the composite document is built prior -to processing with the same prefix and the suffix *._sst* +(insert). A secondary file of the composite document is built prior to +processing with the same prefix and the suffix *._sst* basic markup for importing a document into a master document @@ -2180,7 +2109,6 @@ basic markup for importing a document into a master document << filename2.ssi - The form described above should be relied on. Within the /Vim/ editor it results in the text thus linked becoming hyperlinked to the document it is calling in which is convenient for editing. @@ -2197,7 +2125,6 @@ Configure substitution in _sisu/sisu_document_make @make: :substitute: /${debian_stable}/,'*{Wheezy}*' /${debian_testing}/,'*{Jessie}*' - *resulting output:* The current *Debian* is *Wheezy* the next debian will be *Jessie* diff --git a/data/doc/sisu/markup-samples/manual/en/sisu_filetypes.sst b/data/doc/sisu/markup-samples/manual/en/sisu_filetypes.sst index d36acac0..4b5c31e7 100644 --- a/data/doc/sisu/markup-samples/manual/en/sisu_filetypes.sst +++ b/data/doc/sisu/markup-samples/manual/en/sisu_filetypes.sst @@ -53,7 +53,7 @@ Note: a secondary file of the composite document is built prior to processing wi 3~ sisu insert files (.ssi) -Inserts are documents prepared solely for the purpose of being incorporated into one or more master documents. They resemble regular SiSU text files except they are ignored by the SiSU 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. +Inserts are documents prepared solely for the purpose of being incorporated into one or more master documents. They resemble regular SiSU text files (.sst). Since sisu-5.5.0 (6.1.0) .ssi files can like .ssm files include other .sst or .ssm files. .ssi files cannot be called by the sisu processor directly and can only be incorporated in other documents. Making a file a .ssi file is a quick and convenient way of breaking up a document that is to be included in a master document, and flagging that the file to be incorporated .ssi is not intended that the file should be processed on its own. 2~ sisupod, zipped binary container (sisupod.zip, .ssp) 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 08128821..7db8416e 100644 --- a/data/doc/sisu/markup-samples/manual/en/sisu_markup.sst +++ b/data/doc/sisu/markup-samples/manual/en/sisu_markup.sst @@ -1344,7 +1344,7 @@ code{ 1~ Composite documents markup -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 generated independently, or they could be markup snippets, prepared so as to be easily available to be placed within another text. If the calling document is a master document (built from other documents), it should be named with the suffix *{.ssm}* Within this document you would provide information on the other documents that should be included within the text. These may be other documents that would be processed in a regular way, or markup bits prepared only for inclusion within a master document *{.sst}* regular markup file, or *{.ssi}* (insert/information) A secondary file of the composite document is built prior to processing with the same prefix and the suffix *{._sst}* +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 generated independently, or they could be markup snippets, prepared so as to be easily available to be placed within another text. If the calling document is a master document (built from other documents), it should be named with the suffix *{.ssm}* Within this document you would provide information on the other documents that should be included within the text. These may be other documents that would be processed in a regular way, or markup bits prepared only for inclusion within a master document *{.sst}* regular markup file, or *{.ssi}* (insert). A secondary file of the composite document is built prior to processing with the same prefix and the suffix *{._sst}* basic markup for importing a document into a master document diff --git a/data/doc/sisu/markup-samples/manual/en/sisu_search_cgi.ssi b/data/doc/sisu/markup-samples/manual/en/sisu_search_cgi.ssi index 4e833b9b..301cfa72 100644 --- a/data/doc/sisu/markup-samples/manual/en/sisu_search_cgi.ssi +++ b/data/doc/sisu/markup-samples/manual/en/sisu_search_cgi.ssi @@ -59,6 +59,7 @@ To create a sample search form, from within the same directory run: ``` code sisu --sample-search-form --db-pg ``` + and copy the resulting cgi form to your cgi-bin directory A sample setup for nginx is provided that assumes data will be stored under /srv/www and cgi scripts under /srv/cgi diff --git a/data/doc/sisu/sisu.org b/data/doc/sisu/sisu.org index 8800572d..64246368 100644 --- a/data/doc/sisu/sisu.org +++ b/data/doc/sisu/sisu.org @@ -2264,15 +2264,6 @@ allowing .ssi to also include other .ssi or .sst could lead to recursive .ssi stopping after an additional level of includes seems arbitrary, and possibly prone to error if you are dealing with many documents -***** Discard -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 diff --git a/man/man1/sisu.1 b/man/man1/sisu.1 index f6f4a943..8789a75d 100644 --- a/man/man1/sisu.1 +++ b/man/man1/sisu.1 @@ -1,4 +1,4 @@ -.TH "sisu" "1" "2014-05-18" "6.0.6" "SiSU" +.TH "sisu" "1" "2014-07-11" "6.1.0" "SiSU" .br .SH NAME .br @@ -2458,8 +2458,8 @@ master document .B .sst regular markup file, or .B .ssi -(insert/information) A secondary file of the composite document is built prior -to processing with the same prefix and the suffix +(insert). A secondary file of the composite document is built prior to +processing with the same prefix and the suffix .B ._sst .BR @@ -2587,10 +2587,12 @@ with the same prefix and the suffix ._sst [^11] Inserts are documents prepared solely for the purpose of being incorporated into one or more master documents. They resemble regular .B SiSU -text files except they are ignored by the -.B SiSU -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. +text files (.sst). Since sisu -5.5.0 (6.1.0) .ssi files can like .ssm files +include other .sst or .ssm files. .ssi files cannot be called by the sisu +processor directly and can only be incorporated in other documents. Making a +file a .ssi file is a quick and convenient way of breaking up a document that +is to be included in a master document, and flagging that the file to be +incorporated .ssi is not intended that the file should be processed on its own. .SH SISUPOD, ZIPPED BINARY CONTAINER (SISUPOD.ZIP, .SSP) @@ -3534,6 +3536,13 @@ sisu --pg --update -v en/sisu_manual.ssm .BR To create a sample search form, from within the same directory run: +.nf +sisu --sample-search-form --db-pg +.fi + + +.BR +and copy the resulting cgi form to your cgi-bin directory .BR A sample setup for nginx is provided that assumes data will be stored under -- cgit v1.2.3