diff options
author | Ralph Amissah <ralph@amissah.com> | 2008-02-24 20:58:27 +0000 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2008-02-24 20:58:27 +0000 |
commit | 5c5510b300ec51aadabc1e175797f53e6d725cbe (patch) | |
tree | 262262513fd5087abd22f0738d5d23d8ed632625 | |
parent | vim syntax highlighting for sisu-0.66 (diff) |
identify sisu-0.66 tags
-rw-r--r-- | lib/sisu/v0/param_identify_markup.rb | 61 | ||||
-rw-r--r-- | lib/sisu/v0/sst_identify_markup.rb | 25 |
2 files changed, 62 insertions, 24 deletions
diff --git a/lib/sisu/v0/param_identify_markup.rb b/lib/sisu/v0/param_identify_markup.rb index 5124e89b..056fcc49 100644 --- a/lib/sisu/v0/param_identify_markup.rb +++ b/lib/sisu/v0/param_identify_markup.rb @@ -1,3 +1,4 @@ +# coding: utf-8 =begin * Name: SiSU @@ -76,28 +77,54 @@ module SiSU_Markup_type or @cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/ @version_declared=$1 end - @flag_57,@flag_38=false,false + @flat_66,@flag_57,@flag_38=false,false,false @cont.each_with_index do |y,i| - if @flag_57 \ - or y =~/^:?A~\?? @title/ - @version_determined=0.57 - @flag_57=true - break + if y =~/^(?:0\{?~links?|@links?:)\s/ + links=unless y =~/\{.+?\}\S+/; oldlinks=' (pre 0.20.4 header links)' + else ' (post 0.20.4 header links)' + end + end + unless @flag_38 + if y =~/^:?A~/ + version='0.38' + @version_determined=version + @flag_38=true + end end - if @flag_38 \ - or y =~/^:?A~/ - @version_determined=0.38 - @flag_38=true - break if i >= 200 - if y =~ /(?:~{\*+|~\[\*|~\[\+)\s/ - @version_determined=0.42 #0.38 can safely be treated as 0.42 + if @flag_38 + if @flag_66 \ + or y =~/[:;]\{.+?\}[:;][a-z+]/ + version='0.66' + @version_determined=version + @flag_66=true break end end - if y =~/^0~/ \ - and not @flag_38 - @version_determined=0.16 - break + end + @flag_57,@flag_38=false,false + unless @flag_66 + @cont.each_with_index do |y,i| + if @flag_57 \ + or y =~/^:?A~\?? @title/ + @version_determined=0.57 + @flag_57=true + break + end + if @flag_38 \ + or y =~/^:?A~/ + @version_determined=0.38 + @flag_38=true + break if i >= 200 + if y =~ /(?:~{\*+|~\[\*|~\[\+)\s/ + @version_determined=0.42 #0.38 can safely be treated as 0.42 + break + end + end + if y =~/^0~/ \ + and not @flag_38 + @version_determined=0.16 + break + end end end @@fns=@opt.fns diff --git a/lib/sisu/v0/sst_identify_markup.rb b/lib/sisu/v0/sst_identify_markup.rb index 0f60b916..a9eb4d32 100644 --- a/lib/sisu/v0/sst_identify_markup.rb +++ b/lib/sisu/v0/sst_identify_markup.rb @@ -1,3 +1,4 @@ +# coding: utf-8 =begin * Name: SiSU @@ -113,7 +114,7 @@ WOK or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/ @declared_markup=$1 end - @flat_65,@flag_57,@flag_38=false,false,false + @flat_66,@flag_57,@flag_38=false,false,false cont.each_with_index do |y,i| if y =~/^(?:0\{?~links?|@links?:)\s/ \ and f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])/ @@ -129,16 +130,16 @@ WOK end end if @flag_38 - if @flag_65 \ + if @flag_66 \ or y =~/[a-z+][:;]\{.+?\}[:;][a-z+]/ - version='0.65' - markup=Markup_inform.new(version,'0.65' + oldlinks,@declared_markup,@declared_type) - @flag_65=true + version='0.66' + markup=Markup_inform.new(version,'0.66' + oldlinks,@declared_markup,@declared_type) + @flag_66=true break end end end - unless @flag_65 + unless @flag_66 cont.each_with_index do |y,i| if y =~/^(?:0\{?~links?|@links?:)\s/ \ and f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])/ @@ -244,6 +245,14 @@ WOK def initialize(opt) @opt=opt end + def sisu_0_66 + <<WOK + SiSU 0.66 same as previous, adds semantic tags + /[:;]\{.+?\}[:;][a-z+]/ + e.g. :{ Ralph last;{Amissah};last }:author + +WOK + end def sisu_0_65 <<WOK SiSU 0.65 same as previous, adds semantic tags @@ -366,7 +375,9 @@ WOK tell=if @opt.mod.inspect =~/--query/ tell=case @opt.mod.inspect when /history/ - "#{sisu_0_65}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}\n#{sisu_0_37}\n#{sisu_0_16}\n#{sisu_0_1}" + "#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}\n#{sisu_0_37}\n#{sisu_0_16}\n#{sisu_0_1}" + when /0.66/ + "#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /0.65/ "#{sisu_0_65}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}" when /0.57/ |