From 756caa5d09492586824354864be6a5c9fe244005 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 12 Mar 2012 18:45:04 -0400 Subject: v3dv: start using output control hooks * for config file, document headers, & command line * v3dv: sysenv, ProcessingSettings, start to use hooks to make it possible to control (via: the command line; the document markup header, or; the configuration file) the likes of: ocn, toc, segsubtoc, minitoc, links-to-manifest, search-form, html-navigation, html-navigation-bar, html-right-pane, html-top-band; these are switched on by default and may be switched off in omit lists within configuration file, the document markup header, or command line. The command line takes precedence & may switch on or off overriding settings within the document markup header or the sisu configuration file. * --inc- on by default, but if switched off in doc header or configuration, the command line --inc- has precedence; for each possible exclude configuration the --inc- switch that overrides configuration settings * --exc- == --no-; exclude/switch off feature (but --inc- include has precedence) * document header @build: :omit: [list output features to be omitted] * configuration (sisurc.yml) omit: exclude output feature, overrides configuration settings (omit --dev development branch modifier once merged back to main) --exc-ocn, html (seg, scroll), epub, xml, pdf sisu --dev --exc-ocn --html --epub --xml-sax --xml-dom --xhtml -v \ filename.sst --exc-toc, html (scroll), epub, pdf sisu --dev --exc-toc --html --epub --pdf -v filename.sst --exc-segsubtoc html (seg), epub sisu --dev --exc-segsubtoc --html --epub -v filename.sst --exc-minitoc, html (seg), concordance, manifest sisu --dev --exc-minitoc --html --concordance -v filename.sst --exc-manifest-minitoc, manifest sisu --dev --exc-manifest-minitoc --html -v filename.sst --exc-links_to_manifest, --exc-manifest-links, html (seg, scroll) sisu --dev --exc-manifest-links --html -v filename.sst --exc-search-form, html (seg, scroll), manifest sisu --dev --exc-search-form --html -v filename.sst --exc-html-minitoc, html (seg), concordance sisu --dev --exc-html-minitoc --html --concordance -v filename.sst --exc-html-navigation, html (seg, scroll)? sisu --dev --exc-html-navigation --html -v filename.sst --exc-html-navigation-bar, html (seg) sisu --dev --exc-html-navigation-bar --html -v filename.sst --exc-html-search-form, html (seg, scroll) sisu --dev --exc-html-search-form --html -v filename.sst --exc-html-right-pane, html (seg, scroll) sisu --dev --exc-html-right-pane --html -v filename.sst --exc-html-top-band, html (seg, scroll), concordance (minitoc is forced on to provide seg navigation) sisu --dev --exc-html-top-band --html --concordance -v filename.sst --- lib/sisu/v3dv/epub_segments.rb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'lib/sisu/v3dv/epub_segments.rb') diff --git a/lib/sisu/v3dv/epub_segments.rb b/lib/sisu/v3dv/epub_segments.rb index 96abfdc0..262fde3c 100644 --- a/lib/sisu/v3dv/epub_segments.rb +++ b/lib/sisu/v3dv/epub_segments.rb @@ -61,8 +61,8 @@ module SiSU_EPUB_Seg require_relative 'epub' # epub.rb require_relative 'shared_metadata' # shared_metadata.rb class Output - def initialize(md,outputfile,seg,minitoc,type='') - @md,@output_epub_cont_seg,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type + def initialize(md,outputfile,seg,type='') + @md,@output_epub_cont_seg,@seg,@type=md,outputfile,seg,type end def output #CONSIDER if @seg[:title] =~/\S/ @@ -132,10 +132,10 @@ WOK @vz=SiSU_Env::GetInit.instance.skin @seg_name_xhtml=@@seg_name_xhtml || nil @seg_name_xhtml_tracker=@@tracker || nil + @make=SiSU_Env::ProcessingSettings.new(@md) if @md end def songsheet begin - @minitoc=SiSU_EPUB::Source::Toc.new(@md,@data).minitoc data=get_subtoc_endnotes(@data) data=articles(data) SiSU_EPUB_Seg::Seg.new.cleanup # (((( added )))) @@ -231,15 +231,15 @@ WOK output_epub_cont_seg=File.new(segfilename,'w') if @@seg_name_xhtml[tracking-1] if dob.is==:heading \ or @@seg_name_xhtml[tracking-1] !~/endnotes|book_index|metadata/ - SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,@minitoc).output + SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg).output elsif dob.is==:heading_insert if @@seg_name_xhtml[tracking-1]=='endnotes' - SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'endnotes').output + SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,'endnotes').output elsif @@seg_name_xhtml[tracking-1]=='book_index' - SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'idx').output + SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,'idx').output @@seg[:idx]=[] elsif @@seg_name_xhtml[tracking-1]=='metadata' # navigation bug FIX - SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'metadata').output + SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,'metadata').output else puts "#{__FILE__}::#{__LINE__}" end else puts "#{__FILE__}::#{__LINE__}" @@ -250,7 +250,7 @@ WOK if @@seg_name_xhtml[tracking] =='metadata' segfilename="#{dir_epub_cont}/#{@@seg_name_xhtml[tracking]}#{Sfx[:epub_xhtml]}" output_epub_cont_seg=File.new(segfilename,'w') - SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,@minitoc,'metadata').output + SiSU_EPUB_Seg::Output.new(@md,output_epub_cont_seg,@@seg,'metadata').output SiSU_EPUB_Seg::Seg.new.reinitialise #BUG navigation bug with items following metadata, and occurring before manifest, this becomes a bug ... work area for book index, FIX end #@output_epub_cont_seg.close #%(((( EOF )))) --> @@ -411,7 +411,9 @@ WOK and dob.ln==4 @@seg[:main] << %{\n
\n} @@seg[:main] << dob_xhtml - @@seg[:main] << @@seg_subtoc[@@get_hash_fn] #% insertion of sub-toc + if @make.build.segsubtoc? + @@seg[:main] << @@seg_subtoc[@@get_hash_fn] #% insertion of sub-toc + end else @@seg[:main] << dob_xhtml end -- cgit v1.2.3