Skip to content

Commit

Permalink
port library authors guide to Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha committed Jul 17, 2023
1 parent 4c77b06 commit c3e180e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions _overviews/contributors/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ code fences have been updated to also include the result of evaluating the Scala
Another approach consists in embedding fragments of Scala source files that are part of a module which
is compiled by your build. For instance, given the following test in file `src/test/ch/epfl/scala/Usage.scala`:

{% tabs usage-definition class=tabs-scala-version %}
{% tab 'Scala 2' %}
~~~ scala
package ch.epfl.scala

Expand All @@ -489,6 +491,25 @@ object Usage extends Scalaprops {

}
~~~
{% endtab %}
{% tab 'Scala 3' %}
~~~ scala
package ch.epfl.scala

import scalaprops.{Property, Scalaprops}

object Usage extends Scalaprops:

val testDoNothing =
// #do-nothing
Property.forAll: (x: Int) =>
Example.doNothing(x) == x
// #do-nothing

end Usage
~~~
{% endtab %}
{% endtabs %}

You can embed the fragment surrounded by the `#do-nothing` identifiers with the `@@snip` Paradox directive,
as shown in the `src/documentation/reference.md` file:
Expand Down

0 comments on commit c3e180e

Please sign in to comment.