Skip to content

Commit

Permalink
Use a table for the code example
Browse files Browse the repository at this point in the history
  • Loading branch information
gabro committed May 27, 2018
1 parent 90eee34 commit b55364a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
26 changes: 22 additions & 4 deletions docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ or so long that no one reads it.*

---

Scalafmt turns this mess into the (hopefully) readable, idiomatic and consistently formatted Scala code below
Scalafmt turns the mess on left into the (hopefully) readable, idiomatic and consistently formatted Scala code on the right

```tut:passthrough:silent
```tut:invisible
val code =
s"""|object FormatMe { List(number) match
|{ case head :: Nil
Expand All @@ -31,14 +31,32 @@ val code =
| 3, 4, 5, 6)) }""".stripMargin
```

```tut:evaluated
<table width="100%">
<tbody>
<tr>
<td style="border: none">

```tut:passthrough
println("```scala")
println(code)
println("```")
```

```tut:evaluated
</td>
<td style="border: none">

```tut:passthrough
println("```scala")
println(org.scalafmt.Scalafmt.format(code, org.scalafmt.config.ScalafmtConfig.default40).get)
println("```")
```

</td>
</tr>
</tbody>
</table>


The goal of scalafmt is to produce good enough formatted code so that
you can focus on programming instead of manipulating syntax trivia.
Scalafmt can be used in several environments such as the command line, text
Expand Down
1 change: 0 additions & 1 deletion website/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"next": "Next",
"previous": "Previous",
"tagline": "A code formatter for Scala",
"intro": "Introduction",
"introduction": "Introduction",
"Docs": "Docs",
"GitHub": "GitHub",
Expand Down

0 comments on commit b55364a

Please sign in to comment.