diff --git a/.gitignore b/.gitignore index 9699e18be5..d44d7ea405 100755 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ multiverse.log .eprj .*.swp akka-docs/_build/ +akka-docs/epilog_rst *.pyc akka-docs/exts/ _akka_cluster/ diff --git a/akka-docs/conf.py b/akka-docs/conf.py index 77b7c80be0..2ca3a5c66c 100644 --- a/akka-docs/conf.py +++ b/akka-docs/conf.py @@ -25,6 +25,10 @@ highlight_language = 'scala' add_function_parentheses = False show_authors = True +f = open('epilog_rst', 'U') +rst_epilog = "\n" + f.read() +f.close() + # -- Options for HTML output --------------------------------------------------- html_theme = 'akka' diff --git a/akka-docs/dev/multi-jvm-testing.rst b/akka-docs/dev/multi-jvm-testing.rst index b7ce808a36..ff4057490d 100644 --- a/akka-docs/dev/multi-jvm-testing.rst +++ b/akka-docs/dev/multi-jvm-testing.rst @@ -24,7 +24,9 @@ You can add it as a plugin by adding the following to your project/plugins.sbt:: You can then add multi-JVM testing to ``project/Build.scala`` by including the ``MultiJvm`` settings and config. For example, here is how the akka-remote project adds -multi-JVM testing:: +multi-JVM testing: + +.. parsed-literal:: import sbt._ import Keys._ @@ -47,7 +49,7 @@ multi-JVM testing:: lazy val buildSettings = Defaults.defaultSettings ++ Seq( organization := "com.typesafe.akka", version := "2.1-SNAPSHOT", - scalaVersion := "2.10.0-M6", + scalaVersion := "|scalaVersion|", crossPaths := false ) diff --git a/akka-docs/general/configuration.rst b/akka-docs/general/configuration.rst index 5a4ac993d7..78c2fee4b8 100644 --- a/akka-docs/general/configuration.rst +++ b/akka-docs/general/configuration.rst @@ -140,9 +140,9 @@ when you are uncertain of what configuration is used. If in doubt, you can also easily and nicely inspect configuration objects before or after using them to construct an actor system: -.. code-block:: scala +.. parsed-literal:: - Welcome to Scala version 2.10.0-M6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_27). + Welcome to Scala version |scalaVersion| (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_27). Type in expressions to have them evaluated. Type :help for more information. diff --git a/akka-docs/intro/getting-started.rst b/akka-docs/intro/getting-started.rst index 1282d1be7f..9fae5281a8 100644 --- a/akka-docs/intro/getting-started.rst +++ b/akka-docs/intro/getting-started.rst @@ -120,13 +120,15 @@ Summary of the essential parts for using Akka with SBT: SBT installation instructions on `https://github.com/harrah/xsbt/wiki/Setup `_ -``build.sbt`` file:: +``build.sbt`` file: + +.. parsed-literal:: name := "My Project" version := "1.0" - scalaVersion := "2.10.0-M6" + scalaVersion := "|scalaVersion|" resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/" diff --git a/akka-docs/scala/io.rst b/akka-docs/scala/io.rst index ba12324aa5..b47af1e58e 100644 --- a/akka-docs/scala/io.rst +++ b/akka-docs/scala/io.rst @@ -58,7 +58,7 @@ After extracting data from a ``ByteIterator``, the remaining content can also be .. includecode:: code/akka/docs/io/BinaryCoding.scala :include: rest-to-seq -with no copying from bytes to rest involved. In general, conversions from ByteString to ByteIterator and vice versa are O(1) for non-chunked ``ByteString``s and (at worst) O(nChunks) for chunked ByteStrings. +with no copying from bytes to rest involved. In general, conversions from ByteString to ByteIterator and vice versa are O(1) for non-chunked ``ByteString`` and (at worst) O(nChunks) for chunked ByteStrings. Encoding of data also is very natural, using ``ByteStringBuilder`` diff --git a/project/Sphinx.scala b/project/Sphinx.scala index f306dfd31b..be35d83916 100644 --- a/project/Sphinx.scala +++ b/project/Sphinx.scala @@ -11,6 +11,7 @@ import java.io.File object Sphinx { val sphinxDocs = SettingKey[File]("sphinx-docs") val sphinxTarget = SettingKey[File]("sphinx-target") + val sphinxScalaVersion = TaskKey[String]("sphinx-scala-version") val sphinxPygmentsDir = SettingKey[File]("sphinx-pygments-dir") val sphinxTags = SettingKey[Seq[String]]("sphinx-tags") val sphinxPygments = TaskKey[File]("sphinx-pygments", "Sphinx: install pygments styles") @@ -22,6 +23,7 @@ object Sphinx { lazy val settings = Seq( sphinxDocs <<= baseDirectory, sphinxTarget <<= crossTarget / "sphinx", + sphinxScalaVersion <<= scalaVersionTask, sphinxPygmentsDir <<= sphinxDocs { _ / "_sphinx" / "pygments" }, sphinxTags in sphinxHtml := Seq.empty, sphinxTags in sphinxLatex := Seq.empty, @@ -32,6 +34,12 @@ object Sphinx { sphinx <<= sphinxTask ) + def scalaVersionTask = (scalaVersion, streams) map { (v, s) => + s.log.info("writing version file") + IO.write(file("akka-docs/epilog_rst"), ".. |scalaVersion| replace:: " + v + "\n") + v + } + def pygmentsTask = (sphinxDocs, sphinxPygmentsDir, sphinxTarget, streams) map { (cwd, pygments, baseTarget, s) => { val target = baseTarget / "site-packages" @@ -50,7 +58,7 @@ object Sphinx { } target } - } + } dependsOn sphinxScalaVersion def buildTask(builder: String, tagsKey: SettingKey[Seq[String]]) = { (cacheDirectory, sphinxDocs, sphinxTarget, sphinxPygments, tagsKey, streams) map {