# A card about a definition in a linearization list
class CardLinearizationDef
super CardCode
# Is this card displayed by default?
var is_active: Bool = false is optional, writable
# Link to external code repository
#
# Used if `node` is null
var url: nullable String = null is optional, writable
redef var id = "def_{super}" is lazy
redef var title = mentity.full_name is lazy
redef fun rendering do
var url = self.url
var cin = if is_active then "in" else ""
var active = if is_active then "active" else ""
addn """
<div class='card {{{active}}}' id='{{{id}}}'>
<div class='card-body'>
<h5>
{{{mentity.html_icon.write_to_string}}}
{{{mentity.html_namespace.write_to_string}}}"""
if node != null then
addn """
<div class='btn-bar'>
<button class='btn btn-link' data-toggle='collapse'
data-target='#{{{mentity.html_id}}}'>
<span class='glyphicon glyphicon-console' title='Show code' />
</button>
</div>"""
else if url != null then
addn """
<div class='btn-bar'>
<a class='btn btn-link' href='{{{url}}}'>
<span class='glyphicon glyphicon-console' title='Show code' />
</a>
</div>"""
var mdoc = mentity.mdoc
if mdoc != null then
addn "<br/><br/>"
addn mdoc.html_documentation
end
end
addn "</h5>"
if node != null then
addn """
<div id='{{{mentity.html_id}}}' class='collapse {{{cin}}}'>
<pre>"""
render_code
addn """</pre>
<span class='text-muted'>{{{mentity.location.to_s}}}</span>
</div>"""
end
addn """
</div>
</div>"""
end
end
src/doc/static/static_cards.nit:324,1--385,3