Skip to content

Commit 010a978

Browse files
authored
Merge pull request #2160 from typelevel/fix_docs
Fix docs and check makeSite passes in CI
2 parents e32a586 + 4f7dbe5 commit 010a978

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ jobs:
8181
- name: Check there are no uncommitted changes in git (to catch generated files that weren't committed)
8282
run: sbt '++ ${{ matrix.scala }}' checkGitNoUncommittedChanges
8383

84-
- name: Check Doc Site (2.13.15 only)
85-
if: matrix.scala == '2.13.15'
84+
- name: Check Doc Site (2.13 only)
85+
if: matrix.scala == '2.13'
8686
run: sbt '++ ${{ matrix.scala }}' docs/makeSite
8787

8888
- name: Make target directories

build.sbt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ ThisBuild / githubWorkflowBuildPostamble ++= Seq(
6868
),
6969
WorkflowStep.Sbt(
7070
commands = List("docs/makeSite"),
71-
name = Some(s"Check Doc Site ($scala213Version only)"),
72-
cond = Some(s"matrix.scala == '$scala213Version'")
71+
name = Some(s"Check Doc Site (2.13 only)"),
72+
cond = Some(s"matrix.scala == '2.13'")
7373
)
7474
)
7575

@@ -539,6 +539,7 @@ lazy val docs = project
539539
"scalaVersion" -> scalaVersion.value
540540
),
541541
mdocIn := baseDirectory.value / "src" / "main" / "mdoc",
542+
mdocExtraArguments ++= Seq("--no-link-hygiene"),
542543
Compile / paradox / sourceDirectory := mdocOut.value,
543544
makeSite := makeSite.dependsOn(mdoc.toTask("")).value
544545
)

modules/docs/src/main/mdoc/docs/15-Extensions-PostgreSQL.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ object MyEnum extends Enumeration {
116116
val foo, bar = Value
117117
}
118118

119-
implicit val MyEnumMeta = pgEnum(MyEnum, "myenum")
119+
implicit val MyEnumMeta: Meta[MyEnum.Value] = pgEnum(MyEnum, "myenum")
120120
```
121121

122122
```scala mdoc
@@ -214,14 +214,14 @@ In addition to the general types above, **doobie** provides mappings for the fol
214214

215215
[Geographic types](http://postgis.net/workshops/postgis-intro/geography.html) mappings are defined in a different object (`pgisgeographyimplicits`), to allow geometric types using geodetic coordinates.
216216

217-
```
217+
```scala
218218
import doobie.postgres.pgisgeographyimplicits._
219219

220220
// or define the implicit conversion manually
221221

222-
implicit val geographyPoint: Meta[Point] =
223-
doobie.postgres.pgisgeographyimplicits.PointType
222+
implicit val geographyPoint: Meta[Point] = doobie.postgres.pgisgeographyimplicits.PointType
224223
```
224+
225225
- Point
226226
- Polygon
227227
- MultiPoint
@@ -242,17 +242,17 @@ The following range types are supported, and map to **doobie** generic `Range[T]
242242
- the `tstzrange` schema type maps to `Range[java.time.OffsetDateTime]`
243243

244244
Non empty range maps to:
245-
```scala mdoc:silent
245+
```scala
246246
case class NonEmptyRange[T](lowerBound: Option[T], upperBound: Option[T], edge: Edge) extends Range[T]
247247
```
248248

249249
Empty range maps to:
250-
```scala mdoc:silent
250+
```scala
251251
case object EmptyRange extends Range[Nothing]
252252
```
253253
To control the inclusive and exclusive bounds according to the [PostgreSQL](https://www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-INCLUSIVITY) specification you need to use a special `Edge` enumeration when creating a `Range`:
254254

255-
```scala mdoc:silent
255+
```scala
256256
object Edge {
257257
case object ExclExcl extends Edge
258258
case object ExclIncl extends Edge
@@ -271,13 +271,14 @@ import doobie.postgres.rangeimplicits._
271271

272272
To create for example custom implementation of `Range[Byte]` you can use the public method which declared in the following package `doobie.postgres.rangeimplicits`:
273273

274-
```scala mdoc:silent
274+
```scala
275275
def rangeMeta[T](sqlRangeType: String)(encode: T => String, decode: String => T): Meta[Range[T]]
276276
```
277277

278278
For a `Range[Byte]`, the meta and bounds encoder and decoder would appear as follows:
279279
```scala mdoc:silent
280280
import doobie.postgres.rangeimplicits._
281+
import doobie.postgres.types.Range
281282

282283
implicit val byteRangeMeta: Meta[Range[Byte]] = rangeMeta[Byte]("int4range")(_.toString, _.toByte)
283284

modules/docs/src/main/mdoc/docs/17-FAQ.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ As of **doobie** 0.4 there is a reasonable solution to the logging/instrumentati
150150
There are a lot of ways to handle `SQLXML` so there is no pre-defined strategy, but here is one that maps `scala.xml.Elem` to `SQLXML` via streaming.
151151

152152
```scala mdoc:silent
153-
import doobie.enum.JdbcType.Other
153+
import doobie.enumerated.JdbcType.Other
154154
import java.sql.SQLXML
155155
import scala.xml.{ XML, Elem }
156156

@@ -181,7 +181,7 @@ Domains with check constraints will type check as DISTINCT. For Doobie later tha
181181
```scala mdoc:silent
182182
import cats.data.NonEmptyList
183183
import doobie._
184-
import doobie.enum.JdbcType
184+
import doobie.enumerated.JdbcType
185185

186186
object distinct {
187187

0 commit comments

Comments
 (0)