From d55a1f7d10c0707a3ebaa5d2a4ff0080808d00e9 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Sat, 20 Jul 2013 22:44:00 -0400 Subject: [PATCH 1/1] ni_nitdoc: fixed display for attributes in class page Signed-off-by: Alexandre Terrasa --- src/ni_nitdoc.nit | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/ni_nitdoc.nit b/src/ni_nitdoc.nit index fded40a..31b9455 100644 --- a/src/ni_nitdoc.nit +++ b/src/ni_nitdoc.nit @@ -1166,12 +1166,6 @@ redef class MProperty return "{intro_mclassdef.mclass.html_namespace(mbuilder)}::{intro.link(mbuilder)}" end - # Return the property signature decorated with html - fun html_signature(mbuilder: ModelBuilder): String do - var nprop = mbuilder.mpropdef2npropdef[intro] - return "{name}{nprop.html_signature(mbuilder)}" - end - # Escape name for html output redef fun name do return super.html_escape end @@ -1278,7 +1272,15 @@ redef class MMethodDef classes.add("public") end res.append("
") - res.append("

{mprop.html_signature(page.mbuilder)}

") + if nprop isa AAttrPropdef then + if nprop.mreadpropdef == self then + res.append("

{mprop.name}: {nprop.html_signature(page.mbuilder)}

") + else + res.append("

{mprop.name}(value: {nprop.html_signature(page.mbuilder)})

") + end + else + res.append("

{mprop.name}{nprop.html_signature(page.mbuilder)}

") + end res.append(html_info(page)) res.append("
") if nprop.comment == "" then @@ -1491,9 +1493,8 @@ redef class AAttrPropdef end redef fun html_signature(mbuilder) do - var res = "" - if n_type != null and n_type.to_html != "" then res += ": {n_type.to_html}" - return res + if n_type != null then return n_type.to_html + return "" end end -- 1.7.9.5