summaryrefslogtreecommitdiff
path: root/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala')
-rw-r--r--src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala31
1 files changed, 3 insertions, 28 deletions
diff --git a/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala b/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala
index 038d85b7a8..0f37f86b3e 100644
--- a/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala
+++ b/src/scaladoc/scala/tools/nsc/doc/html/HtmlPage.scala
@@ -216,34 +216,6 @@ abstract class HtmlPage extends Page { thisPage =>
val Trait, Class, Type, Object, Package = Value
}
- /** Returns the _big image name and the alt attribute
- * corresponding to the DocTemplate Entity (upper left icon) */
- def docEntityKindToBigImage(ety: DocTemplateEntity) = {
- def entityToImage(e: DocTemplateEntity) =
- if (e.isTrait) Image.Trait
- else if (e.isClass) Image.Class
- else if (e.isAbstractType || e.isAliasType) Image.Type
- else if (e.isObject) Image.Object
- else if (e.isPackage) Image.Package
- else {
- // FIXME: an entity *should* fall into one of the above categories,
- // but AnyRef is somehow not
- Image.Class
- }
-
- val image = entityToImage(ety)
- val companionImage = ety.companion filter {
- e => e.visibility.isPublic && ! e.inSource.isEmpty
- } map { entityToImage }
-
- (image, companionImage) match {
- case (from, Some(to)) =>
- ((from + "_to_" + to + "_big.png").toLowerCase, from + "/" + to)
- case (from, None) =>
- ((from + "_big.png").toLowerCase, from.toString)
- }
- }
-
def permalink(template: Entity, isSelf: Boolean = true): Elem =
<span class="permalink">
<a href={ memberToUrl(template, isSelf) } title="Permalink">
@@ -251,6 +223,9 @@ abstract class HtmlPage extends Page { thisPage =>
</a>
</span>
+ def docEntityImageClass(tpl: DocTemplateEntity): String =
+ tpl.kind + tpl.companion.fold("")("-companion-" + _.kind)
+
def docEntityKindToCompanionTitle(ety: DocTemplateEntity, baseString: String = "See companion") =
ety.companion match{
case Some(companion) =>