diff options
author | Li Haoyi <haoyi@dropbox.com> | 2015-03-28 22:16:57 +0800 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2015-03-28 22:16:57 +0800 |
commit | 1ac4a2594bf2ebe1fc80b93f1208343653892517 (patch) | |
tree | 7f07cee1d4e6a608853c6f862550675165b78dfb /book/src/main/scala/book/BookData.scala | |
parent | 7006cebd061784900233c405ce03665151b86010 (diff) | |
download | hands-on-scala-js-1ac4a2594bf2ebe1fc80b93f1208343653892517.tar.gz hands-on-scala-js-1ac4a2594bf2ebe1fc80b93f1208343653892517.tar.bz2 hands-on-scala-js-1ac4a2594bf2ebe1fc80b93f1208343653892517.zip |
scalatex 0.2.1
Diffstat (limited to 'book/src/main/scala/book/BookData.scala')
-rw-r--r-- | book/src/main/scala/book/BookData.scala | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/book/src/main/scala/book/BookData.scala b/book/src/main/scala/book/BookData.scala index 9fa4d5e..dc4d717 100644 --- a/book/src/main/scala/book/BookData.scala +++ b/book/src/main/scala/book/BookData.scala @@ -3,15 +3,18 @@ package book import java.io.File import acyclic.file -import ammonite.all._ +import ammonite.ops._ import ammonite.ops.Path import scalatags.Text.TypedTag import scalatags.Text.all._ +import scalatex.site +import scalatex.site.Highlighter + object BookData { - val wd = processWorkingDir + val wd = cwd val cloneRoot = Path(System.getProperty("clone.root")) - - + val lnk = book.lnk + val pureTable = book.pureTable lazy val javaAPIs = { import java.io.File @@ -48,23 +51,13 @@ object BookData { def less = div(cls:="pure-u-1 pure-u-md-11-24") def half = div(cls:="pure-u-1 pure-u-md-1-2") - - val hl = new scalatex.site.Highlighter { - override val pathMappings = Seq( + lazy val hl = new Highlighter { + override def pathMappings = Seq( cloneRoot/"scala-js" -> "https://github.com/scala-js/scala-js/blob/master", cloneRoot/"workbench-example-app" -> "https://github.com/lihaoyi/workbench-example-app/blob/master", wd -> "https://github.com/lihaoyi/hands-on-scala-js/blob/master" ) - override val suffixMappings = Map( - "scala" -> "scala", - "sbt" -> "scala", - "js" -> "javascript" - ) - def scala(s: String) = this.highlight(s, "scala") - def bash(s: String) = this.highlight(s, "bash") - def html(s: String) = this.highlight(s, "html") - def xml(s: String) = this.highlight(s, "xml") - def diff(s: String) = this.highlight(s, "diff") - def javascript(s: String) = this.highlight(s, "javascript") } + + val sect = new site.Section{} } |