X-Git-Url: http://nitlanguage.org diff --git a/src/doc/html_templates/html_model.nit b/src/doc/html_templates/html_model.nit index 2118bfa..b5ccd96 100644 --- a/src/doc/html_templates/html_model.nit +++ b/src/doc/html_templates/html_model.nit @@ -20,19 +20,9 @@ import doc_down import html_components import html::bootstrap import ordered_tree +import model::model_collect redef class MEntity - # ID used as a HTML unique ID and in file names. - # - # **Must** match the following (POSIX ERE) regular expression: - # - # ~~~POSIX ERE - # ^[A-Za-z_][A-Za-z0-9._-]*$ - # ~~~ - # - # That way, the ID is always a valid URI component and a valid XML name. - fun nitdoc_id: String is abstract - # URL of this entity’s Nitdoc page. fun nitdoc_url: String is abstract @@ -341,8 +331,8 @@ redef class MClassDef redef fun css_classes do var set = new HashSet[String] if is_intro then set.add "intro" - for m in mclass.intro.modifiers do set.add m.to_cmangle - for m in modifiers do set.add m.to_cmangle + for m in mclass.intro.collect_modifiers do set.add m.to_cmangle + for m in collect_modifiers do set.add m.to_cmangle return set.to_a end end @@ -432,8 +422,8 @@ redef class MPropDef redef fun css_classes do var set = new HashSet[String] if is_intro then set.add "intro" - for m in mproperty.intro.modifiers do set.add m.to_cmangle - for m in modifiers do set.add m.to_cmangle + for m in mproperty.intro.collect_modifiers do set.add m.to_cmangle + for m in collect_modifiers do set.add m.to_cmangle return set.to_a end end @@ -462,22 +452,50 @@ redef class MMethodDef # FIXME annotation should be handled in their own way redef fun html_modifiers do + if mproperty.is_init then + var res = new Array[String] + if mproperty.visibility != public_visibility then + res.add mproperty.visibility.to_s + end + return res + end var res = super if is_abstract then res.add "abstract" else if is_intern then res.add "intern" end + res.add "fun" + return res + end + + redef fun html_declaration do if mproperty.is_init then - res.add "init" - else - res.add "fun" + var tpl = new Template + tpl.add "" + tpl.add html_modifiers.join(" ") + tpl.add " " + tpl.add html_link + tpl.add html_signature + tpl.add "" + return tpl end - return res + return super + end + + redef fun html_short_signature do + if mproperty.is_root_init and new_msignature != null then + return new_msignature.html_short_signature + end + return msignature.html_short_signature end - redef fun html_short_signature do return msignature.html_short_signature - redef fun html_signature do return msignature.html_signature + redef fun html_signature do + if mproperty.is_root_init and new_msignature != null then + return new_msignature.html_signature + end + return msignature.html_signature + end end redef class MVirtualTypeProp @@ -669,7 +687,7 @@ redef class MConcern private fun html_concern_item: ListItem do var lnk = html_link var tpl = new Template - tpl.add new Link.with_title("#{nitdoc_id}", lnk.text, lnk.title) + tpl.add new Link.with_title("#{nitdoc_id}.concern", lnk.text, lnk.title) var comment = html_short_comment if comment != null then tpl.add ": "