diff options
Diffstat (limited to 'book/src/main/scala')
-rw-r--r-- | book/src/main/scala/book/Book.scala | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/book/src/main/scala/book/Book.scala b/book/src/main/scala/book/Book.scala index d301824..1798713 100644 --- a/book/src/main/scala/book/Book.scala +++ b/book/src/main/scala/book/Book.scala @@ -16,17 +16,21 @@ object Book { val intro = twf("book/intro.tw") val gettingStarted = twf("book/getting-started.tw") val contentBar = { - def rec(current: Node, depth: Int): Frag = { - div( - marginLeft := s"${depth * 5}px", - a(current.name, href:="#"+Utils.munge(current.name)), - current.children.map( - rec(_, depth + 1) + def rec(current: Node, depth: Int): Seq[Frag] = Seq( + li( + a( + current.name, + href:="#"+Utils.munge(current.name), + paddingLeft := s"${depth * 5}px", + cls := "menu-item" ) ) - } + ) ++ current.children.flatMap( + rec(_, depth + 1) + ) + // @li(cls:="menu-item-divided pure-menu-selected") - ul(rec(Utils.structure, 0)) + rec(Utils.structure, 0) } |