From 28f654e11e3c5486a607037179beca647d92bed4 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 6 Sep 2016 13:15:15 -0400 Subject: [PATCH 1/6] 0.2.0 notes --- notes/0.2.0.markdown | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 notes/0.2.0.markdown diff --git a/notes/0.2.0.markdown b/notes/0.2.0.markdown new file mode 100644 index 00000000..9a55bb4b --- /dev/null +++ b/notes/0.2.0.markdown @@ -0,0 +1,11 @@ +### Initial public release of Paradox. + +Features include: + +- Static site generation +- GFM powered by Pegdown +- StringTemplate using ST4 +- @ref link +- @@index container +- @@toc block +- @@snip block From e754125816e7d3692a459cae1f144dd55c9de3b2 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 6 Sep 2016 13:15:48 -0400 Subject: [PATCH 2/6] default to generic theme. Ref #19 --- .../main/scala/com/lightbend/paradox/sbt/ParadoxPlugin.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxPlugin.scala b/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxPlugin.scala index 5a50ddaf..0b23f9ec 100644 --- a/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxPlugin.scala +++ b/plugin/src/main/scala/com/lightbend/paradox/sbt/ParadoxPlugin.scala @@ -44,7 +44,7 @@ object ParadoxPlugin extends AutoPlugin { paradoxTargetSuffix := ".html", paradoxNavigationDepth := 2, paradoxProperties := Map.empty, - paradoxTheme := None, + paradoxTheme := Some(builtinParadoxTheme("generic")), paradoxLeadingBreadcrumbs := Nil, libraryDependencies ++= paradoxTheme.value.toSeq ) From d35bed5149b83f60783cbd1b56d765fa0eaa58c3 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 6 Sep 2016 13:32:56 -0400 Subject: [PATCH 3/6] avoid NPE when `page.st` is not found. Fixes #19 --- .../scala/com/lightbend/paradox/template/PageTemplate.scala | 5 ++++- plugin/src/sbt-test/paradox/error/build.sbt | 5 +++++ plugin/src/sbt-test/paradox/error/project/plugins.sbt | 1 + plugin/src/sbt-test/paradox/error/src/main/paradox/a.md | 1 + plugin/src/sbt-test/paradox/error/test | 1 + plugin/src/sbt-test/paradox/site/project/build.properties | 1 - .../src/sbt-test/paradox/snippets/project/build.properties | 1 - 7 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 plugin/src/sbt-test/paradox/error/build.sbt create mode 100644 plugin/src/sbt-test/paradox/error/project/plugins.sbt create mode 100644 plugin/src/sbt-test/paradox/error/src/main/paradox/a.md create mode 100644 plugin/src/sbt-test/paradox/error/test delete mode 100644 plugin/src/sbt-test/paradox/site/project/build.properties delete mode 100644 plugin/src/sbt-test/paradox/snippets/project/build.properties diff --git a/core/src/main/scala/com/lightbend/paradox/template/PageTemplate.scala b/core/src/main/scala/com/lightbend/paradox/template/PageTemplate.scala index 90aa7fe1..2f5cc2b7 100644 --- a/core/src/main/scala/com/lightbend/paradox/template/PageTemplate.scala +++ b/core/src/main/scala/com/lightbend/paradox/template/PageTemplate.scala @@ -32,7 +32,10 @@ class PageTemplate(directory: File, startDelimiter: Char = '$', stopDelimiter: C * Write a templated page to the target file. */ def write(contents: PageTemplate.Contents, target: File, errorListener: STErrorListener): File = { - val template = templates.getInstanceOf(name).add("page", contents) + val template = Option(templates.getInstanceOf(name)) match { + case Some(t) => t.add("page", contents) + case None => sys.error(s"StringTemplate '$name' was not found for '$target'. Create a template or set a theme that contains one.") + } template.write(target, errorListener) target } diff --git a/plugin/src/sbt-test/paradox/error/build.sbt b/plugin/src/sbt-test/paradox/error/build.sbt new file mode 100644 index 00000000..647dbb5a --- /dev/null +++ b/plugin/src/sbt-test/paradox/error/build.sbt @@ -0,0 +1,5 @@ +lazy val docs = (project in file(".")). + enablePlugins(ParadoxPlugin). + settings( + paradoxTheme := None + ) diff --git a/plugin/src/sbt-test/paradox/error/project/plugins.sbt b/plugin/src/sbt-test/paradox/error/project/plugins.sbt new file mode 100644 index 00000000..be8b011a --- /dev/null +++ b/plugin/src/sbt-test/paradox/error/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % sys.props("project.version")) diff --git a/plugin/src/sbt-test/paradox/error/src/main/paradox/a.md b/plugin/src/sbt-test/paradox/error/src/main/paradox/a.md new file mode 100644 index 00000000..7f3b95d2 --- /dev/null +++ b/plugin/src/sbt-test/paradox/error/src/main/paradox/a.md @@ -0,0 +1 @@ +# A diff --git a/plugin/src/sbt-test/paradox/error/test b/plugin/src/sbt-test/paradox/error/test new file mode 100644 index 00000000..09fb844f --- /dev/null +++ b/plugin/src/sbt-test/paradox/error/test @@ -0,0 +1 @@ +-> paradox diff --git a/plugin/src/sbt-test/paradox/site/project/build.properties b/plugin/src/sbt-test/paradox/site/project/build.properties deleted file mode 100644 index a6e117b6..00000000 --- a/plugin/src/sbt-test/paradox/site/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=0.13.8 diff --git a/plugin/src/sbt-test/paradox/snippets/project/build.properties b/plugin/src/sbt-test/paradox/snippets/project/build.properties deleted file mode 100644 index a6e117b6..00000000 --- a/plugin/src/sbt-test/paradox/snippets/project/build.properties +++ /dev/null @@ -1 +0,0 @@ -sbt.version=0.13.8 From 6306199bac6188be47d62cb7d50a9ed83debe197 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 6 Sep 2016 13:36:14 -0400 Subject: [PATCH 4/6] parallelExecution in Test := false --- build.sbt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 88ae375b..1486ba2f 100644 --- a/build.sbt +++ b/build.sbt @@ -44,7 +44,8 @@ lazy val core = project Library.st4, Library.scalatest % "test", Library.jtidy % "test" - ) + ), + parallelExecution in Test := false ) lazy val plugin = project From d6cf84d098d5ba8b11750d8ad9b66326b99c8a35 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 6 Sep 2016 13:55:49 -0400 Subject: [PATCH 5/6] publishLocal in genericTheme --- build.sbt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 1486ba2f..6dabae72 100644 --- a/build.sbt +++ b/build.sbt @@ -59,8 +59,9 @@ lazy val plugin = project scriptedSettings, scriptedLaunchOpts += ("-Dproject.version=" + version.value), scriptedDependencies := { - (publishLocal in core).value - publishLocal.value + val p1 = (publishLocal in core).value + val p2 = publishLocal.value + val p3 = (publishLocal in genericTheme).value }, test in Test := { (test in Test).value From 57fc6cad5ebd9dcb0dc139353be05dfbc21d782f Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Tue, 6 Sep 2016 14:41:23 -0400 Subject: [PATCH 6/6] Fix scripted tests --- build.sbt | 3 +++ plugin/src/sbt-test/paradox/site/build.sbt | 3 ++- plugin/src/sbt-test/paradox/snippets/build.sbt | 8 +++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 6dabae72..5ac9b116 100644 --- a/build.sbt +++ b/build.sbt @@ -58,6 +58,9 @@ lazy val plugin = project addSbtPlugin(Library.sbtWeb), scriptedSettings, scriptedLaunchOpts += ("-Dproject.version=" + version.value), + scriptedLaunchOpts ++= sys.process.javaVmArguments.filter( + a => Seq("-Xmx", "-Xms", "-XX").exists(a.startsWith) + ), scriptedDependencies := { val p1 = (publishLocal in core).value val p2 = publishLocal.value diff --git a/plugin/src/sbt-test/paradox/site/build.sbt b/plugin/src/sbt-test/paradox/site/build.sbt index a0927876..7862c5e0 100644 --- a/plugin/src/sbt-test/paradox/site/build.sbt +++ b/plugin/src/sbt-test/paradox/site/build.sbt @@ -3,5 +3,6 @@ lazy val docs = project .enablePlugins(ParadoxPlugin) .settings( name := "Paradox Test", - paradoxLeadingBreadcrumbs := List("Alphabet" -> "https://abc.xyz/", "Google" -> "https://www.google.com") + paradoxLeadingBreadcrumbs := List("Alphabet" -> "https://abc.xyz/", "Google" -> "https://www.google.com"), + paradoxTheme := None ) diff --git a/plugin/src/sbt-test/paradox/snippets/build.sbt b/plugin/src/sbt-test/paradox/snippets/build.sbt index 118c5719..647dbb5a 100644 --- a/plugin/src/sbt-test/paradox/snippets/build.sbt +++ b/plugin/src/sbt-test/paradox/snippets/build.sbt @@ -1,3 +1,5 @@ -lazy val docs = project - .in(file(".")) - .enablePlugins(ParadoxPlugin) +lazy val docs = (project in file(".")). + enablePlugins(ParadoxPlugin). + settings( + paradoxTheme := None + )