diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-08-08 14:19:57 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-08-19 15:37:33 +0200 |
commit | 079e3db0f157ee6eae9e8a34b3bbf7a75cdaa929 (patch) | |
tree | 3935ad3196cf7b6d957f16a02d43c49e21165568 /dottydoc/js/src | |
parent | 20fda579d76690cc86a1f0a5c9e703fa4a94cb47 (diff) | |
download | dotty-079e3db0f157ee6eae9e8a34b3bbf7a75cdaa929.tar.gz dotty-079e3db0f157ee6eae9e8a34b3bbf7a75cdaa929.tar.bz2 dotty-079e3db0f157ee6eae9e8a34b3bbf7a75cdaa929.zip |
Implement annotation parsing like CommentFactoryBase from nsc
Diffstat (limited to 'dottydoc/js/src')
-rw-r--r-- | dottydoc/js/src/html/EntityLayout.scala | 48 | ||||
-rw-r--r-- | dottydoc/js/src/model/entities.scala | 22 |
2 files changed, 47 insertions, 23 deletions
diff --git a/dottydoc/js/src/html/EntityLayout.scala b/dottydoc/js/src/html/EntityLayout.scala index 251644075..f81f42e02 100644 --- a/dottydoc/js/src/html/EntityLayout.scala +++ b/dottydoc/js/src/html/EntityLayout.scala @@ -58,28 +58,34 @@ case class EntityLayout(entity: Entity) extends MemberLayout { main( id := "entity-container", cls := "mdl-layout__content", - div( - cls := "page-content", - div(cls := "entity-title", entityTitle), - div(raw(entity.comment.fold("")(_.body))), - entity match { - case x if x.hasMembers => - val e = x.asInstanceOf[Entity with Members] - if (e.members.nonEmpty) - Seq( - h5("Members"), - div( - cls := "mld-grid", - e.members - .collect { - case x if x.hasModifiers && !x.isPrivate => x - } - .flatMap(member(_, entity)).toList + div( + cls := "page-content", + div(cls := "entity-title", entityTitle), + div(raw(entity.comment.fold("")(_.body))), + entity.comment.filter(_.authors.nonEmpty).map { comment => + dl( + dt(cls := "entity-authors", "Authors"), + comment.authors.map(x => dd(cls := "entity-author", raw(x))).toList + ) + }.toOption, + entity match { + case x if x.hasMembers => + val e = x.asInstanceOf[Entity with Members] + if (e.members.nonEmpty) + Seq( + h5("Members"), + div( + cls := "mdl-grid", + e.members + .collect { + case x if x.hasModifiers && !x.isPrivate => x + } + .flatMap(member(_, entity)).toList + ) ) - ) - case _ => () - } - ) + case _ => () + } + ) ), main( id := "search-results", diff --git a/dottydoc/js/src/model/entities.scala b/dottydoc/js/src/model/entities.scala index 4180ad431..ca1b5ec69 100644 --- a/dottydoc/js/src/model/entities.scala +++ b/dottydoc/js/src/model/entities.scala @@ -28,8 +28,26 @@ trait Entity extends sjs.Object { @ScalaJSDefined trait Comment extends sjs.Object { - val body: String - val short: String + val body: String + val short: String + val authors: sjs.Array[String] + val see: sjs.Array[String] + val result: sjs.UndefOr[String] + val throws: Map[String, String] + val valueParams: Map[String, String] + val typeParams: Map[String, String] + val version: sjs.UndefOr[String] + val since: sjs.UndefOr[String] + val todo: List[String] + val deprecated: sjs.UndefOr[String] + val note: List[String] + val example: List[String] + val constructor: sjs.UndefOr[String] + val group: sjs.UndefOr[String] + val groupDesc: Map[String, String] + val groupNames: Map[String, String] + val groupPrio: Map[String, String] + val hideImplicitConversions: List[String] } @ScalaJSDefined |