aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/dal_syntax.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-07-26 20:22:49 -0400
committerRalph Amissah <ralph@amissah.com>2011-07-26 20:22:49 -0400
commit5e292103d5da448844c7c5bc38b920874d895107 (patch)
tree6db0d80632c93a7f89dc8ecfe0db57bc7bd54fae /lib/sisu/v3/dal_syntax.rb
parentv3: emacs syntax highlighting sisu-mode.el (diff)
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
Diffstat (limited to 'lib/sisu/v3/dal_syntax.rb')
-rw-r--r--lib/sisu/v3/dal_syntax.rb20
1 files changed, 17 insertions, 3 deletions
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]}") #'<span style="background-color: rgb(255,240,196)">') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200)
dob.obj.gsub!(/<:\/hi>/,"#{Mx[:fa_hilite_c]}") #'</span>')
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!(/(?:<br>|<br \/>)\s*_([12])\s+/,'<br><:i\1> ')
end