diff options
Diffstat (limited to 'lib/sisu/v5/manpage.rb')
-rw-r--r-- | lib/sisu/v5/manpage.rb | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/lib/sisu/v5/manpage.rb b/lib/sisu/v5/manpage.rb index 3e430b55..ccdd829c 100644 --- a/lib/sisu/v5/manpage.rb +++ b/lib/sisu/v5/manpage.rb @@ -61,7 +61,7 @@ =end module SiSU_Manpage - require_relative 'dal' # dal.rb + require_relative 'ao' # ao.rb require_relative 'sysenv' # sysenv.rb include SiSU_Env include SiSU_Param @@ -69,7 +69,7 @@ module SiSU_Manpage require_relative 'manpage_format' # manpage_format.rb include SiSU_ManpageFormat require_relative 'shared_metadata' # shared_metadata.rb - require_relative 'shared_txt' # shared_txt.rb + require_relative 'txt_shared' # txt_shared.rb @@alt_id_count,@@alt_id_count,@@tablehead,@@number_of_cols=0,0,0,0 @@tablefoot='' class Source @@ -100,8 +100,8 @@ module SiSU_Manpage || @opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],@opt.fns,"#{@md.file.output_path.manpage.dir}/#{@md.file.base_filename.manpage}").flow end - @dal_array=SiSU_DAL::Source.new(@opt).get # dal file drawn here - SiSU_Manpage::Source::Scroll.new(@md,@dal_array).songsheet + @ao_array=SiSU_AO::Source.new(@opt).get # ao file drawn here + SiSU_Manpage::Source::Scroll.new(@md,@ao_array).songsheet rescue SiSU_Errors::Rescued.new($!,$@,@opt.cmd,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ @@ -112,7 +112,7 @@ module SiSU_Manpage private class Scroll <Source require_relative 'defaults' # defaults.rb - require_relative 'shared_txt' # shared_txt.rb + require_relative 'txt_shared' # txt_shared.rb include SiSU_TextUtils @@endnotes={ para: [], end: [] } def initialize(md,data) @@ -120,7 +120,6 @@ module SiSU_Manpage @brace_url=SiSU_Viz::Defaults.new.url_decoration @vz=SiSU_Viz::Defaults.new @tab="\t" - @br="\n" @@notes=:end @manpage={ body: [], open: [], close: [], head: [], metadata: [], tail: [], endnotes: [] } end @@ -128,6 +127,9 @@ module SiSU_Manpage manpage=markup(@data) publish(manpage) end + def break_line + "\n" + end # Used for extraction of endnotes from paragraphs def extract_endnotes(dob='') para=dob.obj.gsub(/#{Mx[:br_line]}/,"\n") @@ -176,7 +178,7 @@ GSUB end def manpage_tail @manpage[:tail] <<<<WOK -#{@br} +#{break_line} .TP .SH SEE ALSO sisu(1), @@ -235,21 +237,21 @@ WOK times=wrapped.length times=78 if times > 78 @manpage[:body] << case lv - when 1; '.SH ' << wrapped.upcase << @br << @br - when 2..3; '.SH ' << wrapped.upcase << @br << @br - when 4; '.SH ' << wrapped.upcase << @br << @br - when 5..6; '.SH ' << wrapped.upcase << @br << @br + when 1; '.SH ' << wrapped.upcase << break_line << break_line + when 2..3; '.SH ' << wrapped.upcase << break_line << break_line + when 4; '.SH ' << wrapped.upcase << break_line << break_line + when 5..6; '.SH ' << wrapped.upcase << break_line << break_line end else @manpage[:body] << if wrapped =~/^\.BI\s/ # main text, contents, body KEEP - '.TP' << @br << wrapped.gsub(/(^\.B)I\s/,'\1 ') # sleight ... simpler output (check gsub!) + '.TP' << break_line << wrapped.gsub(/(^\.B)I\s/,'\1 ') # sleight ... simpler output (check gsub!) else - @br + '.BR' + @br << wrapped + break_line + '.BR' + break_line << wrapped end end if @@endnotes[:para] \ and @@notes==:foot #edit out to switch off endnotes following paragraph to which they belong - @@endnotes[:para].each { |e| @manpage[:body] << e << @br } + @@endnotes[:para].each { |e| @manpage[:body] << e << break_line } elsif @@endnotes[:para] \ and @@notes==:end end @@ -349,7 +351,7 @@ WOK manpage_structure(dob) else if dob.obj =~/#{table_message}/ - @manpage[:body] << dob.obj << @br + @manpage[:body] << dob.obj << break_line end end if (dob.obj =~/<a name="n\d+">/ \ |