From 6be61200c529f7f61a89aac6158eb63026d7a44b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 15 Jun 2007 12:05:07 +0100 Subject: cgi search script fix, related to highlighting matches, changelog update, rest removal of hanging whitespace --- data/doc/sisu/CHANGELOG | 35 +++++++++-- .../dfsg/_sisu/skin/dir/skin_sisu.rb | 8 +-- .../dfsg/_sisu/skin/doc/skin_gnu.rb | 4 +- .../dfsg/_sisu/skin/doc/skin_gutenberg.rb | 4 +- .../dfsg/_sisu/skin/doc/skin_kdissert.rb | 4 +- .../dfsg/_sisu/skin/doc/skin_rms.rb | 8 +-- .../dfsg/_sisu/skin/site/skin_sisu.rb | 8 +-- .../dfsg/_sisu/skin/yml/skin_countries.yml | 2 +- .../dfsg/_sisu/skin/yml/skin_country.yml | 2 +- .../dfsg/sisu_output_overview.ssi | 2 +- data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi | 72 +++++++++++----------- data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi | 72 +++++++++++----------- data/sisu/conf/ruby/irbrc | 2 +- data/sisu/conf/syntax/README | 14 ++--- data/sisu/conf/syntax/diakonos.conf | 4 +- data/sisu/conf/syntax/nanorc | 2 +- data/sisu/conf/syntax/sisu-mode.el | 22 +++---- data/sisu/conf/syntax/sisu.lang | 6 +- data/sisu/conf/syntax/sisu.xml | 2 +- data/sisu/conf/syntax/sisu_nedit.pats | 2 +- data/sisu/conf/vim/addons/ftplugin/sisu.vim | 8 +-- 21 files changed, 155 insertions(+), 128 deletions(-) (limited to 'data') diff --git a/data/doc/sisu/CHANGELOG b/data/doc/sisu/CHANGELOG index 81193a07..2808c231 100644 --- a/data/doc/sisu/CHANGELOG +++ b/data/doc/sisu/CHANGELOG @@ -6,11 +6,38 @@ Reverse Chronological: %% STABLE MANIFEST +%% sisu_0.54.0.orig.tar.gz (2007-06-14::24/4) +http://www.jus.uio.no/sisu/pkg/src/sisu_0.54.0.orig.tar.gz + sisu_0.54.0.orig.tar.gz + sisu_0.54.0-1.dsc + sisu_0.54.0-1.diff.gz + + * indent levels (1-9) added [previously two levels] done for plaintext, html, + xml, odf, latex/pdf [minor syntax addition (_3 - _9), version number + change] + + * bullet indent levels (1-9) added [previously two levels] done for + plaintext, html, odf, latex/pdf [minor syntax addition (_3* - _9*), version + number change] + + * url decoration, open close, default angle brackets + + * fixes, some line-breaking for plaintext (and text groups for) odf and xml + + * css, modifications for extended indents in html and xml [sisu -CC (for + update)] + + * vim syntax highlighter updated to take account of extended indent range + + * rant installer minor changes for future ruby + + * conversion script in data/sisu/conf/convert/sisu_convert + %% sisu_0.53.0.orig.tar.gz (2007-06-02::22/6) http://www.jus.uio.no/sisu/pkg/src/sisu_0.53.0.orig.tar.gz - sisu_0.53.0.orig.tar.gz - sisu_0.53.0-1.dsc - sisu_0.53.0-1.diff.gz + b8f28c2cade1f95956f5cdaef7af7fbd 1254059 sisu_0.53.0.orig.tar.gz + 2a741d1fbe95f25a06b6d10ee709514a 606 sisu_0.53.0-1.dsc + 65b8d4638cb0df8a8d8bcd33e20482b4 182847 sisu_0.53.0-1.diff.gz * housekeeping, internal program adjustments (i.e. unrelated to output) * lib, moved lib base to v0 branch (major version preceded by a v), [from @@ -23,7 +50,7 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_0.53.0.orig.tar.gz * Note: dcc, several hash values change. - * moved to git for scm including git-buildpackage + * moved to git for scm including git-buildpackage (from a combination of mercurial and dars + darcs-buildpackage, [don't ask, it served me quite well though]) diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/dir/skin_sisu.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/dir/skin_sisu.rb index 66786cea..3e27c1d2 100644 --- a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/dir/skin_sisu.rb +++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/dir/skin_sisu.rb @@ -3,7 +3,7 @@ * Author: Ralph@Amissah.com * http://www.jus.uio.no/sisu * http://www.jus.uio.no/sisu/SiSU/download - * Description: Document skin for SiSU descriptive pages, ... + * Description: Document skin for SiSU descriptive pages, ... * License: Same as SiSU see http://www.jus.uio.no/sisu * Notes: Site default appearance variables set in defaults.rb Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb @@ -35,7 +35,7 @@ module SiSU_Viz end def url_site # used in pdf header #puts "#{__LINE__} #{__FILE__}" - 'http://www.jus.uio.no/sisu' + 'http://www.jus.uio.no/sisu' end def url_txt # text to go with url usually stripped url #puts "#{__LINE__} #{__FILE__}" @@ -50,7 +50,7 @@ module SiSU_Viz #end #% color def color_band1 - '"#ffffff"' + '"#ffffff"' end def color_band2 '"#ffffff"' @@ -60,7 +60,7 @@ module SiSU_Viz ' SiSU' end def text_home - 'SiSU' + 'SiSU' end #% icon def icon_home_button diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gnu.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gnu.rb index 50516f85..9f12228f 100644 --- a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gnu.rb +++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gnu.rb @@ -42,14 +42,14 @@ module SiSU_Viz end # color def color_band1 - '"#000070"' + '"#000070"' end #% txt def txt_hp 'Free Software Foundation' end def txt_home # this should be the name of the site eg. Lex Mercatoria or if you prefer to see a url the url in text form copy & ... - #"www.jus.uio.no/sisu/" + #"www.jus.uio.no/sisu/" 'Free Software Foundation' end #% icon diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gutenberg.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gutenberg.rb index 0df9c7ff..261f924a 100644 --- a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gutenberg.rb +++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_gutenberg.rb @@ -3,7 +3,7 @@ * Author: Ralph Amissah * http://www.jus.uio.no/sisu * http://www.jus.uio.no/sisu/SiSU/download - * Description: Document skin sample prepared for Gutenberg Project (first used with "War and Peace") + * Description: Document skin sample prepared for Gutenberg Project (first used with "War and Peace") * License: Same as SiSU see http://www.jus.uio.no/sisu * Notes: Site default appearance variables set in defaults.rb Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb @@ -13,7 +13,7 @@ module SiSU_Viz class Skin #% path def path_root # the only parameter that cannot be changed here - './sisu/' + './sisu/' end def path_rel '../' diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_kdissert.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_kdissert.rb index 87d371f2..3d8c0485 100644 --- a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_kdissert.rb +++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_kdissert.rb @@ -37,14 +37,14 @@ module SiSU_Viz end #% color def color_band1 - '"#ffffff"' + '"#ffffff"' end #% txt def txt_hp 'Kdissert, Document Mapping' end def txt_home # this should be the name of the site eg. Lex Mercatoria or if you prefer to see a url the url in text form copy & ... - #"www.jus.uio.no/sisu/" + #"www.jus.uio.no/sisu/" 'SiSU (document prepared using Kdissert)' end #% icon diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_rms.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_rms.rb index 2ec6c841..2a87c3a5 100644 --- a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_rms.rb +++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/doc/skin_rms.rb @@ -3,7 +3,7 @@ * Author: Ralph Amissah * http://www.jus.uio.no/sisu * http://www.jus.uio.no/sisu/SiSU/download - * Description: Document skin used for Free as in Freedom + * Description: Document skin used for Free as in Freedom * License: Same as SiSU see http://www.jus.uio.no/sisu * Notes: Site default appearance variables set in defaults.rb Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb @@ -45,15 +45,15 @@ module SiSU_Viz #end #% color def color_band1 - '"#cccccc"' - #'"#000070"' + '"#cccccc"' + #'"#000070"' end #% txt def txt_hp 'Free as in Freedom' end def txt_home # this should be the name of the site eg. Lex Mercatoria or if you prefer to see a url the url in text form copy & ... - #"www.jus.uio.no/sisu/" + #"www.jus.uio.no/sisu/" 'Free as in Freedom' end #% icon diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/site/skin_sisu.rb b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/site/skin_sisu.rb index 66786cea..3e27c1d2 100644 --- a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/site/skin_sisu.rb +++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/site/skin_sisu.rb @@ -3,7 +3,7 @@ * Author: Ralph@Amissah.com * http://www.jus.uio.no/sisu * http://www.jus.uio.no/sisu/SiSU/download - * Description: Document skin for SiSU descriptive pages, ... + * Description: Document skin for SiSU descriptive pages, ... * License: Same as SiSU see http://www.jus.uio.no/sisu * Notes: Site default appearance variables set in defaults.rb Generic site wide modifications set here scribe_skin.rb, and this file required by other "scribes" instead of defaults.rb @@ -35,7 +35,7 @@ module SiSU_Viz end def url_site # used in pdf header #puts "#{__LINE__} #{__FILE__}" - 'http://www.jus.uio.no/sisu' + 'http://www.jus.uio.no/sisu' end def url_txt # text to go with url usually stripped url #puts "#{__LINE__} #{__FILE__}" @@ -50,7 +50,7 @@ module SiSU_Viz #end #% color def color_band1 - '"#ffffff"' + '"#ffffff"' end def color_band2 '"#ffffff"' @@ -60,7 +60,7 @@ module SiSU_Viz ' SiSU' end def text_home - 'SiSU' + 'SiSU' end #% icon def icon_home_button diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_countries.yml b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_countries.yml index a68903e1..179b9978 100644 --- a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_countries.yml +++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_countries.yml @@ -1,4 +1,4 @@ -# arch-tag: yaml country list +# arch-tag: yaml country list # Author: Ralph@Amissah.com # License: Same as SiSU see http://www.jus.uio.no/sisu id: AF diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_country.yml b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_country.yml index ebaf8ace..dc835465 100644 --- a/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_country.yml +++ b/data/doc/sisu/sisu_markup_samples/dfsg/_sisu/skin/yml/skin_country.yml @@ -1,4 +1,4 @@ -# arch-tag: yaml country list array +# arch-tag: yaml country list array # Author: Ralph@Amissah.com # License: Same as SiSU see http://www.jus.uio.no/sisu - diff --git a/data/doc/sisu/sisu_markup_samples/dfsg/sisu_output_overview.ssi b/data/doc/sisu/sisu_markup_samples/dfsg/sisu_output_overview.ssi index 4cc32196..e2c90529 100644 --- a/data/doc/sisu/sisu_markup_samples/dfsg/sisu_output_overview.ssi +++ b/data/doc/sisu/sisu_markup_samples/dfsg/sisu_output_overview.ssi @@ -49,7 +49,7 @@ group{ Done * yes/done . partial - + - not available/appropriate Not Done diff --git a/data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi b/data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi index 0d2ed982..6ac1bac4 100644 --- a/data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi +++ b/data/sisu/conf/cgi-bin/sisu_search_pgsql.cgi @@ -1,6 +1,6 @@ #!/usr/bin/env ruby =begin - * Name: SiSU information Structuring Universe + * Name: SiSU information Structuring Universe * Author: Ralph Amissah * http://www.jus.uio.no/sisu * http://www.jus.uio.no/sisu/SiSU/download @@ -39,11 +39,11 @@ SiSU was first released to the public on January 4th 2005 SiSU uses: - + * Standard SiSU markup syntax, * Standard SiSU meta-markup syntax, and the * Standard SiSU object citation numbering and system - + © Ralph Amissah 1997, current 2006. All Rights Reserved. @@ -69,7 +69,7 @@ class Form @base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_searched,@checked_url,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_ignore,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can @tip=if checked_tip =~/\S/ 'text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; ' - else '' + else '' end end def submission_form @@ -101,7 +101,7 @@ class Form #@tip - + echo searched @@ -335,10 +335,10 @@ class Dbi_search_statement %{SELECT metadata.title, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE (#@search_endnotes) AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, endnotes.nr ;} end def sql_select_body_format - %{#{sql_select_body}} + %{#{sql_select_body}} end def sql_select_endnotes_format - %{#{sql_select_endnotes}} + %{#{sql_select_endnotes}} end def contents @conn.select_all(sql_select_body) @@ -670,8 +670,8 @@ FCGI.each_cgi do |cgi| @search=Hash.new @search[:text],@search[:endnotes]=Array.new,Array.new q=CGI.new - @db=if cgi['db'] =~/\S+/: - @stub=/SiSU_(\S+)/.match(cgi['db'])[1] + @db=if cgi['db'] =~/\S+/: + @stub=/SiSU_(\S+)/.match(cgi['db'])[1] cgi['db'] else @stub='sisu' @@ -681,17 +681,17 @@ FCGI.each_cgi do |cgi| if cgi['view']=~/text/: checked_index,checked_text='','checked' else checked_index,checked_text='checked','' end - checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1 - checked_searched='checked' if cgi['searched'] =~/\S/ - checked_tip='checked' if cgi['tip'] =~/\S/ - checked_echo='checked' if cgi['echo'] =~/\S/ - checked_sql='checked' if cgi['sql'] =~/\S/ - if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1 + checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1 + checked_searched='checked' if cgi['searched'] =~/\S/ + checked_tip='checked' if cgi['tip'] =~/\S/ + checked_echo='checked' if cgi['echo'] =~/\S/ + checked_sql='checked' if cgi['sql'] =~/\S/ + if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1 checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='checked' - checked_none='' - elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0 + checked_none='' + elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0 checked_none='checked' - checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='' + checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='' else checked_ignore='checked' end selected_db=case cgi['db'] @@ -699,7 +699,7 @@ FCGI.each_cgi do |cgi| when /SiSU_sisu/: '' end dbi="dbi:Pg:database=#{@db};port=5432" - @conn=DBI.connect(dbi,user) + @conn=DBI.connect(dbi,user) search_field=cgi['find'] if cgi['find'] # =~/\S+/ @search_for=Search_request.new(search_field,q) #.analyze #% search_for #% searches @@ -731,7 +731,7 @@ FCGI.each_cgi do |cgi| canned_search_url=if checked_all =~/checked/ "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}&db=#{cgi['db']}&view=#{cgi['view']}&a=1" else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}&db=#{cgi['db']}&view=#{cgi['view']}&u=1&e=1" - end + end @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1 @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1 canned_note='previous search url:' @@ -750,7 +750,7 @@ FCGI.each_cgi do |cgi| af.gsub!(/%2B/,' ') analyze_format=af st=af.split(/\s*;\s*/) - search_field=st.join("\n") + search_field=st.join("\n") end green=%{} the_can=%{#{canned_note}
#{canned_search_url}

} @@ -786,7 +786,7 @@ WOK #dbi_canning @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can).submission_form #% form @tail=Tail.new.tail - unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/ + unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/ print "Content-type: text/html\n\n" puts (@header+@tail) else #% searches @@ -805,7 +805,7 @@ WOK @body_main=Array.new @endnotes=Array.new oldtid=0 - if @text_search_flag + if @text_search_flag if checked_sql =~/\S/ sql_select_body=dbi_statement.sql_select_body_format sql_select_endnotes=dbi_statement.sql_select_endnotes_format @@ -822,14 +822,14 @@ WOK #metadata_found_body if c["tid"].to_i != oldtid.to_i title=%{#{c["title"]} by #{c["creator"]} pdf portraitpdf landscape
} if file_suffix=~/s/ #hmm watch file_suffix - if @text_search_flag: title='

