diff options
author | Li Haoyi <haoyi@dropbox.com> | 2014-11-10 23:06:45 -0800 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2014-11-10 23:06:45 -0800 |
commit | fe5c2d79f6b71da7864b5f5f9ebd095dc68d9343 (patch) | |
tree | 8a6e821ad98b8b2ccb7993e278124fa58dfc30a7 /book/src/main/scala/book/Utils.scala | |
parent | 7903f44bfb61d292e497fb40ac8a36ba03cedb2a (diff) | |
download | hands-on-scala-js-fe5c2d79f6b71da7864b5f5f9ebd095dc68d9343.tar.gz hands-on-scala-js-fe5c2d79f6b71da7864b5f5f9ebd095dc68d9343.tar.bz2 hands-on-scala-js-fe5c2d79f6b71da7864b5f5f9ebd095dc68d9343.zip |
Moved pure into a webjar, added font-awesome
Diffstat (limited to 'book/src/main/scala/book/Utils.scala')
-rw-r--r-- | book/src/main/scala/book/Utils.scala | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/book/src/main/scala/book/Utils.scala b/book/src/main/scala/book/Utils.scala index 9f11f8e..867ed68 100644 --- a/book/src/main/scala/book/Utils.scala +++ b/book/src/main/scala/book/Utils.scala @@ -54,9 +54,17 @@ case class sect(name: String, subname: String = ""){ sect.structure = newNode def apply(args: Frag*) = { val wrappedContents = contentWrap.getOrElse((x: Frag) => x)(args) + val headingAnchor = a( + href:=s"#${sect.munge(name)}", + cls:="content-link", + title:="Heading anchor" + ) val res = Seq[Frag]( - if (name == "") "" - else headerWrap(name, subname)(cls:="content-subhead", id:=sect.munge(name)), + headerWrap(name, subname)( + cls:="content-subhead", + id:=sect.munge(name), + headingAnchor + ), wrappedContents ) sect.indent -= 1 |