aboutsummaryrefslogtreecommitdiff
path: root/dottydoc/js/src/html/EntityLayout.scala
blob: fcb0cd5e0c8b3901f8b54a6a6fe203e1cab90a90 (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
package dotty.tools.dottydoc
package js
package html

import scalatags.JsDom.all._
import org.scalajs.dom
import org.scalajs.dom.html.{Anchor, Div}
import model._

case class EntityLayout(entity: Entity) extends MemberLayout {
  def html = div(
    cls := "page-content",
    div(raw(entity.comment.fold("")(_.body))),
    entity match {
      case e: Entity with Members if e.members.nonEmpty =>
        Seq(
          h5("Members"),
          div(
            cls := "mld-grid",
            e.members
              .collect { case x: Entity with Modifiers if !x.isPrivate => x}
              .flatMap(member(_, entity))
          )
        )
      case _ => ()
    }
  )
}