'+title - else title='
'+title + if @text_search_flag: title='

'+title + else title='
'+title end @counter_txt_doc+=1 oldtid=c["tid"].to_i else title='' end - if @text_search_flag + if @text_search_flag if cgi['view']=~/text/ #% txt body text=if c["suffix"] !~/1/ #seg if @search_for.text1 =~/\S+/ or q['s1'] =~/\S+/ #% only this branch is working !! @@ -848,22 +848,22 @@ WOK @search_regx=search_regex.to_s end matched_para=c["body"].gsub(/(#@search_regx)/i,%{\\1}) - %{

ocn #{c["ocn"]}:

#{matched_para}} + %{

ocn #{c["ocn"]}:

#{matched_para}} elsif c["suffix"] =~/1/ #doc %{#{title}

ocn #{c["ocn"]}:#{c["body"]}} end @counter_txt_ocn+=1 output=if c["seg"] =~/\S+/: title+text - else text + else text end elsif cgi['view']=~/index/ #% idx body if c["suffix"] !~/1/ #seg - index=%{#{c["ocn"]}, } if @text_search_flag + index=%{#{c["ocn"]}, } if @text_search_flag elsif c["suffix"] =~/1/ #doc - index=%{#{c["ocn"]}, } + index=%{#{c["ocn"]}, } end - if c["seg"] =~/\S+/ - if @text_search_flag + if c["seg"] =~/\S+/ + if @text_search_flag @counter_txt_ocn+=1 output=title+index end @@ -874,8 +874,8 @@ WOK end end end - else output=title - end + else output=title + end @counters_txt=if @counter_txt_doc > 0 %{Found in the main body of #@counter_txt_doc documents, and at #@counter_txt_ocn locations within.
} else '' @@ -889,7 +889,7 @@ WOK file_suffix=e["filename"][/.+?\.(ss[ftms])/, 1] #metadata_found_endnotes if @text_search_flag - if e["metadata_tid"].to_i != oldtid.to_i + if e["metadata_tid"].to_i != oldtid.to_i title=%{


