From 0770dd950f674b97820b0a5839d0929b96b32762 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 26 Sep 2007 11:14:57 +0100 Subject: sysenv, sisurc.yml allow use of relative output paths, expand to absolute --- lib/sisu/v0/sysenv.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb index 15dbeba5..bf474f64 100644 --- a/lib/sisu/v0/sysenv.rb +++ b/lib/sisu/v0/sysenv.rb @@ -734,7 +734,8 @@ module SiSU_Env include FileUtils attr_accessor :filename,:sys,:home,:hostname,:user,:env,:rc,:www,:fnb,:fnn,:fnt,:flv,:webserv_path,:stub_pwd,:webserv_host_cgi,:webserv_port_cgi,:processing,:etc,:yamlrc_dir @@image_flag,@@local_image=true,true #warning on @@image_flag - @@fb=nil + @@fb=@@man_path=nil,nil + #@@fb=nil def initialize(fns='',md=nil) super() #you may not want to re-execute this tatic info so frequently! @fns,@md=fns,md @@ -1141,14 +1142,12 @@ WOK @webserv_path end def webserv #separation required for webrick which cannot use path.output (different requirements as no file is passed) - man_path=if defined? @rc['webserv']['path'] and @rc['webserv']['path'] =~/\S\S+/ - man_path=case @rc['webserv']['path'] - when /^\/\S+/; @rc['webserv']['path'] - when /^\.\/(\S+)/; "#{pwd}/#{$1}" - when /^~\/(\S+)/; "#{home}/#{$1}" - else "#{home}/#{@rc['webserv']['path']}" + man_path=if @@man_path.nil? + man_path=if defined? @rc['webserv']['path'] and @rc['webserv']['path'] =~/\S\S+/ + man_path=@@man_path=File.expand_path(@rc['webserv']['path']) + else nil end - else nil + else manpath=@@man_path end @webserv_path=if defined? man_path and File.writable?("#{man_path}/."); man_path #web server path as configured in rc file elsif FileTest.directory?(defaults[:webserv_path]) and File.writable?("#{defaults[:webserv_path]}/.") #web server path default -- cgit v1.2.3 From a36b83dad3b828761ee565fbb9ff53a5abc6e4b6 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 26 Sep 2007 13:12:21 +0100 Subject: help, (hub), minor reorganisation and a change in response for typing 'sisu' without options --- lib/sisu/v0/help.rb | 16 ++++++++++++++++ lib/sisu/v0/hub.rb | 17 +++++++---------- lib/sisu/v0/sysenv.rb | 3 +-- 3 files changed, 24 insertions(+), 12 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/help.rb b/lib/sisu/v0/help.rb index 4805f6ad..0cd100f4 100644 --- a/lib/sisu/v0/help.rb +++ b/lib/sisu/v0/help.rb @@ -160,6 +160,8 @@ module SiSU_Help This is free software, and you are welcome to redistribute it under the conditions of the GPL3 or later. For more license detail type/enter: "sisu --help license" +for help type 'sisu --help', 'sisu --help [help request]', 'man sisu', (or see the system or online documentation) + typing "sisu" on its own or "sisu --help", should give you this sisu help summary and the sisu (interactive help mode) help prompt, from which help on each keyword can be obtained. alternatively typing #{@cX.orange}sisu --help#{@cX.off} #{@cX.green}[keyword]#{@cX.off} at the command prompt will provide the sisu help page requested and return to the command prompt (if nothing is found it will print this page and return to the command prompt) @@ -184,6 +186,8 @@ alternatively typing #{@cX.orange}sisu --help#{@cX.off} #{@cX.green}[keyword]#{@ ------------------------------------------ SiSU's License #{@cX.green}license#{@cX.off} sisu --help license + +for help type 'sisu --help', 'sisu --help [help request]', 'man sisu', (or see the system or online documentation) WOK # #{@cX.cyan}sisu_convert#{@cX.off} program for initial (very basic and partial) conversion to sisu file format (html and word97 supported) end @@ -1002,8 +1006,18 @@ WOK else "bin: #{@cX.brown}#{bin}#{@cX.off} rc: #{@cX.brown}#{rc}#{@cX.off}" end end + def sisu_version + version=SiSU_Env::Info_version.new.get_version + rb_ver=SiSU_Env::Info_version.new.rbversion + if version[:version] + tell=SiSU_Screen::Ansi.new('-v',version[:project],version[:version],version[:date_stamp],version[:date],rb_ver) + tell.version + else puts 'SiSU version information not available' + end + end def environment cf_defaults=SiSU_Env::Info_processing_flag.new + sisu_version x =< Date: Wed, 26 Sep 2007 15:57:23 +0100 Subject: dal, make metaverse heading :A (represented internally as 1~) easily distinguishable, (tagged 1~meta) --- lib/sisu/v0/dal.rb | 2 +- lib/sisu/v0/html.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/dal.rb b/lib/sisu/v0/dal.rb index f5da8b05..270c46b2 100644 --- a/lib/sisu/v0/dal.rb +++ b/lib/sisu/v0/dal.rb @@ -827,7 +827,7 @@ module SiSU_DAL ocnm=ocnd=ocnv=0 ocnm+=1 header0='<:pn>' - header1="\n1~ Document Information (metadata) <~0;0:0;m#{ocnm}>" + header1="\n1~meta Document Information (metadata) <~0;0:0;m#{ocnm}>" ocnm+=1 header4="\n4~metadata Metadata <~0;m#{ocnm};m#{ocnm}>" ocnm+=1; ocnd+=1 diff --git a/lib/sisu/v0/html.rb b/lib/sisu/v0/html.rb index b23a24b9..bdfd98ee 100644 --- a/lib/sisu/v0/html.rb +++ b/lib/sisu/v0/html.rb @@ -108,7 +108,7 @@ module SiSU_HTML links_guide=SiSU_HTML::Source::Links_guide.new(data,@md).toc data=@tuned_file_array scr_toc=SiSU_HTML::Source::Scroll_head_and_segtoc.new(data,@md,toc,links_guide).in_common #watch - SiSU_HTML::Source::Seg.new(data,@md).songsheet #if not_scroll_only + SiSU_HTML::Source::Seg.new(data,@md).songsheet data=@tuned_file_array scr=SiSU_HTML::Source::Scroll.new(data,@md).songsheet scroll=SiSU_HTML::Source::Scroll_output.new(scr_toc,scr[:body],scr_endnotes,scr[:metadata],scr[:owner_details],scr[:tails],@md).publish -- cgit v1.2.3 From 9f52af3dea138d68be8aca871e3ea7bea0a4998a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 26 Sep 2007 15:59:49 +0100 Subject: segmented html fix for batch processing placement of heading :A-:C footnotes in first segment --- lib/sisu/v0/html_segments.rb | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v0/html_segments.rb b/lib/sisu/v0/html_segments.rb index 7c97925e..fe2966df 100644 --- a/lib/sisu/v0/html_segments.rb +++ b/lib/sisu/v0/html_segments.rb @@ -70,6 +70,7 @@ module SiSU_HTML_seg @@tablehead,@@number_of_cols=0,0 @@flag_group=false @@dp,@@segtocband=nil,nil + @@fns_previous='' attr_reader :seg_name_html,:seg_name_html_tracker def initialize(data='',md='') @data,@md=data,md @@ -396,18 +397,24 @@ module SiSU_HTML_seg @@seg_endnotes[@@fn]=[] @@seg_endnotes[@@fn] << @@seg_endnotes_array @@seg_endnotes_array=[] if para=~/^4~/ + @@fns_previous=@md.fns if para=~/^1~meta/ end - end - if para =~/^4~/ #% EXTRACTION OF SUB-TOCs - @@seg_subtoc[@@fn]=@@seg_subtoc_array - @@seg_subtoc_array=[] - end - if para =~/^4~/ #% SEGMENT NAME, after EXTRACTION OF ENDNOTES & SUB-TOCs - m=para[/^4~(\S+).+?<~(\d+);(?:[oh]|4:)\d+;\w\d+><#@dp:#@dp>$/] - if m; @@fn,@@to_lev4=$1,$2 if m # changed 2004w07 #endnotes and sub-tocs - else - m=para[/^4~(\S+)/] - @@fn,@@to_lev4=$1,'nonum' if m # changed 2005w13 + if para =~/^4~/ #% EXTRACTION OF SUB-TOCs + @@seg_subtoc[@@fn]=@@seg_subtoc_array + @@seg_subtoc_array=[] + end + if para =~/^4~/ #% SEGMENT NAME, after EXTRACTION OF ENDNOTES & SUB-TOCs + if para !~/^4~metadata/ + m=para[/^4~(\S+).+?<~(\d+);(?:[oh]|4:)\d+;\w\d+><#@dp:#@dp>$/] + end + if m; @@fn,@@to_lev4=$1,$2 if m # changed 2004w07 #endnotes and sub-tocs + else + if para !~/^4~metadata/ + m=para[/^4~(\S+)/] + @@fn,@@to_lev4=$1,'nonum' if m # changed 2005w13 + else @@fn='' + end + end end end if para =~/^[56]~\S*\s+(.+)?<~(\d+);(?:h|[56]:)\d+;\w\d+><#@dp:#@dp>$/ -- cgit v1.2.3