From 2a7b037e80cb3db9fd221a3045f9eaa3b05ef214 Mon Sep 17 00:00:00 2001 From: Practicalli Engineering Date: Wed, 6 Mar 2024 23:37:09 +0000 Subject: [PATCH] format: clojure-cli repl section and changelog --- CHANGELOG.md | 6 +++--- docs/clojure-cli/repl/coding.md | 9 ++++----- docs/clojure-cli/repl/help.md | 28 +++++++++++++++------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d9c28266..a8fc8d5f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ # Unreleased ## Changed - clojure-cli: enhance built-in commands description -- code-challenge: rewrite code challenges overview +- code-challenge: rewrite code challenges overview - dev: code block consistent style lint rules 46 & 48 - mkdocs: clojure-idiom admonition style - dev: gitleaks rules configuration for checking secrets in megalinter workflow @@ -29,7 +29,7 @@ - dev: changelog-check remove paths-ignore - clojure-cli: install deps.edn configuration - clojure-cli: `clojure -X:deps tree` examples -- clojure-cli: `clojure -X:deps pom` +- clojure-cli: `clojure -X:deps pom` - install: debian packages approach for OpenJDK rather than a specific Ubuntu tab - install: recommended OpenJDK versions of 17 and 21 as hint - editor: refactor Clojure LSP page and format for Material for MkDocs @@ -43,7 +43,7 @@ - dev: sparse checkout scheduled version workflow - dev: upload-artefact v4 & remove explicit token from megalinter - format: use shell for code blocks, add missing clojure language to code blocks -- dev: megalinter local runner - validate all files +- dev: megalinter local runner - validate all files - dev: spell lychee config file for megalinter config set as warnings - dev: extend lychee exclusion rules and base url - dev: allow `a` and `img` html elements in markdown linter diff --git a/docs/clojure-cli/repl/coding.md b/docs/clojure-cli/repl/coding.md index 54fb1fbc9..79e3ca948 100644 --- a/docs/clojure-cli/repl/coding.md +++ b/docs/clojure-cli/repl/coding.md @@ -3,14 +3,14 @@ Clojure code can be typed into the REPL directly and the result instantly returned. Code can also be loaded from a project source code files, to run pre-written code. ??? HINT "Clojure Editors are the main tool for writing code" - An [editor connected to a Clojure REPL](/clojure-editors/) and evaluating from source code files is the most effective way for writing Clojure code. + An [editor connected to a Clojure REPL](/clojure/clojure-editors/) and evaluating from source code files is the most effective way for writing Clojure code. - Evaluating code in an editor automatically uses the correct namespace, avoiding the need to change namespaces or fully qualify function calls. Evaluation results can be shown in-line, as comments next to the code or in a data inspector. + Evaluating code in an editor automatically uses the correct namespace, avoiding the need to change namespaces or fully qualify function calls. Evaluation results can be shown in-line, as comments next to the code or in a data inspector. - Editors provide structural editing and Clojure syntax checking, along with general editor features. and + Editors provide structural editing and Clojure syntax checking, along with general editor features. -## Using the REPL +## Using the REPL Use the `clojure` command to start a REPL with Rebel, or the `clj` wrapper with the Clojure CLI REPL ([requires `rlwrap` binary](/clojure/install/clojure-cli/#optional-rlwrap-readline)). @@ -137,4 +137,3 @@ Use the `:verbose` option when issues occur loading a particular namespace. As ## Next steps [Managing Library dependencies in REPL](libraries.md){.md-button} - diff --git a/docs/clojure-cli/repl/help.md b/docs/clojure-cli/repl/help.md index cefbaa6f2..abe63a2f2 100644 --- a/docs/clojure-cli/repl/help.md +++ b/docs/clojure-cli/repl/help.md @@ -22,17 +22,18 @@ Moving the cursor after the name of a function will show the signatures availabl > `clojure.repl/doc` function also shows the docstring of a function `(clojure.repl/doc doc)` -++ctrl+c+ctrl+"a"++ on a name shows all the possible matching functions to help you discover what is available. ++tab++ through the list of matches, ++enter++ to select a function +++ctrl+x++ ++ctrl+"a"++ on a name shows all the possible matching functions to help you discover what is available. ++tab++ through the list of matches, ++enter++ to select a function -![clojure repl rebel - apropos on function showing all variations](https://github.com/practicalli/graphic-design/blob/live/clojure/rebel/clojure-repl-rebel-function-apropos-map-dark.png?raw=true) +![clojure repl rebel - apropos on function showing all variations](https://github.com/practicalli/graphic-design/blob/live/clojure/rebel/clojure-repl-rebel-function-apropos-map-dark.png?raw=true#only-dark) +![clojure repl rebel - apropos on function showing all variations](https://github.com/practicalli/graphic-design/blob/live/clojure/rebel/clojure-repl-rebel-function-apropos-map-light.png?raw=true#only-light) ## Rebel Commands -Type `:repl/help` or `:repl` TAB to see a list of available commands. +Type `:repl/help` or `:repl` followed by ++tab++ to see a list of available commands. | Keybinding | Description | -|---------------------------|-------------------------------------------------------------------| +|-------------------------- | ----------------------------------------------------------------- | | `:repl/help` | Prints the documentation for all available commands. | | `:repl/key-bindings` | search or list current key bindings | | `:repl/quit` | Quits the REPL | @@ -44,16 +45,17 @@ Type `:repl/help` or `:repl` TAB to see a list of available commands. | `:repl/toggle-highlight` | Toggle readline syntax highlighting on and off | | `:repl/toggle-indent` | Toggle the automatic indenting of Clojure code on and off | + ## Key-bindings -| Keybinding | Description | -|-----------------|-------------------------------------------------------------------------------| -| `Ctrl-C` | aborts editing the current line | -| `Ctrl-D` | at the start of a line => sends an end of stream message | -| `TAB` | word completion or code indent when cursor in whitespace at the start of line | -| `Ctrl-X_Ctrl-D` | Show documentation for word at point | -| `Ctrl-X_Ctrl-S` | Show source for word at point | -| `Ctrl-X_Ctrl-A` | Show apropos for word at point | -| `Ctrl-X_Ctrl-E` | Inline eval for SEXP before the point | +| Keybinding | Description | +| ------------------------- | ------------------------------------------------------------------------------- | +| ++ctrl+"c"++ | aborts editing the current line | +| ++ctrl+"d"++ | at the start of a line => sends an end of stream message | +| ++tab++ | word completion or code indent when cursor in whitespace at the start of line | +| ++ctrl+"x"++ ++ctrl+"d"++ | Show documentation for word at point | +| ++ctrl+"x"++ ++ctrl+"s"++ | Show source for word at point | +| ++ctrl+"x"++ ++ctrl+"a"++ | Show apropos for word at point | +| ++ctrl+"x"++ ++ctrl+"e"++ | Inline eval for SEXP before the point | Examine key-bindings with the `:repl/key-bindings` command.