Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

port library authors guide to Scala 3 #2873

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading