Skip to content

Commit

Permalink
clojure-cli: improve terminal repl description
Browse files Browse the repository at this point in the history
Signed-off-by: John Practicalli <250870+practicalli-john@users.noreply.github.com>
  • Loading branch information
practicalli-johnny committed Jul 31, 2023
1 parent f171a2a commit 3abd157
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions docs/clojure-cli/repl/index.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Rebel REPL Terminal UI
# Terminal REPL

The REPL is the environment in which all Clojure code runs, whether that be during development, testing or in production systems.

A Terminal UI provides a simple way to interact with the REPL, sending code expressions for evaluation and returning results. A terminal UI is most useful for expressions for longer running processes or for a convenient way to interact with the REPL state and manage components.
A Terminal REPL provides a simple way to interact with the REPL, sending code expressions for evaluation and returning results. A terminal REPL is very quick experiments, working with long running processes (e.g. http severs running Clojure) or for a convenient way to interact with the REPL state and manage components (e.g restarting system components, querying UI component state or services system state).

Including an nREPL server when starting the REPL allows [clojure ware editors](/clojure/clojure-editors/) to connect to the REPL process, providing a more effective way to write and extend Clojure code.
## Rebel Terminal REPL UI

Rebel is a REPL terminal UI that provides auto-completion, function call syntax help, themes and key binding styles to enhance the development experience. Clojure tools also include [a REPL with a minimal interface](/alternative-tools/clojure-cli/basic-repl.md) by default.

<p style="text-align:center">
<iframe width="560" height="315" src="https://www.youtube.com/embed/U19TWMsg0s0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</p>

## Install rebel readline
### Install rebel readline

[:fontawesome-solid-book-open: Practicalli Clojure CLI Config](/clojure/install/clojure-cli/#practicalli-clojure-cli-config) contains an alias to run rebel readline.

Expand All @@ -23,7 +23,7 @@ Rebel is a REPL terminal UI that provides auto-completion, function call syntax
:main-opts ["-m" "rebel-readline.main"]}
```

## Running the rebel REPL
### Running the rebel REPL

Start a Clojure REPL with Rebel terminal UI. Use the command in the root of a Clojure project to include the project dependencies and source code.

Expand All @@ -44,7 +44,7 @@ Evaluate Clojure code by typing at the `=> user` prompt pressing `Return`, the r
> ++ctrl+"c"++ if the repl process does not return to the shell prompt.

# Customize Rebel Readline
### Customize Rebel Readline

`:repl/help` in the repl prompt shows the Rebel configuration options

Expand Down Expand Up @@ -87,11 +87,13 @@ Set configuration options in a `rebel_readline.edn` file, in `$XDG_CONFIG_HOME/c
![Clojure Rebel REPL - repl/help](https://raw.githubusercontent.com/practicalli/graphic-design/live/clojure/rebel/clojure-repl-rebel-help-menu-dark.png#only-dark)
![Clojure Rebel REPL - repl/help](https://raw.githubusercontent.com/practicalli/graphic-design/live/clojure/rebel/clojure-repl-rebel-help-menu-light.png#only-light)

## Basic REPL
## Terminal REPL and Editor

Including an nREPL server when starting the REPL allows [clojure ware editors](/clojure/clojure-editors/) to connect to the REPL process, providing a more effective way to write and extend Clojure code.

When only using a [Clojure editor](/clojure/clojure-editor/) an external REPL can still be of use. Separating the REPL process from the editor process allows the editor to be closed, upgraded or swapped for a different editor without having to end the REPL session.
An external REPL can still be of use even when only evaluating code in a [Clojure editor](/clojure/clojure-editor/). Separating the REPL process from the editor process allows the editor to be closed, upgraded or swapped for a different editor without having to end the REPL session. Different editors could be connected to the same REPL to use particular features they provide.

A REPL process can be long running, staying alive for days, weeks or months when working on larger projects. Avoiding a REPL restart keeps the state of the REPL, keeping the flow in the Clojure workflow.
A REPL process can be long running, staying alive for days, weeks or months when working on larger projects. Avoiding a REPL atop and start maintains the state of the REPL in memory, supporting the flow of the Clojure workflow.

Including an nREPL server when starting the REPL allows [clojure ware editors](/clojure/clojure-editors/) to connect to the REPL process.

Expand Down Expand Up @@ -124,7 +126,7 @@ To have a basic terminal UI REPL prompt use the `:repl/basic` alias to start a R
clj -M:repl/basic
```

To only have the REPL process without a REPL prompt, use the `:repl/headless` aliase to start a REPL process with nREPL connection. This approach is useful to separate the REPL output from the editor whilst keeping all the interacting with the REPL via the editor.
To only have the REPL process without a REPL prompt, use the `:repl/headless` aliase to start a REPL process with nREPL connection. This approach is useful to separate the REPL output from the editor whilst keeping all the interaction with the REPL via the editor.

!!! NOTE ""
```shell
Expand Down

0 comments on commit 3abd157

Please sign in to comment.