#{e["title"]} by #{e["creator"]} pdf portraitpdf landscape
} if file_suffix=~/s/ @counter_endn_doc+=1 oldtid=e["metadata_tid"].to_i @@ -898,7 +898,7 @@ WOK if cgi['view']=~/text/ #% txt endnotes @counter_endn_ocn+=1 matched_endnote=e["body"].gsub(/(#@search_regx)/i,%{\\1}) - output=%{#{title}
note #{e["nr"]} referred to from ocn #{e["ocn"]}: #{matched_endnote}} + output=%{#{title}
note #{e["nr"]} referred to from ocn #{e["ocn"]}: #{matched_endnote}} elsif cgi['view']=~/index/ #% idx endnotes @counter_endn_ocn+=1 output=%{#{title}#{e["nr"]}#{e["ocn"]}], } diff --git a/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi b/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi index f4c5382a..5bef900e 100644 --- a/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi +++ b/data/sisu/conf/cgi-bin/sisu_search_sqlite.cgi @@ -1,6 +1,6 @@ #!/usr/bin/env ruby =begin - * Name: SiSU information Structuring Universe + * Name: SiSU information Structuring Universe * Author: Ralph Amissah * http://www.jus.uio.no/sisu * http://www.jus.uio.no/sisu/SiSU/download @@ -39,11 +39,11 @@ SiSU was first released to the public on January 4th 2005 SiSU uses: - + * Standard SiSU markup syntax, * Standard SiSU meta-markup syntax, and the * Standard SiSU object citation numbering and system - + © Ralph Amissah 1997, current 2006. All Rights Reserved. @@ -68,7 +68,7 @@ class Form @base,@search_field,@selected_db,@checked_index,@checked_text,@checked_tip,@checked_searched,@checked_url,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_ignore,@search_note,@the_can=base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can @tip=if checked_tip =~/\S/ 'text:__; keywords:__; title:__; author:__; subject:__; description:__; publisher:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; ' - else '' + else '' end end def submission_form @@ -105,7 +105,7 @@ class Form #@tip - + echo searched @@ -339,10 +339,10 @@ class Dbi_search_statement %{SELECT metadata.title, metadata.creator, metadata.filename, endnotes.body, endnotes.nr, endnotes.ocn, endnotes.metadata_tid FROM metadata, endnotes WHERE #{@search_endnotes} AND metadata.tid = endnotes.metadata_tid ORDER BY metadata.title, endnotes.nr ;} end def sql_select_body_format - %{#{sql_select_body}} + %{#{sql_select_body}} end def sql_select_endnotes_format - %{#{sql_select_endnotes}} + %{#{sql_select_endnotes}} end def contents @conn.select_all(sql_select_body) @@ -674,8 +674,8 @@ FCGI.each_cgi do |cgi| @search=Hash.new @search[:text],@search[:endnotes]=Array.new,Array.new q=CGI.new - @db=if cgi['db'] =~/\S+/: - @stub=/SiSU_(\S+)/.match(cgi['db'])[1] + @db=if cgi['db'] =~/\S+/: + @stub=/SiSU_(\S+)/.match(cgi['db'])[1] cgi['db'] else @stub='sisu' @@ -685,17 +685,17 @@ FCGI.each_cgi do |cgi| if cgi['view']=~/text/: checked_index,checked_text='','checked' else checked_index,checked_text='checked','' end - checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1 - checked_searched='checked' if cgi['searched'] =~/\S/ - checked_tip='checked' if cgi['tip'] =~/\S/ - checked_echo='checked' if cgi['echo'] =~/\S/ - checked_sql='checked' if cgi['sql'] =~/\S/ - if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1 + checked_url='checked' if cgi['url'] =~/\S/ or cgi['u'].to_i==1 + checked_searched='checked' if cgi['searched'] =~/\S/ + checked_tip='checked' if cgi['tip'] =~/\S/ + checked_echo='checked' if cgi['echo'] =~/\S/ + checked_sql='checked' if cgi['sql'] =~/\S/ + if cgi['checks'] =~/check_all/ or cgi['check_all'] =~/\S/ or cgi['a'].to_i==1 checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='checked' - checked_none='' - elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0 + checked_none='' + elsif cgi['checks'] =~/check_none/ #or cgi['a'].to_i==0 checked_none='checked' - checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='' + checked_all=checked_url=checked_searched=checked_tip=checked_echo=checked_sql='' else checked_ignore='checked' end selected_db=case cgi['db'] @@ -708,7 +708,7 @@ FCGI.each_cgi do |cgi| when /SiSU_sisu/: "/home/ralph/sisu_www/sisu/sisu_sqlite.db" end @dbi="DBI:SQLite:#{db_sqlite}" #sqlite3 ? - @conn=DBI.connect(@dbi) + @conn=DBI.connect(@dbi) search_field=cgi['find'] if cgi['find'] # =~/\S+/ @search_for=Search_request.new(search_field,q) #.analyze #% search_for #% searches @@ -740,7 +740,7 @@ FCGI.each_cgi do |cgi| canned_search_url=if checked_all =~/checked/ "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}&db=#{cgi['db']}&view=#{cgi['view']}&a=1" else "#@base?#{s1}#{key}#{ti}#{au}#{sj}#{dsc}#{pb}#{cntr}#{dt}#{ty}#{id}#{src}#{lang}#{rel}#{cov}#{cr}#{co}#{ab}#{dtc}#{dti}#{dtm}#{dta}#{dtv}&db=#{cgi['db']}&view=#{cgi['view']}&u=1&e=1" - end + end @search[:text][1]=%{documents.clean~'#{@search_for.text1}'} #s1 @search[:endnotes][1]=%{endnotes.clean~'#{@search_for.text1}'} #s1 canned_note='previous search url:' @@ -759,7 +759,7 @@ FCGI.each_cgi do |cgi| af.gsub!(/%2B/,' ') analyze_format=af st=af.split(/\s*;\s*/) - search_field=st.join("\n") + search_field=st.join("\n") end green=%{} the_can=%{#{canned_note}
#{canned_search_url}

} @@ -795,7 +795,7 @@ WOK #dbi_canning @header=Form.new(@base,search_field,selected_db,checked_index,checked_text,checked_tip,checked_searched,checked_url,checked_echo,checked_sql,checked_all,checked_none,checked_ignore,search_note,the_can).submission_form #% form @tail=Tail.new.tail - unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/ + unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/ print "Content-type: text/html\n\n" puts (@header+@tail) else #% searches @@ -814,7 +814,7 @@ WOK @body_main=Array.new @endnotes=Array.new oldtid=0 - if @text_search_flag + if @text_search_flag if checked_sql =~/\S/ sql_select_body=dbi_statement.sql_select_body_format sql_select_endnotes=dbi_statement.sql_select_endnotes_format @@ -831,14 +831,14 @@ WOK #metadata_found_body if c["tid"].to_i != oldtid.to_i title=%{#{c["title"]} by #{c["creator"]} pdf portraitpdf landscape
} if file_suffix=~/s/ #hmm watch file_suffix - if @text_search_flag: title='

