From: Jean Privat Date: Mon, 6 Feb 2012 19:43:55 +0000 (-0500) Subject: nitdoc: add title to links with signature and documentation X-Git-Tag: v0.5~32^2~24 X-Git-Url: http://nitlanguage.org nitdoc: add title to links with signature and documentation Signed-off-by: Jean Privat --- diff --git a/src/nitdoc.nit b/src/nitdoc.nit index a0b7a44..104bfef 100644 --- a/src/nitdoc.nit +++ b/src/nitdoc.nit @@ -383,7 +383,7 @@ end redef class MMModule super MMEntity redef fun html_link(dctx) do - return "{self}" + return "{self}" end fun require_doc(dctx: DocContext): Bool @@ -630,7 +630,7 @@ redef class MMModule var lpi = self[gp.intro.local_class.global][gp] if lps.has(lpi) then - dctx.add("
  • I {lpi} ({lpi.local_class})
  • \n") + dctx.add("
  • I {lpi.html_open_link(dctx)}{lpi} ({lpi.local_class})
  • \n") lps.remove(lpi) else dctx.add("
  • I {lpi}") @@ -639,7 +639,7 @@ redef class MMModule if lps.length >= 1 then dctx.sort(lps) for lp in lps do - dctx.add("
  • R {lp} ({lp.local_class})
  • ") + dctx.add("
  • R {lp.html_open_link(dctx)}{lp} ({lp.local_class})
  • ") end end end @@ -716,11 +716,11 @@ redef class MMModule var lpi = self[gp.intro.local_class.global][gp] lps.remove(lpi) - dctx.add("
  • I {lpi} ({lpi.local_class})
  • \n") + dctx.add("
  • I {lpi.html_open_link(dctx)}{lpi} ({lpi.local_class})
  • \n") if lps.length >= 1 then dctx.sort(lps) for lp in lps do - dctx.add("
  • R {lp} ({lp.local_class})
  • \n") + dctx.add("
  • R {lp.html_open_link(dctx)}{lp} ({lp.local_class})
  • \n") end end end @@ -737,16 +737,34 @@ redef class MMLocalProperty return "PROP_{local_class}_{cmangle(name)}" end + fun html_open_link(dctx: DocContext): String + do + if not require_doc(dctx) then print "not required {self}" + var title = "{name}{signature.to_s}" + if short_doc != " " then + title += " #{short_doc}" + end + return "" + end + redef fun html_link(dctx) do if not require_doc(dctx) then print "not required {self}" - return "{self}" + var title = "{name}{signature.to_s}" + if short_doc != " " then + title += " #{short_doc}" + end + return "{self}" end fun html_link_special(dctx: DocContext, lc: MMLocalClass): String do if not require_doc(dctx) then print "not required {self}" - return "{self}" + var title = "{name}{signature_for(lc.get_type)}" + if short_doc != " " then + title += " #{short_doc}" + end + return "{self}" end # Kind of property (fun, attr, etc.) @@ -1057,7 +1075,7 @@ redef class MMLocalClass redef fun html_link(dctx) do if not require_doc(dctx) then print "{dctx.filename}: not required {self}" - return "{self}" + return "{self}" end redef fun short_doc do return global.intro.short_doc