blob: 59ac4eb10585a23bee8717037fbe5f5871b1c53d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
/* NSC -- new Scala compiler
* Copyright 2007-2010 LAMP/EPFL
* @author David Bernard, Manohar Jonnalagedda
*/
package scala.tools.nsc
package doc
package html
package page
import model._
import scala.collection._
import scala.xml._
class Index(modelRoot: Package) extends HtmlPage {
def path = List("index.html")
def title = "Scaladoc: all classes and objects"
def headers =
<xml:group>
<style type="text/css">
@import url({ relativeLinkTo(List("index.css", "lib")) }) screen;
</style>
<script type="text/javascript" src={ relativeLinkTo{List("index.js", "lib")} }></script>
</xml:group>
def body =
<body>
<div id="browser">
<input id="quickflt" type="text" accesskey="/"/>
<div id="tpl">{
def packageElem(pack: model.Package): NodeSeq = {
<xml:group>
{ if (!pack.isRootPackage)
<h3><a class="tplshow" href={ relativeLinkTo(pack) }>{ pack.qualifiedName }</a></h3>
else NodeSeq.Empty
}
<ol class="templates">{
val tpls: Map[String, Seq[DocTemplateEntity]] =
(pack.templates filter (!_.isPackage)) groupBy (_.name)
for (tn <- tpls.keySet.toSeq sortWith (_.toLowerCase < _.toLowerCase)) yield {
val entries = tpls(tn) sortWith { (less, more) => less.isTrait || more.isObject }
def doEntry(ety: DocTemplateEntity, firstEty: Boolean): NodeSeq = {
val etyTpe =
if (ety.isTrait) "trait" else if (ety.isClass) "class" else if (ety.isObject) "object" else "package"
<a class="tplshow" href={ relativeLinkTo(ety) }>
{ if (firstEty) Text(packageQualifiedName(ety)) else NodeSeq.Empty }
<span class={ etyTpe }>({ Text(etyTpe) })</span>
</a>
}
<li title={ entries.head.qualifiedName }>{
doEntry(entries.head, true) ++ (entries.tail map (doEntry(_, false)))
}</li>
}
}</ol>
<ol class="packages"> {
for (sp <- pack.packages sortWith (_.name.toLowerCase < _.name.toLowerCase)) yield
<li>{ packageElem(sp) }</li>
}</ol>
</xml:group>
}
packageElem(modelRoot)
}</div>
</div>
<div id="content">
<iframe src={ relativeLinkTo{List("package.html")} }/>
</div>
</body>
def packageQualifiedName(ety: DocTemplateEntity): String =
if (ety.inTemplate.isPackage) ety.name else (packageQualifiedName(ety.inTemplate) + "." + ety.name)
}
|