aboutsummaryrefslogtreecommitdiff
path: root/dottydoc
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-06-13 11:16:13 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-08-19 15:37:25 +0200
commit34590e7b62b58ef0ccbda58dcb4dea69ff492d25 (patch)
tree00c56f90cf104054504f8bf0f25dfc7531aeff6d /dottydoc
parent091272744ac958e847b408cd30b3bc9978136d0e (diff)
downloaddotty-34590e7b62b58ef0ccbda58dcb4dea69ff492d25.tar.gz
dotty-34590e7b62b58ef0ccbda58dcb4dea69ff492d25.tar.bz2
dotty-34590e7b62b58ef0ccbda58dcb4dea69ff492d25.zip
Add parameter-lists (text-only)
Diffstat (limited to 'dottydoc')
-rw-r--r--dottydoc/js/src/html/Member.scala10
-rw-r--r--dottydoc/js/src/model/entities.scala1
-rw-r--r--dottydoc/jvm/resources/index.css13
-rw-r--r--dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala6
4 files changed, 24 insertions, 6 deletions
diff --git a/dottydoc/js/src/html/Member.scala b/dottydoc/js/src/html/Member.scala
index 8b6a85e59..d0d2c4560 100644
--- a/dottydoc/js/src/html/Member.scala
+++ b/dottydoc/js/src/html/Member.scala
@@ -47,10 +47,10 @@ trait MemberLayout {
""",
onclick := { () => toggleBetween(shortComment, and = fullComment) },
div(
- cls := "mdl-cell mdl-cell--12-col",
+ cls := "mdl-cell mdl-cell--12-col member-definition",
span(
cls := "member-name",
- m.modifiers.mkString(" ") + " " + m.kind + " " + m.name + typeParams(m)
+ s"""${m.modifiers.mkString(" ")} ${m.kind} ${m.name}${typeParams(m)}${paramList(m)}"""
),
returnValue(m, parent)
),
@@ -62,6 +62,12 @@ trait MemberLayout {
}
}
+ def paramList(m: Entity): String = m match {
+ case d: Def if d.paramLists.nonEmpty =>
+ d.paramLists.map(xs => xs map { case (x, y: UnsetLink) => s"$x: ${y.query}" } mkString ("(", ", ", ")")).mkString("")
+ case _ => ""
+ }
+
def typeParams(m: Entity): String = m match {
case d: Def if d.typeParams.nonEmpty => d.typeParams.mkString("[", ", ", "]")
case _ => ""
diff --git a/dottydoc/js/src/model/entities.scala b/dottydoc/js/src/model/entities.scala
index 1d8c00b2c..a50a04271 100644
--- a/dottydoc/js/src/model/entities.scala
+++ b/dottydoc/js/src/model/entities.scala
@@ -53,6 +53,7 @@ trait Trait extends Class
@ScalaJSDefined
trait Def extends Entity with Modifiers {
val typeParams: sjs.Array[String]
+ //val paramLists: sjs.Array[sjs.Array[(String, _)]]
}
@ScalaJSDefined
diff --git a/dottydoc/jvm/resources/index.css b/dottydoc/jvm/resources/index.css
index c7292a1a4..4217eb286 100644
--- a/dottydoc/jvm/resources/index.css
+++ b/dottydoc/jvm/resources/index.css
@@ -1,3 +1,6 @@
+/* Fonts -------------------------------------------------------------------- */
+@import url(https://fonts.googleapis.com/css?family=Source+Code+Pro);
+
/* Sidebar ------------------------------------------------------------------ */
span.subtitle {
font-size: 12px;
@@ -100,12 +103,11 @@ main > div.page-content {
padding: 30px 60px;
}
-span.member-name, span.return-value {
- font-family: "Roboto","Helvetica","Arial",sans-serif;
+div.member-definition {
+ font-family: "Source Code Pro", sans-serif;
font-weight: 400;
font-size: 16px;
margin: 24px 0 16px;
- letter-spacing: .04em;
line-height: 24px;
}
@@ -117,6 +119,11 @@ div.member.member-fullcomment:hover {
cursor: pointer;
}
+div.full-comment,
+div.summary-comment {
+ margin-left: 0;
+}
+
/* Search results ----------------------------------------------------------- */
main#search-results {
display: none;
diff --git a/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala b/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala
index a97ee2bb5..2dfc98c42 100644
--- a/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala
+++ b/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala
@@ -62,7 +62,11 @@ object factories {
t.tparams.map(_.symbol.name.toString)
def paramLists(t: DefDef)(implicit ctx: Context): List[List[(String, MaterializableLink)]] = {
- Nil
+ def getParams(xs: List[ValDef]): List[(String, MaterializableLink)] = xs map { vd =>
+ (vd.name.toString, UnsetLink(Text(vd.tpt.show), vd.tpt.show))
+ }
+
+ t.vparamss.map(getParams)
}
def filteredName(str: String) = str