diff --git a/website/docs/cookbooks/emacs.md b/website/docs/cookbooks/emacs.md new file mode 100644 index 0000000000..bf53e721a2 --- /dev/null +++ b/website/docs/cookbooks/emacs.md @@ -0,0 +1,30 @@ +--- +title: Scala CLI within Emacs +sidebar_position: 14 +--- + +Emacs users can make it easier to use Scala CLI from within their editor by +loading an extension: . + +That lets you send Scala code directly from your buffer to the Scala REPL. + +![scala-cli-repl-demo](/img/scala-cli-repl.jpg) + +The extension also facilitates [literate +programming](https://en.wikipedia.org/wiki/Literate_programming) using +[Org Mode](https://orgmode.org/), by letting the user experiment with +source blocks looking like the following. + +``` org +#+begin_src scala :scala-version 3.0.0 :dep '("com.lihaoyi::os-lib:0.9.0") +println("This is:" + os.pwd) +#+end_src +#+end_src +``` + +In the above you can see that you can select the Scala version and +dependencies you need for your code. + +The users who use [lsp-metals](https://github.com/emacs-lsp/lsp-metals) +can also enable lsp support within a source block to access utilities as +completion and navigation from within the Org Mode file. diff --git a/website/docs/cookbooks/intro.md b/website/docs/cookbooks/intro.md index 08106fde4e..2f219db47b 100644 --- a/website/docs/cookbooks/intro.md +++ b/website/docs/cookbooks/intro.md @@ -29,6 +29,7 @@ To get started, try one of the cookbooks below: - [IDEA IntelliJ](./intellij.md) - [Scala CLI alongside SBT in IDEA IntelliJ](./intellij-sbt-with-bsp.md) - [Multiple Scala CLI projects as separate modules in IDEA IntelliJ](./intellij-multi-bsp.md) +- [Scala CLI within Emacs](./emacs.md) ## Packaging ⚡️ diff --git a/website/static/img/scala-cli-repl.jpg b/website/static/img/scala-cli-repl.jpg new file mode 100644 index 0000000000..3a17e449f8 Binary files /dev/null and b/website/static/img/scala-cli-repl.jpg differ