From 231c64ecdf11280c8c7c2342462b7682ce8214fc Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 Mar 2012 18:42:33 -0400 Subject: v3dv: texinfo, fix (break holding back 3.2 merge) * proposed next version starts 3.2, (merge dev branch after 3.1.15) --- data/doc/sisu/CHANGELOG_v3 | 3 ++ lib/sisu/v3dv/texinfo.rb | 28 ++++++++--------- lib/sisu/v3dv/texinfo_format.rb | 69 ++++++++++++++++++----------------------- 3 files changed, 46 insertions(+), 54 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v3 b/data/doc/sisu/CHANGELOG_v3 index 4d38fd5a..93213b05 100644 --- a/data/doc/sisu/CHANGELOG_v3 +++ b/data/doc/sisu/CHANGELOG_v3 @@ -21,6 +21,9 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_3.1.15.orig.tar.xz sisu_3.1.15-1.dsc sisu_3.1.15-1.debian.tar.gz +* texinfo, fix (break holding back 3.2 merge) + [proposed next version starts 3.2, (merge dev branch after 3.1.15)] + %% 3.1.14.orig.tar.xz (2012-02-14:07/2) http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/sisu_3.1.14 http://git.sisudoc.org/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_3.1.14-1 diff --git a/lib/sisu/v3dv/texinfo.rb b/lib/sisu/v3dv/texinfo.rb index 145712e1..2496ce7a 100644 --- a/lib/sisu/v3dv/texinfo.rb +++ b/lib/sisu/v3dv/texinfo.rb @@ -140,11 +140,10 @@ module SiSU_TexInfo data=@data data=pre(data) data=endnote(data) - data=markup(data) - objects=tail(data) - #output(objects) - output(@tex_file) - #output(data.compact) + data,head=markup(data) + objs_txt=tail(data) + doc_txt=[head,objs_txt] + output(doc_txt) makeinfo #KEEP reinstate when fixed #% place_info rescue; STDERR.puts SiSU_Screen::Ansi.new(@md.opt.cmd,$!,$@).rescue @@ -340,14 +339,9 @@ module SiSU_TexInfo end #%case with endnotes dob.obj=dob.obj.gsub(/\s*[0-8]\\+(\S+)?\s+/,' ') if dob.obj - if dob.obj \ - && (dob.is !=:structure \ - && dob.is !=:comment) - @tex_file << dob.obj - end data_new << dob end - data_new + [data_new, @tex_file] end def number_titles data,data_new=@data,[] @@ -376,12 +370,16 @@ module SiSU_TexInfo end def tail(data) tex=SiSU_TexInfoFormat::Texinfo.new(@md) - objects=[] + objs_txt=[] data.each do |dob| - objects << dob.obj if dob.obj + if dob.obj \ + && (dob.is !=:structure \ + && dob.is !=:comment) + objs_txt << dob.obj if dob.obj + end end - objects << tex.dublincore << tex.tail - objects + objs_txt << tex.dublincore << tex.tail + objs_txt end def output(data) filename_texinfo=%{#{@env.processing_path.texi}/#{@md.fnb}.texinfo} diff --git a/lib/sisu/v3dv/texinfo_format.rb b/lib/sisu/v3dv/texinfo_format.rb index 0555809d..fa5390b6 100644 --- a/lib/sisu/v3dv/texinfo_format.rb +++ b/lib/sisu/v3dv/texinfo_format.rb @@ -261,43 +261,34 @@ WOK relation="Relation: #{relation}\n\n" if relation #dc coverage="Coverage: #{coverage}\n\n" if coverage #dc rights="Rights: #{rights}\n\n" if rights #dc - "@node Dublin Core\n" + - "@unnumbered Dublin Core\n" + - "@cindex chapter, Dublin Core\n\n" + - "#{full_title}" + - "#{author}" + - "#{subject}" + - "#{description}" + - "#{publisher}" + - "#{contributor}" + - "#{date}" + - "#{date_created}" + - "#{date_issued}" + - "#{date_available}" + - "#{date_valid}" + - "#{date_modified}" + - "#{format}" + - "#{identifier}" + - "#{source}" + - "#{language}" + - "#{relation}" + - "#{coverage}" + - "#{rights}" + - "\n\n" + </,'').strip + dob.obj=dob.obj.gsub(/\n/m,' '). + gsub(/<:#>/,''). + gsub(/,\s+/,' - '). + strip dob end def menu @@ -310,52 +301,52 @@ WOK def level1 dob=clean(@dob) nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'') - dob.obj="@node #{nd}\n@unnumbered #{dob.obj}\n@cindex chapter, #{nd}\n" + dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n" dob end def level2 dob=clean(@dob) nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'') - dob.obj="@node #{nd}\n@unnumbered #{dob.obj}\n@cindex chapter, #{nd}\n" + dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n" dob end def level3 dob=clean(@dob) nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'') - dob.obj="@node #{nd}\n@unnumbered #{dob.obj}\n@cindex chapter, #{nd}\n" + dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n" dob end def level4 dob=clean(@dob) nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'') - dob.obj="@node #{nd}\n@unnumbered #{dob.obj}\n@cindex chapter, #{nd}\n" + dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n" dob end def level5 dob=clean(@dob) nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'') - dob.obj="@node #{nd}\n@unnumbered #{dob.obj}\n@cindex chapter, #{nd}\n" + dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n" dob end def level6 dob=clean(@dob) nd=dob.obj.gsub(/@footnote\{.+?\}\s+/,'') - dob.obj="@node #{nd}\n@unnumbered #{dob.obj}\n@cindex chapter, #{nd}\n" + dob.obj="@node #{nd}\n@unnumbered #{nd}\n@cindex chapter, #{nd}\n" dob end def submenu @dob.obj=@dob.obj.join("\n") @dob.obj=@dob.obj.gsub(/[5]\\+~\S+/,'') dob=clean(@dob) - dob.obj="@menu\n#{dob.obj}\n@end menu\n\n" - dob.obj=dob.obj.gsub(/.+/m,"#{dob.obj}") + dob.obj="@menu\n#{dob.obj}\n@end menu\n\n". + gsub(/.+/m,"#{dob.obj}") end def subsubmenu @dob.obj=@dob.obj.join("\n") @dob.obj=@dob.obj.gsub(/[6]\\+~\S+/,'') dob=clean(@dob) - dob.obj="@menu\n#{dob.obj}\n@end menu\n\n" - dob.obj=dob.obj.gsub(/.+/m,"#{dob.obj}") + dob.obj="@menu\n#{dob.obj}\n@end menu\n\n". + gsub(/.+/m,"#{dob.obj}") end def indent1 @dob.obj=@dob.obj.gsub(/<:i1>(.*)/,'\1') -- cgit v1.2.3