nitc :: DocCommand :: to_html
# Render results as a HTML string
fun to_html: Writable do return "<p class='text-danger'>Not yet implemented</p>"
src/doc/templates/html_commands.nit:31,2--32,81
redef fun to_html do
var mentities = self.results
if mentities == null then return ""
var tpl = new Template
tpl.add "<ul>"
for mentity in mentities do
var mdoc = mentity.mdoc_or_fallback
tpl.add "<li>"
tpl.add mentity.html_link
if mdoc != null then
tpl.add " - "
tpl.add mdoc.html_synopsis
end
tpl.add "</li>"
end
tpl.add "</ul>"
return tpl.write_to_string
end
src/doc/templates/html_commands.nit:60,2--78,4
redef fun to_html do
var mentity = self.mentity
if mentity == null then return ""
var mdoc = self.mdoc
var tpl = new Template
tpl.add "<h3>"
# FIXME comments left here until I figure out what to do about the presentation options
# if not opts.has_key("no-link") then
tpl.add mentity.html_link
# end
if mdoc != null then
# if not opts.has_key("no-link") and not opts.has_key("no-synopsis") then
tpl.add " - "
# end
# if not opts.has_key("no-synopsis") then
tpl.add mdoc.html_synopsis
# end
end
tpl.add "</h3>"
if mdoc != null then
# if not opts.has_key("no-comment") then
tpl.add mdoc.html_comment
# end
end
return tpl.write_to_string
end
src/doc/templates/html_commands.nit:82,2--108,4
redef fun to_html do
var name = self.maintainer
if name == null then return ""
return "<b>{name.html_escape}</b>"
end
src/doc/templates/html_commands.nit:255,2--260,4
redef fun to_html do
var names = self.contributors
if names == null or names.is_empty then return ""
var tpl = new Template
tpl.add "<ul>"
for name in names do
tpl.add "<li><b>{name.html_escape}</b></li>"
end
tpl.add "</ul>"
return tpl.write_to_string
end
src/doc/templates/html_commands.nit:264,2--275,4
redef fun to_html do
var options = self.options
if options == null or options.is_empty then return ""
var tpl = new Template
tpl.addn "<pre>"
tpl.addn "<table width='100%'>"
for opt, desc in options do
tpl.addn "<tr>"
tpl.addn "<th valign='top' width='30%'>{opt}</th>"
tpl.addn "<td width='70%'>{desc}</td>"
tpl.addn "</tr>"
end
tpl.addn "</table>"
tpl.addn "</pre>"
return tpl.write_to_string
end
src/doc/templates/html_commands.nit:330,2--347,4