diff options
author | Ralph Amissah <ralph@amissah.com> | 2007-10-15 19:27:16 +0100 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2007-10-15 19:27:16 +0100 |
commit | e1ec4bd2dad2bd22ad97cea398ae1cfcfae183a2 (patch) | |
tree | 6ffe3ae1b2453578a032ce053934a31f980645e9 /lib/sisu/v0/manpage.rb | |
parent | regex matching of images, (and rearrangement of conditionals) (diff) |
mostly the arrangement of conditionals
Diffstat (limited to 'lib/sisu/v0/manpage.rb')
-rw-r--r-- | lib/sisu/v0/manpage.rb | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/lib/sisu/v0/manpage.rb b/lib/sisu/v0/manpage.rb index 397b94d8..e747e22a 100644 --- a/lib/sisu/v0/manpage.rb +++ b/lib/sisu/v0/manpage.rb @@ -289,10 +289,12 @@ WOK '.BR' << @br << wrapped # [consider s/.BR/.PP/] end end - if @@endnotes[:para] and @@dostype =~/footnote/ #edit out to switch off endnotes following paragraph to which they belong + if @@endnotes[:para] \ + and @@dostype =~/footnote/ #edit out to switch off endnotes following paragraph to which they belong @manpage[:body] << @br @@endnotes[:para].each { |e| @manpage[:body] << e << @br } - elsif @@endnotes[:para] and @@dostype =~/endnote/ + elsif @@endnotes[:para] \ + and @@dostype =~/endnote/ @manpage[:body] << @br*2 end @@endnotes[:para]=[] @@ -387,7 +389,8 @@ WOK @sto=Split_text_object.new(para).lev_segname_para_ocn ### problem in scroll, it appears tables are getting paragraph numbers m=/<~(\d+);(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - if para =~m and para=~/\S+/ + if para =~m \ + and para=~/\S+/ para=case @sto.format when /^(1)~(?:(\S+))?/ manpage_structure(para,$1,@sto.ocn,$2) @@ -432,11 +435,14 @@ WOK end elsif para =~/#{table_message}/ @manpage[:body] << para << @br - elsif para =~/(Note|Endnotes?)/ and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ - elsif para =~/(MetaData)/ and para =~/<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info ####suspect visit + elsif para =~/(Note|Endnotes?)/ \ + and para !~/<~\d+;(?:\w|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ + elsif para =~/(MetaData)/ \ + and para =~/<~(\d+);[um]\d+;\w\d+><#@dp:#@dp>$/ #debug 2003w46 add rc info ####suspect visit #formatMono=MonoSiSU.new('<br /><a name="metadata">MetaData</a>') #para=formatMono.bold_para - elsif para.include? 'Owner Details' and para !~/<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ + elsif para.include? 'Owner Details' \ + and para !~/<~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+><#@dp:#@dp>$/ #formatMono=MonoSiSU.new('<br /><a name="owner.details">Owner Details</a>') #@@manpage[:owner_details]=formatMono.bold_para #para='' @@ -446,7 +452,10 @@ WOK format_text=Format_text_object.new(one,two) para=format_text.seg_no_paranum end - para='' if (para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/) # -endnote + para='' if (para =~/<a name="n\d+">/ \ + and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/) # -endnote + para='' + end case para when /<:i[1-9]>/ if para =~/.*<:#>.*$/m @@ -501,7 +510,8 @@ WOK filename_manpage=SiSU_Env::SiSU_file.new(@md,@md.fn[:manpage]).mkfile_man @sisu=[] @content.each do |para| # this is a hack - if para.class == Array and para.length > 0 + if para.class == Array \ + and para.length > 0 para.each do |line| line.gsub!(/\s+$/m,'') filename_manpage.puts line #unix manpage |