'+title - else title='
'+title + if @text_search_flag: title='

'+title + else title='
'+title end @counter_txt_doc+=1 oldtid=c["tid"].to_i else title='' end - if @text_search_flag + if @text_search_flag if cgi['view']=~/text/ #% txt body text=if c["suffix"] !~/1/ #seg if @search_for.text1 =~/\S+/ or q['s1'] =~/\S+/ #% only this branch is working !! @@ -857,22 +857,22 @@ WOK @search_regx=search_regex.to_s end matched_para=c["body"].gsub(/(#@search_regx)/i,%{\\1}) - %{

ocn #{c["ocn"]}:

#{matched_para}} + %{

ocn #{c["ocn"]}:

#{matched_para}} elsif c["suffix"] =~/1/ #doc %{#{title}

ocn #{c["ocn"]}:#{c["body"]}} end @counter_txt_ocn+=1 output=if c["seg"] =~/\S+/: title+text - else text + else text end elsif cgi['view']=~/index/ #% idx body if c["suffix"] !~/1/ #seg - index=%{#{c["ocn"]}, } if @text_search_flag + index=%{#{c["ocn"]}, } if @text_search_flag elsif c["suffix"] =~/1/ #doc - index=%{#{c["ocn"]}, } + index=%{#{c["ocn"]}, } end - if c["seg"] =~/\S+/ - if @text_search_flag + if c["seg"] =~/\S+/ + if @text_search_flag @counter_txt_ocn+=1 output=title+index end @@ -883,8 +883,8 @@ WOK end end end - else output=title - end + else output=title + end @counters_txt=if @counter_txt_doc > 0 %{Found in the main body of #@counter_txt_doc documents, and at #@counter_txt_ocn locations within.
} else '' @@ -898,7 +898,7 @@ WOK file_suffix=e["filename"][/.+?\.(ss[ftm])/, 1] #metadata_found_endnotes if @text_search_flag - if e["metadata_tid"].to_i != oldtid.to_i + if e["metadata_tid"].to_i != oldtid.to_i title=%{


