Do nothing by default but subclasses should put all their specific templating code in this method to regroup and simplify their logic
Note: to avoid inconsistencies, the template is automatically frozen
(see freeze
) after the invocation of rendering
.
# Service used to render the content of the template.
#
# Do nothing by default but subclasses should put all their specific
# templating code in this method to regroup and simplify their logic
#
# Note: to avoid inconsistencies, the template is automatically frozen
# (see `freeze`) after the invocation of `rendering`.
protected fun rendering do end
lib/template/template.nit:88,2--95,31
redef fun rendering
do
var header = header
if header != null then add header
var name = name
if annotations.is_empty then
add "module {name}\n\n"
else
add "module {name} is\n"
for annotation in annotations do add "\t{annotation}\n"
add "end\n\n"
end
for i in imports do
if i.to_s.has("import ") then
add i
else
add "import "
add i
end
add "\n"
end
add "\n"
for l in content do
add l
add "\n"
end
end
lib/gen_nit/gen_nit.nit:68,2--97,4
redef fun rendering
do
var code_message = http_status_codes[code]
var message
if code_message != null then
message = "Error {code}: {code_message}"
else message = "Error {code}"
add """
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<title>"""
add message
add """
</title>
</head>
<body>"""
var header = header
if header != null then add header
add """
<div class="container">
<h1>"""
add message
add "</h1>"
var body = body
if body != null then add body
add """
</div>
</body>
</html>"""
end
lib/nitcorn/http_errors.nit:37,2--74,4
redef fun rendering do add """
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{{message or else status}}}</title>
</head>
<body>
<h1>{{{status}}} {{{message or else ""}}}</h1>
</body>
</html>"""
lib/popcorn/examples/middlewares/example_html_error_handler.nit:28,2--38,12
redef fun rendering do
add """
COMPOSERS
=========
"""
add_all composers
add """
DETAILS
=======
"""
add_all composer_details
end
lib/template/examples/tmpl_composer.nit:38,2--50,4
redef fun rendering do add """
COMPOSER: {{{firstname}}} {{{lastname}}}
BIRTH...: {{{birth}}}
DEATH...: {{{death}}}
"""
lib/template/examples/tmpl_composer.nit:72,2--77,3
redef fun rendering do
add "<span{render_css_classes} aria-hidden=\"true\"></span>"
end
lib/html/bootstrap.nit:229,2--231,4
redef fun rendering do
addn "<div{render_css_classes}>"
if is_dismissible then
add "<button type=\"button\" class=\"close\" data-dismiss=\"alert\""
add "aria-label=\"Close\"><span aria-hidden=\"true\">×</span>"
addn "</button>"
end
addn text.write_to_string
addn "</div>"
end
lib/html/bootstrap.nit:383,2--392,4
redef fun rendering do
addn "<div{render_css_classes}>"
var heading = self.heading
if heading != null then
addn "<div class=\"panel-heading\">"
addn heading.write_to_string
addn "</div>"
end
var body = self.body
if body != null then
addn "<div class=\"panel-body\">"
addn body.write_to_string
addn "</div>"
end
var footer = self.footer
if footer != null then
addn "<div class=\"panel-footer\">"
addn footer.write_to_string
addn "</div>"
end
addn "</div>"
end
lib/html/bootstrap.nit:449,2--470,4