scalameta/mdoc

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

Open

#903 opened on Oct 22, 2024

 (5 comments) (1 reaction) (0 assignees)Scala (89 forks)github user discovery
enhancementgood first issuehelp wanted

Repository metrics

Stars
 (402 stars)
PR merge metrics
 (Avg merge 8h 29m) (11 merged PRs in 30d)

Description

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...

Contributor guide