Method: JsDuck::Tag::Aside#to_html

Defined in:
lib/jsduck/tag/aside.rb

#to_html(asides) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/jsduck/tag/aside.rb', line 34

def to_html(asides)
  asides.map do |aside|
    type = aside[:type]
    name = aside[:name]
    assets_group = get_assets_group(type)
    asset = assets_group[name]
    if asset
      url = "#!/#{type}/#{name}"
      heading = type.to_s.capitalize
      title = asset["title"]
      icon_url = assets_group.icon_url(asset)
      "        <div class='aside \#{type}'>\n          <h4>\#{heading}</h4>\n          <p><a href='\#{url}'><img src='\#{icon_url}' alt=''> \#{title}</a></p>\n        </div>\n      EOHTML\n    else\n      warn(\"Unknown @aside name: \#{type} \#{name}\")\n    end\n  end.compact\nend\n"