From 770e1f57a270ce5b183d340e7e7673b0c34d5013 Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Sat, 28 Sep 2024 22:32:08 +1000 Subject: [PATCH 1/3] Separate docs --- build.sbt | 98 +++++++++++++++++++---------------- docs/about/README.md | 1 - docs/src/docs/about/README.md | 1 + 3 files changed, 53 insertions(+), 47 deletions(-) delete mode 120000 docs/about/README.md create mode 100644 docs/src/docs/about/README.md diff --git a/build.sbt b/build.sbt index 5601492..c8f8ee5 100644 --- a/build.sbt +++ b/build.sbt @@ -51,6 +51,57 @@ lazy val benchmarks = (project in file("benchmarks")) name := "benchmarks", ).enablePlugins(JmhPlugin) +lazy val docs = (project in file("docs")) + .dependsOn(core) + .enablePlugins(LaikaPlugin) + .settings( + name := "docs", + laikaTheme := { + import laika.ast.Path.Root + import laika.ast.{Image, ExternalTarget} + import laika.helium.config.* + import laika.helium.Helium + + Helium.defaults.site + .landingPage( + title = Some("Spark Fast Tests"), + subtitle = Some("Unit testing your Apache Spark application"), + latestReleases = Seq( + ReleaseInfo("Latest Stable Release", "1.0.0") + ), + license = Some("MIT"), + titleLinks = Seq( + VersionMenu.create(unversionedLabel = "Getting Started"), + LinkGroup.create( + IconLink.external("https://github.com/mrpowers-io/spark-fast-tests", HeliumIcon.github) + ) + ), + linkPanel = Some( + LinkPanel( + "Documentation", + TextLink.internal(Root / "about" / "README.md", "Spark Fast Tests") + ) + ), + projectLinks = Seq( + LinkGroup.create( + TextLink.internal(Root / "api" / "com" / "github" / "mrpowers" / "spark" / "fast" / "tests" / "index.html", "API (Scaladoc)") + ) + ), + teasers = Seq( + Teaser("Fast", "Handle small dataframes effectively and provide column assertions"), + Teaser("Flexible", "Works fine with scalatest, uTest, munit") + ) + ) + .build + }, + laikaIncludeAPI := true, + laikaExtensions ++= { + import laika.format.Markdown + import laika.config.SyntaxHighlighting + Seq(Markdown.GitHubFlavor, SyntaxHighlighting) + }, + ) + credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credentials") licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")) @@ -66,49 +117,4 @@ publishMavenStyle := true publishTo := sonatypePublishToBundle.value -Global / useGpgPinentry := true - -enablePlugins(LaikaPlugin) - -import laika.format.Markdown -import laika.config.SyntaxHighlighting -import laika.ast.Path.Root -import laika.ast.{Image, ExternalTarget} -import laika.helium.config.* -import laika.helium.Helium - -laikaTheme := Helium.defaults.site - .landingPage( - title = Some("Spark Fast Tests"), - subtitle = Some("Unit testing your Apache Spark application"), - latestReleases = Seq( - ReleaseInfo("Latest Stable Release", "1.0.0") - ), - license = Some("MIT"), - titleLinks = Seq( - VersionMenu.create(unversionedLabel = "Getting Started"), - LinkGroup.create( - IconLink.external("https://github.com/mrpowers-io/spark-fast-tests", HeliumIcon.github) - ) - ), - linkPanel = Some( - LinkPanel( - "Documentation", - TextLink.internal(Root / "about" / "README.md", "Spark Fast Tests") - ) - ), - projectLinks = Seq( - LinkGroup.create( - TextLink.internal(Root / "api" / "com" / "github" / "mrpowers" / "spark" / "fast" / "tests" / "index.html", "API (Scaladoc)") - ) - ), - teasers = Seq( - Teaser("Fast", "Handle small dataframes effectively and provide column assertions"), - Teaser("Flexible", "Works fine with scalatest, uTest, munit") - ) - ) - .build - -laikaIncludeAPI := true -laikaExtensions ++= Seq(Markdown.GitHubFlavor, SyntaxHighlighting) -Laika / sourceDirectories := Seq((ThisBuild / baseDirectory).value / "docs") +Global / useGpgPinentry := true \ No newline at end of file diff --git a/docs/about/README.md b/docs/about/README.md deleted file mode 120000 index fe84005..0000000 --- a/docs/about/README.md +++ /dev/null @@ -1 +0,0 @@ -../../README.md \ No newline at end of file diff --git a/docs/src/docs/about/README.md b/docs/src/docs/about/README.md new file mode 100644 index 0000000..fe84005 --- /dev/null +++ b/docs/src/docs/about/README.md @@ -0,0 +1 @@ +../../README.md \ No newline at end of file From 8f63c096e89b24b3dd12e1642b0472238a534c9b Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Sat, 28 Sep 2024 22:53:55 +1000 Subject: [PATCH 2/3] Restore sourceDirectories structure --- build.sbt | 1 + docs/{src/docs => }/about/README.md | 0 2 files changed, 1 insertion(+) rename docs/{src/docs => }/about/README.md (100%) diff --git a/build.sbt b/build.sbt index c8f8ee5..db78e4f 100644 --- a/build.sbt +++ b/build.sbt @@ -100,6 +100,7 @@ lazy val docs = (project in file("docs")) import laika.config.SyntaxHighlighting Seq(Markdown.GitHubFlavor, SyntaxHighlighting) }, + Laika / sourceDirectories := Seq((ThisBuild / baseDirectory).value / "docs") ) credentials += Credentials(Path.userHome / ".sbt" / "sonatype_credentials") diff --git a/docs/src/docs/about/README.md b/docs/about/README.md similarity index 100% rename from docs/src/docs/about/README.md rename to docs/about/README.md From b8eb8d5da61fc34e2f3052d87820043638616725 Mon Sep 17 00:00:00 2001 From: Tuan Pham Date: Tue, 8 Oct 2024 21:23:18 +1100 Subject: [PATCH 3/3] run laikaSite only on doc project --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f090925..a8bae56 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -9,7 +9,7 @@ jobs: - uses: actions/checkout@v1 - uses: olafurpg/setup-scala@v10 - name: Build docs - run: sbt laikaSite + run: sbt "project docs" laikaSite - name: Deploy to GH Pages uses: peaceiris/actions-gh-pages@v4 with: