aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-09-20 16:12:33 -0400
committerRalph Amissah <ralph@amissah.com>2010-09-20 16:55:21 -0400
commit55d9519d1c1cef7f511595e82f0354ad54e4302b (patch)
tree06123a3c61c38436d4d0c01ff7ffd3b1c81caf13 /lib
parenturls, sysenv, set manpage viewer to "man" (diff)
identify markup, update ... revisit
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v2/sst_identify_markup.rb67
1 files changed, 53 insertions, 14 deletions
diff --git a/lib/sisu/v2/sst_identify_markup.rb b/lib/sisu/v2/sst_identify_markup.rb
index 61b4ee11..a6f2a550 100644
--- a/lib/sisu/v2/sst_identify_markup.rb
+++ b/lib/sisu/v2/sst_identify_markup.rb
@@ -110,7 +110,7 @@ WOK
or cont[0] =~ /^(?:%\s+)?sisu-([0-9](?:\.[0-9]+){1,2})/
@declared_markup=$1
end
- @flag_66,@flag_57,@flag_38=false,false,false
+ @flag_2_0,@flag_1_0,@flag_69,@flag_66,@flag_57,@flag_38=false,false,false,false,false,false
cont.each_with_index do |y,i|
if y =~/^(?:0\{?~links?|@links?:)\s/ \
and f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])/
@@ -118,6 +118,13 @@ WOK
else ' (post 0.20.4 header links)'
end
end
+ if @flag_2_0 \
+ or y =~/^@make:|^@classify|^\s\s?:[a-z_-]+?:\s+\S/
+ version=2.0.to_f
+ markup=Markup_inform.new(version,'2.0' + oldlinks,@declared_markup,@declared_type)
+ @flag_2_0=true
+ break
+ end
unless @flag_38
if (y =~/^:?A~/ and f =~/(?:\.sst|\.ssm|\.ssi)/)
version='0.38'
@@ -126,11 +133,11 @@ WOK
end
end
if @flag_38
- if @flag_69 \
+ if @flag_1_0 \
or y =~/^=\{.+?\}\s*$/
version='0.69'
markup=Markup_inform.new(version,'0.69' + oldlinks,@declared_markup,@declared_type)
- @flag_69=true
+ @flag_1_0=true
break
end
if @flag_66 \
@@ -142,7 +149,9 @@ WOK
end
end
end
- unless @flag_66 or @flag_69
+ unless @flag_2_0 \
+ or @flag_1_0 \
+ or @flag_66
cont.each_with_index do |y,i|
if y =~/^(?:0\{?~links?|@links?:)\s/ \
and f =~/(?:\.sst|\.ssm|\.ssi|\.s[123])/
@@ -246,9 +255,34 @@ WOK
def initialize(opt)
@opt=opt
end
+ def sisu_2_0
+ <<WOK
+ SiSU 2.0 same as 1.0, apart from the changing of headers and the addition of a monospace tag
+ related headers now grouped, e.g.
+
+ @title:
+ :subtitle:
+
+ @creator:
+ :author:
+ :translator:
+ :illustrator:
+
+ see document markup samples, and sisu --help headers
+
+ the monospace tag takes the form of a has '#' \#{ this enclosed text would be monospaced }#
+
+WOK
+ end
+ def sisu_1_0
+ <<WOK
+ SiSU 1.0 same as 0.69
+
+WOK
+ end
def sisu_0_69
<<WOK
- SiSU 0.69 same as previous, adds book index tags
+ SiSU 0.69 (same as 1.0) as previous (0.57) with the addition of 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"
@@ -280,9 +314,10 @@ WOK
end
def sisu_0_57
<<WOK
- SiSU 0.57 is the same as 0.42 with the introduction of some a shortcut to use
- the headers @title and @creator in the first heading [expanded using the
- contents of the headers @title: and @author:]
+
+ SiSU 0.57 (a subset of 1.0) is the same as 0.42 with the introduction of some
+ a shortcut to use the headers @title and @creator in the first heading
+ [expanded using the contents of the headers @title: and @author:]
:A~ @title by @author
@@ -290,7 +325,7 @@ WOK
end
def sisu_0_42
<<WOK
- SiSU 0.42 is the same as 0.38 with the introduction of some additional endnote types,
+ SiSU 0.42 (a subset of 1.0) is the same as 0.38 with the introduction of some additional endnote types,
Introduces some varations on endnotes, in particular the use of the asterisk
~{* for example for describing an author }~ and ~{** for describing a second author }~
@@ -310,11 +345,11 @@ WOK
def sisu_0_38
<<WOK
- SiSU 0.38 introduced alternative experimental header and heading/structure markers,
+ SiSU 0.38 (a subset of 1.0) introduced alternative experimental header and heading/structure markers,
@headername: and headers :A~ :B~ :C~ 1~ 2~ 3~
- as the equivalent of
+ as the equivalent of (the superceded)
0~headername and headers 1~ 2~ 3~ 4~ 5~ 6~
@@ -342,8 +377,8 @@ WOK
def sisu_0_37
<<WOK
- SiSU 0.37 introduced new file naming convention,
- using the file extensions .sst .ssm and .ssi
+ SiSU 0.37 introduced the file naming convention, that remains in use in SiSU
+ v1 and v2, using the file extensions .sst .ssm and .ssi
to replace .s1 .s2 .s3 .r1 .r2 .r3 and .si
this is captured by the following file 'rename' instruction:
@@ -392,7 +427,11 @@ WOK
tell=if @opt.mod.inspect =~/--query/
tell=case @opt.mod.inspect
when /history/
- "#{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}"
+ "#{sisu_2_0}#{sisu_1_0}#{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 /2.0/
+ "#{sisu_2_0}#{sisu_1_0}#{sisu_0_69}#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}"
+ when /1.0/
+ "#{sisu_1_0}#{sisu_0_69}#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}"
when /0.69/
"#{sisu_0_69}#{sisu_0_66}#{sisu_0_57}#{sisu_0_42}#{sisu_0_38}#{sisu_0_16}"
when /0.66/