Module: Card::Set::All::Links::HtmlFormat

Extended by:
Card::Set::AbstractFormat
Defined in:
tmpsets/set/mod021-standard/all/links.rb

Instance Method Summary collapse

Instance Method Details

in HTML, #link_to_card adds special css classes indicated whether a card is "known" (real or virtual) or "wanted" (unknown) TODO: upgrade from (known/wanted)-card to (real/virtual/unknown)-card



110
111
112
113
114
115
# File 'tmpsets/set/mod021-standard/all/links.rb', line 110

def link_to_card cardish, text=nil, opts={}
  name = Card::Name[cardish]
  slotterify opts if opts[:slotter]
  add_known_or_wanted_class opts, name
  super name, (text || name), opts
end

in HTML, #link_to_resource automatically adds a target to external resources so they will open in another tab. It also adds css classes indicating whether the resource is internal or external



126
127
128
129
# File 'tmpsets/set/mod021-standard/all/links.rb', line 126

def link_to_resource resource, text=nil, opts={}
  add_resource_opts opts, resource_type(resource)
  super
end

in HTML, #link_to_view defaults to a remote link with rel="nofollow".



118
119
120
121
# File 'tmpsets/set/mod021-standard/all/links.rb', line 118

def link_to_view view, text=nil, opts={}
  slotterify opts
  super view, (text || view), opts
end