aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/xml_dom.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2007-06-14 10:16:51 +0100
committerRalph Amissah <ralph.amissah@gmail.com>2007-06-14 10:16:51 +0100
commit4c11eebf5ea1ce4abaeb8dc555ec1bf2cb27947e (patch)
treef85706d4725d429e61c12320a13c71a5033a300e /lib/sisu/v0/xml_dom.rb
parent0.53.0, pre-build, see changelog, library naming changed for scm, placed unde... (diff)
sisu-0.54.0 (minor additions to syntax, indent range extended)sisu_0.54.0
* 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 <http://url> * 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
Diffstat (limited to 'lib/sisu/v0/xml_dom.rb')
-rw-r--r--lib/sisu/v0/xml_dom.rb26
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/sisu/v0/xml_dom.rb b/lib/sisu/v0/xml_dom.rb
index 9c13dcc1..4225a276 100644
--- a/lib/sisu/v0/xml_dom.rb
+++ b/lib/sisu/v0/xml_dom.rb
@@ -118,7 +118,7 @@ module SiSU_XML_DOM
end
def songsheet
pre
- markup
+ @data=markup(@data)
post
publish
end
@@ -225,13 +225,13 @@ WOK
@cont[2]=false if @cont[2]
@cont[3]=false if @cont[3]
####### attempt to close contents
- if @copen[3] # 6{
+ if @copen[3] # 6~
[3,2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
@copen[1]=@copen[2]=@copen[3]=false
- elsif @copen[2] # 5{
+ elsif @copen[2] # 5~
[2,1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
@copen[1]=@copen[2]=@copen[3]=false
- elsif @copen[1] # 4{
+ elsif @copen[1] # 4~
[1].each { |v| @@xml[:body] << "#{@tab*n}</contents#{v}>\n" }
@copen[1]=@copen[2]=@copen[3]=false
end
@@ -318,8 +318,7 @@ WOK
@@xml[:body] << "#{@tab*0}</object>" << "\n" #if para[@regx]
@endnotes=[]
end
- def markup
- data=@data
+ def markup(data)
xml_sc(@md)
@rcdc=false
@level,@cont,@copen,@xml_contents_close=[],[],[],[]
@@ -388,9 +387,12 @@ WOK
@@xml[:body] << table_structure(para,ocn)
else #xml_structure(para, nil, nil, nil)
type=case para
- when /^\s*<:i1>/; 'indent1'
- when /^\s*<:i2>/; 'indent2'
- else 'norm'
+ when /^\s*(?:<:i([1-9])> )?_\*/
+ m=$1
+ para.gsub!(/^(\s*(?:<:i[1-9]> )?)_\*/,'\1')
+ "indent_bullet#{m}"
+ when /^\s*<:i([1-9])>/; "indent#{$1}"
+ else 'norm'
end
xml_markup(para)
@@xml[:body] << %{#{@tab*6}<object id="#{para[@regx,3]}">} << "\n" if para[@regx] and para[@regx,3]
@@ -417,10 +419,7 @@ WOK
para='' if para =~/<a name="n\d+">/ and para =~/^(-\{{2}~\d+|<!e[:_]\d+!>)/ # -endnote
if para =~/.*<:#>.*$/
para=case para
- when /<:i1>/
- format_text=Format_text_object.new(para,'')
- format_text.scr_inden_ocn_e_no_paranum
- when /<:i2>/
+ when /<:i[1-9]>/
format_text=Format_text_object.new(para,'')
format_text.scr_inden_ocn_e_no_paranum
end
@@ -481,7 +480,6 @@ WOK
end
def publish
content=[]
- data=@data
content << @@xml[:open] << @@xml[:head] << @@xml[:body] << @@xml[:metadata]
content << @@xml[:owner_details] if @md.stmp =~/\w\w/
content << @@xml[:tail] << @@xml[:close]