From 2d540ec84bdf233fed1ccd8575620823a5d0cafb Mon Sep 17 00:00:00 2001 From: Kevin Amado Date: Mon, 13 Jun 2022 12:37:28 -0600 Subject: [PATCH] docs: simplify readme --- README.md | 30 +++------------------ integrations/doom-emacs/README.md | 9 +++++++ integrations/pre-commit-hooks-nix/README.md | 15 +++++++++++ integrations/pre-commit/README.md | 20 ++++++++++++++ 4 files changed, 47 insertions(+), 27 deletions(-) create mode 100644 integrations/doom-emacs/README.md create mode 100644 integrations/pre-commit-hooks-nix/README.md create mode 100644 integrations/pre-commit/README.md diff --git a/README.md b/README.md index 1bc8663..de2430b 100644 --- a/README.md +++ b/README.md @@ -95,33 +95,9 @@ We integrate with common code editors and workflows: - [Alejandra extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=kamadorueda.alejandra) - - [Doom-emacs](https://github.com/hlissner/doom-emacs): - - ``` - (set-formatter! 'alejandra "alejandra --quiet" :modes '(nix-mode)) - ``` - - - [Pre-commit](https://pre-commit.com/): - - ```yaml - repos: - - repo: https://github.com/kamadorueda/alejandra - rev: 1.4.0 - hooks: - # Choose one of the following: - - id: alejandra # Requires Nix to be previously installed in the system - - id: alejandra-system # Requires Alejandra to be previously installed in the system - ``` - - - [pre-commit-hooks.nix](https://github.com/cachix/pre-commit-hooks.nix) - - ```nix - pre-commit-check = pre-commit-hooks.lib.${system}.run { - hooks = { - alejandra.enable = true; - }; - }; - ``` + - [Doom-emacs](./integrations/doom-emacs/README.md) + - [Pre-commit](./integrations/pre-commit/README.md) + - [pre-commit-hooks.nix](./integrations/pre-commit-hooks-nix/README.md) ## Getting started diff --git a/integrations/doom-emacs/README.md b/integrations/doom-emacs/README.md new file mode 100644 index 0000000..f7ae280 --- /dev/null +++ b/integrations/doom-emacs/README.md @@ -0,0 +1,9 @@ +# Doom-Emacs integration + +In order to configure Alejandra in +[Doom-emacs](https://github.com/hlissner/doom-emacs) +just use the following: + +```lisp +(set-formatter! 'alejandra "alejandra --quiet" :modes '(nix-mode)) +``` diff --git a/integrations/pre-commit-hooks-nix/README.md b/integrations/pre-commit-hooks-nix/README.md new file mode 100644 index 0000000..3db566b --- /dev/null +++ b/integrations/pre-commit-hooks-nix/README.md @@ -0,0 +1,15 @@ +# Pre-commit-hooks.nix integration + +In order to use Alejandra with +[pre-commit-hooks.nix](https://github.com/cachix/pre-commit-hooks.nix) +use a configuration file like the following: + +```nix +{ + pre-commit-check = pre-commit-hooks.lib.${system}.run { + hooks = { + alejandra.enable = true; + }; + }; +} +``` diff --git a/integrations/pre-commit/README.md b/integrations/pre-commit/README.md new file mode 100644 index 0000000..dcffea9 --- /dev/null +++ b/integrations/pre-commit/README.md @@ -0,0 +1,20 @@ +# Pre-Commit integration + +In order to use Alejandra with +[Pre-Commit](https://pre-commit.com/) +just create a file named `.pre-commit-config.yaml` +with contents: + +```yaml +repos: + - repo: https://github.com/kamadorueda/alejandra + rev: 1.4.0 + # Choose either the 'alejandra' or 'alejandra-system' hook + # depending on what pre-requisites you have: + hooks: + # Requires Nix to be previously installed in the system + - id: alejandra + + # Requires Alejandra to be previously installed in the system + - id: alejandra-system +```