Skip to content

Commit

Permalink
Merge pull request #77 from jonas/fix-scaladoc-directive
Browse files Browse the repository at this point in the history
Fix the scaladoc directive to work for Scala 2.12
  • Loading branch information
eed3si9n authored Dec 8, 2016
2 parents a9a2510 + bfdfdfe commit 3546b75
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 4 deletions.
8 changes: 6 additions & 2 deletions notes/0.2.8.markdown
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
### Fixes and enhancements

- Source url. See below. [#69][69] by [@jonas][@jonas] and [@gsechaud][@gsechaud]
- Fix `@scaladoc` to work for Scala 2.12. [#77][77] by [@jonas][@jonas]

### Source origin url on GitHub

`$page.source_url$` contains the plain text of the github source url of the current page. Works only if the associated `github.base_url` is defined. If it doesn't, this field returns a null value; then a condition testing like `$if(page.source_url)$` would be necessary in this case.
Provide a new template "sourc.st" available in the generic theme which allows to display a simple plain text with the link associated to the current file.
Provide a new template "source.st" available in the generic theme which allows to display a simple plain text with the link associated to the current file.

[69]: https://github.com/lightbend/paradox/pull/69
[69]: https://github.com/lightbend/paradox/pull/69
[77]: https://github.com/lightbend/paradox/pull/77
[@gsechaud]: https://github.com/gsechaud
[@jonas]: https://github.com/jonas
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ object ParadoxPlugin extends AutoPlugin {
"javadoc.java.base_url" -> sys.props.get("java.specification.version").collect {
case JavaSpecVersion(v) => url(s"https://docs.oracle.com/javase/$v/docs/api/")
},
"scaladoc.version" -> scalaVersion,
"scaladoc.version" -> Some(scalaVersion),
"scaladoc.scala.base_url" -> Some(url(s"http://www.scala-lang.org/api/$scalaVersion")),
"scaladoc.base_url" -> apiURL,
"github.base_url" -> scmInfo.map(_.browseUrl).filter(_.getHost == "github.com")
).collect { case (prop, Some(url)) => (prop, url.toString) }
).collect { case (prop, Some(value)) => (prop, value.toString) }
}

def readProperty(resource: String, property: String): String = {
Expand Down
12 changes: 12 additions & 0 deletions plugin/src/sbt-test/paradox/scaladoc-2.12/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
val akkaVersion = "2.4.13"
val akkaHttpVersion = "10.0.0"

version := "0.1.0"
scalaVersion := "2.12.1"

enablePlugins(ParadoxPlugin)
paradoxTheme := None
paradoxProperties in Compile ++= Map(
"scaladoc.akka.base_url" -> s"http://doc.akka.io/api/akka/$akkaVersion",
"scaladoc.akka.http.base_url" -> s"http://doc.akka.io/api/akka-http/$akkaHttpVersion"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<p>Use a <a href="http://www.scala-lang.org/api/2.12.1/scala/concurrent/Future.html">Future</a> to avoid that long running operations block the <a href="http://doc.akka.io/api/akka/2.4.13/akka/actor/Actor.html">Actor</a>.</p>
<p><a href="http://doc.akka.io/api/akka-http/10.0.0/akka/http/scaladsl/Http$.html">Http</a></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % sys.props("project.version"))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$page.content$
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Use a @scaladoc:[Future](scala.concurrent.Future) to avoid that long running operations block the @scaladoc:[Actor](akka.actor.Actor).

@scaladoc:[Http](akka.http.scaladsl.Http$)
3 changes: 3 additions & 0 deletions plugin/src/sbt-test/paradox/scaladoc-2.12/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> paradox

$ must-mirror target/paradox/site/scaladoc-2.12.html expected/scaladoc-2.12.html

0 comments on commit 3546b75

Please sign in to comment.