nitc :: CardMEntity :: defaultinit
# A card about a mentity
#
# It displays the documentation about the model entity.
class CardMEntity
super StaticCard
autoinit(mentity, full_doc)
# MEntity displayed in this card
var mentity: MEntity is writable
# Render the mentity full documentation?
var full_doc = false is optional, writable
redef var id = mentity.html_id is lazy
redef var title = mentity.html_name is lazy
redef fun rendering do
addn """
<div id='{{{id}}}' class='card'>
<div class='card-left text-center'>
{{{mentity.html_icon.write_to_string}}}
</div>
<div class='card-body'>
<h5 class='card-heading'>
{{{mentity.html_declaration.write_to_string}}}
</h5>
<p><small>{{{mentity.html_namespace.write_to_string}}}</small></p>"""
var mdoc = mentity.mdoc_or_fallback
if mdoc != null then
if full_doc then
addn mdoc.html_documentation
else
addn mdoc.html_synopsis
end
end
addn """
</div>
</div>"""
end
end
src/doc/static/static_cards.nit:176,1--215,3