nitc :: CardCatalogPackage :: _id
nitc $ CardCatalogPackage :: SELF
Type of this instance, automatically specialized in every classnitc $ CardCatalogPackage :: rendering
Service used to render the content of the template.nitc :: CardCatalogPackage :: _id
nitc :: CardMEntity :: _id
template :: Template :: _is_frozen
Is the template allowing more modification (add
)
template :: Template :: _is_writing
Flag to avoid infinite recursivity if a template contains itselftemplate :: Template :: _render_done
Flag to avoid multiple renderingnitc :: CardMEntity :: _title
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: CardCatalog :: defaultinit
nitc :: CardMEntity :: defaultinit
template :: Template :: defaultinit
nitc :: StaticCard :: defaultinit
core :: Object :: defaultinit
core :: Writable :: defaultinit
nitc :: CardMEntity :: full_doc=
Render the mentity full documentation?template :: Template :: is_frozen=
Is the template allowing more modification (add
)
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
template :: Template :: is_writing
Flag to avoid infinite recursivity if a template contains itselftemplate :: Template :: is_writing=
Flag to avoid infinite recursivity if a template contains itselfcore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).template :: Template :: render_done=
Flag to avoid multiple renderingcore :: Writable :: write_to_bytes
Likewrite_to
but return a new Bytes (may be quite large)
core :: Writable :: write_to_file
Likewrite_to
but take care of creating the file
core :: Writable :: write_to_string
Likewrite_to
but return a new String (may be quite large).
# A card that displays a package from a Nit catalog
class CardCatalogPackage
super CardCatalog
super CardMEntity
autoinit(catalog, mentity)
redef var id = "package_{super}" is lazy
redef fun rendering do
var mpackage = self.mentity
if not mpackage isa MPackage then return
addn """
<div id='{{{id}}}' class='card'>
<div class='card-left text-center'>{{{mpackage.html_icon.write_to_string}}}</div>
<div class='card-body' style='width: 75%'>
<h5 class='card-heading'>
{{{mentity.html_declaration.write_to_string}}}
<small> """
for tag in mpackage.metadata.tags do
add "<span>"
add "<a href='tag_{tag.to_cmangle}.html' class='text-muted'>{tag}</a>"
if tag != mpackage.metadata.tags.last then addn ", "
add "</span>"
end
addn """</small>
</h5>"""
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>"
addn " <div class='card-right' style='width: 25%'>"
for maintainer in mpackage.metadata.maintainers do
addn maintainer.to_html
end
addn " <br>"
var license = mpackage.metadata.license
if license != null then
addn """
<span class='text-muted'>
<a href='http://opensource.org/licenses/{{{license}}}' class='text-muted'>
{{{license}}}
</a>
</span>"""
end
addn " </div>"
addn "</div>"
end
end
src/doc/static/static_cards.nit:503,1--556,3