From 44464e284ee840ee0ef7eae2d3f8d589680b18ca Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 19 Apr 2011 21:37:52 -0400 Subject: v3: param, md remove md.cmd and md.mod shortcut methods, use use md.opt * affects many files that now use @md.opt.cmd & @md.opt.mod (instead of @md.cmd & @md.mod) --- lib/sisu/v3/po4a.rb | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'lib/sisu/v3/po4a.rb') diff --git a/lib/sisu/v3/po4a.rb b/lib/sisu/v3/po4a.rb index ba892634..d65191e0 100644 --- a/lib/sisu/v3/po4a.rb +++ b/lib/sisu/v3/po4a.rb @@ -172,8 +172,8 @@ module SiSU_po4a @brace_url=SiSU_Viz::Skin.new.url_decoration @vz=SiSU_Env::Get_init.instance.skin @tab="\t" - @@endnotes_=(@md.mod.inspect =~/--endnote/) ? true : false # --footnote - @br=(@md.mod.inspect =~/--dos/) ? "\r\n" : "\n" # --unix + @@endnotes_=(@md.opt.mod.inspect =~/--endnote/) ? true : false # --footnote + @br=(@md.opt.mod.inspect =~/--dos/) ? "\r\n" : "\n" # --unix @pot={ body: [], open: [], close: [], head: [], metadata: [], tail: [] } end def songsheet @@ -213,7 +213,7 @@ module SiSU_po4a d="#{nt} #{@fn}" mark="^~ " instruct=s_mark='' - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct=%{\n# footnotes, the preferred sisu markup for a footnote is~{this is a footnote}~ however, for translation a footnote reference marker in the text~^ with a set of notes following the paragraph starting on a newline with "^~ this is a footnote", is easier to deal with, if possible these should be converted back to~{inline notes}~} s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"} end @@ -518,7 +518,7 @@ GSUB mark="#{dob_src.lv}~#{fn} " d="#{dob_src.is} (level #{dob_src.lv})" instruct=s_mark='' - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct=%{\n# markup for headings is marker at the start of the line/object, indicating the heading level, and if provided an associated name tag, this heading is "#{mark}"} s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"} end @@ -546,7 +546,7 @@ GSUB mark="_#{dob_src.indent}* " d="#{dob_src.is}: indent #{dob_src.indent}, bullet" instruct=s_mark='' - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct=%{\n# markup for indented bullet text is at the start of the line/object, an underscore followed by the indent level and an asterisk "#{mark}"} s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"} end @@ -555,7 +555,7 @@ GSUB mark="_#{dob_src.indent} " d="#{dob_src.is}: indent #{dob_src.indent}" instruct=s_mark='' - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct=%{\n# markup for indented text is at the start of the line/object, an underscore followed by the indent level "#{mark}"} s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"} end @@ -570,7 +570,7 @@ GSUB mark='_* ' d="#{dob_src.is}: bullet" instruct=s_mark='' - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct=%{\n# markup for indented text is at the start of the line/object, an underscore followed by an asterisk "#{mark}"} s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"} end @@ -581,7 +581,7 @@ GSUB mark='' d=dob_src.is instruct=%{\n# regular paragraph, no special markup} - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct="\n# " s_mark="\n# " + %{"\\n\\n#{mark}...\\n\\n"} end @@ -607,7 +607,7 @@ GSUB mark="block{\\n\\n...\\n\\n}block" d=dob_src.is instruct=s_mark='' - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct="\n# block text is a text block with an opening and closing marker, the content of which may be wrapped" s_mark="\n# " + %{"\\n\\n#{mark}\\n\\n"} end @@ -622,7 +622,7 @@ GSUB mark="group{\\n\\n...\\n\\n}group" d=dob_src.is instruct=s_mark='' - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct="\n# group text is a text block with an opening and closing marker, the content of which may be wrapped" s_mark="\n# " + %{"\\n\\n#{mark}\\n\\n"} end @@ -637,7 +637,7 @@ GSUB mark="poem{\n\nverse\n\nverse\n\n...\n\n}poem" d=dob_src.is instruct=s_mark='' - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct="\n# verse are part of the text block described as a poem, the first verse is preceeded by an opening marker, and the last verse by a closing marker, the content of which should remain unwrapped" s_mark="\n# " + %{"\\n\\n#{mark}\\n\\n"} end @@ -652,7 +652,7 @@ GSUB mark="code{\\n\\n...\\n\\n}code" d=dob_src.is instruct=s_mark='' - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct="\n# codeblocks are a text block with an opening and closing marker, the content of which should remain unwrapped" s_mark="\n# " + %{"\\n\\n#{mark}\\n\\n"} end @@ -667,7 +667,7 @@ GSUB mark="table{\\n\\n...\\n\\n}table" d=dob_src.is instruct=s_mark='' - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct="\n# tables are a text block with an opening and closing marker, the content of which should remain unwrapped" s_mark="\n# " + %{"\\n\\n#{mark}\\n\\n"} end @@ -683,7 +683,7 @@ GSUB def pot_structure_idx(dob_src='',dob_trn='') #% Used to extract the structure of a document mark="={ ... }" instruct=s_mark='' - if @md.cmd=~/M/ + if @md.opt.cmd=~/M/ instruct="\n# the book index should be attached unwrapped to the preceding text block (there should be a new line, but no empty line)" s_mark="\n# " + %{"\\n#{mark}\\n\\n"} end @@ -730,11 +730,11 @@ GSUB if (data_src[s].is == 'comment' or data_trn[t].is == 'comment') \ and (data_src[s].is != data_trn[t].is) if data_src[s].is == 'comment' - puts "src (comment):\n\t" + data_src[s].obj if @md.cmd =~/M/ + puts "src (comment):\n\t" + data_src[s].obj if @md.opt.cmd =~/M/ s+=1 #next if data_src[s].is == 'comment' elsif data_trn[t].is == 'comment' - puts "trans (comment):\n\t" + data_trn[t].obj if @md.cmd =~/M/ + puts "trans (comment):\n\t" + data_trn[t].obj if @md.opt.cmd =~/M/ t+=1 #next if data_trn[t].is == 'comment' end @@ -943,7 +943,7 @@ GSUB po4a_git end def po4a_git - unless @md.cmd =~/M/ + unless @md.opt.cmd =~/M/ require_relative 'git' # git.rb git=SiSU_Git::Source.new(@md.opt) git.create_file_structure_git unless FileTest.directory?(@file.output_path.pot_git) -- cgit v1.2.3