#{e["title"]} by #{e["creator"]} pdf portraitpdf landscape
} if file_suffix=~/s/ @counter_endn_doc+=1 oldtid=e["metadata_tid"].to_i @@ -907,7 +907,7 @@ WOK if cgi['view']=~/text/ #% txt endnotes @counter_endn_ocn+=1 matched_endnote=e["body"].gsub(/(#@search_regx)/i,%{\\1}) - output=%{#{title}
note #{e["nr"]} referred to from ocn #{e["ocn"]}: #{matched_endnote}} + output=%{#{title}
note #{e["nr"]} referred to from ocn #{e["ocn"]}: #{matched_endnote}} elsif cgi['view']=~/index/ #% idx endnotes @counter_endn_ocn+=1 output=%{#{title}#{e["nr"]}#{e["ocn"]}], } diff --git a/data/sisu/conf/ruby/irbrc b/data/sisu/conf/ruby/irbrc index b585faf6..cceffdfc 100644 --- a/data/sisu/conf/ruby/irbrc +++ b/data/sisu/conf/ruby/irbrc @@ -1,7 +1,7 @@ require 'irb/completion' IRB.conf[:use_readline] = true IRB.conf[:PROMPT_MODE] = :XMP -#IRB.conf[:PROMPT] = +#IRB.conf[:PROMPT] = #simple-prompt def ri arg puts `ri #{arg}` diff --git a/data/sisu/conf/syntax/README b/data/sisu/conf/syntax/README index 04c0ea09..82d5ff67 100644 --- a/data/sisu/conf/syntax/README +++ b/data/sisu/conf/syntax/README @@ -75,18 +75,18 @@ contains rudimentary sisu syntax highlighting files for: some error checking * comments: this editor features display line wrap -NOTE: +NOTE: -[SiSU parses files with long lines or line breaks, -but, display linewrap (without line-breaks) is a +[SiSU parses files with long lines or line breaks, +but, display linewrap (without line-breaks) is a convenient editor feature to have for sisu markup] kde-config --prefix -KDEDIR/share/apps/katepart/syntax/ +KDEDIR/share/apps/katepart/syntax/ KDEHOME/share/apps/katepart/syntax -[In the configure dialog in kate, go to the "Editor->highlighting" page and ->select a highlight to change the mimetype/pattern associations for it.] +[In the configure dialog in kate, go to the "Editor->highlighting" page and +>select a highlight to change the mimetype/pattern associations for it.] /etc/mime.types /usr/share/mime/text -# +# # * aeditor (an editor written in ruby) diff --git a/data/sisu/conf/syntax/diakonos.conf b/data/sisu/conf/syntax/diakonos.conf index 212ed5b8..f40547bc 100644 --- a/data/sisu/conf/syntax/diakonos.conf +++ b/data/sisu/conf/syntax/diakonos.conf @@ -30,7 +30,7 @@ bol_behaviour alternating-first-char eof_newline false # Specifies whether the cursor should be at the end (false) of found text, or the -# beginning (true). +# beginning (true). found_cursor_start false max_clips 30 @@ -920,7 +920,7 @@ lang.yaml.indent.ignore ^\s*$ #% SiSU lang.sisu.filemask \.(?:sst|ssm|ssi|[_-]sst)$ -lang.sisu.format.default white +lang.sisu.format.default white lang.sisu.tokens.comment ^%+\s+.* lang.sisu.tokens.comment.format 8 #langsisu.tokens.comments.format 8 bold diff --git a/data/sisu/conf/syntax/nanorc b/data/sisu/conf/syntax/nanorc index 82183131..213a0c26 100644 --- a/data/sisu/conf/syntax/nanorc +++ b/data/sisu/conf/syntax/nanorc @@ -165,7 +165,7 @@ ## to set the background color to black or white. ## # syntax "c-file" "\.(c|C|cc|cpp|cxx|h|H|hh|hpp|hxx)$" -# color red "\<[A-Z_]{2,}\>" +# color red "\<[A-Z_]{2,}\>" # color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|signed|unsigned|inline)\>" # color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>" # color brightyellow "\<(for|if|while|do|else|case|default|switch|goto|continue|break|return)\>" diff --git a/data/sisu/conf/syntax/sisu-mode.el b/data/sisu/conf/syntax/sisu-mode.el index 3f56de1c..c12c1a72 100644 --- a/data/sisu/conf/syntax/sisu-mode.el +++ b/data/sisu/conf/syntax/sisu-mode.el @@ -61,13 +61,13 @@ ;; ;; default variables ;; (defvar sisu-mode.el-hook nil) -;; +;; ;; (defvar sisu-mode-map ;; (let ((sisu-mode-map (make-keymap))) ;; (define-key wpdl-mode-map "\C-j" 'newline-and-indent) ;; sisu-mode-map) ;; "Keymap for SiSU major mode") -;; +;; ;; (add-to-list 'auto-mode-alist '("\\.ss[tmi]\\'" . sisu-mode)) (defvar sisu-mode-hook nil) @@ -123,7 +123,7 @@ ; select more appropriate matches )) "Additional Keywords to highlight in SiSU mode") - + (defconst sisu-font-lock-keywords-3 (append sisu-font-lock-keywords-2 (list @@ -133,7 +133,7 @@ (defvar sisu-font-lock-keywords sisu-font-lock-keywords-3 "Default highlighting expressions for SiSU mode") - + (defvar sisu-mode-syntax-table (let ((sisu-mode-syntax-table (make-syntax-table))) (modify-syntax-entry ?_ "w" sisu-mode-syntax-table) @@ -162,7 +162,7 @@ ;; (let ((map (make-sparse-keymap))) ;; ;; insert (define-key map ...) stuff here ;; (setq sisu-mode.el-map map))) -;; +;; ;; syntax highlighting: standard keywords ;; (defconst sisu-font-lock-keywords-1 ;; '( @@ -171,7 +171,7 @@ ;; ;; ("^[ \t]+\\(.*\\)$" 1 font-lock-type-face) ;; ) ;; "Minimal highlighting expressions for SiSU mode.") -;; +;; ;; ;; syntax highlighting: additional keywords ;; (defconst sisu-font-lock-keywords-2 ;; (append sisu-font-lock-keywords-1 @@ -179,7 +179,7 @@ ;; ("%+ \\(.*\\)" 2 font-lock-comment-face) ;; )) ;; "Additional Keywords to highlight in SiSU mode.") -;; +;; ;; ;; syntax highlighting: even more keywords ;; (defconst sisu-font-lock-keywords-3 ;; (append sisu-font-lock-keywords-2 @@ -193,21 +193,21 @@ ;; ("\"\\([^\"]+\\)\"" 0 font-lock-string-face) ;; )) ;; "Balls-out highlighting in SiSU mode.") -;; +;; ;; ;; default level of highlight to maximum ;; (defvar sisu-font-lock-keywords sisu-font-lock-keywords-3 ;; "Default highlighting expressions for SiSU mode") -;; +;; ;; ;; no special indenting, just pure text mode ;; (defun sisu-indent-line () ;; "Indent current line as SiSU code. Does nothing yet." ;; (interactive) ;; ) -;; +;; ;; ;; no special syntax table ;; (defvar sisu-mode.el-syntax-table nil ;; "Syntax table for sisu-mode.el.") -;; +;; ;; ;; create and activate syntax table ;; (defun sisu-create-syntax-table () ;; (if sisu-mode.el-syntax-table diff --git a/data/sisu/conf/syntax/sisu.lang b/data/sisu/conf/syntax/sisu.lang index df126b23..4fcd9b68 100644 --- a/data/sisu/conf/syntax/sisu.lang +++ b/data/sisu/conf/syntax/sisu.lang @@ -2,7 +2,7 @@ @@ -34,11 +34,11 @@ or: [/_,^+-]\{ \}[/_,^+-] - + [*]\S+[*] - + \{[^}]+\}(http:\/\/\S+|image)\s diff --git a/data/sisu/conf/syntax/sisu.xml b/data/sisu/conf/syntax/sisu.xml index d54483ac..9467ec44 100644 --- a/data/sisu/conf/syntax/sisu.xml +++ b/data/sisu/conf/syntax/sisu.xml @@ -147,7 +147,7 @@ - + diff --git a/data/sisu/conf/syntax/sisu_nedit.pats b/data/sisu/conf/syntax/sisu_nedit.pats index 8e12cd5c..e60e0bf0 100644 --- a/data/sisu/conf/syntax/sisu_nedit.pats +++ b/data/sisu/conf/syntax/sisu_nedit.pats @@ -1,4 +1,4 @@ -! Nedit Syntax highlighting patterns and commenting for SiSU +! Nedit Syntax highlighting patterns and commenting for SiSU ! Version 0.1 ! ! INSTALLATION diff --git a/data/sisu/conf/vim/addons/ftplugin/sisu.vim b/data/sisu/conf/vim/addons/ftplugin/sisu.vim index 8526206c..00ed9189 100644 --- a/data/sisu/conf/vim/addons/ftplugin/sisu.vim +++ b/data/sisu/conf/vim/addons/ftplugin/sisu.vim @@ -11,7 +11,7 @@ :endif :autocmd FileType sisu :set nonumber :set encoding=utf-8 fileencodings= -:set ff=unix +:set ff=unix :set autowrite " Automatically save before commands like :next and :make :set nocompatible :set tabstop=2 @@ -54,7 +54,7 @@ "% vimdiff q exits :if &diff : cmap q qa -:endif +:endif "% remapping lines make cursor jump a line at a time within wrapped text :nnoremap j gj :nnoremap k gk @@ -122,7 +122,7 @@ "% foldtype Fold? set foldtext :set foldtext=v:folddashes.substitute(getline(v:foldstart),'\\=','','g',) :set foldexpr=getline(v:lnum-1)!~@/&&getline(v:lnum)!~@/&&getline(v:lnum+1)!~@/ -"% foldsearch t77: Fold on search result +"% foldsearch t77: Fold on search result :function! FoldMake(search) : set fdm=manual : normal zE @@ -169,7 +169,7 @@ : command! F4 FMake ^[1-4]\~ : command! F5 FMake ^[4-5]\~ : command! F6 FMake ^[4-6]\~ -: command! Fc FMake ^[%]\+\s\+ +: command! Fc FMake ^[%]\+\s\+ : endif "% folds Fold Patterns misc ":command! Fp FMake ^\s*[A-Za-z0-9#] -- cgit v1.2.3