diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-05-12 22:43:02 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-05-12 22:43:02 -0400 |
commit | 9d76329a6203dbb2b48b926d764b3429ac04ea5c (patch) | |
tree | 0d0cfaf0af56bdc688a38bd43e06110e0d90dcb8 /lib/sisu/v6/sysenv.rb | |
parent | v6: texpdf, pdf default font size configurable (cli & sisurc.yml) (no fractions) (diff) |
v6: texpdf, pdf colored hyperlinks configurable
* --pdf-hyperlinks-color
--pdf-hyperlinks-no-color or --pdf-hyperlinks-monochrome
* ['default']['pdf_hyperlinks']='color'
(other options switch hyperlink color off 'no-color' 'color-off' 'monochrome')
* (Closes: #744391) no color on a4 portrait
see discussion in sisu.org
Diffstat (limited to 'lib/sisu/v6/sysenv.rb')
-rw-r--r-- | lib/sisu/v6/sysenv.rb | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/sisu/v6/sysenv.rb b/lib/sisu/v6/sysenv.rb index 6136d248..8c819d9b 100644 --- a/lib/sisu/v6/sysenv.rb +++ b/lib/sisu/v6/sysenv.rb @@ -1874,6 +1874,48 @@ WOK file=@fns.gsub(/\.ssm(?:\.sst)?/,'.ssm.sst') "#{source_file_path}/#{file}" end + def texpdf_hyperlinks(cli) + @cli=cli + @hyplnks=if cli != :na + cli + elsif (defined? @rc['default']['pdf_hyperlinks']) \ + && (@rc['default']['pdf_hyperlinks']=~/color/) + :color + elsif (defined? @rc['default']['pdf_hyperlinks']) \ + && (@rc['default']['pdf_hyperlinks']=~/(?:no-color|color-off|mono(?:chrome)?)/) + :mono + else :na + end + def landscape + if @cli != :na + @cli + elsif (defined? @rc['default']['pdf_hyperlinks_landscape']) \ + && (@rc['default']['pdf_hyperlinks_landscape']=~/color/) + :color + elsif (defined? @rc['default']['pdf_hyperlinks_landscape']) \ + && (@rc['default']['pdf_hyperlinks_landscape']=~/(?:no-color|color-off|mono(?:chrome)?)/) + :mono + elsif @hyplnks != :na + @hyplnks + else :na + end + end + def portrait + if @cli != :na + @cli + elsif (defined? @rc['default']['pdf_hyperlinks_portrait']) \ + && (@rc['default']['pdf_hyperlinks_portrait']=~/color/) + :color + elsif (defined? @rc['default']['pdf_hyperlinks_portrait']) \ + && (@rc['default']['pdf_hyperlinks_portrait']=~/(?:no-color|color-off|mono(?:chrome)?)/) + :mono + elsif @hyplnks != :na + @hyprlnks + else :na + end + end + self + end def font def size(pt=nil) if pt && pt != :na |