class SiSU_Processing_Settings::ProcessingSettings

Public Class Methods

new(md) click to toggle source
# File lib/sisu/se_processing.rb, line 59
def initialize(md)
  @md=md
end

Public Instance Methods

build() click to toggle source
# File lib/sisu/se_processing.rb, line 76
def build
  def ocn?
    if cmd_rc_act[:ocn][:set]==:on
      true
    elsif cmd_rc_act[:ocn][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.ocn? \
    and doc_rc.toc? ==:off
      false
    elsif env_rc.build.ocn? ==:off
      false
    else
      true
    end
  end
  def plaintext_ocn?
    if cmd_rc_act[:txt_ocn][:set]==:on \
    or cmd_rc_act[:ocn][:set]==:on
      true
    elsif cmd_rc_act[:txt_ocn][:set]==:off \
    or cmd_rc_act[:ocn][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.ocn? \
    and doc_rc.toc? ==:off
      false
    elsif env_rc.build.ocn? ==:off
      false
    else
      true
    end
  end
  def odt_ocn?
    if cmd_rc_act[:odt_ocn][:set]==:on \
    or cmd_rc_act[:ocn][:set]==:on
      true
    elsif cmd_rc_act[:odt_ocn][:set]==:off \
    or cmd_rc_act[:ocn][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.ocn? \
    and doc_rc.toc? ==:off
      false
    elsif env_rc.build.ocn? ==:off
      false
    else
      true
    end
  end
  def html_strict?
    if cmd_rc_act[:html_strict][:set]==:on
      true
    elsif cmd_rc_act[:html_strict][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.html_strict? \
    and doc_rc.html_strict? ==:on
      true
    else
      false
    end
  end
  def toc?
    if cmd_rc_act[:toc][:set]==:on
      true
    elsif cmd_rc_act[:toc][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.toc? \
    and doc_rc.toc? ==:off
      false
    elsif env_rc.build.toc? ==:off
      false
    else
      true
    end
  end
  def manifest?
    if cmd_rc_act[:manifest][:set]==:on
      true
    elsif cmd_rc_act[:manifest][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.manifest? \
    and doc_rc.manifest? ==:off
      false
    elsif env_rc.build.manifest? ==:off
      false
    else
      true
    end
  end
  def links_to_manifest?
    if cmd_rc_act[:links_to_manifest][:set]==:on
      true
    elsif cmd_rc_act[:links_to_manifest][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.links_to_manifest? \
    and doc_rc.links_to_manifest? ==:off
      false
    elsif env_rc.build.links_to_manifest? ==:off
      false
    else
      true
    end
  end
  def metadata?
    if cmd_rc_act[:metadata][:set]==:on
      true
    elsif cmd_rc_act[:metadata][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.metadata? \
    and doc_rc.metadata? ==:off
      false
    elsif env_rc.build.metadata? ==:off
      false
    else
      true
    end
  end
  def minitoc?
    if html_top_band? == false #one form of navigation necessary
      true
    elsif cmd_rc_act[:minitoc][:set]==:on
      true
    elsif cmd_rc_act[:minitoc][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.minitoc? \
    and doc_rc.minitoc? ==:off
      false
    elsif env_rc.build.minitoc? ==:off
      false
    else
      false
    end
  end
  def manifest_minitoc?
    if html_top_band? == false #one form of navigation necessary
      true
    elsif cmd_rc_act[:manifest_minitoc][:set]==:on \
    || cmd_rc_act[:minitoc][:set]==:on
      true
    elsif cmd_rc_act[:manifest_minitoc][:set]==:off \
    || cmd_rc_act[:minitoc][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.manifest_minitoc? \
    and (doc_rc.manifest_minitoc? ==:off \
    || doc_rc.minitoc? ==:off)
      false
    elsif env_rc.build.manifest_minitoc? ==:off \
    || env_rc.build.minitoc? ==:off
      false
    elsif minitoc? == false
      false
    else
      false
    end
  end
  def html_minitoc?
    if html_top_band? == false #one form of navigation necessary
      true
    elsif cmd_rc_act[:html_minitoc][:set]==:on \
    || cmd_rc_act[:minitoc][:set]==:on
      true
    elsif cmd_rc_act[:html_minitoc][:set]==:off \
    || cmd_rc_act[:minitoc][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.html_minitoc? \
    and (doc_rc.html_minitoc? ==:off \
    || doc_rc.minitoc? ==:off)
      false
    elsif env_rc.build.html_minitoc? ==:off \
    || env_rc.build.minitoc? ==:off
      false
    elsif minitoc? == false
      false
    else
      false
    end
  end
  def html_top_band?
    if cmd_rc_act[:html_top_band][:set]==:on
      true
    elsif cmd_rc_act[:html_top_band][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.html_top_band? \
    and doc_rc.html_top_band? ==:off
      false
    elsif env_rc.build.html_top_band? ==:off
      false
    else
      true
    end
  end
  def html_navigation?
    if cmd_rc_act[:html_navigation][:set]==:on
      true
    elsif cmd_rc_act[:html_navigation][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.html_navigation? \
    and doc_rc.html_navigation? ==:off
      false
    elsif env_rc.build.html_navigation? ==:off
      false
    else
      true
    end
  end
  def html_navigation_bar?
    if cmd_rc_act[:html_navigation_bar][:set]==:on
      true
    elsif cmd_rc_act[:html_navigation_bar][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.html_navigation_bar? \
    and doc_rc.html_navigation_bar? ==:off
      false
    elsif env_rc.build.html_navigation_bar? ==:off
      false
    else
      false
    end
  end
  def search_form?
    if cmd_rc_act[:search_form][:set]==:on
      true
    elsif cmd_rc_act[:search_form][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.html_search_form? \
    and doc_rc.search_form? ==:off
      false
    elsif env_rc.build.search_form? ==:off
      false
    else
      true
    end
  end
  def html_search_form?
    if cmd_rc_act[:html_search_form][:set]==:on \
    || cmd_rc_act[:search_form][:set]==:on
      true
    elsif cmd_rc_act[:html_search_form][:set]==:off \
    || cmd_rc_act[:search_form][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.html_search_form? \
    and (doc_rc.html_search_form? ==:off \
    || doc_rc.search_form? ==:off)
      false
    elsif env_rc.build.html_search_form? ==:off \
    || env_rc.build.search_form? ==:off
      false
    elsif search_form? == false
      false
    else
      true
    end
  end
  def html_right_pane?
    if cmd_rc_act[:html_right_pane][:set]==:on
      true
    elsif cmd_rc_act[:html_right_pane][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.html_right_pane? \
    and doc_rc.html_right_pane? ==:off
      false
    elsif env_rc.build.html_right_pane? ==:off
      false
    else
      true
    end
  end
  def segsubtoc?
    if cmd_rc_act[:segsubtoc][:set]==:on
      true
    elsif cmd_rc_act[:segsubtoc][:set]==:off
      false
    elsif doc_rc.is_a?(Method) \
    and defined? doc_rc.segsubtoc? \
    and doc_rc.segsubtoc? ==:off
      false
    elsif env_rc.build.segsubtoc? ==:off
      false
    else
      true
    end
  end
  self
end
by?() click to toggle source
# File lib/sisu/se_processing.rb, line 439
def by?
  if dump?
    :dump
  elsif redirect?
    :redirect
  elsif by_language_code?
    :language
  elsif by_filetype?
    :filetype
  elsif by_filename?
    :filename
  else #recheck current default
    :language
  end
end
by_filename?() click to toggle source
# File lib/sisu/se_processing.rb, line 405
def by_filename?
  if cmd_rc_act[:output_by][:set] == :filename
    true
  elsif cmd_rc_act[:output_by][:set] == :language \
  or cmd_rc_act[:output_by][:set] == :filetype
    false
  elsif cmd_rc_act[:output_by][:set] == :filename
    true
  else
    env_rc.output_dir_structure.by_filename?
  end
end
by_filetype?() click to toggle source
# File lib/sisu/se_processing.rb, line 393
def by_filetype?
  if cmd_rc_act[:output_by][:set] == :filetype
    true
  elsif cmd_rc_act[:output_by][:set] == :language \
  or cmd_rc_act[:output_by][:set] == :filename
    false
  elsif cmd_rc_act[:output_by][:set] == :filetype
    true
  else
    env_rc.output_dir_structure.by_filetype?
  end
end
by_language_code?() click to toggle source
# File lib/sisu/se_processing.rb, line 381
def by_language_code?
  if cmd_rc_act[:output_by][:set] == :language
    true
  elsif cmd_rc_act[:output_by][:set] == :filetype \
  or cmd_rc_act[:output_by][:set] == :filename
    false
  elsif cmd_rc_act[:output_by][:set] == :language
    true
  else
    env_rc.output_dir_structure.by_language_code?
  end
end
cmd_rc_act() click to toggle source
# File lib/sisu/se_processing.rb, line 73
def cmd_rc_act #command-line rc
  @cmd_rc_act=@md.opt.opt_act
end
cnf_rc() click to toggle source
# File lib/sisu/se_processing.rb, line 62
def cnf_rc #sisurc.yml
  @rc=SiSU_Env::GetInit.new.sisu_yaml.rc
end
doc_rc() click to toggle source
# File lib/sisu/se_processing.rb, line 68
def doc_rc #document rc, make instructions
  (defined? @md.make) \
  ? @md.make
  : nil
end
dump?() click to toggle source
# File lib/sisu/se_processing.rb, line 420
def dump?
  ((cmd_rc_act[:dump][:bool] \
  &&  cmd_rc_act[:dump][:inst]) \
  || (env_rc.output_dir_structure.dump?)) \
  ? true
  : false
end
dump_or_redirect?() click to toggle source
# File lib/sisu/se_processing.rb, line 434
def dump_or_redirect?
  ((dump?) || (redirect?)) \
  ? true
  : false
end
env_rc() click to toggle source
# File lib/sisu/se_processing.rb, line 65
def env_rc #env rc (including sisurc.yml)
  @env_rc ||=SiSU_Env::InfoEnv.new(@md.fns)
end
html_minitoc?() click to toggle source
# File lib/sisu/se_processing.rb, line 239
def html_minitoc?
  if html_top_band? == false #one form of navigation necessary
    true
  elsif cmd_rc_act[:html_minitoc][:set]==:on \
  || cmd_rc_act[:minitoc][:set]==:on
    true
  elsif cmd_rc_act[:html_minitoc][:set]==:off \
  || cmd_rc_act[:minitoc][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.html_minitoc? \
  and (doc_rc.html_minitoc? ==:off \
  || doc_rc.minitoc? ==:off)
    false
  elsif env_rc.build.html_minitoc? ==:off \
  || env_rc.build.minitoc? ==:off
    false
  elsif minitoc? == false
    false
  else
    false
  end
end
html_navigation?() click to toggle source
# File lib/sisu/se_processing.rb, line 277
def html_navigation?
  if cmd_rc_act[:html_navigation][:set]==:on
    true
  elsif cmd_rc_act[:html_navigation][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.html_navigation? \
  and doc_rc.html_navigation? ==:off
    false
  elsif env_rc.build.html_navigation? ==:off
    false
  else
    true
  end
end
html_navigation_bar?() click to toggle source
# File lib/sisu/se_processing.rb, line 292
def html_navigation_bar?
  if cmd_rc_act[:html_navigation_bar][:set]==:on
    true
  elsif cmd_rc_act[:html_navigation_bar][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.html_navigation_bar? \
  and doc_rc.html_navigation_bar? ==:off
    false
  elsif env_rc.build.html_navigation_bar? ==:off
    false
  else
    false
  end
end
html_right_pane?() click to toggle source
# File lib/sisu/se_processing.rb, line 343
def html_right_pane?
  if cmd_rc_act[:html_right_pane][:set]==:on
    true
  elsif cmd_rc_act[:html_right_pane][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.html_right_pane? \
  and doc_rc.html_right_pane? ==:off
    false
  elsif env_rc.build.html_right_pane? ==:off
    false
  else
    true
  end
end
html_search_form?() click to toggle source
# File lib/sisu/se_processing.rb, line 322
def html_search_form?
  if cmd_rc_act[:html_search_form][:set]==:on \
  || cmd_rc_act[:search_form][:set]==:on
    true
  elsif cmd_rc_act[:html_search_form][:set]==:off \
  || cmd_rc_act[:search_form][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.html_search_form? \
  and (doc_rc.html_search_form? ==:off \
  || doc_rc.search_form? ==:off)
    false
  elsif env_rc.build.html_search_form? ==:off \
  || env_rc.build.search_form? ==:off
    false
  elsif search_form? == false
    false
  else
    true
  end
end
html_strict?() click to toggle source
# File lib/sisu/se_processing.rb, line 126
def html_strict?
  if cmd_rc_act[:html_strict][:set]==:on
    true
  elsif cmd_rc_act[:html_strict][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.html_strict? \
  and doc_rc.html_strict? ==:on
    true
  else
    false
  end
end
html_top_band?() click to toggle source
# File lib/sisu/se_processing.rb, line 262
def html_top_band?
  if cmd_rc_act[:html_top_band][:set]==:on
    true
  elsif cmd_rc_act[:html_top_band][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.html_top_band? \
  and doc_rc.html_top_band? ==:off
    false
  elsif env_rc.build.html_top_band? ==:off
    false
  else
    true
  end
end
manifest?() click to toggle source
# File lib/sisu/se_processing.rb, line 154
def manifest?
  if cmd_rc_act[:manifest][:set]==:on
    true
  elsif cmd_rc_act[:manifest][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.manifest? \
  and doc_rc.manifest? ==:off
    false
  elsif env_rc.build.manifest? ==:off
    false
  else
    true
  end
end
manifest_minitoc?() click to toggle source
# File lib/sisu/se_processing.rb, line 216
def manifest_minitoc?
  if html_top_band? == false #one form of navigation necessary
    true
  elsif cmd_rc_act[:manifest_minitoc][:set]==:on \
  || cmd_rc_act[:minitoc][:set]==:on
    true
  elsif cmd_rc_act[:manifest_minitoc][:set]==:off \
  || cmd_rc_act[:minitoc][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.manifest_minitoc? \
  and (doc_rc.manifest_minitoc? ==:off \
  || doc_rc.minitoc? ==:off)
    false
  elsif env_rc.build.manifest_minitoc? ==:off \
  || env_rc.build.minitoc? ==:off
    false
  elsif minitoc? == false
    false
  else
    false
  end
end
metadata?() click to toggle source
# File lib/sisu/se_processing.rb, line 184
def metadata?
  if cmd_rc_act[:metadata][:set]==:on
    true
  elsif cmd_rc_act[:metadata][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.metadata? \
  and doc_rc.metadata? ==:off
    false
  elsif env_rc.build.metadata? ==:off
    false
  else
    true
  end
end
minitoc?() click to toggle source
# File lib/sisu/se_processing.rb, line 199
def minitoc?
  if html_top_band? == false #one form of navigation necessary
    true
  elsif cmd_rc_act[:minitoc][:set]==:on
    true
  elsif cmd_rc_act[:minitoc][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.minitoc? \
  and doc_rc.minitoc? ==:off
    false
  elsif env_rc.build.minitoc? ==:off
    false
  else
    false
  end
end
multilingual?() click to toggle source
# File lib/sisu/se_processing.rb, line 417
def multilingual?
  by_language_code?
end
ocn?() click to toggle source
# File lib/sisu/se_processing.rb, line 77
def ocn?
  if cmd_rc_act[:ocn][:set]==:on
    true
  elsif cmd_rc_act[:ocn][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.ocn? \
  and doc_rc.toc? ==:off
    false
  elsif env_rc.build.ocn? ==:off
    false
  else
    true
  end
end
ocn_html_identifier() click to toggle source
# File lib/sisu/se_processing.rb, line 375
def ocn_html_identifier
  (build.html_strict?) \
  ? Mx[:ocn_id_char]
  : ''
end
odt_ocn?() click to toggle source
# File lib/sisu/se_processing.rb, line 109
def odt_ocn?
  if cmd_rc_act[:odt_ocn][:set]==:on \
  or cmd_rc_act[:ocn][:set]==:on
    true
  elsif cmd_rc_act[:odt_ocn][:set]==:off \
  or cmd_rc_act[:ocn][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.ocn? \
  and doc_rc.toc? ==:off
    false
  elsif env_rc.build.ocn? ==:off
    false
  else
    true
  end
end
output_dir_structure() click to toggle source
# File lib/sisu/se_processing.rb, line 380
def output_dir_structure
  def by_language_code?
    if cmd_rc_act[:output_by][:set] == :language
      true
    elsif cmd_rc_act[:output_by][:set] == :filetype \
    or cmd_rc_act[:output_by][:set] == :filename
      false
    elsif cmd_rc_act[:output_by][:set] == :language
      true
    else
      env_rc.output_dir_structure.by_language_code?
    end
  end
  def by_filetype?
    if cmd_rc_act[:output_by][:set] == :filetype
      true
    elsif cmd_rc_act[:output_by][:set] == :language \
    or cmd_rc_act[:output_by][:set] == :filename
      false
    elsif cmd_rc_act[:output_by][:set] == :filetype
      true
    else
      env_rc.output_dir_structure.by_filetype?
    end
  end
  def by_filename?
    if cmd_rc_act[:output_by][:set] == :filename
      true
    elsif cmd_rc_act[:output_by][:set] == :language \
    or cmd_rc_act[:output_by][:set] == :filetype
      false
    elsif cmd_rc_act[:output_by][:set] == :filename
      true
    else
      env_rc.output_dir_structure.by_filename?
    end
  end
  def multilingual?
    by_language_code?
  end
  def dump?
    ((cmd_rc_act[:dump][:bool] \
    &&  cmd_rc_act[:dump][:inst]) \
    || (env_rc.output_dir_structure.dump?)) \
    ? true
    : false
  end
  def redirect?
    ((cmd_rc_act[:redirect][:bool] \
    &&  cmd_rc_act[:redirect][:inst]) \
    || (env_rc.output_dir_structure.redirect?)) \
    ? true
    : false
  end
  def dump_or_redirect?
    ((dump?) || (redirect?)) \
    ? true
    : false
  end
  def by?
    if dump?
      :dump
    elsif redirect?
      :redirect
    elsif by_language_code?
      :language
    elsif by_filetype?
      :filetype
    elsif by_filename?
      :filename
    else #recheck current default
      :language
    end
  end
  self
end
plaintext_ocn?() click to toggle source
# File lib/sisu/se_processing.rb, line 92
def plaintext_ocn?
  if cmd_rc_act[:txt_ocn][:set]==:on \
  or cmd_rc_act[:ocn][:set]==:on
    true
  elsif cmd_rc_act[:txt_ocn][:set]==:off \
  or cmd_rc_act[:ocn][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.ocn? \
  and doc_rc.toc? ==:off
    false
  elsif env_rc.build.ocn? ==:off
    false
  else
    true
  end
end
redirect?() click to toggle source
# File lib/sisu/se_processing.rb, line 427
def redirect?
  ((cmd_rc_act[:redirect][:bool] \
  &&  cmd_rc_act[:redirect][:inst]) \
  || (env_rc.output_dir_structure.redirect?)) \
  ? true
  : false
end
search_form?() click to toggle source
# File lib/sisu/se_processing.rb, line 307
def search_form?
  if cmd_rc_act[:search_form][:set]==:on
    true
  elsif cmd_rc_act[:search_form][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.html_search_form? \
  and doc_rc.search_form? ==:off
    false
  elsif env_rc.build.search_form? ==:off
    false
  else
    true
  end
end
segsubtoc?() click to toggle source
# File lib/sisu/se_processing.rb, line 358
def segsubtoc?
  if cmd_rc_act[:segsubtoc][:set]==:on
    true
  elsif cmd_rc_act[:segsubtoc][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.segsubtoc? \
  and doc_rc.segsubtoc? ==:off
    false
  elsif env_rc.build.segsubtoc? ==:off
    false
  else
    true
  end
end
toc?() click to toggle source
# File lib/sisu/se_processing.rb, line 139
def toc?
  if cmd_rc_act[:toc][:set]==:on
    true
  elsif cmd_rc_act[:toc][:set]==:off
    false
  elsif doc_rc.is_a?(Method) \
  and defined? doc_rc.toc? \
  and doc_rc.toc? ==:off
    false
  elsif env_rc.build.toc? ==:off
    false
  else
    true
  end
end