7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/slideshow/helpers/source_helper.rb', line 7
def source( *args )
opts = args.last.kind_of?(Hash) ? args.pop : {}
name_or_path = args.last.kind_of?(String) ? args.pop : "#{@name}#{@extname}"
link_text = opts[:text] || '(Source)'
name_or_path = "#{opts[:path]}/#{name_or_path}" if opts[:path]
name_or_path << @extname if File.extname( name_or_path ).empty?
base = 'http://github.com/geraldb/slideshow/raw/master/samples'
buf = "<a href='#{base}/#{name_or_path}'>#{link_text}</a>"
puts " Adding HTML for source link to '#{name_or_path}'..."
guard_inline( buf )
end
|