From 471e20c8ead73ee34916f8010dc933322275d830 Mon Sep 17 00:00:00 2001 From: Enno Runne <458526+ennru@users.noreply.github.com> Date: Tue, 21 May 2019 17:54:22 +0200 Subject: [PATCH 1/7] Next Snapshot --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 0e28603..e356d7e 100644 --- a/build.sbt +++ b/build.sbt @@ -7,7 +7,7 @@ name := "sbt-site" organization := "com.typesafe.sbt" -version := "1.3.3" +version := "1.3.4-SNAPSHOT" crossSbtVersions := List("0.13.17", "1.1.6") licenses += ("BSD 3-Clause", url("https://opensource.org/licenses/BSD-3-Clause")) From e0906b5440c48a8cf700308e16491940340c0d03 Mon Sep 17 00:00:00 2001 From: Enno <458526+ennru@users.noreply.github.com> Date: Wed, 22 May 2019 14:01:48 +0200 Subject: [PATCH 2/7] Drop sbt 0.13 support (#150) --- .travis.yml | 3 +- build.sbt | 55 +++--- project/plugins.sbt | 6 +- src/main/paradox/advanced-usage.md | 2 +- src/main/paradox/api-documentation.md | 10 +- src/main/paradox/generators/asciidoctor.md | 6 +- src/main/paradox/generators/gitbook.md | 8 +- src/main/paradox/generators/hugo.md | 8 +- src/main/paradox/generators/jekyll.md | 8 +- src/main/paradox/generators/laika.md | 11 +- src/main/paradox/generators/nanoc.md | 6 +- src/main/paradox/generators/pamflet.md | 6 +- src/main/paradox/generators/paradox.md | 8 +- src/main/paradox/generators/sphinx.md | 6 +- src/main/paradox/getting-started.md | 2 +- src/main/paradox/index.md | 5 +- src/main/paradox/migration-guide.md | 10 ++ src/main/paradox/notes/1.4.0.md | 10 ++ src/main/paradox/notes/index.md | 2 + src/main/paradox/preprocess.md | 18 +- src/main/paradox/publishing.md | 6 +- .../com/typesafe/sbt/site/Compat.scala | 31 ---- .../sbt/site/laika/LaikaSitePlugin.scala | 53 ------ .../com/typesafe/sbt/site/Compat.scala | 11 +- .../site/asciidoctor/AsciidoctorPlugin.scala | 2 +- .../sbt/site/laika/LaikaSitePlugin.scala | 0 .../sbt/site/paradox/ParadoxSitePlugin.scala | 2 +- .../sbt/site/sphinx/SphinxHelpers.scala | 2 +- .../{laika_1.x => laika}/blog-post/README.md | 0 .../{laika_1.x => laika}/blog-post/build.sbt | 0 .../blog-post/project/CustomDirectives.scala | 0 .../laika/blog-post/project/build.properties | 1 + .../blog-post/project/plugins.sbt | 0 .../blog-post/src/blog/default.template.html | 0 .../blog-post/src/blog/index.md | 0 .../blog-post/src/blog/topics/directory.conf | 0 .../blog-post/src/blog/topics/post-1.md | 0 .../blog-post/src/blog/topics/post-2.md | 0 .../{laika_0.13 => laika}/blog-post/test | 0 .../{laika_0.13 => laika}/minimal/build.sbt | 0 .../laika/minimal/project/build.properties | 1 + .../minimal/project/plugins.sbt | 0 .../minimal/src/laikaSite/index.md | 0 .../{laika_0.13 => laika}/minimal/test | 0 src/sbt-test/laika_0.13/blog-post/README.md | 1 - src/sbt-test/laika_0.13/blog-post/build.sbt | 34 ---- .../blog-post/project/CustomDirectives.scala | 55 ------ .../blog-post/project/build.properties | 1 - .../blog-post/src/blog/default.template.html | 159 ------------------ .../minimal/project/build.properties | 1 - .../blog-post/project/build.properties | 1 - .../laika_1.x/blog-post/project/plugins.sbt | 1 - .../laika_1.x/blog-post/src/blog/index.md | 5 - .../blog-post/src/blog/topics/directory.conf | 4 - .../blog-post/src/blog/topics/post-1.md | 8 - .../blog-post/src/blog/topics/post-2.md | 10 -- src/sbt-test/laika_1.x/blog-post/test | 2 - src/sbt-test/laika_1.x/minimal/build.sbt | 22 --- .../minimal/project/build.properties | 1 - .../laika_1.x/minimal/project/plugins.sbt | 1 - .../laika_1.x/minimal/src/laikaSite/index.md | 3 - src/sbt-test/laika_1.x/minimal/test | 2 - src/sbt-test/site/minimum-sbt-0.13/build.sbt | 16 -- .../minimum-sbt-0.13/project/build.properties | 2 - .../site/minimum-sbt-0.13/project/plugins.sbt | 1 - .../minimum-sbt-0.13/src/paradox/index.md | 15 -- .../site/minimum-sbt-0.13/src/paradox/test.md | 7 - src/sbt-test/site/minimum-sbt-0.13/test | 2 - .../minimum-sbt-1.0/project/build.properties | 2 +- .../plays-nice-with-tut-sbt-0.13/build.sbt | 18 -- .../project/build.properties | 1 - .../project/plugins.sbt | 2 - .../src/main/tut/index.md | 15 -- .../src/main/tut/test.md | 5 - .../site/plays-nice-with-tut-sbt-0.13/test | 2 - .../project/build.properties | 2 +- 76 files changed, 114 insertions(+), 586 deletions(-) create mode 100644 src/main/paradox/notes/1.4.0.md delete mode 100644 src/main/scala-sbt-0.13/com/typesafe/sbt/site/Compat.scala delete mode 100644 src/main/scala-sbt-0.13/com/typesafe/sbt/site/laika/LaikaSitePlugin.scala rename src/main/{scala-sbt-1.0 => scala}/com/typesafe/sbt/site/Compat.scala (86%) rename src/main/{scala-sbt-1.0 => scala}/com/typesafe/sbt/site/laika/LaikaSitePlugin.scala (100%) rename src/sbt-test/{laika_1.x => laika}/blog-post/README.md (100%) rename src/sbt-test/{laika_1.x => laika}/blog-post/build.sbt (100%) rename src/sbt-test/{laika_1.x => laika}/blog-post/project/CustomDirectives.scala (100%) create mode 100644 src/sbt-test/laika/blog-post/project/build.properties rename src/sbt-test/{laika_0.13 => laika}/blog-post/project/plugins.sbt (100%) rename src/sbt-test/{laika_1.x => laika}/blog-post/src/blog/default.template.html (100%) rename src/sbt-test/{laika_0.13 => laika}/blog-post/src/blog/index.md (100%) rename src/sbt-test/{laika_0.13 => laika}/blog-post/src/blog/topics/directory.conf (100%) rename src/sbt-test/{laika_0.13 => laika}/blog-post/src/blog/topics/post-1.md (100%) rename src/sbt-test/{laika_0.13 => laika}/blog-post/src/blog/topics/post-2.md (100%) rename src/sbt-test/{laika_0.13 => laika}/blog-post/test (100%) rename src/sbt-test/{laika_0.13 => laika}/minimal/build.sbt (100%) create mode 100644 src/sbt-test/laika/minimal/project/build.properties rename src/sbt-test/{laika_0.13 => laika}/minimal/project/plugins.sbt (100%) rename src/sbt-test/{laika_0.13 => laika}/minimal/src/laikaSite/index.md (100%) rename src/sbt-test/{laika_0.13 => laika}/minimal/test (100%) delete mode 100644 src/sbt-test/laika_0.13/blog-post/README.md delete mode 100644 src/sbt-test/laika_0.13/blog-post/build.sbt delete mode 100644 src/sbt-test/laika_0.13/blog-post/project/CustomDirectives.scala delete mode 100644 src/sbt-test/laika_0.13/blog-post/project/build.properties delete mode 100644 src/sbt-test/laika_0.13/blog-post/src/blog/default.template.html delete mode 100644 src/sbt-test/laika_0.13/minimal/project/build.properties delete mode 100644 src/sbt-test/laika_1.x/blog-post/project/build.properties delete mode 100644 src/sbt-test/laika_1.x/blog-post/project/plugins.sbt delete mode 100644 src/sbt-test/laika_1.x/blog-post/src/blog/index.md delete mode 100644 src/sbt-test/laika_1.x/blog-post/src/blog/topics/directory.conf delete mode 100644 src/sbt-test/laika_1.x/blog-post/src/blog/topics/post-1.md delete mode 100644 src/sbt-test/laika_1.x/blog-post/src/blog/topics/post-2.md delete mode 100644 src/sbt-test/laika_1.x/blog-post/test delete mode 100644 src/sbt-test/laika_1.x/minimal/build.sbt delete mode 100644 src/sbt-test/laika_1.x/minimal/project/build.properties delete mode 100644 src/sbt-test/laika_1.x/minimal/project/plugins.sbt delete mode 100644 src/sbt-test/laika_1.x/minimal/src/laikaSite/index.md delete mode 100644 src/sbt-test/laika_1.x/minimal/test delete mode 100644 src/sbt-test/site/minimum-sbt-0.13/build.sbt delete mode 100644 src/sbt-test/site/minimum-sbt-0.13/project/build.properties delete mode 100644 src/sbt-test/site/minimum-sbt-0.13/project/plugins.sbt delete mode 100644 src/sbt-test/site/minimum-sbt-0.13/src/paradox/index.md delete mode 100644 src/sbt-test/site/minimum-sbt-0.13/src/paradox/test.md delete mode 100644 src/sbt-test/site/minimum-sbt-0.13/test delete mode 100644 src/sbt-test/site/plays-nice-with-tut-sbt-0.13/build.sbt delete mode 100644 src/sbt-test/site/plays-nice-with-tut-sbt-0.13/project/build.properties delete mode 100644 src/sbt-test/site/plays-nice-with-tut-sbt-0.13/project/plugins.sbt delete mode 100644 src/sbt-test/site/plays-nice-with-tut-sbt-0.13/src/main/tut/index.md delete mode 100644 src/sbt-test/site/plays-nice-with-tut-sbt-0.13/src/main/tut/test.md delete mode 100644 src/sbt-test/site/plays-nice-with-tut-sbt-0.13/test diff --git a/.travis.yml b/.travis.yml index 9d3658f..04951be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ dist: trusty jdk: oraclejdk8 matrix: include: - - env: SBT_CROSS_VERSION="0.13.17" - env: SBT_CROSS_VERSION="1.1.6" addons: @@ -63,5 +62,5 @@ deploy: skip_cleanup: true on: tags: true - condition: $TRAVIS_PULL_REQUEST = false && $SBT_CROSS_VERSION = 0.13* + condition: $TRAVIS_PULL_REQUEST = false && $SBT_CROSS_VERSION = 1.1* #travis-deploy diff --git a/build.sbt b/build.sbt index e356d7e..020f1c4 100644 --- a/build.sbt +++ b/build.sbt @@ -6,9 +6,13 @@ enablePlugins(SbtPlugin) name := "sbt-site" organization := "com.typesafe.sbt" +organizationName := "sbt" +organizationHomepage := Some(url("https://www.scala-sbt.org/")) -version := "1.3.4-SNAPSHOT" -crossSbtVersions := List("0.13.17", "1.1.6") +homepage := Some(url("https://www.scala-sbt.org/sbt-site/")) + +version := "1.4.0-SNAPSHOT" +crossSbtVersions := List("1.1.6") licenses += ("BSD 3-Clause", url("https://opensource.org/licenses/BSD-3-Clause")) //#scm-info @@ -26,44 +30,31 @@ libraryDependencies ++= Seq( "ws.unfiltered" %% "unfiltered-filter" % unfilteredVersion, "ws.unfiltered" %% "unfiltered-jetty" % unfilteredVersion, "ws.unfiltered" %% "unfiltered-specs2" % unfilteredVersion % "test", - "org.foundweekends" %% "pamflet-library" % "0.7.1", - "org.yaml" % "snakeyaml" % "1.13", - "com.typesafe" % "config" % "1.2.1", // Last version to support Java 1.6 - "org.asciidoctor" % "asciidoctorj" % "1.5.4.1", - "org.asciidoctor" % "asciidoctorj-diagram" % "1.5.4.1" + "org.foundweekends" %% "pamflet-library" % "0.8.0", + "org.yaml" % "snakeyaml" % "1.24", + "com.typesafe" % "config" % "1.3.4", + "org.asciidoctor" % "asciidoctorj" % "1.6.2", + "org.asciidoctor" % "asciidoctorj-diagram" % "1.5.16" ) -addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.3.2") - -libraryDependencies ++= { - if ((sbtBinaryVersion in pluginCrossBuild).value == "0.13") { - Seq( - Defaults.sbtPluginExtra( - "org.planet42" % "laika-sbt" % "0.7.0", - (sbtBinaryVersion in pluginCrossBuild).value, - (scalaBinaryVersion in pluginCrossBuild).value - ) - ) - } else { - Seq( - Defaults.sbtPluginExtra( - "org.planet42" % "laika-sbt" % "0.8.0", - (sbtBinaryVersion in pluginCrossBuild).value, - (scalaBinaryVersion in pluginCrossBuild).value - ) - ) - } -} +addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.5.4") + +libraryDependencies += + Defaults.sbtPluginExtra( + "org.planet42" % "laika-sbt" % "0.8.0", + (sbtBinaryVersion in pluginCrossBuild).value, + (scalaBinaryVersion in pluginCrossBuild).value + ) enablePlugins(ParadoxSitePlugin, ParadoxMaterialThemePlugin) -sourceDirectory in Paradox := sourceDirectory.value / "main" / "paradox" +Paradox / sourceDirectory := sourceDirectory.value / "main" / "paradox" ParadoxMaterialThemePlugin.paradoxMaterialThemeSettings(Paradox) -paradoxMaterialTheme in Paradox ~= { +Paradox / paradoxMaterialTheme ~= { _.withFavicon("img/favicon.png") .withLogo("img/sbt-logo.svg") .withRepository(uri("https://github.com/sbt/sbt-site")) } -version in Paradox := { +Paradox / version := { if (isSnapshot.value) "git tag -l".!!.split("\r?\n").last.substring(1) else version.value } @@ -74,7 +65,7 @@ git.remoteRepo := scmInfo.value.get.connection.replace("scm:git:", "") //#ghpages-publish TaskKey[Unit]("runScriptedTest") := Def.taskDyn { - val sbtBinVersion = (sbtBinaryVersion in pluginCrossBuild).value + val sbtBinVersion = (pluginCrossBuild / sbtBinaryVersion).value val base = sbtTestDirectory.value def isCompatible(directory: File): Boolean = { diff --git a/project/plugins.sbt b/project/plugins.sbt index 4b4f7fc..a8e4117 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,7 +1,7 @@ -addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4") -addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.2") +addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.5") +addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.3") //#sbt-ghpages -addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2") +addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3") //#sbt-ghpages addSbtPlugin("io.github.jonas" % "sbt-paradox-material-theme" % "0.6.0") diff --git a/src/main/paradox/advanced-usage.md b/src/main/paradox/advanced-usage.md index bcafc8d..5ff45b3 100644 --- a/src/main/paradox/advanced-usage.md +++ b/src/main/paradox/advanced-usage.md @@ -6,6 +6,6 @@ Here are listed examples of a more advanced usage. If you need to run a generator on more than one source directory, bypassing the `AutoPlugin` system and defining one or more sbt `Configuration`s is necessary. For example, suppose you have two Paradox source directories and want them each generated as a subdirectory under `target/site`. A `build.sbt` might look something like this: -@@ snip[advanced-usage](../../sbt-test/site/can-run-generator-twice/build.sbt) { #advanced-usage } +@@ snip[advanced-usage](/src/sbt-test/site/can-run-generator-twice/build.sbt) { #advanced-usage } The other generators follow a similar pattern, e.g. `JekyllPlugin.jekyllSettings(config("foo"))`. diff --git a/src/main/paradox/api-documentation.md b/src/main/paradox/api-documentation.md index 9b0d3a6..94d2afc 100644 --- a/src/main/paradox/api-documentation.md +++ b/src/main/paradox/api-documentation.md @@ -4,17 +4,17 @@ To include Scaladoc with your site, add the following line to your `build.sbt`: -@@ snip[enablePlugin](../../sbt-test/scaladoc/can-add-scaladoc/build.sbt) { #enablePlugin } +@@ snip[enablePlugin](/src/sbt-test/scaladoc/can-add-scaladoc/build.sbt) { #enablePlugin } This will default to putting the Scaladoc under the `latest/api` directory on the website. You can change this with the `siteSubdirName` key in the `SiteScaladoc` scope: -@@ snip[siteSubdirName](../../sbt-test/scaladoc/can-add-scaladoc/build.sbt) { #siteSubdirName } +@@ snip[siteSubdirName](/src/sbt-test/scaladoc/can-add-scaladoc/build.sbt) { #siteSubdirName } ## Aggregating API documentation with sbt-unidoc [sbt-unidoc] allows to aggregate Scaladoc or Javadoc from sub-projects into a unified view. The following example shows how you can add aggregated Scaladoc to your site: -@@ snip[unidoc-site](../../sbt-test/scaladoc/can-aggregate/build.sbt) { #subprojects #unidoc-site } +@@ snip[unidoc-site](/src/sbt-test/scaladoc/can-aggregate/build.sbt) { #subprojects #unidoc-site } [sbt-unidoc]: https://github.com/sbt/sbt-unidoc @@ -24,8 +24,8 @@ In case you want to include the Scaladoc separate for each sub-product there are you only have a few sub-projects the simplest solution is to manually include the scaladoc for each project: -@@ snip[scaladoc-site](../../sbt-test/scaladoc/can-aggregate/build.sbt) { #subprojects #scaladoc-site } +@@ snip[scaladoc-site](/src/sbt-test/scaladoc/can-aggregate/build.sbt) { #subprojects #scaladoc-site } For projects with many such sub-projects, a more maintainable approach is to configure it in a more programatic way: -@@ snip[scaladoc-site-alternative](../../sbt-test/scaladoc/can-aggregate/build.sbt) { #subprojects #scaladoc-site-alternative } +@@ snip[scaladoc-site-alternative](/src/sbt-test/scaladoc/can-aggregate/build.sbt) { #subprojects #scaladoc-site-alternative } diff --git a/src/main/paradox/generators/asciidoctor.md b/src/main/paradox/generators/asciidoctor.md index c8b13d6..11efd0b 100644 --- a/src/main/paradox/generators/asciidoctor.md +++ b/src/main/paradox/generators/asciidoctor.md @@ -2,16 +2,16 @@ The sbt-site plugin has direct support for building [Asciidoctor] projects. To enable Asciidoctor site generation, simply enable the associated plugin in your `build.sbt` file: -@@ snip[enablePlugin](../../../sbt-test/asciidoctor/can-use-asciidoctor/build.sbt) { #enablePlugin } +@@ snip[enablePlugin](/src/sbt-test/asciidoctor/can-use-asciidoctor/build.sbt) { #enablePlugin } This assumes you have an Asciidoctor project under the `src/asciidoctor` directory. To change this, set the `sourceDirectory` key in the `Asciidoctor` scope: ```sbt -sourceDirectory in Asciidoctor := sourceDirectory.value / "asciimd" +Asciidoctor / sourceDirectory := sourceDirectory.value / "asciimd" ``` Similarly, the output can be redirected to a subdirectory of `target/site` via the `siteSubdirName` key in `Asciidoctor` scope: -@@ snip[siteSubdirName](../../../sbt-test/asciidoctor/can-use-asciidoctor/build.sbt) { #siteSubdirName } +@@ snip[siteSubdirName](/src/sbt-test/asciidoctor/can-use-asciidoctor/build.sbt) { #siteSubdirName } [Asciidoctor]: http://asciidoctor.org diff --git a/src/main/paradox/generators/gitbook.md b/src/main/paradox/generators/gitbook.md index ce384bb..d4f1087 100644 --- a/src/main/paradox/generators/gitbook.md +++ b/src/main/paradox/generators/gitbook.md @@ -2,20 +2,20 @@ The sbt-site plugin has direct support for building [GitBook] projects. To enable GitBook site generation, simply enable the associated plugin in your `build.sbt` file: -@@ snip[enablePlugin](../../../sbt-test/gitbook/ignore-dot-files/build.sbt) { #enablePlugin } +@@ snip[enablePlugin](/src/sbt-test/gitbook/ignore-dot-files/build.sbt) { #enablePlugin } This assumes you have a GitBook project under the `src/gitbook` directory. To change this, set the `sourceDirectory` key in the `GitBook` scope: ```sbt -sourceDirectory in GitBook := sourceDirectory.value / "doc" +GitBook / sourceDirectory := sourceDirectory.value / "doc" ``` Similarly, the output can be redirected to a subdirectory of `target/site` via the `siteSubdirName` key in `GitBook` scope: -@@ snip[siteSubdirName](../../../sbt-test/gitbook/ignore-dot-files/build.sbt) { #siteSubdirName } +@@ snip[siteSubdirName](/src/sbt-test/gitbook/ignore-dot-files/build.sbt) { #siteSubdirName } The plugin can also be configured to manage all GitBook setup and installation by configuring a dedicated directory in which GitBook's npm packages can be installed. -@@ snip[gitbookInstallDir](../../../sbt-test/gitbook/can-manage-installation/build.sbt) { #gitbookInstallDir } +@@ snip[gitbookInstallDir](/src/sbt-test/gitbook/can-manage-installation/build.sbt) { #gitbookInstallDir } [GitBook]: https://www.gitbook.com diff --git a/src/main/paradox/generators/hugo.md b/src/main/paradox/generators/hugo.md index 30e4685..e91132d 100644 --- a/src/main/paradox/generators/hugo.md +++ b/src/main/paradox/generators/hugo.md @@ -2,20 +2,20 @@ The sbt-site plugin has support for building [Hugo] projects. To enable Hugo site generation, simply enable the associated plugin in your `build.sbt` file: -@@ snip[enablePlugin](../../../sbt-test/hugo/can-use-hugo/build.sbt) { #enablePlugin } +@@ snip[enablePlugin](/src/sbt-test/hugo/can-use-hugo/build.sbt) { #enablePlugin } The `hugo` binary must be installed on your `$PATH` in order to be accessible to sbt-site. In addition, this plugin assumes you have a Hugo project under the `src/hugo` directory. To change this, set the `sourceDirectory` key in the `Hugo` scope: ```sbt -sourceDirectory in Hugo := sourceDirectory.value / "doc" +Hugo / sourceDirectory := sourceDirectory.value / "doc" ``` You may also change the [base-url](https://gohugo.io/overview/configuration/) that gets passed to the `hugo` command by adjusting the following setting: -@@ snip[baseURL](../../../sbt-test/hugo/can-use-hugo/build.sbt) { #baseURL } +@@ snip[baseURL](/src/sbt-test/hugo/can-use-hugo/build.sbt) { #baseURL } To export environment variables when forking the `hugo` process, for example to render with Hugo's [getenv function](https://hugodocs.info/functions/getenv/), use: -@@ snip[extraEnv](../../../sbt-test/hugo/can-use-hugo/build.sbt) { #extraEnv } +@@ snip[extraEnv](/src/sbt-test/hugo/can-use-hugo/build.sbt) { #extraEnv } [Hugo]: https://gohugo.io/ diff --git a/src/main/paradox/generators/jekyll.md b/src/main/paradox/generators/jekyll.md index 930a31a..ea4642f 100644 --- a/src/main/paradox/generators/jekyll.md +++ b/src/main/paradox/generators/jekyll.md @@ -2,20 +2,20 @@ The sbt-site plugin has direct support for running [Jekyll]. This is useful for supporting custom Jekyll plugins that are not allowed when publishing to GitHub, or hosting a Jekyll site on your own server. To add Jekyll support, enable the associated plugin: -@@ snip[enablePlugin](../../../sbt-test/jekyll/can-use-jekyll/build.sbt) { #enablePlugin } +@@ snip[enablePlugin](/src/sbt-test/jekyll/can-use-jekyll/build.sbt) { #enablePlugin } This assumes you have a Jekyll project in the `src/jekyll` directory. To change this, set the key `sourceDirectory` in the `Jekyll` scope: ```sbt -sourceDirectory in Jekyll := sourceDirectory.value / "hyde" +Jekyll / sourceDirectory := sourceDirectory.value / "hyde" ``` To redirect the output to a subdirectory of `target/site`, use the `siteSubdirName` key in `Jekyll` scope: -@@ snip[siteSubdirName](../../../sbt-test/jekyll/can-use-jekyll/build.sbt) { #siteSubdirName } +@@ snip[siteSubdirName](/src/sbt-test/jekyll/can-use-jekyll/build.sbt) { #siteSubdirName } One common issue with Jekyll is ensuring that everyone uses the same version for generating a website. There is special support for ensuring the version of gems. To do so, add the following to your `build.sbt` file: -@@ snip[requiredGems](../../../sbt-test/jekyll/can-use-jekyll/build.sbt) { #requiredGems } +@@ snip[requiredGems](/src/sbt-test/jekyll/can-use-jekyll/build.sbt) { #requiredGems } [Jekyll]: https://jekyllrb.com diff --git a/src/main/paradox/generators/laika.md b/src/main/paradox/generators/laika.md index dddab80..86bd7ac 100644 --- a/src/main/paradox/generators/laika.md +++ b/src/main/paradox/generators/laika.md @@ -3,12 +3,12 @@ The sbt-site plugin has support for building [Laika] projects. To enable Laika site generation, simply enable the associated plugin in your `build.sbt` file: -@@ snip[enablePlugin](../../../sbt-test/laika_0.13/minimal/build.sbt) { #enablePlugin } +@@ snip[enablePlugin](/src/sbt-test/laika/minimal/build.sbt) { #enablePlugin } This plugin assumes you have a Laika project under the `src/laika` directory. To change this, set the `sourceDirectory` key in the `LaikaSite` scope: ```sbt -sourceDirectory in LaikaSite := sourceDirectory.value / "doc" +LaikaSite / sourceDirectory := sourceDirectory.value / "doc" ``` This plugin use [Laika](https://github.com/planet42/Laika) sbt plugin internally and redefine default values for several Laika sbt keys which related to `sourceDirectory` in order to both work in harmony. @@ -19,10 +19,7 @@ From other hand you can customize other aspects of Laika's behavior through basi [Laika sbt plugin](https://planet42.github.io/Laika/using-laika/sbt.html) keys and hooks. For example in order to add custom block directives you can include such code to your build.sbt: -sbt 0.13 -: @@ snip[laikaSbtPluginCustomization](../../../sbt-test/laika_0.13/blog-post/build.sbt) { #laikaSbtPluginCustomization } - -sbt 1.x -: @@ snip[laikaSbtPluginCustomization](../../../sbt-test/laika_1.x/blog-post/build.sbt) { #laikaSbtPluginCustomization } +sbt +: @@ snip[laikaSbtPluginCustomization](/src/sbt-test/laika/blog-post/build.sbt) { #laikaSbtPluginCustomization } [Laika]: https://github.com/planet42/Laika diff --git a/src/main/paradox/generators/nanoc.md b/src/main/paradox/generators/nanoc.md index 299e2ff..a23798b 100644 --- a/src/main/paradox/generators/nanoc.md +++ b/src/main/paradox/generators/nanoc.md @@ -2,16 +2,16 @@ The sbt-site plugin has direct support for building [Nanoc] projects. To enable Nanoc site generation, simply enable the associated plugin in your `build.sbt` file: -@@ snip[enablePlugin](../../../sbt-test/nanoc/can-use-nanoc/build.sbt) { #enablePlugin } +@@ snip[enablePlugin](/src/sbt-test/nanoc/can-use-nanoc/build.sbt) { #enablePlugin } This assumes you have a Nanoc project under the `src/nanoc` directory. To change this, set the `sourceDirectory` key in the `Nanoc` scope: ```sbt -sourceDirectory in Nanoc := sourceDirectory.value / "conan" +Nanoc / sourceDirectory := sourceDirectory.value / "conan" ``` Similarly, the output can be redirected to a subdirectory of `target/site` via the `siteSubdirName` key in `Nanoc` scope: -@@ snip[siteSubdirName](../../../sbt-test/nanoc/can-use-nanoc/build.sbt) { #siteSubdirName } +@@ snip[siteSubdirName](/src/sbt-test/nanoc/can-use-nanoc/build.sbt) { #siteSubdirName } [Nanoc]: https://nanoc.ws/ diff --git a/src/main/paradox/generators/pamflet.md b/src/main/paradox/generators/pamflet.md index 2953359..0559215 100644 --- a/src/main/paradox/generators/pamflet.md +++ b/src/main/paradox/generators/pamflet.md @@ -2,16 +2,16 @@ The sbt-site plugin has direct support for building [Pamflet] projects. To enable Pamflet site generation, simply enable the associated plugin in your `build.sbt` file: -@@ snip[enablePlugin](../../../sbt-test/pamflet/can-use-pamflet/build.sbt) { #enablePlugin } +@@ snip[enablePlugin](/src/sbt-test/pamflet/can-use-pamflet/build.sbt) { #enablePlugin } This assumes you have a Pamflet project under the `src/pamflet` directory. To change this, set the `sourceDirectory` key in the `Pamflet` scope: ```sbt -sourceDirectory in Pamflet := sourceDirectory.value / "papyrus" +Pamflet / sourceDirectory := sourceDirectory.value / "papyrus" ``` Similarly, the output can be redirected to a subdirectory of `target/site` via the `siteSubdirName` key in `Pamflet` scope: -@@ snip[siteSubdirName](../../../sbt-test/pamflet/can-use-pamflet/build.sbt) { #siteSubdirName } +@@ snip[siteSubdirName](/src/sbt-test/pamflet/can-use-pamflet/build.sbt) { #siteSubdirName } [Pamflet]: http://www.foundweekends.org/pamflet/ diff --git a/src/main/paradox/generators/paradox.md b/src/main/paradox/generators/paradox.md index 4d6bc7e..05a2244 100644 --- a/src/main/paradox/generators/paradox.md +++ b/src/main/paradox/generators/paradox.md @@ -4,21 +4,21 @@ The sbt-site plugin has direct support for building [Paradox] projects. To enable Paradox site generation, simply enable the associated plugin in your `build.sbt` file: -@@ snip[enablePlugin](../../../sbt-test/paradox/can-use-paradox/build.sbt) { #enablePlugin } +@@ snip[enablePlugin](/src/sbt-test/paradox/can-use-paradox/build.sbt) { #enablePlugin } This assumes you have a Paradox project under the `src/paradox` directory. To change this, set the `sourceDirectory` key in the `Paradox` scope: ```sbt -sourceDirectory in Paradox := sourceDirectory.value / "doc" +Paradox / sourceDirectory := sourceDirectory.value / "doc" ``` If you are configuring Paradox from scratch remember to also configure a theme: -@@ snip[paradoxTheme](../../../sbt-test/paradox/can-use-paradox/build.sbt) { #paradoxTheme } +@@ snip[paradoxTheme](/src/sbt-test/paradox/can-use-paradox/build.sbt) { #paradoxTheme } Note that Paradox settings such as `paradoxProperties` should be scoped to `Paradox` instead of `Compile` as used in the [Paradox documentation]. For example to configure an `@extref` link prefix use: -@@ snip[paradoxProperties](../../../sbt-test/paradox/can-use-paradox/build.sbt) { #paradoxProperties } +@@ snip[paradoxProperties](/src/sbt-test/paradox/can-use-paradox/build.sbt) { #paradoxProperties } [Paradox]: https://github.com/lightbend/paradox [Paradox documentation]: https://developer.lightbend.com/docs/paradox/latest/ diff --git a/src/main/paradox/generators/sphinx.md b/src/main/paradox/generators/sphinx.md index abaa472..9f46830 100644 --- a/src/main/paradox/generators/sphinx.md +++ b/src/main/paradox/generators/sphinx.md @@ -2,16 +2,16 @@ The sbt-site plugin has direct support for building [Sphinx] projects. To enable Sphinx site generation, simply enable the associated plugin in your `build.sbt` file: -@@ snip[enablePlugin](../../../sbt-test/sphinx/can-use-sphinx/build.sbt) { #enablePlugin } +@@ snip[enablePlugin](/src/sbt-test/sphinx/can-use-sphinx/build.sbt) { #enablePlugin } This assumes you have a Sphinx project under the `src/sphinx` directory. To change this, set the `sourceDirectory` key in the `Sphinx` scope: ```sbt -sourceDirectory in Sphinx := sourceDirectory.value / "androsphinx" +Sphinx / sourceDirectory := sourceDirectory.value / "androsphinx" ``` Similarly, the output can be redirected to a subdirectory of `target/site` via the `siteSubdirName` key in `Sphinx` scope: -@@ snip[siteSubdirName](../../../sbt-test/sphinx/can-use-sphinx/build.sbt) { #siteSubdirName } +@@ snip[siteSubdirName](/src/sbt-test/sphinx/can-use-sphinx/build.sbt) { #siteSubdirName } [Sphinx]: http://sphinx-doc.org diff --git a/src/main/paradox/getting-started.md b/src/main/paradox/getting-started.md index 5068346..40adb59 100644 --- a/src/main/paradox/getting-started.md +++ b/src/main/paradox/getting-started.md @@ -67,7 +67,7 @@ To create a zip package of the site run `package-site`. To also include this zip file as an artifact when running `publish`, add the following to your `build.sbt`: -@@ snip[publishSite](../../sbt-test/site/can-package-and-publish-zip-file/build.sbt) { #publishSite } +@@ snip[publishSite](/src/sbt-test/site/can-package-and-publish-zip-file/build.sbt) { #publishSite } Once you have generated and packaged your site the next step is to publish it. The @ref:[publishing](publishing.md) section discusses several mechanisms, such as [sbt-ghpages]. diff --git a/src/main/paradox/index.md b/src/main/paradox/index.md index e180e32..7e8cc35 100644 --- a/src/main/paradox/index.md +++ b/src/main/paradox/index.md @@ -6,10 +6,9 @@ Before upgrading please consult the @github:[release notes](/notes/). Instructio @@@ note +* Version 1.4+ is published for sbt 1.2.x. * Version 1.3+ is cross published to both sbt 0.13 and sbt 1.x. * As of sbt-site version 1.x.x, sbt version 0.13.10+ or 1.0.0-RC2+ is supported. -* For earlier 0.13.x releases, use [version 0.8.2][0.8.2]. -* For sbt 0.12, use [version 0.7.2][0.7.2]. @@@ @@ -28,6 +27,4 @@ Before upgrading please consult the @github:[release notes](/notes/). Instructio @@@ -[0.7.2]: https://github.com/sbt/sbt-site/tree/v0.7.2 -[0.8.2]: https://github.com/sbt/sbt-site/tree/v0.8.2 [sbt-ghpages]: https://github.com/sbt/sbt-ghpages diff --git a/src/main/paradox/migration-guide.md b/src/main/paradox/migration-guide.md index fdd3aae..27135d1 100644 --- a/src/main/paradox/migration-guide.md +++ b/src/main/paradox/migration-guide.md @@ -1,5 +1,15 @@ # Migration Guide + +## Migrating from version 1.3.x to 1.4.x + +Only sbt >1.1.6 is supported. + +### ParadoxSitePlugin + +`ParadoxPlugin` is enabled whenever `ParadoxSitePlugin` is enabled. + + ## Migrating from version 0.x.x to 1.x.x diff --git a/src/main/paradox/notes/1.4.0.md b/src/main/paradox/notes/1.4.0.md new file mode 100644 index 0000000..ec5382d --- /dev/null +++ b/src/main/paradox/notes/1.4.0.md @@ -0,0 +1,10 @@ +# Release 1.4.0 + +See the [1.4.0 milestone](https://github.com/sbt/sbt-site/milestone/8?closed=1) for the full list of related tickets and PRs. + +## Breaking changes + +* sbt-site is published for sbt >1.1.6, only +* upgade to Paradox 0.5.x (with its breaking changes) + +## Enhancements diff --git a/src/main/paradox/notes/index.md b/src/main/paradox/notes/index.md index 9556849..f409a81 100644 --- a/src/main/paradox/notes/index.md +++ b/src/main/paradox/notes/index.md @@ -4,6 +4,8 @@ @@@ index + - [1.4.0](1.4.0.md) + - [1.3.3](1.3.3.md) - [1.3.2](1.3.2.md) - [1.3.1](1.3.1.md) - [1.3.0](1.3.0.md) diff --git a/src/main/paradox/preprocess.md b/src/main/paradox/preprocess.md index 86d4bfc..4380eef 100644 --- a/src/main/paradox/preprocess.md +++ b/src/main/paradox/preprocess.md @@ -6,15 +6,15 @@ sbt-site supports simple variable and Regular Expression substitution via the `P The `PreprocessPlugin` reads files from an input directory, substitute variables and writes them to an output directory. In addition to preprocessing static content it is also possible to use the plugin either before or after invoking a @ref:[site generator](generators/index.md). To enable, add this to your `build.sbt` file: -@@ snip[enablePlugin](../../sbt-test/preprocess/does-transform-variables/build.sbt) { #enablePlugin } +@@ snip[enablePlugin](/src/sbt-test/preprocess/does-transform-variables/build.sbt) { #enablePlugin } By default files are read from `src/site-preprocess` but this is configurable by setting `sourceDirectory`: -@@ snip[sourceDirectory](../../sbt-test/preprocess/does-transform-variables/build.sbt) { #sourceDirectory } +@@ snip[sourceDirectory](/src/sbt-test/preprocess/does-transform-variables/build.sbt) { #sourceDirectory } Variables are delimited by surrounding the name with `@` symbols (e.g. `@VERSION@`). Values are assigned to variables via the setting `preprocessVars: Map[String, String]`. For example: -@@ snip[preprocessVars](../../sbt-test/preprocess/does-transform-variables/build.sbt) { #preprocessVars } +@@ snip[preprocessVars](/src/sbt-test/preprocess/does-transform-variables/build.sbt) { #preprocessVars } @@@ note The plugin will generate an error if a variable is found in the source file with no matching value in `preprocessVars`. @@ -24,21 +24,21 @@ More advanced substitution patterns can be used by providing Regular Expression For example Scaladoc used to (before 2.12.9 and 2.13.0) prepend ".scala" to source links of Java files. The following preprocessing rule will find and fix such links: -@@ snip[preprocessRules](../../sbt-test/preprocess/transform-scaladoc/build.sbt) { #preprocessRules } +@@ snip[preprocessRules](/src/sbt-test/preprocess/transform-scaladoc/build.sbt) { #preprocessRules } The setting `preprocessIncludeFilter` is used to define the filename extensions that should be processed when `makeSite` is run. -@@ snip[preprocessIncludeFilter](../../sbt-test/preprocess/does-transform-variables/build.sbt) { #preprocessIncludeFilter } +@@ snip[preprocessIncludeFilter](/src/sbt-test/preprocess/does-transform-variables/build.sbt) { #preprocessIncludeFilter } The default filter is: -@@ snip[preprocessIncludeFilter](../scala/com/typesafe/sbt/site/preprocess/PreprocessPlugin.scala) { #preprocessIncludeFilter } +@@ snip[preprocessIncludeFilter](/src/main/scala/com/typesafe/sbt/site/preprocess/PreprocessPlugin.scala) { #preprocessIncludeFilter } ## Preprocessing Markdown files with tut The [tut] sbt plugin allows you to write documentation with fenced code blocks that is typechecked and run as part of your build. For example this markdown snippet: -@@ snip[tut](../../sbt-test/site/plays-nice-with-tut/src/main/tut/index.md) { #tut } +@@ snip[tut](/src/sbt-test/site/plays-nice-with-tut/src/main/tut/index.md) { #tut } Will show the result of running the code in the Scala REPL: @@ -51,12 +51,12 @@ Will show the result of running the code in the Scala REPL: The following example shows how to use it to preprocess a collection of markdown files before running a site generator. -@@ snip[tut](../../sbt-test/site/plays-nice-with-tut/build.sbt) { #tut } +@@ snip[tut](/src/sbt-test/site/plays-nice-with-tut/build.sbt) { #tut } The example uses the Paradox site generator but can be adapted to any site generator which understands markdown by configuring its `sourceDirectory` accordingly. For Jekyll, this would be: ```sbt -sourceDirectory in Jekyll := tutTargetDirectory.value +Jekyll / sourceDirectory := tutTargetDirectory.value ``` [tut]: https://github.com/tpolecat/tut diff --git a/src/main/paradox/publishing.md b/src/main/paradox/publishing.md index fa4c649..5d7ffce 100644 --- a/src/main/paradox/publishing.md +++ b/src/main/paradox/publishing.md @@ -10,13 +10,13 @@ mechanisms to be supported in the future. Set up the plugin by adding the following to `project/plugins.sbt` (check the [sbt-ghpages project][sbt-ghpages] for the most recent version). -@@ snip[sbt-ghpages](../../../project/plugins.sbt) { #sbt-ghpages } +@@ snip[sbt-ghpages](/project/plugins.sbt) { #sbt-ghpages } Then configure your sbt build to use a special remote when running on Travis CI and otherwise fall back to the normal Git remote configured via the `scmInfo` setting. -@@ snip[ghpages-publish](../../../build.sbt) { #scm-info #ghpages-publish } +@@ snip[ghpages-publish](/build.sbt) { #scm-info #ghpages-publish } At this point you should be able to run `sbt ghpagesPushSite` to publish your site. @@ -113,7 +113,7 @@ created and explicitly disable publishing for pull request. The `before_deploy` step takes care of setting up the environment so that `git push` automatically finds the deploy key. -@@ snip[travis-deploy](../../../.travis.yml) { #travis-deploy } +@@ snip[travis-deploy](/.travis.yml) { #travis-deploy } @@@ note diff --git a/src/main/scala-sbt-0.13/com/typesafe/sbt/site/Compat.scala b/src/main/scala-sbt-0.13/com/typesafe/sbt/site/Compat.scala deleted file mode 100644 index da77905..0000000 --- a/src/main/scala-sbt-0.13/com/typesafe/sbt/site/Compat.scala +++ /dev/null @@ -1,31 +0,0 @@ -package com.typesafe.sbt.site - -import sbt._ -import sbt.Keys._ -import sbt.FilesInfo.Style - -object Compat { - - type Process = sbt.Process - val Process = sbt.Process - type ProcessLogger = sbt.ProcessLogger - - def cached(cacheBaseDirectory: File, inStyle: Style, outStyle: Style)(action: (ChangeReport[File], ChangeReport[File]) => Set[File]): Set[File] => Set[File] = - FileFunction.cached(cacheBaseDirectory = cacheBaseDirectory)(inStyle = inStyle, outStyle = outStyle)(action = action) - - val genSources = (s: State) => { - Preview.runTask(watchSources, s) - } - - def watchSettings(config: Configuration): Seq[Setting[_]] = - Seq( - watchSources in Global ++= (sourceDirectory in config).value.***.get - ) - - def CacheStore(file: File) = file - - implicit class FileOps(file: File) { - def allPaths = file.*** - } - -} diff --git a/src/main/scala-sbt-0.13/com/typesafe/sbt/site/laika/LaikaSitePlugin.scala b/src/main/scala-sbt-0.13/com/typesafe/sbt/site/laika/LaikaSitePlugin.scala deleted file mode 100644 index ab882a7..0000000 --- a/src/main/scala-sbt-0.13/com/typesafe/sbt/site/laika/LaikaSitePlugin.scala +++ /dev/null @@ -1,53 +0,0 @@ -package com.typesafe.sbt.site.laika - -import java.io.File - -import sbt._ -import Keys._ -import com.typesafe.sbt.site.SitePlugin -import com.typesafe.sbt.site.util.SiteHelpers -import com.typesafe.sbt.site.SitePlugin.autoImport.siteSubdirName -import com.typesafe.sbt.site.SitePlugin.autoImport.makeSite -import laika.sbt.LaikaSbtPlugin.{ LaikaKeys, LaikaPlugin } - -object LaikaSitePlugin extends AutoPlugin { - override def requires = SitePlugin - override def trigger = noTrigger - - object autoImport { - val LaikaSite = config("laikaSite") - } - import autoImport._ - - override def projectSettings = laikaSettings(LaikaSite) - - /** Creates settings necessary for running Laika in the given configuration. */ - def laikaSettings(config: Configuration): Seq[Setting[_]] = - LaikaPlugin.defaults ++ - inConfig(config)( - Seq( - includeFilter := AllPassFilter, - excludeFilter := HiddenFileFilter, - mappings := generate( - target.value, - includeFilter.value, - excludeFilter.value - ), - siteSubdirName := "", - target in (LaikaKeys.Laika, LaikaKeys.site) := (target in makeSite).value, - sourceDirectories in LaikaKeys.Laika := Seq(sourceDirectory.value) - ) - ) ++ - SiteHelpers.directorySettings(config) ++ - SiteHelpers.watchSettings(config) ++ - SiteHelpers.addMappingsToSiteDir(mappings in config, siteSubdirName in config) ++ - Seq( - makeSite := makeSite.dependsOn(LaikaKeys.html in LaikaKeys.Laika).value - ) - - private def generate(target: File, inc: FileFilter, exc: FileFilter): Seq[(File, String)] = { - // Figure out what was generated. - val files = (target ** inc) --- (target ** exc) --- target - files pair relativeTo(target) - } -} diff --git a/src/main/scala-sbt-1.0/com/typesafe/sbt/site/Compat.scala b/src/main/scala/com/typesafe/sbt/site/Compat.scala similarity index 86% rename from src/main/scala-sbt-1.0/com/typesafe/sbt/site/Compat.scala rename to src/main/scala/com/typesafe/sbt/site/Compat.scala index 2ee00f8..9f4106b 100644 --- a/src/main/scala-sbt-1.0/com/typesafe/sbt/site/Compat.scala +++ b/src/main/scala/com/typesafe/sbt/site/Compat.scala @@ -2,11 +2,12 @@ package com.typesafe.sbt.site import java.nio.file.Files -import sbt._ -import sbt.Keys._ -import sbt.util.CacheStoreFactory -import FileInfo.Style +import sbt.Defaults.ConfigGlobal +import sbt.Keys.{excludeFilter, includeFilter, sourceDirectory, watchSources} import sbt.internal.io.Source +import sbt.util.CacheStoreFactory +import sbt.util.FileInfo.Style +import sbt.{ChangeReport, Configuration, File, FileFilter, Setting, State} object Compat { @@ -50,7 +51,7 @@ object Compat { def watchSettings(config: Configuration): Seq[Setting[_]] = Seq( - watchSources in Global += new Source( + ConfigGlobal / watchSources += new Source( base = (sourceDirectory in config).value, includeFilter = (includeFilter in config).value, excludeFilter = (excludeFilter in config).value diff --git a/src/main/scala/com/typesafe/sbt/site/asciidoctor/AsciidoctorPlugin.scala b/src/main/scala/com/typesafe/sbt/site/asciidoctor/AsciidoctorPlugin.scala index 6ff9f7d..2cda173 100644 --- a/src/main/scala/com/typesafe/sbt/site/asciidoctor/AsciidoctorPlugin.scala +++ b/src/main/scala/com/typesafe/sbt/site/asciidoctor/AsciidoctorPlugin.scala @@ -54,7 +54,7 @@ object AsciidoctorPlugin extends AutoPlugin { val attributes = new util.HashMap[String, AnyRef]() attributes.put("project-version", version) options.setAttributes(attributes) - asciidoctor.renderDirectory(new AsciiDocDirectoryWalker(input.getAbsolutePath), options) + asciidoctor.convertDirectory(new AsciiDocDirectoryWalker(input.getAbsolutePath), options) val inputImages = input / "images" if (inputImages.exists()) { val outputImages = output / "images" diff --git a/src/main/scala-sbt-1.0/com/typesafe/sbt/site/laika/LaikaSitePlugin.scala b/src/main/scala/com/typesafe/sbt/site/laika/LaikaSitePlugin.scala similarity index 100% rename from src/main/scala-sbt-1.0/com/typesafe/sbt/site/laika/LaikaSitePlugin.scala rename to src/main/scala/com/typesafe/sbt/site/laika/LaikaSitePlugin.scala diff --git a/src/main/scala/com/typesafe/sbt/site/paradox/ParadoxSitePlugin.scala b/src/main/scala/com/typesafe/sbt/site/paradox/ParadoxSitePlugin.scala index 350be98..17cc3fd 100644 --- a/src/main/scala/com/typesafe/sbt/site/paradox/ParadoxSitePlugin.scala +++ b/src/main/scala/com/typesafe/sbt/site/paradox/ParadoxSitePlugin.scala @@ -10,7 +10,7 @@ import com.typesafe.sbt.web.SbtWeb /** Paradox generator. */ object ParadoxSitePlugin extends AutoPlugin { - override def requires = SitePlugin && SbtWeb + override def requires = SitePlugin && SbtWeb && ParadoxPlugin override def trigger = noTrigger object autoImport { val Paradox = config("paradox") diff --git a/src/main/scala/com/typesafe/sbt/site/sphinx/SphinxHelpers.scala b/src/main/scala/com/typesafe/sbt/site/sphinx/SphinxHelpers.scala index 4573018..5a68c9a 100644 --- a/src/main/scala/com/typesafe/sbt/site/sphinx/SphinxHelpers.scala +++ b/src/main/scala/com/typesafe/sbt/site/sphinx/SphinxHelpers.scala @@ -110,7 +110,7 @@ private[sphinx] class CommandLineSphinxRunner extends SphinxRunner { if (!incremental) IO.delete(target) val logger = sphinxLogger(log) val buildOptions = if (!incremental) Seq("-a", "-E") else Seq.empty[String] - val colourOptions = if (!log.ansiCodesSupported) Seq("-N") else Seq.empty[String] + val colourOptions = Seq("-N") val tagOptions = tags flatMap (Seq("-t", _)) val propertyOptions = (properties map { case (k, v) => "-D%s=%s" format (k, v) }).toSeq val command = Seq("sphinx-build") ++ buildOptions ++ colourOptions ++ Seq("-b", builder, "-d", doctrees.absolutePath) ++ tagOptions ++ propertyOptions ++ Seq(src.absolutePath, target.absolutePath) diff --git a/src/sbt-test/laika_1.x/blog-post/README.md b/src/sbt-test/laika/blog-post/README.md similarity index 100% rename from src/sbt-test/laika_1.x/blog-post/README.md rename to src/sbt-test/laika/blog-post/README.md diff --git a/src/sbt-test/laika_1.x/blog-post/build.sbt b/src/sbt-test/laika/blog-post/build.sbt similarity index 100% rename from src/sbt-test/laika_1.x/blog-post/build.sbt rename to src/sbt-test/laika/blog-post/build.sbt diff --git a/src/sbt-test/laika_1.x/blog-post/project/CustomDirectives.scala b/src/sbt-test/laika/blog-post/project/CustomDirectives.scala similarity index 100% rename from src/sbt-test/laika_1.x/blog-post/project/CustomDirectives.scala rename to src/sbt-test/laika/blog-post/project/CustomDirectives.scala diff --git a/src/sbt-test/laika/blog-post/project/build.properties b/src/sbt-test/laika/blog-post/project/build.properties new file mode 100644 index 0000000..c0bab04 --- /dev/null +++ b/src/sbt-test/laika/blog-post/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.2.8 diff --git a/src/sbt-test/laika_0.13/blog-post/project/plugins.sbt b/src/sbt-test/laika/blog-post/project/plugins.sbt similarity index 100% rename from src/sbt-test/laika_0.13/blog-post/project/plugins.sbt rename to src/sbt-test/laika/blog-post/project/plugins.sbt diff --git a/src/sbt-test/laika_1.x/blog-post/src/blog/default.template.html b/src/sbt-test/laika/blog-post/src/blog/default.template.html similarity index 100% rename from src/sbt-test/laika_1.x/blog-post/src/blog/default.template.html rename to src/sbt-test/laika/blog-post/src/blog/default.template.html diff --git a/src/sbt-test/laika_0.13/blog-post/src/blog/index.md b/src/sbt-test/laika/blog-post/src/blog/index.md similarity index 100% rename from src/sbt-test/laika_0.13/blog-post/src/blog/index.md rename to src/sbt-test/laika/blog-post/src/blog/index.md diff --git a/src/sbt-test/laika_0.13/blog-post/src/blog/topics/directory.conf b/src/sbt-test/laika/blog-post/src/blog/topics/directory.conf similarity index 100% rename from src/sbt-test/laika_0.13/blog-post/src/blog/topics/directory.conf rename to src/sbt-test/laika/blog-post/src/blog/topics/directory.conf diff --git a/src/sbt-test/laika_0.13/blog-post/src/blog/topics/post-1.md b/src/sbt-test/laika/blog-post/src/blog/topics/post-1.md similarity index 100% rename from src/sbt-test/laika_0.13/blog-post/src/blog/topics/post-1.md rename to src/sbt-test/laika/blog-post/src/blog/topics/post-1.md diff --git a/src/sbt-test/laika_0.13/blog-post/src/blog/topics/post-2.md b/src/sbt-test/laika/blog-post/src/blog/topics/post-2.md similarity index 100% rename from src/sbt-test/laika_0.13/blog-post/src/blog/topics/post-2.md rename to src/sbt-test/laika/blog-post/src/blog/topics/post-2.md diff --git a/src/sbt-test/laika_0.13/blog-post/test b/src/sbt-test/laika/blog-post/test similarity index 100% rename from src/sbt-test/laika_0.13/blog-post/test rename to src/sbt-test/laika/blog-post/test diff --git a/src/sbt-test/laika_0.13/minimal/build.sbt b/src/sbt-test/laika/minimal/build.sbt similarity index 100% rename from src/sbt-test/laika_0.13/minimal/build.sbt rename to src/sbt-test/laika/minimal/build.sbt diff --git a/src/sbt-test/laika/minimal/project/build.properties b/src/sbt-test/laika/minimal/project/build.properties new file mode 100644 index 0000000..c0bab04 --- /dev/null +++ b/src/sbt-test/laika/minimal/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.2.8 diff --git a/src/sbt-test/laika_0.13/minimal/project/plugins.sbt b/src/sbt-test/laika/minimal/project/plugins.sbt similarity index 100% rename from src/sbt-test/laika_0.13/minimal/project/plugins.sbt rename to src/sbt-test/laika/minimal/project/plugins.sbt diff --git a/src/sbt-test/laika_0.13/minimal/src/laikaSite/index.md b/src/sbt-test/laika/minimal/src/laikaSite/index.md similarity index 100% rename from src/sbt-test/laika_0.13/minimal/src/laikaSite/index.md rename to src/sbt-test/laika/minimal/src/laikaSite/index.md diff --git a/src/sbt-test/laika_0.13/minimal/test b/src/sbt-test/laika/minimal/test similarity index 100% rename from src/sbt-test/laika_0.13/minimal/test rename to src/sbt-test/laika/minimal/test diff --git a/src/sbt-test/laika_0.13/blog-post/README.md b/src/sbt-test/laika_0.13/blog-post/README.md deleted file mode 100644 index bd39c3e..0000000 --- a/src/sbt-test/laika_0.13/blog-post/README.md +++ /dev/null @@ -1 +0,0 @@ -Based on [Blog Post](https://startbootstrap.com/template-overviews/blog-post/) and adopted for Laika just as sample diff --git a/src/sbt-test/laika_0.13/blog-post/build.sbt b/src/sbt-test/laika_0.13/blog-post/build.sbt deleted file mode 100644 index 4f2cf27..0000000 --- a/src/sbt-test/laika_0.13/blog-post/build.sbt +++ /dev/null @@ -1,34 +0,0 @@ -name := "test" - -//#enablePlugin -enablePlugins(LaikaSitePlugin) -//#enablePlugin - -sourceDirectory in LaikaSite := sourceDirectory.value / "blog" - -siteSubdirName in LaikaSite := "blog" - -//#laikaSbtPluginCustomization -import LaikaKeys._ - -blockDirectives in Laika += CustomDirectives.postsToc -siteRenderers in Laika += CustomDirectives.postsRenderer -sourceDirectories in Laika := Seq((sourceDirectory in LaikaSite).value) -//#laikaSbtPluginCustomization - -TaskKey[Unit]("checkContent") := { - val dest = (target in makeSite).value / (siteSubdirName in LaikaSite).value - - val expectedFilesAndWords = Map( - dest / "index.html" -> Seq("Start Bootstrap Template", "Blog Post Title", "Second Post Title"), - dest / "topics" / "post-1.html" -> Seq("Blog Post Title", "recusandae laborum minus inventore?"), - dest / "topics" / "post-2.html" -> Seq("Second Post Title", "perspiciatis. Enim, iure!") - ) - - for ((file, words) <- expectedFilesAndWords) { - assert(file.exists, s"${file.getAbsolutePath} did not exist") - val content = IO.readLines(file) - for (word <- words) - assert(content.exists(_.contains(word)), s"Did not find $word content in:\n${content.mkString("\n")}") - } -} diff --git a/src/sbt-test/laika_0.13/blog-post/project/CustomDirectives.scala b/src/sbt-test/laika_0.13/blog-post/project/CustomDirectives.scala deleted file mode 100644 index 08cf839..0000000 --- a/src/sbt-test/laika_0.13/blog-post/project/CustomDirectives.scala +++ /dev/null @@ -1,55 +0,0 @@ -import laika.directive.Directives.Blocks -import laika.directive.StandardDirectives -import laika.render.HTMLWriter -import laika.rewrite.{DocumentCursor, TreeCursor} -import laika.tree.Documents.{Document, DocumentTree} -import laika.tree.Elements -import laika.tree.Elements._ -import com.typesafe.config.Config - -// Just sample, probably not the best way to do custom toc for Laika -object CustomDirectives extends StandardDirectives { - - case class PostsTocElement(title: Seq[Span], by: String, path: PathInfo, options: Elements.Options) - extends Elements.Element with Elements.Block - - val postsToc: Blocks.Directive = Blocks.create("postsToc") { - import Blocks.Combinators._ - - def titleOrName (content: Document) = - if (content.title.nonEmpty) content.title - else Seq(Text(content.name)) - - def by(config: Config) = - if (config.hasPath("by")) - config.getString("by") - else "" - - cursor.map { cursor => - val posts = cursor.root.children.collect { - case pd: TreeCursor => - pd.children.collect { - case d: DocumentCursor => - val path = d.target.path - val refPath = cursor.parent.target.path - PostsTocElement(titleOrName(d.target), - by(d.config), - PathInfo.fromPath(path, refPath.parent), - Styles("toc")) - } - }.flatten - - BlockSequence(posts) - } - } - - val postsRenderer: HTMLWriter => RenderFunction = { out => { - case PostsTocElement(title, by, path, options) => - out << Paragraph(List( - CrossLink(title, "", path), - LineBreak(), - SpanSequence(Seq(Text("by "), Text(by))) - ), options) - } - } -} diff --git a/src/sbt-test/laika_0.13/blog-post/project/build.properties b/src/sbt-test/laika_0.13/blog-post/project/build.properties deleted file mode 100644 index c091b86..0000000 --- a/src/sbt-test/laika_0.13/blog-post/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=0.13.16 diff --git a/src/sbt-test/laika_0.13/blog-post/src/blog/default.template.html b/src/sbt-test/laika_0.13/blog-post/src/blog/default.template.html deleted file mode 100644 index 7441b72..0000000 --- a/src/sbt-test/laika_0.13/blog-post/src/blog/default.template.html +++ /dev/null @@ -1,159 +0,0 @@ - - - -
- - - - - - - -