Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 0.4 -> main #232

Merged
merged 15 commits into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.5")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
7 changes: 4 additions & 3 deletions docs/site.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ For example, the sbt-typelevel `VERSION` is `@VERSION@` and `SNAPSHOT_VERSION` i
If you generate your API documentation with [sbt-unidoc](https://github.com/sbt/sbt-unidoc), you can use the `TypelevelUnidocPlugin` to publish a Scaladoc-only artifact to Sonatype/Maven alongside your library artifacts. This makes it possible to browse your unidocs at [javadoc.io](https://www.javadoc.io/); for example, the sbt-typelevel [API docs](@API_URL@) are published like this.

```scala
lazy val unidoc = project
.in(file("unidoc"))
// Make sure to add to your root aggregate so it gets published!
lazy val unidocs = project
.in(file("unidocs"))
.enablePlugins(TypelevelUnidocPlugin) // also enables the ScalaUnidocPlugin
.settings(
name := "woozle-docs"
Expand All @@ -44,4 +45,4 @@ lazy val unidoc = project

### How can I customize my website's appearance?

We refer you to the comprehensive [Laika manual](https://planet42.github.io/Laika/index.html) and specifically the [`laikaTheme` setting](https://planet42.github.io/Laika/0.18/02-running-laika/01-sbt-plugin.html#laikatheme-setting).
We refer you to the comprehensive [Laika manual](https://planet42.github.io/Laika/index.html) and specifically the [`laikaTheme` setting](https://planet42.github.io/Laika/0.18/02-running-laika/01-sbt-plugin.html#laikatheme-setting).
2 changes: 1 addition & 1 deletion site/build.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.24")
addSbtPlugin("org.planet42" % "laika-sbt" % "0.18.1")
addSbtPlugin("org.planet42" % "laika-sbt" % "0.18.2")
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@ header img {
width: auto;
margin-top: 6px;
}

#sidebar li.nav-header {
margin-top: -20px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import MdocPlugin.autoImport._
import LaikaPlugin.autoImport._
import gha.GenerativePlugin
import GenerativePlugin.autoImport._
import TypelevelKernelPlugin.autoImport._

object TypelevelSitePlugin extends AutoPlugin {

Expand Down Expand Up @@ -117,7 +118,8 @@ object TypelevelSitePlugin extends AutoPlugin {
},
tlSiteHeliumExtensions := TypelevelHeliumExtensions(
licenses.value.headOption,
tlSiteRelatedProjects.value
tlSiteRelatedProjects.value,
tlIsScala3.value
),
tlSiteApiUrl := {
val javadocioUrl = for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import laika.config.Config
import laika.io.model.InputTree
import laika.markdown.github.GitHubFlavor
import laika.parse.code.SyntaxHighlighting
import laika.parse.code.languages.DottySyntax
import laika.rewrite.DefaultTemplatePath
import laika.theme.Theme
import laika.theme.ThemeBuilder
Expand All @@ -32,9 +33,14 @@ import java.net.URL

object TypelevelHeliumExtensions {

@deprecated("Use overload with scala3 parameter", "0.4.7")
def apply(license: Option[(String, URL)], related: Seq[(String, URL)]): ThemeProvider =
apply(license, related, false)

def apply(
license: Option[(String, URL)],
related: Seq[(String, URL)]
related: Seq[(String, URL)],
scala3: Boolean
): ThemeProvider = new ThemeProvider {
def build[F[_]](implicit F: Sync[F]): Resource[F, Theme[F]] =
ThemeBuilder[F]("Typelevel Helium Extensions")
Expand All @@ -49,7 +55,11 @@ object TypelevelHeliumExtensions {
Path.Root / "site" / "styles.css"
)
)
.addExtensions(GitHubFlavor, SyntaxHighlighting)
.addExtensions(
GitHubFlavor,
if (scala3) SyntaxHighlighting.withSyntaxBinding("scala", DottySyntax)
else SyntaxHighlighting
)
.addBaseConfig(licenseConfig(license).withFallback(relatedConfig(related)))
.build
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ object TypelevelUnidocPlugin extends AutoPlugin {
import TypelevelSonatypePlugin.javadocioUrl

override def projectSettings = Seq(
Compile / doc := (ScalaUnidoc / doc).value,
Compile / packageDoc / mappings := (ScalaUnidoc / packageDoc / mappings).value,
ThisBuild / apiURL := javadocioUrl.value,
mimaPreviousArtifacts := Set.empty,
Expand Down