Skip to content

Commit 187e512

Browse files
committed
[Fix #29] Remove the manual grammar installation instructions
Very few people will have to do this, so it doesn't really make sense to go into so much details.
1 parent 9662b6c commit 187e512

File tree

1 file changed

+11
-57
lines changed

1 file changed

+11
-57
lines changed

README.md

Lines changed: 11 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ You can read more about the vision for `clojure-ts-mode` [here](https://metaredu
9595

9696
## Current Status
9797

98-
**This library is still under development. Breaking changes should be expected.**
98+
**This library is still under active development. Breaking changes should be expected.**
9999

100100
## Installation
101101

@@ -150,67 +150,21 @@ Once installed, evaluate clojure-ts-mode.el and you should be ready to go.
150150

151151
### Install tree-sitter grammars
152152

153-
The compile tree-sitter clojure shared library must be available to Emacs.
154-
Additionally, the tree-sitter
155-
[markdown_inline](https://github.com/MDeiml/tree-sitter-markdown) shared library
156-
will also be used for docstrings if available.
153+
`clojure-ts-mode` makes use of two TreeSitter grammars to work properly:
154+
155+
- The Clojure grammar, mentioned earlier
156+
- [markdown_inline](https://github.com/MDeiml/tree-sitter-markdown), which
157+
will be used for docstrings if available and if `clojure-ts-use-markdown-inline` is enabled.
157158

158159
If you have `git` and a C compiler (`cc`) available on your system's `PATH`,
159-
**then these steps should not be necessary**. clojure-ts-mode will install the
160+
`clojure-ts-mode` will install the
160161
grammars when you first open a Clojure file and `clojure-ts-ensure-grammars` is
161162
set to `t` (the default).
162163

163-
If clojure-ts-mode fails to automatically install the grammar, you have the option to install it manually.
164-
165-
#### From your OS
166-
167-
Some distributions may package the tree-sitter-clojure grammar in their package repositories.
168-
If yours does you may be able to install tree-sitter-clojure with your system package manager.
169-
170-
If the version packaged by your OS is out of date, you may see errors in the `*Messages*` buffer or your clojure buffers will not have any syntax highlighting.
171-
172-
If this happens you should install the grammar manually with `M-x treesit-install-language-grammar <RET> clojure` and follow the prompts.
173-
Recommended values for these prompts can be seen in `clojure-ts-grammar-recipes`.
174-
175-
#### Compile From Source
176-
177-
If all else fails, you can attempt to download and compile manually.
178-
All you need is `git` and a C compiler (GCC works well).
179-
180-
To start, clone [tree-sitter-clojure](https://github.com/sogaiu/tree-sitter-clojure).
181-
182-
Then run the following code (depending on your OS) from the tree-sitter-clojure repository on your machine.
183-
184-
#### Linux
185-
186-
```bash
187-
mkdir -p dist
188-
cc -c -I./src src/parser.c -o "parser.o"
189-
cc -fPIC -shared src/parser.o -o "dist/libtree-sitter-clojure.so"
190-
```
191-
192-
#### macOS
193-
194-
```bash
195-
mkdir -p dist
196-
cc -c -I./src src/parser.c -o "parser.o"
197-
cc -fPIC -shared src/parser.o -o "dist/libtree-sitter-clojure.dylib"
198-
```
199-
200-
#### Windows
201-
202-
I don't know how to do this on Windows. Patches welcome!
203-
204-
#### Finally, in emacs
205-
206-
Then tell Emacs where to find the shared library by adding something like this to your init file:
207-
208-
```emacs-lisp
209-
(setq treesit-extra-load-path '( "~/path/to/tree-sitter-clojure/dist"))
210-
```
211-
212-
OR you can move the `libtree-sitter-clojure.so`/`libtree-sitter-clojure.dylib` to a directory named `tree-sitter`
213-
under your `user-emacs-directory` (typically `~/.emacs.d` on Unix systems).
164+
If `clojure-ts-mode` fails to automatically install the grammar, you have the
165+
option to install it manually, Please, refer to the installation instructions of
166+
each required grammar and make sure you're install the versions expected. (see
167+
`clojure-ts-grammar-recipes` for details)
214168

215169
## Migrating to clojure-ts-mode
216170

0 commit comments

Comments
 (0)