aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2012-10-03 00:24:05 -0400
committerRalph Amissah <ralph@amissah.com>2012-10-03 00:24:05 -0400
commitc041ea2efdc0f1c6d2ecb07f9f29ba3ddf37a39f (patch)
tree0e2118774a19509ac47732424d04d5baa670c486 /lib/sisu/v4
parentv4: param (header make), html, home button: text button; image/icon button (diff)
v4: param (header make), pdf, footer
Diffstat (limited to 'lib/sisu/v4')
-rw-r--r--lib/sisu/v4/param.rb26
-rw-r--r--lib/sisu/v4/texpdf_format.rb13
2 files changed, 29 insertions, 10 deletions
diff --git a/lib/sisu/v4/param.rb b/lib/sisu/v4/param.rb
index 740a7598..f9607df2 100644
--- a/lib/sisu/v4/param.rb
+++ b/lib/sisu/v4/param.rb
@@ -1071,6 +1071,12 @@ module SiSU_Param
else nil
end
end
+ def footer
+ s=if @h['footer']
+ @h['footer'].split(/\s*;\s*/)
+ else nil
+ end
+ end
self
end
def current_publisher
@@ -1162,6 +1168,7 @@ module SiSU_Param
else
".#{@opt.lng}"
end
+ @footer_links= { left: { say: '', url: '' }, center: { say: '', url: '' } }
@rgx_image=/(?:^|[^_\\])\{(?:\s*|\~\^\s+)(\S+?\.(?:png|jpg|gif)\b)/m
@rgx_audio=/\{\s*(\S+?\.(?:mp3|ogg))/
@rgx_mm=/\{\s*(\S+?\.(?:ogg|mpeg))/ #expand and distinguish ogg
@@ -1361,6 +1368,25 @@ module SiSU_Param
? @make.manpage.section
: 1
end
+ if defined? @make.footer \
+ and @make.footer.is_a?(Array)
+ @footer_links= { left: { say: '', url: '' }, center: { say: '', url: '' } } #already set
+ @footer_links[:left]=if @make.footer[0]=~/\{.+?\}(?:(?:https?|file|ftp):\/|\.\.)\/\S+(?:\s|$)/
+ say,url=/\{\s*(.+?)\s*\}((?:(?:https?|file|ftp):\/|\.\.)\/\S+)/im.match(@make.footer[0])[1,2]
+ { say: say, url: url }
+ else
+ { say: '', url: '' }
+ end
+ @footer_links[:center]=if @make.footer[1]=~/\{.+?\}(?:(?:https?|file|ftp):\/|\.\.)\/\S+(?:\s|$)/
+ say,url=/\{\s*(.+?)\s*\}((?:(?:https?|file|ftp):\/|\.\.)\/\S+)/im.match(@make.footer[1])[1,2]
+ { say: say, url: url }
+ else
+ { say: '', url: '' }
+ end
+ @footer_links
+ else #already set
+ @footer_links= { left: { say: '', url: '' }, center: { say: '', url: '' } }
+ end
if defined? @make.home_button_text \
and @make.home_button_text.is_a?(Array)
a_idx=0
diff --git a/lib/sisu/v4/texpdf_format.rb b/lib/sisu/v4/texpdf_format.rb
index 3c2d9231..223633de 100644
--- a/lib/sisu/v4/texpdf_format.rb
+++ b/lib/sisu/v4/texpdf_format.rb
@@ -1422,16 +1422,9 @@ WOK
"\\rhead[ ]{ }\n"
end
def footer
- base_prog_txt=if @md.base_program
- case @md.base_program
- when /kdissert/i; " \\\\ \\href{http://freehackers.org/~tnagy/kdissert/}{Kdissert}"
- else ''
- end
- else ''
- end
- "\\lfoot[\\textrm{\\thepage}]{\\tiny \\href{#{@vz.url_footer_signature}}{#{@vz.txt_signature}}#{base_prog_txt}}\n" +
- "\\cfoot[\\href{#{@vz.url_home}}{#{@vz.url_txt}}]{\\href{#{@vz.url_home}}{#{@vz.url_txt}}}\n" +
- "\\rfoot[\\tiny \\href{#{@vz.url_sisu}}{#{@vz.txt_signature}}]{\\textrm{\\thepage}}\n"
+ f="\\lfoot[\\textrm{\\thepage}]{\\tiny \\href{#{@md.footer_links[:left][:url]}}{#{@md.footer_links[:left][:say]}}}\n" +
+ "\\cfoot{\\href{#{@md.footer_links[:center][:url]}}{#{@md.footer_links[:center][:say]}}}\n" +
+ "\\rfoot[\\tiny \\href{}{}]{\\textrm{\\thepage}}\n"
end
def site
if not @vz.url_home.empty? \