Skip to content

Commit

Permalink
Add material theme to paradox (#98)
Browse files Browse the repository at this point in the history
* Add material theme to paradox

* Add paradox site publish on release

* Add sbt-site and sbt-ghpages
  • Loading branch information
regadas authored Dec 7, 2020
1 parent 848b05d commit b456c60
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ jobs:

- run: sbt ++${{ matrix.scala }} release

- run: sbt ++${{ matrix.scala }} docs/makeSite

- uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/target/site

build-docs:
name: Build docs
strategy:
Expand Down
2 changes: 1 addition & 1 deletion README.md
35 changes: 30 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ ThisBuild / githubWorkflowAddedJobs ++= Seq(
)
)

ThisBuild / githubWorkflowPublish ++= Seq(
WorkflowStep.Sbt(List("docs/makeSite")),
WorkflowStep.Use(
"JamesIves",
"github-pages-deploy-action",
"3.7.1",
params = Map(
"GITHUB_TOKEN" -> "${{ secrets.GITHUB_TOKEN }}",
"BRANCH" -> "gh-pages",
"FOLDER" -> "docs/target/site"
)
)
)

ThisBuild / homepage := Some(url("https://github.com/typelevel/cats-parse"))

ThisBuild / scmInfo := Some(
Expand All @@ -79,19 +93,30 @@ lazy val root = project
.settings(scalaVersion := "2.13.4")

lazy val docs = project
.enablePlugins(ParadoxPlugin, MdocPlugin, NoPublishPlugin)
.enablePlugins(
ParadoxSitePlugin,
ParadoxMaterialThemePlugin,
MdocPlugin,
NoPublishPlugin,
GhpagesPlugin
)
.settings(
name := "paradox-docs",
libraryDependencies += jawnAst,
paradoxTheme := Some(builtinParadoxTheme("generic")),
paradoxProperties in Compile ++= Map(
"empty" -> "",
"version" -> version.value
),
githubWorkflowArtifactUpload := false,
mdocIn := (paradox / sourceDirectory).value,
paradox / sourceManaged := mdocOut.value,
Compile / paradox := (Compile / paradox).dependsOn(mdoc.toTask("")).value
git.remoteRepo := "[email protected]:typelevel/cats-parse.git",
mdocIn := (Compile / baseDirectory).value / "src",
Compile / paradox / sourceDirectory := mdocOut.value,
Compile / paradox := (Compile / paradox).dependsOn(mdoc.toTask("")).value,
Compile / paradoxMaterialTheme := ParadoxMaterialTheme()
.withColor("red", "orange")
.withFont("Ubuntu", "Ubuntu Mono")
.withCopyright("Copyright (c) 2020 Typelevel")
.withRepository(uri("https://github.com/typelevel/cats-parse"))
)
.dependsOn(coreJVM, bench)

Expand Down
13 changes: 10 additions & 3 deletions docs/src/main/paradox/index.md → docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,15 @@

A parsing library for the cats ecosystem.

To use in sbt add, the following to your `libraryDependencies`:
* `"org.typelevel" %% "cats-parse" % "0.1.0"`
* or `"org.typelevel" %%% "cats-parse" % "0.1.0"` in a Scala.js project.
To use in sbt add, the following to your `libraryDependencies`:

```scala
// use this snippet for the JVM
libraryDependencies += "org.typelevel" %% "cats-parse" % "0.1.0"

// use this snippet for JS, or cross-building
libraryDependencies += "org.typelevel" %%% "cats-parse" % "0.1.0"
```

The [API docs](https://oss.sonatype.org/service/local/repositories/releases/archive/org/typelevel/cats-parse_2.12/0.0.1/cats-parse_2.12-0.0.1-javadoc.jar/!/cats/parse/index.html) are published.

Expand All @@ -25,6 +31,7 @@ this library has a few goals:

Below is most of a json parser (the string unescaping is elided). This example can give you a feel
for what it is like to use this library.

```scala mdoc:invisible
import cats.parse.bench.self.JsonStringUtil
```
Expand Down
3 changes: 3 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ addSbtPlugin("com.codecommit" % "sbt-spiewak-sonatype" % "0.19.1")
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.9.5")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.13")
addSbtPlugin("io.github.jonas" % "sbt-paradox-material-theme" % "0.6.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")

0 comments on commit b456c60

Please sign in to comment.