Browse files

added 'exportedImportToHtml' in HtmlPage.

  • Loading branch information...
1 parent 3512e20 commit 95dcb73d13510062785375e391d3aa52b7db1949 @rssh committed Nov 28, 2012
View
18 src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala
@@ -206,6 +206,24 @@ abstract class HtmlPage extends Page { thisPage =>
case tpl :: tpls => templateToHtml(tpl) ++ sep ++ templatesToHtml(tpls, sep)
}
+ /** Returns the HTML code that represents exported import in `tpl` as a hyperlinked name. */
+ def exportedImportToHtml(ei: ExportedImportEntity): NodeSeq =
+ typeToHtml(ei.base,true) ++ (ei.selectors map { sel =>
+ if (sel.to.nonEmpty)
+ // todo: make to links to approriative symbols.
+ <span class="import-selectors">{sel.from} => {sel.to}</span>
+ else
+ <span class="import-selectors">{sel.from}</span>
+ })
+
+
+ def exportedImportsToHtml(eiss: List[ExportedImportEntity], sep: NodeSeq): NodeSeq = eiss match {
+ case Nil => NodeSeq.Empty
+ case ei :: Nil => exportedImportToHtml(ei)
+ case ei :: eis => exportedImportToHtml(ei) ++ sep ++ exportedImportsToHtml(eis, sep)
+ }
+
+
/** Returns the _big image name corresponding to the DocTemplate Entity (upper left icon) */
def docEntityKindToBigImage(ety: DocTemplateEntity) =
if (ety.isTrait && !ety.companion.isEmpty && ety.companion.get.visibility.isPublic && ety.companion.get.inSource != None) "trait_to_object_big.png"
View
4 src/compiler/scala/tools/nsc/doc/html/page/Template.scala
@@ -636,12 +636,12 @@ class Template(universe: doc.Universe, generator: DiagramGenerator, tpl: DocTemp
}
val exportedImports = mbr match {
+ // TODO: get from dtpl fill deep exported imports/
case dtpl: DocTemplateEntity if isSelf && !isReduced && dtpl.exportedImports.nonEmpty =>
<div class="toggleContainer block">
<span class="toggle">Exported Imports</span>
<div class="exportedImports hiddenContent">{
- // !!!
- Text(dtpl.exportedImports.toString)
+ exportedImportsToHtml(dtpl.exportedImports, sep = scala.xml.Text(", "))
}</div>
</div>
case _ => NodeSeq.Empty

0 comments on commit 95dcb73

Please sign in to comment.