From 6d898f1eb74160fbc7d6365b3ad8d6b9417d2f19 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 14 Feb 2012 21:32:53 -0500 Subject: v3dv: control hooks * hooks to make it possible to control (via: the command line; the document markup header, or; the command line) the likes of: toc, manifest, manifest-links, metadata, html-minitoc, html-navigation, html-navigation-bar; these are switched on by default and control takes the form of making it possible to switch them off. --- lib/sisu/v3dv/options.rb | 64 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) (limited to 'lib/sisu/v3dv/options.rb') diff --git a/lib/sisu/v3dv/options.rb b/lib/sisu/v3dv/options.rb index fbb3261e..b2b7ff15 100644 --- a/lib/sisu/v3dv/options.rb +++ b/lib/sisu/v3dv/options.rb @@ -486,8 +486,68 @@ module SiSU_Commandline || mod.inspect =~/"--maintenance|--keep-processing-files"/) \ ? { bool: true } : { bool: false } - act[:ocn]=if mod.inspect =~/"--no-ocn"/ - { bool: false } + act[:switch]=if mod.inspect =~/"--switch-off=/ + off_list=mod.join(';').gsub(/^.*--switch-off=['"]?(.+?)(?:['"];.+)?$/,'\1') + off_list=off_list.scan(/[^,;\s]+/) + { bool: false, off: off_list} + else { bool: true, off: [] } + end + act[:ocn]=if mod.inspect =~/"--no-ocn"/ \ + || act[:switch][:off].inspect =~/"ocn"/ + { bool: false } + else { bool: true } + end + act[:toc]=if mod.inspect =~/"--no-toc"/ \ + || act[:switch][:off].inspect =~/"toc"/ + { bool: false } + else { bool: true } + end + act[:manifest]=if mod.inspect =~/"--no-manifest"/ \ + || act[:switch][:off].inspect =~/"manifest"/ + #|| mod.inspect =~/"--(?:redirect|dump)/ + { bool: false } + else { bool: true } + end + act[:manifest_links]=if mod.inspect =~/"--no-manifest-links"/ \ + || act[:switch][:off].inspect =~/"manifest_links"/ \ + || mod.inspect =~/"--(?:redirect|dump)/ + { bool: false } + else { bool: true } + end + act[:manifest_minitoc]=if mod.inspect =~/"--no-manifest-minitoc"/ \ + || act[:switch][:off].inspect =~/"manifest_minitoc"|"minitoc"/ + #|| mod.inspect =~/"--(?:redirect|dump)/ + { bool: false } + else { bool: true } + end + act[:metadata]=if mod.inspect =~/"--no-metadata"/ \ + || act[:switch][:off].inspect =~/"metadata"/ + { bool: false } + else { bool: true } + end + act[:html_minitoc]=if mod.inspect =~/"--no-html-minitoc"/ \ + || act[:switch][:off].inspect =~/"html_minitoc"|"minitoc"/ + { bool: false } + else { bool: true } + end + act[:html_navigation]=if mod.inspect =~/"--no-html-navigation"/ \ + || act[:switch][:off].inspect =~/"html_navigation"|"nav"/ + { bool: false } + else { bool: true } + end + act[:html_navigation_bar]=if mod.inspect =~/"--no-html-navigation-bar"/ \ + || act[:switch][:off].inspect =~/"html_navigation_bar"|"navbar"/ + { bool: false } + else { bool: true } + end + act[:html_search_form]=if mod.inspect =~/"--no-html-search-form"/ \ + || act[:switch][:off].inspect =~/"html_search_form"|"search"/ + { bool: false } + else { bool: true } + end + act[:html_right_column]=if mod.inspect =~/"--no-html-right-column"/ \ + || act[:switch][:off].inspect =~/"html_right_column"|"promo"/ + { bool: false } else { bool: true } end act[:dal]=(cmd =~/m/ \ -- cgit v1.2.3