Skip to content

Commit

Permalink
port library authors guide to Scala 3
Browse files Browse the repository at this point in the history
bishabosha authored and julienrf committed Jul 18, 2023

Verified

This commit was signed with the committer’s verified signature.
marekful Marcell Fülöp
1 parent a726a55 commit 5d4b11d
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
@@ -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

@@ -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:

0 comments on commit 5d4b11d

Please sign in to comment.