aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/xml_docbook5.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-06-19 19:17:23 -0400
committerRalph Amissah <ralph@amissah.com>2014-06-19 19:17:23 -0400
commit83137da0f259e8366eba7f626319b5a5b9b27d6d (patch)
tree761c81279d2b228ba17535a06970f792cbfd7b45 /lib/sisu/v6/xml_docbook5.rb
parentv5 v6: ao, misc, mostly minor cleaning (diff)
v5 v6: indent spaces, minor
Diffstat (limited to 'lib/sisu/v6/xml_docbook5.rb')
-rw-r--r--lib/sisu/v6/xml_docbook5.rb74
1 files changed, 37 insertions, 37 deletions
diff --git a/lib/sisu/v6/xml_docbook5.rb b/lib/sisu/v6/xml_docbook5.rb
index f5dba87a..bc4ad233 100644
--- a/lib/sisu/v6/xml_docbook5.rb
+++ b/lib/sisu/v6/xml_docbook5.rb
@@ -127,8 +127,8 @@ module SiSU_XML_Docbook_Book
structure_build_collapsed(data)
#tail
end
- def space
- ' '
+ def spaces
+ Ax[:spaces]
end
def tags
# collapsed -->
@@ -176,7 +176,7 @@ module SiSU_XML_Docbook_Book
end
def output(o,comment='')
puts o.lc == (0..6) \
- ? "#{space*o.lc}<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}</#{o.lc}>#{comment}"
+ ? "#{spaces*o.lc}<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}</#{o.lc}>#{comment}"
: "<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}</#{o.lc}>#{comment}"
end
def structure_collapsed(data)
@@ -213,21 +213,21 @@ module SiSU_XML_Docbook_Book
@splv=o.lc
tag_id=o.tags[0] ? %{ id="#{o.tags[0]}" } : ''
if doc_position ==:head
- filename_docbook.puts %{#{space*o.lc}<title#{id}>}
+ filename_docbook.puts %{#{spaces*o.lc}<title#{id}>}
doc_position=:body_and_tail
else
filename_docbook.puts structure_build_tag_close(o.lc,h)
- filename_docbook.puts %{#{space*(o.lc)}<#{tags.docbook(o.lc,chlv)}#{tag_id}>
-#{space*o.lc}<title#{id}>
+ filename_docbook.puts %{#{spaces*(o.lc)}<#{tags.docbook(o.lc,chlv)}#{tag_id}>
+#{spaces*o.lc}<title#{id}>
}
end
filename_docbook.puts SiSU_TextUtils::Wrap.new(o.obj + ocn,80,(@splv*2+2)).line_wrap
- filename_docbook.puts %{#{space*o.lc}</title>}
+ filename_docbook.puts %{#{spaces*o.lc}</title>}
h=o.lc
elsif (o.of ==:para or o.of ==:block)
- filename_docbook.puts "#{space*(@splv)}<para#{id}>"
+ filename_docbook.puts "#{spaces*(@splv)}<para#{id}>"
filename_docbook.puts SiSU_TextUtils::Wrap.new(o.obj + ocn,80,(@splv*2+2)).line_wrap
- filename_docbook.puts "#{space*(@splv)}</para>"
+ filename_docbook.puts "#{spaces*(@splv)}</para>"
end
end
filename_docbook.puts structure_build_tag_close(0,h)
@@ -237,40 +237,40 @@ module SiSU_XML_Docbook_Book
x=[]
case h
when 0
- x << "#{space*0}</#{tags.docbook(0)}>" if (lc <= 0)
+ x << "#{spaces*0}</#{tags.docbook(0)}>" if (lc <= 0)
when 1
- x << "#{space*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
- x << "#{space*0}</#{tags.docbook(0)}>" if (lc <= 0)
+ x << "#{spaces*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
+ x << "#{spaces*0}</#{tags.docbook(0)}>" if (lc <= 0)
when 2
- x << "#{space*2}</#{tags.docbook(2,@chlv)}>" if (lc <= 2)
- x << "#{space*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
- x << "#{space*0}</#{tags.docbook(0)}>" if (lc <= 0)
+ x << "#{spaces*2}</#{tags.docbook(2,@chlv)}>" if (lc <= 2)
+ x << "#{spaces*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
+ x << "#{spaces*0}</#{tags.docbook(0)}>" if (lc <= 0)
when 3
- x << "#{space*3}</#{tags.docbook(3,@chlv)}>" if (lc <= 3)
- x << "#{space*2}</#{tags.docbook(2,@chlv)}>" if (lc <= 2)
- x << "#{space*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
- x << "#{space*0}</#{tags.docbook(0)}>" if (lc <= 0)
+ x << "#{spaces*3}</#{tags.docbook(3,@chlv)}>" if (lc <= 3)
+ x << "#{spaces*2}</#{tags.docbook(2,@chlv)}>" if (lc <= 2)
+ x << "#{spaces*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
+ x << "#{spaces*0}</#{tags.docbook(0)}>" if (lc <= 0)
when 4
- x << "#{space*4}</#{tags.docbook(4,@chlv)}>" if (lc <= 4)
- x << "#{space*3}</#{tags.docbook(3,@chlv)}>" if (lc <= 3)
- x << "#{space*2}</#{tags.docbook(2,@chlv)}>" if (lc <= 2)
- x << "#{space*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
- x << "#{space*0}</#{tags.docbook(0)}>" if (lc <= 0)
+ x << "#{spaces*4}</#{tags.docbook(4,@chlv)}>" if (lc <= 4)
+ x << "#{spaces*3}</#{tags.docbook(3,@chlv)}>" if (lc <= 3)
+ x << "#{spaces*2}</#{tags.docbook(2,@chlv)}>" if (lc <= 2)
+ x << "#{spaces*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
+ x << "#{spaces*0}</#{tags.docbook(0)}>" if (lc <= 0)
when 5
- x << "#{space*5}</#{tags.docbook(5)}>" if (lc <= 5)
- x << "#{space*4}</#{tags.docbook(4,@chlv)}>" if (lc <= 4)
- x << "#{space*5}</#{tags.docbook(3,@chlv)}>" if (lc <= 3)
- x << "#{space*2}</#{tags.docbook(2,@chlv)}>" if (lc <= 2)
- x << "#{space*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
- x << "#{space*0}</#{tags.docbook(0)}>" if (lc <= 0)
+ x << "#{spaces*5}</#{tags.docbook(5)}>" if (lc <= 5)
+ x << "#{spaces*4}</#{tags.docbook(4,@chlv)}>" if (lc <= 4)
+ x << "#{spaces*5}</#{tags.docbook(3,@chlv)}>" if (lc <= 3)
+ x << "#{spaces*2}</#{tags.docbook(2,@chlv)}>" if (lc <= 2)
+ x << "#{spaces*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
+ x << "#{spaces*0}</#{tags.docbook(0)}>" if (lc <= 0)
when 6
- x << "#{space*6}</#{tags.docbook(6)}>" if (lc <= 6)
- x << "#{space*5}</#{tags.docbook(5)}>" if (lc <= 5)
- x << "#{space*4}</#{tags.docbook(4,@chlv)}>" if (lc <= 4)
- x << "#{space*3}</#{tags.docbook(3,@chlv)}>" if (lc <= 3)
- x << "#{space*2}</#{tags.docbook(2,@chlv)}>" if (lc <= 2)
- x << "#{space*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
- x << "#{space*0}</#{tags.docbook(0)}>" if (lc <= 0)
+ x << "#{spaces*6}</#{tags.docbook(6)}>" if (lc <= 6)
+ x << "#{spaces*5}</#{tags.docbook(5)}>" if (lc <= 5)
+ x << "#{spaces*4}</#{tags.docbook(4,@chlv)}>" if (lc <= 4)
+ x << "#{spaces*3}</#{tags.docbook(3,@chlv)}>" if (lc <= 3)
+ x << "#{spaces*2}</#{tags.docbook(2,@chlv)}>" if (lc <= 2)
+ x << "#{spaces*1}</#{tags.docbook(1,@chlv)}>" if (lc <= 1)
+ x << "#{spaces*0}</#{tags.docbook(0)}>" if (lc <= 0)
end
x.join("\n")
end