Module: Fig_00

Included in:
Fig_A, Fig_H, Fig_N, Fig_P, Fig_Z
Defined in:
lib/zine_brewer/templates/fig/module_fig_base.rb

Instance Method Summary collapse

Instance Method Details

#captionObject



20
21
22
23
24
25
26
# File 'lib/zine_brewer/templates/fig/module_fig_base.rb', line 20

def caption
  begin
    cap.chomp.sub(/^\\/, '').gsub(/\n/,'<br/>')
  rescue
    nil
  end
end

#imgs_listObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/zine_brewer/templates/fig/module_fig_base.rb', line 5

def imgs_list
  result = []
  (imgs rescue a_img_param).each do |h|
    a_img = {}
    raise "Error: No src:" if h["src"].nil?
    a_img[:fig_src] = make_src(h["src"])
    a_img[:href] = h["href"]
    a_img[:alt] = make_alt(h["alt"])
    a_img[:img_style] = make_img_style(h["width"], h["height"]) \
      unless h["width"].nil? && h["height"].nil?
    result << a_img
  end
  result
end