From 52f8b9c0b1e1606a4260ef2e0df4d525497691b1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 7 Jul 2007 09:21:47 +0100 Subject: cgi-sample search form; texinfo fix; xml scaffold; help, man pages etc. visited; screen output, color set to true; docbook entries removed * cgi generated sample search form * order results on files of the same title, in multiple files (with different filenames) * postgresql, character case sensitivity, control, on/off * tail decoration, gplv3 & sisu info * texinfo/info (pinfo) module starts to do something vaguely useful again [not a much used module, testing required] * print XML rendition of document structure to screen -T * sisurc.yml default, color set to true [apologies if this causes anyone any inconvenience, it is configurable in sisurc.yml] * help, man pages, README (man(8) related and env, 'sisu -V') * docbook entries removed for the present time * sisu-install (install ruby rant script renamed) and permissions set to executable --- lib/sisu/v0/texinfo.rb | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'lib/sisu/v0/texinfo.rb') diff --git a/lib/sisu/v0/texinfo.rb b/lib/sisu/v0/texinfo.rb index 29f31421..88f91d7d 100644 --- a/lib/sisu/v0/texinfo.rb +++ b/lib/sisu/v0/texinfo.rb @@ -87,7 +87,7 @@ module SiSU_TexInfo when /\.[_-]?sst$/ Dir.mkdir(@env.path.output) unless FileTest.directory?("#{@env.path.output}") Dir.mkdir(@env.path.texi) unless FileTest.directory?(@env.path.tex) - @@filename_texinfo=File.new(%{#{@env.path.texi}/#@opt.fnb.texinfo},'w+') + @@filename_texinfo=File.new(%{#{@env.path.texi}/#{@opt.fnb}.texinfo},'w+') end rescue; STDERR.puts SiSU_Screen::Ansi.new(@opt.cmd,$!,$@).rescue ensure @@ -158,13 +158,13 @@ module SiSU_TexInfo @tex_file=[] data=@data data.each do |para| - para.gsub!(/&/,'<=and>') # DEBUG 2003w16 this is a kludge, because i could not get parameters # from param, Sort out ... revert to more elegant solution if para =~ //,'') + para.gsub!(/(^|\s)\{(.+?)\}(http:\/\/\S+)/,'\1(\2 [linked to:] \3)') do_mono=TexInfoFormat::Texinfo.new(para,@md) @tex_file << do_mono.spec_char end @@ -176,8 +176,10 @@ module SiSU_TexInfo @tex_file=[] data.each do |para| # BUG bug -> have problems with endnotes in headers - if para =~ /\\~\\\{\d+\s+/ #if para =~ /\\\}\\~/m,' @footnote{ \2} ') + if para =~ /\\~@\{\d+\s+/ #if para =~ /@\}\\~/m,' @footnote{ \1} ') + elsif para =~ /\\~@\{\*+\s+/ #if para =~ /@\}\\~/m,' @footnote{ \1} ') end @tex_file << para end @@ -226,7 +228,7 @@ module SiSU_TexInfo if @@flag['code']==1 line.gsub!(/^\s*(.+)/m, "\\noindent \\marginpar\[left-text\]{\\begin{tiny}#{@@counting}\\end{tiny}}\\1\\") @@counting+=1 if @@flag['code']==1 - else line.gsub!(/(.+)/m,'\noindent\1\') + else line.gsub!(/(.+)/m,'\noindent\1') end end end @@ -258,7 +260,7 @@ module SiSU_TexInfo toc=TexInfoFormat::Texinfo.new($1,@md) texinfo_menu << toc.menu end - if para =~ /^[4-6]\\+~\S+\s*(.+?)\s*$/ + if para =~ /^[4-6]\\+~(?:\S+)?\s+(.+?)\s*$/ toc=TexInfoFormat::Texinfo.new($1,@md) texinfo_menu << toc.menu case para @@ -270,6 +272,8 @@ module SiSU_TexInfo @subsubmenu[n_menu]=[] @submenu[n_menu] << toc.menu when /^[6]\\+~\S+\s+(.+?)\s*$/ + n_submenu+=1 + @subsubmenu[n_submenu]=[] @subsubmenu[n_submenu] << toc.menu end end @@ -279,7 +283,7 @@ module SiSU_TexInfo @tex_file << texinfo_menu @tex_file << "* Index::\n" + "@end menu\n\n" + - "@c {{{ 5\n\n" + "@c %% 5\n\n" n_menu,n_submenu=0,0 @@do_submenu,@@do_subsubmenu=1,1 data.each do |para| @@ -325,14 +329,13 @@ module SiSU_TexInfo if para !~/\S/ para=nil else - para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>/,'~[\1]') - #para.gsub!(/[1-3]\\\\\{\\\\\{\\\\\{\s+/, '') - #para.gsub!(/[1-3]\\\\\{\s+/, '') + para.gsub!(/<\\~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/,'<\1>') + #para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>/,'<\1>') + #para.gsub!(/<\\~(\d+);\w\d+;\w\d+><#@dp:#@dp>/,'<\1>') para=para end - #para.gsub!(/^\s+$/mi, "") end -#%case with endnotes + #%case with endnotes para.gsub!(/\s*[0-8]\\+(\S+)?\s+/,' ') if para @tex_file << para if para end @@ -397,7 +400,7 @@ module SiSU_TexInfo end def makeinfo if @md.fns =~/\.[_-]?sst$/ - m=/(.+?)\.[_-]?sst$/.match(@md.fns) + m=/(.+?)\.([_-]?sst)$/.match(@md.fns) fnb,sfx=m[1],m[2] pwd=Dir.pwd case sfx -- cgit v1.2.3