aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v2/param.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v2/param.rb')
-rw-r--r--lib/sisu/v2/param.rb52
1 files changed, 26 insertions, 26 deletions
diff --git a/lib/sisu/v2/param.rb b/lib/sisu/v2/param.rb
index 8b75edfc..89eaced3 100644
--- a/lib/sisu/v2/param.rb
+++ b/lib/sisu/v2/param.rb
@@ -224,7 +224,7 @@ module SiSU_Param
@h
end
def title
- a=@s.split(/[ ]*\n[ ]*/m)
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
def main
s=@h['main']
@@ -269,7 +269,7 @@ module SiSU_Param
self
end
def creator #there are sub categories that need to be catered for and sometimes more than one author etc.; implement array.to_s.length validation test later, current test on string approximate as string is not used
- a=@s.split(/[ ]*\n[ ]*/m)
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
def author
@h['author']=(@h['author'] ? @h['author'] : @h['main'])
@@ -378,7 +378,7 @@ module SiSU_Param
self
end
def rights
- a=@s.split(/[ ]*\n[ ]*/m)
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
def copyright
def text #you may wish to expand to take from all
@@ -433,27 +433,27 @@ module SiSU_Param
s=copyright.text + ';'
if defined? copyright.translation \
and copyright.translation
- s +=' translation ' + copyright.translation + ';'
+ s +='<br> translation ' + copyright.translation + ';'
end
if defined? copyright.illustrations \
and copyright.illustrations
- s +=' illustrations ' + copyright.illustrations + ';'
+ s +='<br> illustrations ' + copyright.illustrations + ';'
end
if defined? copyright.photographs \
and copyright.photographs
- s +=' photographs ' + copyright.photographs + ';'
+ s +='<br> photographs ' + copyright.photographs + ';'
end
if defined? copyright.digitization \
and copyright.digitization
- s +=' digitization ' + copyright.digitization + ';'
+ s +='<br> digitization ' + copyright.digitization + ';'
end
if defined? copyright.audio \
and copyright.audio
- s +=' audio ' + copyright.audio + ';'
+ s +='<br> audio ' + copyright.audio + ';'
end
if defined? copyright.license \
and copyright.license
- s +=' License: ' + copyright.license
+ s +='<br> License: ' + copyright.license
end
if s.empty?
SiSU_Screen::Ansi.new(@cmd,'WARNING Document Rights information missing; provide @rights: :copyright:').warn unless @opt.cmd =~/q/
@@ -468,7 +468,7 @@ module SiSU_Param
self
end
def classify
- a=@s.split(/[ ]*\n[ ]*/m)
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
def coverage
s=@h['coverage']
@@ -528,14 +528,14 @@ module SiSU_Param
self
end
def publisher
- a=@s.split(/[ ]*\n[ ]*/m)
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
s=@h['main']
l,n=Db[:col_name],'publisher'
validate_length(s,l,n)
end
def date
- a=@s.split(/[ ]*\n[ ]*/m)
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
def added_to_site
s=@h['added_to_site']
@@ -575,7 +575,7 @@ module SiSU_Param
self
end
def language # as things stand this should really be populated from title.language and original.language, resolve
- a=@s.split(/[ ]*\n[ ]*/m)
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
def document
s=@h['document']=(@h['document'] ? @h['document'] : @h['main'])
@@ -600,24 +600,24 @@ module SiSU_Param
self
end
def make
- a=@s.split(/[ ]*\n[ ]*/m)
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
def headings
lv=[]
- s=@s
- s=((s =~/;/) ? (s.split(/;\s*/)) : [ s ])
- lv[0]=s
- lv1=s[0] ||='1~ ' #some arbitrary changes made
+ x=@h['headings']
+ x=((x =~/;/) ? (x.split(/;\s*/)) : [ x ])
+ lv[0]=x
+ lv1=x[0] ||='1~ ' #some arbitrary changes made
lv[1]=/^#{lv1}/
- lv2=s[1] ||='2~ '
+ lv2=x[1] ||='2~ '
lv[2]=/^#{lv2}/
- lv3=s[2] ||='3~ '
+ lv3=x[2] ||='3~ '
lv[3]=/^#{lv3}/
- lv4=s[3] ||='4~ '
+ lv4=x[3] ||='4~ '
lv[4]=/^#{lv4}/
- lv5=s[4] ||='5~ '
+ lv5=x[4] ||='5~ '
lv[5]=/^#{lv5}/
- lv6=s[5] ||='6~ '
+ lv6=x[5] ||='6~ '
lv[6]=/^#{lv6}/
lv
end
@@ -720,7 +720,7 @@ module SiSU_Param
@s
end
def original
- a=@s.split(/[ ]*\n[ ]*/m)
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
def publisher
s=@h['publisher']
@@ -755,11 +755,11 @@ module SiSU_Param
self
end
def links
- a=@s.split(/[ ]*\n[ ]*/m)
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
a
end
def notes
- a=@s.split(/[ ]*\n[ ]*/m)
+ a=@s.split(/\n%\s.+?$|[ ]*\n[ ]*/m)
@h=build_hash(a)
def abstract
@h['abstract']