From edb78ae9dbfb502c6cb03aab08b1a15d5ba5678b Mon Sep 17 00:00:00 2001 From: Donna Malayeri Date: Mon, 4 Apr 2011 16:37:51 +0000 Subject: [scaladoc] Make object/template name be a link ... [scaladoc] Make object/template name be a link to the companion. Closes #4411. Review by extempore to make sure the design makes sense. --- .../scala/tools/nsc/doc/html/page/Template.scala | 31 ++++++++++------------ 1 file changed, 14 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala index 021d894358..e2a5f7d1fd 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala @@ -54,10 +54,20 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {

{ templatesToHtml(tpl.inTemplate.toRoot.reverse.tail, xml.Text(".")) }

} -
- -

{ if (tpl.isRootPackage) "root package" else tpl.name }

-
+ { val templateName = if (tpl.isRootPackage) "root package" else tpl.name + val displayName = tpl.companion match { + case Some(companion) => + if (companion.visibility.isPublic && companion.inSource != None) + { templateName } + else templateName + case _ => + templateName + } +
+ +

{ displayName }

+
+ } { signature(tpl, true) } { memberToCommentHtml(tpl, true) } @@ -275,19 +285,6 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage { attributes: { fvs map { fv => { inlineToHtml(fv.text) ++ xml.Text(" ") } } } } ++ - { tpl.companion match { - case Some(companion) if (isSelf && !isReduced) => - if (companion.visibility.isPublic && companion.inSource != None) { -
- go to: companion -
- } else { - NodeSeq.Empty - } - case _ => - NodeSeq.Empty - } - } ++ { val inDefTpls = mbr.inDefinitionTemplates if ((inDefTpls.tail.isEmpty && (inDefTpls.head == mbr.inTemplate)) || isReduced) NodeSeq.Empty else {
-- cgit v1.2.3