nitc :: CardCode :: defaultinit
nitc :: CardCode :: render_code
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 :: CardMEntity :: defaultinit
nitc :: StaticCard :: defaultinit
core :: Writable :: defaultinit
template :: Template :: defaultinit
core :: Object :: defaultinit
nitc :: CardCode :: 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).nitc :: CardCode :: render_code
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 the code of a MEntity
class CardCode
super CardMEntity
autoinit(mentity, node)
# AST node to display in this card
var node: nullable ANode is writable
redef var id = "code_{super}" is lazy
redef var title = "Code"
redef fun rendering do
addn "<div id='{id}' class='card'>"
addn " <div class='card-body'>"
if node != null then
addn "<pre>"
render_code
addn "</pre>"
end
addn "<span class='text-muted'>{mentity.location}</span>"
addn " </div>"
addn "</div>"
end
private fun render_code do
var node = self.node
if node == null then return
var hl = new HtmlightVisitor
hl.show_infobox = false
hl.highlight_node node
addn hl.html
end
end
src/doc/static/static_cards.nit:387,1--421,3