nitc :: CardInheritance :: _ancestors
Ancestors listnitc :: CardInheritance :: _descendants
Descendants listnitc :: CardInheritance :: _id
nitc :: CardInheritance :: _title
nitc :: CardInheritance :: ancestors=
Ancestors listnitc :: CardInheritance :: defaultinit
nitc :: CardInheritance :: descendants=
Descendants listnitc :: CardInheritance :: render_list
nitc $ CardInheritance :: SELF
Type of this instance, automatically specialized in every classnitc $ CardInheritance :: rendering
Service used to render the content of the template.nitc :: CardInheritance :: _ancestors
Ancestors listnitc :: CardInheritance :: _descendants
Descendants listnitc :: CardMEntity :: _id
nitc :: CardInheritance :: _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 :: CardInheritance :: _title
nitc :: CardMEntity :: _title
nitc :: CardInheritance :: ancestors=
Ancestors listcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: CardMEntity :: defaultinit
nitc :: StaticCard :: defaultinit
template :: Template :: defaultinit
core :: Object :: defaultinit
core :: Writable :: defaultinit
nitc :: CardInheritance :: defaultinit
nitc :: CardInheritance :: descendants=
Descendants listnitc :: 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 renderingnitc :: CardInheritance :: render_list
core :: 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 about the inheritance of a MEntity
class CardInheritance
super CardMEntity
# Ancestors list
var ancestors: nullable Array[MEntity] is writable
# Parents list
var parents: nullable Array[MEntity] is writable
# Children list
var children: nullable Array[MEntity] is writable
# Descendants list
var descendants: nullable Array[MEntity] is writable
redef var id = "inh_{super}" is lazy
redef var title = "Inheritance" is lazy
redef fun rendering do
var ancestors = self.ancestors
var descendants = self.descendants
if ancestors == null and parents == null and
children == null and descendants == null then return
addn "<div id='{id}' class='card'>"
addn " <div class='card-body'>"
if ancestors != null and ancestors.length <= 10 then
render_list("Ancestors", ancestors)
else
render_list("Parents", parents)
end
if descendants != null and descendants.length <= 10 then
render_list("Descendants", descendants)
else
render_list("Children", children)
end
addn " </div>"
addn "</div>"
end
private fun render_list(title: String, mentities: nullable Array[MEntity]) do
if mentities == null or mentities.is_empty then return
addn "<h4 id='{id}'>{title}</h4>"
addn "<ul class='list-unstyled'>"
for mentity in mentities do
addn html_list_item(mentity)
end
addn "</ul>"
end
private fun html_list_item(mentity: MEntity): ListItem do
var tpl = new Template
tpl.add mentity.html_namespace
var comment = mentity.mdoc_or_fallback
if comment != null then
tpl.add ": "
tpl.add comment.html_synopsis
end
return new ListItem(tpl)
end
end
src/doc/static/static_cards.nit:236,1--297,3