From f06613bb90d370053963d544b14ee7c3e8706671 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 May 2014 20:33:11 -0400 Subject: v6: xml object citation numbering (docbook fictionbook) --- lib/sisu/v6/xml_docbook5.rb | 5 ++++- lib/sisu/v6/xml_fictionbook2.rb | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v6/xml_docbook5.rb b/lib/sisu/v6/xml_docbook5.rb index 98369836..f5dba87a 100644 --- a/lib/sisu/v6/xml_docbook5.rb +++ b/lib/sisu/v6/xml_docbook5.rb @@ -113,6 +113,7 @@ module SiSU_XML_Docbook_Book @trans=SiSU_XML_Munge::Trans.new(md) @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(md.opt) @env=@particulars.env + @make ||=SiSU_Env::ProcessingSettings.new(md) end def songsheet @t='sisu' @@ -198,7 +199,9 @@ module SiSU_XML_Docbook_Book filename_docbook.puts head data.each_with_index do |o,i| if (defined? o.ocn and not o.ocn.nil?) - ocn="\n#{Dx[:ocn_o]}#{o.ocn}#{Dx[:ocn_c]}" + ocn=(@make.build.ocn?) \ + ? "\n#{Dx[:ocn_o]}#{o.ocn}#{Dx[:ocn_c]}" + : '' id=%{ id="o#{o.ocn}" } else ocn,id='','' diff --git a/lib/sisu/v6/xml_fictionbook2.rb b/lib/sisu/v6/xml_fictionbook2.rb index 7d86e9f9..d0ad4a7f 100644 --- a/lib/sisu/v6/xml_fictionbook2.rb +++ b/lib/sisu/v6/xml_fictionbook2.rb @@ -304,7 +304,12 @@ module SiSU_XML_Fictionbook doc_position=:head filename_fictionbook.puts head data.each_with_index do |o,i| - ocn=(defined? o.ocn and not o.ocn.nil?) ? "\n#{Dx[:ocn_o]}#{o.ocn}#{Dx[:ocn_c]}" : '' + ocn=if @make.build.ocn? + (defined? o.ocn and not o.ocn.nil?) \ + ? "\n#{Dx[:ocn_o]}#{o.ocn}#{Dx[:ocn_c]}" + : '' + else '' + end if o.is ==:heading unless doc_position==:head filename_fictionbook.puts structure_build_tag_close(o.lc,h) -- cgit v1.2.3