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

How can I convert Scala 3.x code with mdoc CLI? #903

Open
windymelt opened this issue Oct 22, 2024 · 1 comment
Open

How can I convert Scala 3.x code with mdoc CLI? #903

windymelt opened this issue Oct 22, 2024 · 1 comment

Comments

@windymelt
Copy link

Hi, thank you for neat and useful software.

My mdoc (v2.6.1) seems not accepting Scala 3.x code from CLI.

For instance, following code does not compile:

```scala mdoc
def fib(n: Int): Int = n match
case 1 => 1
case n => n * fib(n - 1)

fib(5)
```
mdoc --in main.template.md --out main.mdoc.md
info: Compiling 1 file to main.mdoc.md
error: main.template.md:5:1: `{` expected but `case` found
case 1 => 1
^^^^
info: Compiled in 0.2s (1 error)

Can I modify Scala version from CLI?

Of course, creating entire project to compiling just one source code is such a pain...

@tgodzik
Copy link
Contributor

tgodzik commented Oct 22, 2024

Looks like we never added the option, we were mostly focused on sbt and worksheets. It should not be hard to add though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants