Skip to content

Commit 3238096

Browse files
committed
Improve the markup of the README
1 parent 095b36f commit 3238096

File tree

1 file changed

+48
-32
lines changed

1 file changed

+48
-32
lines changed

README.md

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
highlighting), indentation, navigation and refactoring support for the
1212
[Clojure(Script) programming language](https://clojure.org).
1313

14-
-----------
15-
16-
**This documentation tracks the `master` branch of `clojure-mode`. Some of
17-
the features and settings discussed here might not be available in
18-
older releases (including the current stable release). Please, consult
19-
the relevant git tag (e.g. [5.19.0](https://github.com/clojure-emacs/clojure-mode/tree/v5.19.0)) if you need documentation for a
20-
specific `clojure-mode` release.**
14+
> [!IMPORTANT]
15+
>
16+
> This documentation tracks the `master` branch of `clojure-mode`. Some of the
17+
> features and settings discussed here might not be available in older releases
18+
> (including the current stable release). Please, consult the relevant git tag
19+
> (e.g. [5.20.0](https://github.com/clojure-emacs/clojure-mode/tree/v5.20.0)) if
20+
> you need documentation for a specific `clojure-mode` release.
2121
2222
## Installation
2323

@@ -47,12 +47,12 @@ If the installation doesn't work try refreshing the package list:
4747

4848
The `clojure-mode` package actually bundles together several major modes:
4949

50-
* `clojure-mode` is a major mode for editing Clojure code
51-
* `clojurescript-mode` is a major mode for editing ClojureScript code
52-
* `clojurec-mode` is a major mode for editing `.cljc` source files
53-
* `clojuredart-mode` is a major mode for editing ClojureDart `.cljd` source files
54-
* `jank-mode` is a major mode for editing Jank `.jank` source files
55-
* `joker-mode` is a major mode for editing Joker `.joke` source files
50+
- `clojure-mode` is a major mode for editing Clojure code
51+
- `clojurescript-mode` is a major mode for editing ClojureScript code
52+
- `clojurec-mode` is a major mode for editing `.cljc` source files
53+
- `clojuredart-mode` is a major mode for editing ClojureDart `.cljd` source files
54+
- `jank-mode` is a major mode for editing Jank `.jank` source files
55+
- `joker-mode` is a major mode for editing Joker `.joke` source files
5656

5757
All the major modes derive from `clojure-mode` and provide more or less the same
5858
functionality. Differences can be found mostly in the font-locking -
@@ -140,14 +140,16 @@ The indentation of function forms is configured by the variable
140140
2)
141141
```
142142

143-
**Note:** Prior to clojure-mode 5.10, the configuration options for `clojure-indent-style` used to be
144-
keywords, but now they are symbols. Keywords will still be supported at least until clojure-mode 6.
143+
> [!NOTE]
144+
>
145+
> Prior to clojure-mode 5.10, the configuration options for `clojure-indent-style` used to be
146+
> keywords, but now they are symbols. Keywords will still be supported at least until clojure-mode 6.
145147
146148
#### Indentation of keywords
147149

148150
Similarly we have the `clojure-indent-keyword-style`, which works in the following way:
149151

150-
* `always-align` (default) - All
152+
- `always-align` (default) - All
151153
args are vertically aligned with the first arg in case (A),
152154
and vertically aligned with the function name in case (B).
153155

@@ -159,7 +161,7 @@ Similarly we have the `clojure-indent-keyword-style`, which works in the followi
159161
[bar.baz])
160162
```
161163

162-
* `always-indent` - All args are indented like a macro body.
164+
- `always-indent` - All args are indented like a macro body.
163165

164166
``` clojure
165167
(:require [foo.bar]
@@ -169,7 +171,7 @@ Similarly we have the `clojure-indent-keyword-style`, which works in the followi
169171
0)
170172
```
171173

172-
* `align-arguments` - Case (A) is indented like `always-align`, and
174+
- `align-arguments` - Case (A) is indented like `always-align`, and
173175
case (B) is indented like a macro body.
174176

175177
``` clojure
@@ -288,7 +290,11 @@ You can change this behaviour like this:
288290
You might also want to change `comment-add` to 0 in that way, so that Emacs comment
289291
functions (e.g. `comment-region`) would use `;` by default instead of `;;`.
290292

291-
**Note:** Check out [this section](https://guide.clojure.style/#comments) of the Clojure style guide to understand better the semantics of the different comment levels and why `clojure-mode` treats them differently by default.
293+
> [!TIP]
294+
>
295+
> Check out [this section](https://guide.clojure.style/#comments) of the Clojure
296+
> style guide to understand better the semantics of the different comment levels
297+
> and why `clojure-mode` treats them differently by default.
292298
293299
### Vertical alignment
294300

@@ -315,9 +321,11 @@ happen whenever you select some code and hit `TAB`.
315321

316322
### Font-locking
317323

318-
`clojure-mode` features static font-locking (syntax highlighting) that you can extend yourself
319-
if needed. As typical for Emacs, it's based on regular expressions. You can find
320-
the default font-locking rules in `clojure-font-lock-keywords`. Here's how you can add font-locking for built-in Clojure functions and vars:
324+
`clojure-mode` features static font-locking (syntax highlighting) that you can
325+
extend yourself if needed. As typical for Emacs, it's based on regular
326+
expressions. You can find the default font-locking rules in
327+
`clojure-font-lock-keywords`. Here's how you can add font-locking for built-in
328+
Clojure functions and vars:
321329

322330
``` el
323331
(defvar clojure-built-in-vars
@@ -360,9 +368,12 @@ var a symbol resolves to). That's why `clojure-mode`'s font-locking defaults are
360368
conservative and minimalistic.
361369

362370
Precise font-locking requires additional data that can obtained from a running
363-
REPL (that's how CIDER's [dynamic font-locking](https://docs.cider.mx/cider/config/syntax_highlighting.html) works) or from static code analysis.
371+
REPL (that's how CIDER's [dynamic
372+
font-locking](https://docs.cider.mx/cider/config/syntax_highlighting.html)
373+
works) or from static code analysis.
364374

365-
When it comes to non built-in definitions, `clojure-mode` needs to be manually instructed how to handle the docstrings and highlighting. Here's an example:
375+
When it comes to non built-in definitions, `clojure-mode` needs to be manually
376+
instructed how to handle the docstrings and highlighting. Here's an example:
366377

367378
``` emacs-lisp
368379
(put '>defn 'clojure-doc-string-elt 2)
@@ -373,7 +384,9 @@ When it comes to non built-in definitions, `clojure-mode` needs to be manually i
373384
1 font-lock-keyword-face)))
374385
```
375386

376-
**Note:** The `clojure-doc-string-elt` attribute is processed by the function `clojure-font-lock-syntactic-face-function`.
387+
> [!NOTE]
388+
>
389+
> The `clojure-doc-string-elt` attribute is processed by the function `clojure-font-lock-syntactic-face-function`.
377390
378391
## Refactoring support
379392

@@ -481,7 +494,7 @@ without affecting the namespace declaration.
481494

482495
## Related packages
483496

484-
* [clojure-mode-extra-font-locking][] provides additional font-locking
497+
- [clojure-mode-extra-font-locking][] provides additional font-locking
485498
for built-in methods and macros. The font-locking is pretty
486499
imprecise, because it doesn't take namespaces into account and it
487500
won't font-lock a function at all possible positions in a sexp, but
@@ -502,9 +515,9 @@ plenty of incorrect font-locking. CIDER users should avoid this package,
502515
as CIDER does its own dynamic font-locking, which is namespace-aware
503516
and doesn't produce almost any false positives.
504517

505-
* [clj-refactor][] provides refactoring support.
518+
- [clj-refactor][] provides additional refactoring support.
506519

507-
* Enabling `CamelCase` support for editing commands(like
520+
- Enabling `CamelCase` support for editing commands (like
508521
`forward-word`, `backward-word`, etc) in `clojure-mode` is quite
509522
useful since we often have to deal with Java class and method
510523
names. The built-in Emacs minor mode `subword-mode` provides such
@@ -514,7 +527,7 @@ functionality:
514527
(add-hook 'clojure-mode-hook #'subword-mode)
515528
```
516529

517-
* The use of [paredit][] when editing Clojure (or any other Lisp) code
530+
- The use of [paredit][] when editing Clojure (or any other Lisp) code
518531
is highly recommended. It helps ensure the structure of your forms is
519532
not compromised and offers a number of operations that work on code
520533
structure at a higher level than just characters and words. To enable
@@ -524,7 +537,7 @@ it for Clojure buffers:
524537
(add-hook 'clojure-mode-hook #'paredit-mode)
525538
```
526539

527-
* [smartparens][] is an excellent
540+
- [smartparens][] is an excellent
528541
(newer) alternative to paredit. Many Clojure hackers have adopted it
529542
recently and you might want to give it a try as well. To enable
530543
`smartparens` use the following code:
@@ -533,7 +546,7 @@ it for Clojure buffers:
533546
(add-hook 'clojure-mode-hook #'smartparens-strict-mode)
534547
```
535548

536-
* [RainbowDelimiters][] is a
549+
- [RainbowDelimiters][] is a
537550
minor mode which highlights parentheses, brackets, and braces
538551
according to their depth. Each successive level is highlighted in a
539552
different color. This makes it easy to spot matching delimiters,
@@ -545,7 +558,7 @@ it for Clojure buffers:
545558
(add-hook 'clojure-mode-hook #'rainbow-delimiters-mode)
546559
```
547560

548-
* [aggressive-indent-mode][] automatically adjust the indentation of your code,
561+
- [aggressive-indent-mode][] automatically adjust the indentation of your code,
549562
while you're writing it. Using it together with `clojure-mode` is highly
550563
recommended. Provided you've already installed `aggressive-indent-mode` you can
551564
enable it like this:
@@ -554,6 +567,9 @@ enable it like this:
554567
(add-hook 'clojure-mode-hook #'aggressive-indent-mode)
555568
```
556569

570+
Note that it might cause performance issues if you're dealing with large
571+
Clojure source files.
572+
557573
## REPL Interaction
558574

559575
One of the fundamental aspects of Lisps in general, and Clojure in

0 commit comments

Comments
 (0)