From 5e292103d5da448844c7c5bc38b920874d895107 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 26 Jul 2011 20:22:49 -0400 Subject: v3: dal, indent, control of first line of indent & rest of paragraph * implements hanging indent, and possibility to set first line step indent * __[1-9] hanging indent (initial indent 0); paragraph text indent [1-9] * _[0-9]?_[1-9] initial indent; paragraph text indent * __[1-9]! bold words \\ part of hanging indent paragraph text --- lib/sisu/v3/dal_syntax.rb | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v3/dal_syntax.rb') diff --git a/lib/sisu/v3/dal_syntax.rb b/lib/sisu/v3/dal_syntax.rb index 4595d6e1..bb1aacbe 100644 --- a/lib/sisu/v3/dal_syntax.rb +++ b/lib/sisu/v3/dal_syntax.rb @@ -398,9 +398,19 @@ module SiSU_Syntax dob.obj.gsub!(/=\{(.+?)\}/, "#{Mx[:idx_o]}\\1#{Mx[:idx_c]}") dob.obj.gsub!(/^\s*_([1-9])\*\s*/, - "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}#{Mx[:gl_bullet]}") #bullets, shortcut + "#{Mx[:pa_o]}:i\\1:\\1#{Mx[:pa_c]}#{Mx[:gl_bullet]}") #bullets, shortcut dob.obj.gsub!(/^\s*_([1-9])\s+/, - "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}") #indent + "#{Mx[:pa_o]}:i\\1:\\1#{Mx[:pa_c]}") #indent + dob.obj.gsub!(/^\s*_([1-9])!\s+(.+?)\s*$/, + "#{Mx[:pa_o]}:i\\1:\\1#{Mx[:pa_c]}#{Mx[:fa_bold_o]}\\2#{Mx[:fa_bold_c]} ") #indent bold + dob.obj.gsub!(/^\s*__([1-9])\s+/, + "#{Mx[:pa_o]}:i0:\\1#{Mx[:pa_c]}") #hang + dob.obj.gsub!(/^\s*__([1-9])!\s+(.+?)\s*$/, + "#{Mx[:pa_o]}:i0:\\1#{Mx[:pa_c]}#{Mx[:fa_bold_o]}\\2#{Mx[:fa_bold_c]} ") #hangdef + dob.obj.gsub!(/^\s*_([0-9])_([0-9])\s+/, + "#{Mx[:pa_o]}:i\\1:\\2#{Mx[:pa_c]}") #hang + dob.obj.gsub!(/^\s*_([0-9])_([0-9])!\s+(.+?)\s*$/, + "#{Mx[:pa_o]}:i\\1:\\2#{Mx[:pa_c]}#{Mx[:fa_bold_o]}\\3#{Mx[:fa_bold_c]} ") #hangdef dob.obj.gsub!(/<:hi>/,"#{Mx[:fa_hilite_o]}") #'') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200) dob.obj.gsub!(/<:\/hi>/,"#{Mx[:fa_hilite_c]}") #'') dob.obj.gsub!(/(#{Mx[:gr_o]}verse#{Mx[:gr_c]}.+)/m,"\\1\n") @@ -517,7 +527,11 @@ module SiSU_Syntax line.gsub!(/^\s*_\([1-9]\)\(\*\+\)\s*/, "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}#{Mx[:fa_o]}\\2#{Mx[:fa_c_o]}") #bullets, shortcut line.gsub!(/^\s*_\([1-9]\)\s+/, - "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}") + "#{Mx[:pa_o]}:i\\1#{Mx[:pa_c]}") #watch + line.gsub!(/^\s*__\([1-9]\)\s+/, + "#{Mx[:pa_o]}:h\\1#{Mx[:pa_c]}") #watch + #line.gsub!(/^\s*__\([1-9]\)!\s+/, + # "#{Mx[:pa_o]}:hd\\1#{Mx[:pa_c]}") #watch line.gsub!(/#{Mx[:br_line]}\s*_[12]\s+/, "#{Mx[:br_line]} ") #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:
|
)\s*_([12])\s+/,'
<:i\1> ') end -- cgit v1.2.3