aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/xml_docbook5.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-06-19 21:18:05 -0400
committerRalph Amissah <ralph@amissah.com>2014-06-19 21:18:05 -0400
commitc7eddcb1c6ab5b1bc79cf72cf8b229e58665b7fd (patch)
tree0385e26dba70cdfdb9d05a51f7066aa3eb61ea08 /lib/sisu/v6/xml_docbook5.rb
parentv6: docbook, tables (diff)
v6: docbook, images
Diffstat (limited to 'lib/sisu/v6/xml_docbook5.rb')
-rw-r--r--lib/sisu/v6/xml_docbook5.rb28
1 files changed, 25 insertions, 3 deletions
diff --git a/lib/sisu/v6/xml_docbook5.rb b/lib/sisu/v6/xml_docbook5.rb
index db6e7eb0..28fa25ed 100644
--- a/lib/sisu/v6/xml_docbook5.rb
+++ b/lib/sisu/v6/xml_docbook5.rb
@@ -197,6 +197,28 @@ module SiSU_XML_Docbook_Book
'</docinfo>'
].flatten
end
+ def adjust_output(o,ocn,filename_docbook,splv)
+ if o.obj =~/#{Xx[:split]}/
+ outs=o.obj.split(/#{Xx[:split]}/)
+ outs.each do |out|
+ if out =~/<figure id=/m
+ out=out.gsub(/:spaces0:/m,
+ %{#{spaces*(splv)}#{spaces}}).
+ gsub(/:spaces1:/m,
+ %{#{spaces*(splv)}#{spaces*2}})
+ filename_docbook.puts out
+ filename_docbook.puts "#{spaces*3}#{ocn}"
+ else
+ unless out.empty?
+ filename_docbook.puts SiSU_TextUtils::Wrap.new(out,80,(splv*2+2),nil).line_wrap
+ filename_docbook.puts "#{spaces*3}#{ocn}"
+ end
+ end
+ end
+ else
+ filename_docbook.puts SiSU_TextUtils::Wrap.new(o.obj,80,(splv*2+2),nil,ocn).line_wrap
+ end
+ end
def structure_build_collapsed(data)
#output_file=@md.file.output_path.xml_docbook_book.dir + '/' + @md.file.base_filename.xml_docbook_book
file=SiSU_Env::FileOp.new(@md)
@@ -230,7 +252,7 @@ module SiSU_XML_Docbook_Book
#{spaces*o.lc}<title#{id}>
}
end
- filename_docbook.puts SiSU_TextUtils::Wrap.new(o.obj,80,(@splv*2+2),nil,ocn).line_wrap
+ adjust_output(o,ocn,filename_docbook,@splv)
filename_docbook.puts %{#{spaces*o.lc}</title>}
h=o.lc
elsif o.of ==:layout \
@@ -248,12 +270,12 @@ module SiSU_XML_Docbook_Book
filename_docbook.puts SiSU_Tables::TableXMLdocbook.new(o,id).table.obj
else
filename_docbook.puts "#{spaces*(@splv)}<para#{id}>"
- filename_docbook.puts SiSU_TextUtils::Wrap.new(o.obj + ocn,80,(@splv*2+2)).line_wrap
+ adjust_output(o,ocn,filename_docbook,@splv)
filename_docbook.puts "#{spaces*(@splv)}</para>"
end
elsif o.of ==:para
filename_docbook.puts "#{spaces*(@splv)}<para#{id}>"
- filename_docbook.puts SiSU_TextUtils::Wrap.new(o.obj + ocn,80,(@splv*2+2)).line_wrap
+ adjust_output(o,ocn,filename_docbook,@splv)
filename_docbook.puts "#{spaces*(@splv)}</para>"
end
end