From 4c11eebf5ea1ce4abaeb8dc555ec1bf2cb27947e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 14 Jun 2007 10:16:51 +0100 Subject: sisu-0.54.0 (minor additions to syntax, indent range extended) * indent levels (1-9) added [previously two levels] done for plaintext, html, xml, odf, latex/pdf [minor syntax addition (_3 - _9), version number change] * bullet indent levels (1-9) added [previously two levels] done for plaintext, html, odf, latex/pdf [minor syntax addition (_3* - _9*), version number change] * url decoration, open close, default angle brackets * fixes, some line-breaking for plaintext (and text groups for) odf and xml * css, modifications for extended indents in html and xml [sisu -CC (for update)] * vim syntax highlighter updated to take account of extended indent range * rant installer minor changes for future ruby * conversion script in data/sisu/conf/convert/sisu_convert --- lib/sisu/v0/dal_syntax.rb | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'lib/sisu/v0/dal_syntax.rb') diff --git a/lib/sisu/v0/dal_syntax.rb b/lib/sisu/v0/dal_syntax.rb index 513dc721..d0014ad6 100644 --- a/lib/sisu/v0/dal_syntax.rb +++ b/lib/sisu/v0/dal_syntax.rb @@ -61,7 +61,7 @@ module Syntax @manmkp_ital='[i/]\\{.+?\\}[i/]' tail_m_ital=%q{(?:\s|[.,;:?!'")]|~\^|~\\\{\s|$)} tail_m_bold=%q{(?:(?:<\/i>)?(?:\s|[.,;:?!'")]|~\^|~\\\{\s|$))?} - bold_line=%q{^!_\s.+?(?:\n|$)} + bold_line=%q{^!_\s.+?(?:
|\n|$)} @line_scan_ital=if defined? @md.make_italic[:str] and defined? @vz.markup_make_italic[:str] /#@http_m|#{bold_line}|#@manmkp_ital#{tail_m_ital}|(?:#{@md.make_italic[:str]}|#{@vz.markup_make_italic[:str]})#{tail_m_ital}|\S+|\n/ elsif defined? @md.make_italic[:str] @@ -120,9 +120,10 @@ module Syntax line end def embolden(given) - given.gsub!(/(?:^!_|^[789]~)\s+(.+?)\s+((?:[*]~\S+\s*)+)/,'\1 \2') - given.gsub!(/(?:^!_|^[789]~)\s+(.+?)\s*([~-]#)$/,'\1 \2') - given.gsub!(/(?:^!_\s+|^[789]~\s+)(.*)?\s*$/,'\1') + given.gsub!(/(?:^!_|^[7-9]~)\s+(.+?)(
)/,'\1\2') + given.gsub!(/(?:^!_|^[7-9]~)\s+(.+?)\s+((?:[*]~\S+\s*)+)/,'\1 \2') + given.gsub!(/(?:^!_|^[7-9]~)\s+(.+?)\s*([~-]#)$/,'\1 \2') + given.gsub!(/(?:^!_\s+|^[7-9]~\s+)(.*)?\s*$/,'\1') end def wordlist_bold(line) line=line.dup @@ -140,7 +141,7 @@ module Syntax w.gsub!(@vz.markup_make_bold,'\1') end else - if w =~ /(?:^!_|^[789]~)\s+/; embolden(w) #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! + if w =~ /(?:^!_|^[7-9]~)\s+/; embolden(w) #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! end end line_array << w @@ -149,7 +150,7 @@ module Syntax else line end else - if line !~/^(?:[0-9]~|%+\s)/ and line =~ /(?:^!_|^[789]~)\s+/; embolden(line) + if line !~/^(?:[0-9]~|%+\s)/ and line =~ /(?:^!_|^[7-9]~)\s+/; embolden(line) end end line @@ -172,8 +173,10 @@ module Syntax # ~{endnote}~ # !_ #bold/emphasise paragraph # _" #blockquote paragraph - # _1 #indent paragraph 1 step - # _2 #indent paragraph 2 steps + # _1 <:i1> #indent paragraph 1 step + # _2 <:i2> #indent paragraph 2 steps + # _3 <:i3> #indent paragraph 3 steps + # _4 <:i4> #indent paragraph 4 steps # _* #bullet (list) # _1* #bullet (list) indented # _1* #bullet (list) indented @@ -255,17 +258,15 @@ module Syntax line.gsub!(/(^|\s+)-([^{]\S+?)-( |$)/,'\1\2\3') #underscore single word, watch line.gsub!(/(^|\s+|['"]| |\(|\>|\d+)\^(\S+?)\^/,'\1\2') #superscript single word, watch digit added line.gsub!(/<[:e]\s+(.+?)!?>/,'~{ \1 }~') # not tested - line.gsub!(/^\s*_([12])(\*+)\s*/,'<:i\1> _* ') #bullets, shortcut - line.gsub!(/^\s*_([12])\s+/,'<:i\1> ') #indent + line.gsub!(/^\s*_([1-9])(\*+)\s*/,'<:i\1> _* ') #bullets, shortcut + line.gsub!(/^\s*_([1-9])\s+/,'<:i\1> ') #indent line.gsub!(/(?:
|
)\s*_[12]\s+/,'
') #indent used in endnotes, not implemented, replace when ready with: line.gsub!(/(?:
|
)\s*_([12])\s+/,'
<:i\1> ') - #line.gsub!(/^\s*_([12])\s+/,"<:i\\1> ") - #line.gsu!b!(/^\s*_([12])\s+/," ") #indent line line.gsub!(/<:?br>/,'
') #adjustment 2004w41, from # line.gsub!(/
/,'
') ##added - #line.gsub!(/(?:^!_\s+|^[78]~\s+|<:b>)(.*)?([~-]#)$/i,"\\1 \\2") #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! - #line.gsub!(/(?:^!_\s+|^[78]~\s+|<:b>)(.*)?\s*$/i,"\\1") #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! - #line.gsub!(/(?:(?:^| )!_ |^[78]~ |<:b>)(.*)\n/mi,"\\1 ") #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! - #line.gsub!(/^_" (.*)\n/i,"
\\1
") #blockquotes #introduce KEEP + #line.gsub!(/(?:^!_\s+|^[7-9]~\s+|<:b>)(.*)?([~-]#)$/i,'\1 \2') #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! + #line.gsub!(/(?:^!_\s+|^[7-9]~\s+|<:b>)(.*)?\s*$/i,'\1') #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! + #line.gsub!(/(?:(?:^| )!_ |^[7-9]~ |<:b>)(.*)\n/mi,'\1 ') #bold paragraph/emphasize #may wish to remove think about 7{ 8{ conversion not satisfactory, as information is lost! + #line.gsub!(/^_" (.*)\n/i,'
\1
') #blockquotes #introduce KEEP line.gsub!(/<:hi>/,'') # bright yellow rgb(255,255,0) pale yellow rgb(255,255,200) line.gsub!(/<:\/hi>/,'') line.gsub!(/(<:verse>.+)/m,"\\1\n") @@ -319,8 +320,8 @@ module Syntax line.gsub!(/(^|\s+|['"]|\(|\>)\/([\(\)a-zA-Z0-9']+?)\/([ ,.;:'"~$]|[^a-zA-Z0-9])/,'\1\2\3') #italics single word, watch line.gsub!(/(^|\s+|['"]|\(|\>)_(\S+?)_/,'\1\2') #underscore single word, watch line.gsub!(/(^|\s+|['"]|\(|\>|\d+)\^(\S+?)\^/,'\1\2') #superscript single word, watch digit added - line.gsub!(/^\s*_([12])(\*+)\s*/,"<:i\\1> _* ") # bullets, shortcut - line.gsub!(/^\s*_([12])\s+/,'<:i\1> ') + line.gsub!(/^\s*_([1-9])(\*+)\s*/,'<:i\1> _* ') # bullets, shortcut + line.gsub!(/^\s*_([1-9])\s+/,'<:i\1> ') line.gsub!(/<:?br>/,'
') end @data -- cgit v1.2.3