From 06145fcda953ce6ea963b63a91e4ac8103c9cc58 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 14 Feb 2014 00:26:53 -0500 Subject: v5 v6: ocn, object citation numbering, --no-numbering option & default tuning * add less cryptic --numbering --no-numbering command-line options (to --no-ocn) * plaintext & odt switch default to ocn==true for consistency with other output * [decide how fine-grained ocn/numbering switches could be: could be per output type by command-line instruction (see txt & odt); currently set per sisu instruction for all outputs] --- lib/sisu/v5/options.rb | 22 +++++++++++----------- lib/sisu/v5/sysenv.rb | 4 ++-- lib/sisu/v6/options.rb | 22 +++++++++++----------- lib/sisu/v6/sysenv.rb | 4 ++-- 4 files changed, 26 insertions(+), 26 deletions(-) (limited to 'lib/sisu') diff --git a/lib/sisu/v5/options.rb b/lib/sisu/v5/options.rb index bce0a8a4..85e71f40 100644 --- a/lib/sisu/v5/options.rb +++ b/lib/sisu/v5/options.rb @@ -666,10 +666,10 @@ module SiSU_Commandline { set: :filetype } else { set: :na } end - act[:ocn]=if mod.inspect =~/"--ocn"|"--inc-ocn"/ + act[:ocn]=if mod.inspect =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/ { bool: true, set: :on } - elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"/ \ - || act[:switch][:off].inspect =~/"ocn"/ + elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ \ + || act[:switch][:off].inspect =~/"ocn"|"--numbering"/ { bool: false, set: :off } else { bool: true, set: :na } end @@ -866,11 +866,11 @@ module SiSU_Commandline ? { bool: true, set: :on } : { bool: false, set: :na } act[:odt]=if cmd =~/o/ \ - or mod.inspect =~/"--odt"|"--odf"|"--odt-ocn"|"--odf-ocn"/ - act[:odt_ocn]=if (mod.inspect =~/"--odt-ocn"|"--odf-ocn"/ \ - or mod.inspect =~/"--ocn"|"--inc-ocn"/) + or mod.inspect =~/"--odt"|"--odf"|"--odt-(?:ocn|numbering)"|"--odf-(?:ocn|numbering)"/ + act[:odt_ocn]=if (mod.inspect =~/"--odt-(?:ocn|numbering)"|"--odf-(?:ocn|numbering)"/ \ + or mod.inspect =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/) { bool: true, set: :on } - elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"/ + elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ { bool: false, set: :off } else { bool: false, set: :na } @@ -905,11 +905,11 @@ module SiSU_Commandline ? { bool: true, set: :on } : { bool: false, set: :na } act[:txt]=if cmd =~/[at]/ \ - or mod.inspect =~/"--txt"|"--text"|"--plaintext"|"--txt-ocn"|"--text-ocn"|"--plaintext-ocn"/ - act[:txt_ocn]=if (mod.inspect =~/"--txt-ocn"|"--text-ocn"|"--plaintext-ocn"/ \ - or mod.inspect =~/"--ocn"|"--inc-ocn"/) + or mod.inspect =~/"--txt"|"--text"|"--plaintext"|"--txt-(?:ocn|numbering)"|"--text-(?:ocn|numbering)"|"--plaintext-(?:ocn|numbering)"/ + act[:txt_ocn]=if (mod.inspect =~/"--txt-(?:ocn|numbering)"|"--text-(?:ocn|numbering)"|"--plaintext-(?:ocn|numbering)"/ \ + or mod.inspect =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/) { bool: true, set: :on } - elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"/ + elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ { bool: false, set: :off } else { bool: false, set: :na } diff --git a/lib/sisu/v5/sysenv.rb b/lib/sisu/v5/sysenv.rb index 7d8a9766..491ca94f 100644 --- a/lib/sisu/v5/sysenv.rb +++ b/lib/sisu/v5/sysenv.rb @@ -3919,7 +3919,7 @@ WOK elsif env_rc.build.ocn? ==:off false else - false + true end end def odt_ocn? @@ -3936,7 +3936,7 @@ WOK elsif env_rc.build.ocn? ==:off false else - false + true end end def html_strict? diff --git a/lib/sisu/v6/options.rb b/lib/sisu/v6/options.rb index 6f4cce37..aacfcbe6 100644 --- a/lib/sisu/v6/options.rb +++ b/lib/sisu/v6/options.rb @@ -666,10 +666,10 @@ module SiSU_Commandline { set: :filetype } else { set: :na } end - act[:ocn]=if mod.inspect =~/"--ocn"|"--inc-ocn"/ + act[:ocn]=if mod.inspect =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/ { bool: true, set: :on } - elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"/ \ - || act[:switch][:off].inspect =~/"ocn"/ + elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ \ + || act[:switch][:off].inspect =~/"ocn"|"--numbering"/ { bool: false, set: :off } else { bool: true, set: :na } end @@ -866,11 +866,11 @@ module SiSU_Commandline ? { bool: true, set: :on } : { bool: false, set: :na } act[:odt]=if cmd =~/o/ \ - or mod.inspect =~/"--odt"|"--odf"|"--odt-ocn"|"--odf-ocn"/ - act[:odt_ocn]=if (mod.inspect =~/"--odt-ocn"|"--odf-ocn"/ \ - or mod.inspect =~/"--ocn"|"--inc-ocn"/) + or mod.inspect =~/"--odt"|"--odf"|"--odt-(?:ocn|numbering)"|"--odf-(?:ocn|numbering)"/ + act[:odt_ocn]=if (mod.inspect =~/"--odt-(?:ocn|numbering)"|"--odf-(?:ocn|numbering)"/ \ + or mod.inspect =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/) { bool: true, set: :on } - elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"/ + elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ { bool: false, set: :off } else { bool: false, set: :na } @@ -905,11 +905,11 @@ module SiSU_Commandline ? { bool: true, set: :on } : { bool: false, set: :na } act[:txt]=if cmd =~/[at]/ \ - or mod.inspect =~/"--txt"|"--text"|"--plaintext"|"--txt-ocn"|"--text-ocn"|"--plaintext-ocn"/ - act[:txt_ocn]=if (mod.inspect =~/"--txt-ocn"|"--text-ocn"|"--plaintext-ocn"/ \ - or mod.inspect =~/"--ocn"|"--inc-ocn"/) + or mod.inspect =~/"--txt"|"--text"|"--plaintext"|"--txt-(?:ocn|numbering)"|"--text-(?:ocn|numbering)"|"--plaintext-(?:ocn|numbering)"/ + act[:txt_ocn]=if (mod.inspect =~/"--txt-(?:ocn|numbering)"|"--text-(?:ocn|numbering)"|"--plaintext-(?:ocn|numbering)"/ \ + or mod.inspect =~/"--ocn"|"--inc-ocn"|"--numbering"|"--inc-numbering"/) { bool: true, set: :on } - elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"/ + elsif mod.inspect =~/"--no-ocn"|"--exc-ocn"|"--no-numbering"|"--exc-numbering"/ { bool: false, set: :off } else { bool: false, set: :na } diff --git a/lib/sisu/v6/sysenv.rb b/lib/sisu/v6/sysenv.rb index 16fbbf4c..ece3ca79 100644 --- a/lib/sisu/v6/sysenv.rb +++ b/lib/sisu/v6/sysenv.rb @@ -3921,7 +3921,7 @@ WOK elsif env_rc.build.ocn? ==:off false else - false + true end end def odt_ocn? @@ -3938,7 +3938,7 @@ WOK elsif env_rc.build.ocn? ==:off false else - false + true end end def html_strict? -- cgit v1.2.3