From 600b78374789fba87ef72e927207135653e03c1c Mon Sep 17 00:00:00 2001 From: Heather Miller Date: Thu, 22 Mar 2012 21:15:57 +0100 Subject: Scaladoc: improved usecases, display full signature. Closes #5291 Makes the full signature of a use case member available, but still hidden under a drop-down menu. --- .../scala/tools/nsc/doc/html/page/Template.scala | 13 +++++++++++- .../tools/nsc/doc/html/resource/lib/template.css | 24 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) (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 bd5f98bab7..0c9c88c0f5 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala @@ -345,6 +345,17 @@ class Template(universe: doc.Universe, tpl: DocTemplateEntity) extends HtmlPage } } + val fullSignature: Seq[scala.xml.Node] = { + mbr match { + case nte: NonTemplateMemberEntity if nte.isUseCase => +
+ Full Signature +
{ signature(nte.useCaseOf.get,true) }
+
+ case _ => NodeSeq.Empty + } + } + val selfType: Seq[scala.xml.Node] = mbr match { case dtpl: DocTemplateEntity if (isSelf && !dtpl.selfType.isEmpty && !isReduced) =>
Self Type
@@ -466,7 +477,7 @@ class Template(universe: doc.Universe, tpl: DocTemplateEntity) extends HtmlPage } // end attributes block vals --- - val attributesInfo = attributes ++ definitionClasses ++ selfType ++ annotations ++ deprecation ++ migration ++ sourceLink ++ mainComment + val attributesInfo = attributes ++ definitionClasses ++ fullSignature ++ selfType ++ annotations ++ deprecation ++ migration ++ sourceLink ++ mainComment val attributesBlock = if (attributesInfo.isEmpty) NodeSeq.Empty diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css index 4f552b7169..6fb83c133e 100644 --- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css +++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css @@ -340,6 +340,30 @@ div.members > ol > li:last-child { color: darkgreen; } +.full-signature-usecase h4 span { + font-size: 10pt; +} + +.full-signature-usecase > #signature { + padding-top: 0px; +} + +#template .full-signature-usecase > .signature.closed { + background: none; +} + +#template .full-signature-usecase > .signature.opened { + background: none; +} + +.full-signature-block { + padding: 5px 0 0; + border-top: 1px solid #EBEBEB; + margin-top: 5px; + margin-bottom: 5px; +} + + /* Comments text formating */ .cmt {} -- cgit v1.2.3