Skip to content

Commit b456c60

Browse files
authored
Add material theme to paradox (#98)
* Add material theme to paradox * Add paradox site publish on release * Add sbt-site and sbt-ghpages
1 parent 848b05d commit b456c60

5 files changed

Lines changed: 52 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ jobs:
147147

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

150+
- run: sbt ++${{ matrix.scala }} docs/makeSite
151+
152+
- uses: JamesIves/github-pages-deploy-action@3.7.1
153+
with:
154+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
155+
BRANCH: gh-pages
156+
FOLDER: docs/target/site
157+
150158
build-docs:
151159
name: Build docs
152160
strategy:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docs/src/main/paradox/index.md
1+
docs/src/index.md

build.sbt

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@ ThisBuild / githubWorkflowAddedJobs ++= Seq(
5959
)
6060
)
6161

62+
ThisBuild / githubWorkflowPublish ++= Seq(
63+
WorkflowStep.Sbt(List("docs/makeSite")),
64+
WorkflowStep.Use(
65+
"JamesIves",
66+
"github-pages-deploy-action",
67+
"3.7.1",
68+
params = Map(
69+
"GITHUB_TOKEN" -> "${{ secrets.GITHUB_TOKEN }}",
70+
"BRANCH" -> "gh-pages",
71+
"FOLDER" -> "docs/target/site"
72+
)
73+
)
74+
)
75+
6276
ThisBuild / homepage := Some(url("https://github.com/typelevel/cats-parse"))
6377

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

8195
lazy val docs = project
82-
.enablePlugins(ParadoxPlugin, MdocPlugin, NoPublishPlugin)
96+
.enablePlugins(
97+
ParadoxSitePlugin,
98+
ParadoxMaterialThemePlugin,
99+
MdocPlugin,
100+
NoPublishPlugin,
101+
GhpagesPlugin
102+
)
83103
.settings(
84104
name := "paradox-docs",
85105
libraryDependencies += jawnAst,
86-
paradoxTheme := Some(builtinParadoxTheme("generic")),
87106
paradoxProperties in Compile ++= Map(
88107
"empty" -> "",
89108
"version" -> version.value
90109
),
91110
githubWorkflowArtifactUpload := false,
92-
mdocIn := (paradox / sourceDirectory).value,
93-
paradox / sourceManaged := mdocOut.value,
94-
Compile / paradox := (Compile / paradox).dependsOn(mdoc.toTask("")).value
111+
git.remoteRepo := "git@github.com:typelevel/cats-parse.git",
112+
mdocIn := (Compile / baseDirectory).value / "src",
113+
Compile / paradox / sourceDirectory := mdocOut.value,
114+
Compile / paradox := (Compile / paradox).dependsOn(mdoc.toTask("")).value,
115+
Compile / paradoxMaterialTheme := ParadoxMaterialTheme()
116+
.withColor("red", "orange")
117+
.withFont("Ubuntu", "Ubuntu Mono")
118+
.withCopyright("Copyright (c) 2020 Typelevel")
119+
.withRepository(uri("https://github.com/typelevel/cats-parse"))
95120
)
96121
.dependsOn(coreJVM, bench)
97122

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@
44

55
A parsing library for the cats ecosystem.
66

7-
To use in sbt add, the following to your `libraryDependencies`:
8-
* `"org.typelevel" %% "cats-parse" % "0.1.0"`
9-
* or `"org.typelevel" %%% "cats-parse" % "0.1.0"` in a Scala.js project.
7+
To use in sbt add, the following to your `libraryDependencies`:
8+
9+
```scala
10+
// use this snippet for the JVM
11+
libraryDependencies += "org.typelevel" %% "cats-parse" % "0.1.0"
12+
13+
// use this snippet for JS, or cross-building
14+
libraryDependencies += "org.typelevel" %%% "cats-parse" % "0.1.0"
15+
```
1016

1117
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.
1218

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

2632
Below is most of a json parser (the string unescaping is elided). This example can give you a feel
2733
for what it is like to use this library.
34+
2835
```scala mdoc:invisible
2936
import cats.parse.bench.self.JsonStringUtil
3037
```

project/plugins.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ addSbtPlugin("com.codecommit" % "sbt-spiewak-sonatype" % "0.19.1")
99
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.9.5")
1010
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
1111
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.13")
12+
addSbtPlugin("io.github.jonas" % "sbt-paradox-material-theme" % "0.6.0")
13+
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1")
14+
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")

0 commit comments

Comments
 (0)