Skip to content

Commit 1137b2d

Browse files
committed
docs: simplify readme
1 parent a10a159 commit 1137b2d

File tree

4 files changed

+49
-27
lines changed

4 files changed

+49
-27
lines changed

README.md

+3-27
Original file line numberDiff line numberDiff line change
@@ -95,33 +95,9 @@
9595
We integrate with common code editors and workflows:
9696

9797
- [Alejandra extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=kamadorueda.alejandra)
98-
- [Doom-emacs](https://github.com/hlissner/doom-emacs):
99-
100-
```
101-
(set-formatter! 'alejandra "alejandra --quiet" :modes '(nix-mode))
102-
```
103-
104-
- [Pre-commit](https://pre-commit.com/):
105-
106-
```yaml
107-
repos:
108-
- repo: https://github.com/kamadorueda/alejandra
109-
rev: 1.4.0
110-
hooks:
111-
# Choose one of the following:
112-
- id: alejandra # Requires Nix to be previously installed in the system
113-
- id: alejandra-system # Requires Alejandra to be previously installed in the system
114-
```
115-
116-
- [pre-commit-hooks.nix](https://github.com/cachix/pre-commit-hooks.nix)
117-
118-
```nix
119-
pre-commit-check = pre-commit-hooks.lib.${system}.run {
120-
hooks = {
121-
alejandra.enable = true;
122-
};
123-
};
124-
```
98+
- [Doom-emacs](./integrations/doom-emacs/README.md)
99+
- [Pre-commit](./integrations/pre-commit/README.md)
100+
- [pre-commit-hooks.nix](./integrations/pre-commit-hooks-nix/README.md)
125101

126102
## Getting started
127103

integrations/doom-emacs/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Doom-Emacs integration
2+
3+
In order to configure Alejandra in
4+
[Doom-emacs](https://github.com/hlissner/doom-emacs):
5+
6+
Just use the following:
7+
8+
```lisp
9+
(set-formatter! 'alejandra "alejandra --quiet" :modes '(nix-mode))
10+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Pre-commit-hooks.nix integration
2+
3+
In order to use Alejandra with
4+
[pre-commit-hooks.nix](https://github.com/cachix/pre-commit-hooks.nix),
5+
use a file like the following:
6+
7+
```nix
8+
{
9+
pre-commit-check = pre-commit-hooks.lib.${system}.run {
10+
hooks = {
11+
alejandra.enable = true;
12+
};
13+
};
14+
}
15+
```

integrations/pre-commit/README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Pre-Commit integration
2+
3+
In order to configure Alejandra in
4+
[Pre-Commit](https://pre-commit.com/),
5+
6+
First create a file named `.pre-commit-config.yaml`,
7+
with contents:
8+
9+
```yaml
10+
repos:
11+
- repo: https://github.com/kamadorueda/alejandra
12+
rev: 1.4.0
13+
# Choose either the 'alejandra' or 'alejandra-system' hook
14+
# depending on what pre-requisites you have:
15+
hooks:
16+
# Requires Nix to be previously installed in the system
17+
- id: alejandra
18+
19+
# Requires Alejandra to be previously installed in the system
20+
- id: alejandra-system
21+
```

0 commit comments

Comments
 (0)