diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-06-19 21:19:17 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-06-19 21:19:17 -0400 |
commit | e7ce3d1c446e63853068380e7d025ba991817146 (patch) | |
tree | e6bbd964dfb17263c40d3309801bc0d1d9593efa /lib/sisu/v6/xml_docbook5.rb | |
parent | v6: docbook, images (diff) |
v6: docbook, code block
Diffstat (limited to 'lib/sisu/v6/xml_docbook5.rb')
-rw-r--r-- | lib/sisu/v6/xml_docbook5.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sisu/v6/xml_docbook5.rb b/lib/sisu/v6/xml_docbook5.rb index 28fa25ed..b3e9e035 100644 --- a/lib/sisu/v6/xml_docbook5.rb +++ b/lib/sisu/v6/xml_docbook5.rb @@ -197,6 +197,9 @@ module SiSU_XML_Docbook_Book '</docinfo>' ].flatten end + def code_output(o,ocn,filename_docbook) + filename_docbook.puts o.obj.gsub(/\n?(?:#{Mx[:br_line]}|#{Mx[:br_nl]})\n?/m,"\n") + end def adjust_output(o,ocn,filename_docbook,splv) if o.obj =~/#{Xx[:split]}/ outs=o.obj.split(/#{Xx[:split]}/) @@ -268,6 +271,12 @@ module SiSU_XML_Docbook_Book elsif o.of ==:block if o.is ==:table filename_docbook.puts SiSU_Tables::TableXMLdocbook.new(o,id).table.obj + elsif o.is ==:code + filename_docbook.puts "#{spaces*(@splv)}<para#{id}>" + filename_docbook.puts "#{spaces*(@splv+1)}<programlisting>" + code_output(o,ocn,filename_docbook) + filename_docbook.puts "#{spaces*(@splv+1)}</programlisting>" + filename_docbook.puts "#{spaces*(@splv)}</para>" else filename_docbook.puts "#{spaces*(@splv)}<para#{id}>" adjust_output(o,ocn,filename_docbook,@splv) |