diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index e4a7295..c43deca 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -16,6 +16,7 @@ export default defineConfig({ sidebar: [ { text: 'Quick Start', link: '/quick-start' }, + { text: 'Installation', link: '/installation' }, { text: 'Overview', link: '/overview' }, { text: 'Usage', link: '/usage' }, { text: 'Formatter Specification', link: '/formatter-spec' }, diff --git a/docs/installation.md b/docs/installation.md index 38347c6..a76e178 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -4,7 +4,10 @@ outline: deep # Installation -There are two options to install `treefmt`: by downloading the latest binary, or by compiling and building the tool from source. +There are two options to install `treefmt`: + +1. Downloading the latest binary +2. Compiling and building it from source. ## Installing with a binary file @@ -12,31 +15,34 @@ You can find the list of the latest binaries [here](https://github.com/numtide/t ## Building from source -There are several ways to build `treefmt` from source. Your choice will depend on whether you're a [nix](https://github.com/NixOS/nix) user. +There are several ways to build `treefmt` from source. Your choice will depend on whether you're a [nix](https://github.com/NixOS/nix) user or +not. ### Non-Nix User To try the project without building it, run: ``` -$ cargo run -- --help +$ go run main.go --help ``` -The command will output the manual. You can run the tool in this manner with any other flag or option to format your project. +The command will output the manual. You can run the tool in this manner with any other flag or option to format your +project. -To build a binary, you need to have rust installed. You can install it with [rustup](https://rustup.rs/). Now, if you want to build the project, switch to the project root folder and run: +To build a binary, you need to have `go 1.22` installed. You can find instructions [here](https://go.dev/doc/install). + +Now, if you want to build the project, switch to the project root folder and run: ``` -$ cargo build +$ go build ``` -After the successful execution of the cargo build command, you will find the `treefmt` binary in the target folder. +After the successful execution of the build command, you will find the `treefmt` binary in the project root folder. ### Nix User -[Nix](https://github.com/NixOS/nix) is a package manager foundational for NixOS. You can use it in NixOS and in any other OS equally. - -If you're using both `treefmt` and `nix`, you can go for [`treefmt-nix`](https://github.com/numtide/treefmt-nix), a special tool that makes installation and configuration of `treefmt` with `nix` easier. +If you're using both `treefmt` and `nix`, you can go for [`treefmt-nix`](https://github.com/numtide/treefmt-nix), a wrapper that makes installation and +configuration of `treefmt` with `nix` easier. **Non-flake user**