aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-09-19 19:05:10 -0400
committerRalph Amissah <ralph@amissah.com>2008-09-19 19:05:10 -0400
commitf4c1bd46a8e947bb64d8596ba1f650ec48f945ad (patch)
tree740cb2f311da4b72e6b2fa5c7c3d79c5d25e6f44 /lib
parentMerge branch 'upstream' into debian/sid (diff)
parentsample sisu markup "Free as in Freedom": book index markers included, and; id... (diff)
Merge branch 'upstream' into debian/sid
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v0/param.rb4
-rw-r--r--lib/sisu/v0/param_identify_markup.rb15
-rw-r--r--lib/sisu/v0/sst_identify_markup.rb31
3 files changed, 42 insertions, 8 deletions
diff --git a/lib/sisu/v0/param.rb b/lib/sisu/v0/param.rb
index 7994487d..02d20ed7 100644
--- a/lib/sisu/v0/param.rb
+++ b/lib/sisu/v0/param.rb
@@ -217,7 +217,6 @@ module SiSU_Param
fns_array=@data.dup
skip unless fns_array # consider
@markup_version=SiSU_Markup_type::Markup_identify.new(fns_array,@opt).markup_version? #% determine markup version
- if @markup_version >= 0.65 then @sem_tag=true end
if fns_array[0] =~ /^(?:% )?(?:SiSU\s+(?:master\s+)?[\d.]*|sisu-[\d.]+)$/ #check markup and markup version
if fns_array[0] =~ /^(?:% )?(?:SiSU\s+(?:master\s+)?|sisu-)[\d.]+$/ #check markup and markup version
@markup_version_declared=fns_array[0].match(/^(?:% )?(?:SiSU\s+(?:master\s+)?|sisu-)([\d.]+)$/)[1]
@@ -644,6 +643,9 @@ module SiSU_Param
end
@ec[:audio] << para.scan(@rgx_audio).uniq if para =~@rgx_audio #embedded content
@ec[:multimedia] << para.scan(@rgx_mm).uniq if para =~@rgx_mm #embedded content
+ unless @sem_tag
+ @sem_tag=true if para=~/[:;]\{.+?\}[:;][a-z+]/ #refix later
+ end
end #% here endeth the document loop
if @ec[:image].length > 0
@ec[:image].flatten!
diff --git a/lib/sisu/v0/param_identify_markup.rb b/lib/sisu/v0/param_identify_markup.rb
index 056fcc49..e86e51cd 100644
--- a/lib/sisu/v0/param_identify_markup.rb
+++ b/lib/sisu/v0/param_identify_markup.rb
@@ -77,7 +77,7 @@ module SiSU_Markup_type
or @cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/
@version_declared=$1
end
- @flat_66,@flag_57,@flag_38=false,false,false
+ @flag_66,@flag_57,@flag_38=false,false,false
@cont.each_with_index do |y,i|
if y =~/^(?:0\{?~links?|@links?:)\s/
links=unless y =~/\{.+?\}\S+/; oldlinks=' (pre 0.20.4 header links)'
@@ -86,23 +86,30 @@ module SiSU_Markup_type
end
unless @flag_38
if y =~/^:?A~/
- version='0.38'
+ version=0.38
@version_determined=version
@flag_38=true
end
end
if @flag_38
+ if @flag_69 \
+ or y =~/^=\{.+?\}\s*$/
+ version=0.69
+ @flag_69=true
+ @version_determined=version
+ break
+ end
if @flag_66 \
or y =~/[:;]\{.+?\}[:;][a-z+]/
version='0.66'
- @version_determined=version
@flag_66=true
+ @version_determined=version
break
end
end
end
@flag_57,@flag_38=false,false
- unless @flag_66
+ unless @flag_66 or @flag_69
@cont.each_with_index do |y,i|
if @flag_57 \
or y =~/^:?A~\?? @title/
diff --git a/lib/sisu/v0/sst_identify_markup.rb b/lib/sisu/v0/sst_identify_markup.rb
index a9eb4d32..3fbac3f3 100644
--- a/lib/sisu/v0/sst_identify_markup.rb
+++ b/lib/sisu/v0/sst_identify_markup.rb
@@ -114,7 +114,7 @@ WOK
or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/
@declared_markup=$1
end
- @flat_66,@flag_57,@flag_38=false,false,false
+ @flag_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])/
@@ -130,6 +130,13 @@ WOK
end
end
if @flag_38
+ if @flag_69 \
+ or y =~/^=\{.+?\}\s*$/
+ version='0.69'
+ markup=Markup_inform.new(version,'0.69' + oldlinks,@declared_markup,@declared_type)
+ @flag_69=true
+ break
+ end
if @flag_66 \
or y =~/[a-z+][:;]\{.+?\}[:;][a-z+]/
version='0.66'
@@ -139,7 +146,7 @@ WOK
end
end
end
- unless @flag_66
+ unless @flag_66 or @flag_69
cont.each_with_index do |y,i|
if y =~/^(?:0\{?~links?|@links?:)\s/ \
and f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])/
@@ -245,6 +252,22 @@ WOK
def initialize(opt)
@opt=opt
end
+ def sisu_0_69
+ <<WOK
+ SiSU 0.69 same as previous, adds book index tags
+ /^=\{.+?\}$/
+ e.g. appended to a paragraph, on a new-line (without a blank line in between)
+ logical structure produced assuming this is the first text "object"
+ ={GNU/Linux community distribution:Debian+2|Fedora|Gentoo;Free Software Foundation+5}
+
+ Free Software Foundation, 1-6
+ GNU/Linux community distribution, 1
+ Debian, 1-3
+ Fedora, 1
+ Gentoo,
+
+WOK
+ end
def sisu_0_66
<<WOK
SiSU 0.66 same as previous, adds semantic tags
@@ -375,7 +398,9 @@ WOK
tell=if @opt.mod.inspect =~/--query/
tell=case @opt.mod.inspect
when /history/
- "#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}\n#{sisu_0_37}\n#{sisu_0_16}\n#{sisu_0_1}"
+ "#{sisu_0_69}#{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.69/
+ "#{sisu_0_69}#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}"
when /0.66/
"#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}"
when /0.65/