diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/page/Index.scala | 20 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/resource/lib/index.css | 6 | ||||
-rw-r--r-- | test/scaladoc/run/SI-6017.scala | 4 |
3 files changed, 21 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Index.scala b/src/compiler/scala/tools/nsc/doc/html/page/Index.scala index 2f83741d4e..c76bdc58d9 100644 --- a/src/compiler/scala/tools/nsc/doc/html/page/Index.scala +++ b/src/compiler/scala/tools/nsc/doc/html/page/Index.scala @@ -48,14 +48,20 @@ class Index(universe: doc.Universe, val index: doc.Index) extends HtmlPage { </div> </body> - def letters: NodeSeq = { - val xs = index.firstLetterIndex.keys.toSeq - xs.sorted map { - c => <a target="template" href={ "index/index-" + c + ".html" }>{ - if (c == '_') '#' else c.toUpper - }</a> + def letters: NodeSeq = + '_' +: ('a' to 'z') map { + char => { + val label = if (char == '_') '#' else char.toUpper + + index.firstLetterIndex.get(char) match { + case Some(_) => + <a target="template" href={ "index/index-" + char + ".html" }>{ + label + }</a> + case None => <span>{ label }</span> + } + } } - } def browser = <div id="browser" class="ui-layout-west"> diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.css b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.css index 2a8f9b570a..55fb370a41 100644 --- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.css +++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.css @@ -206,7 +206,7 @@ h1 { border-right:0; } -#letters > a { +#letters > a, #letters > span { /* font-family: monospace;*/ color: #858484; font-weight: bold; @@ -214,6 +214,10 @@ h1 { text-shadow: #ffffff 0 1px 0; padding-right: 2px; } + +#letters > span { + color: #bbb; +} #tpl { display: block; diff --git a/test/scaladoc/run/SI-6017.scala b/test/scaladoc/run/SI-6017.scala index e729dca67d..9951534c6d 100644 --- a/test/scaladoc/run/SI-6017.scala +++ b/test/scaladoc/run/SI-6017.scala @@ -18,7 +18,9 @@ object Test extends ScaladocModelTest { assert(index.firstLetterIndex('s').keys.toSeq.length == 2) val indexPage = new Index(universe, index) - assert(indexPage.letters.length == 1) + val letters = indexPage.letters + assert(letters.length > 1) + assert(letters(0).toString == "<span>#</span>") } case _ => assert(false) } |