diff options
author | Li Haoyi <haoyi@dropbox.com> | 2014-11-10 22:51:49 -0800 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2014-11-10 22:51:49 -0800 |
commit | 7903f44bfb61d292e497fb40ac8a36ba03cedb2a (patch) | |
tree | f768813f144c7b1a8733c6dcc0deb92e4b110837 /book/src/main/scala/book/Utils.scala | |
parent | ebdba5a49e6c1be8d271752d1d546142c37453a9 (diff) | |
download | hands-on-scala-js-7903f44bfb61d292e497fb40ac8a36ba03cedb2a.tar.gz hands-on-scala-js-7903f44bfb61d292e497fb40ac8a36ba03cedb2a.tar.bz2 hands-on-scala-js-7903f44bfb61d292e497fb40ac8a36ba03cedb2a.zip |
Fixed up table CSS, standardized tables, standardized links
Diffstat (limited to 'book/src/main/scala/book/Utils.scala')
-rw-r--r-- | book/src/main/scala/book/Utils.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/book/src/main/scala/book/Utils.scala b/book/src/main/scala/book/Utils.scala index 494b861..9f11f8e 100644 --- a/book/src/main/scala/book/Utils.scala +++ b/book/src/main/scala/book/Utils.scala @@ -3,6 +3,14 @@ package book import acyclic.file import scala.collection.mutable import scalatags.Text.all._ +case class pureTable(header: Frag*){ + def apply(content: Frag*) = { + table(cls:="pure-table pure-table-horizontal half-table")( + thead(header), + tbody(content) + ) + } +} object sect{ var indent = 0 @@ -57,6 +65,13 @@ case class sect(name: String, subname: String = ""){ } } case class Node(name: String, children: mutable.Buffer[Node]) +object lnk{ + val usedLinks = mutable.Set.empty[String] + def apply(name: String, url: String) = { + usedLinks.add(url) + a(name, href:=url) + } +} object hl{ def highlight(snippet: Seq[String], lang: String) = { |