diff --git a/.vale/config/vocabularies/haze/accept.txt b/.vale/config/vocabularies/haze/accept.txt index 4cd11e4..925d628 100644 --- a/.vale/config/vocabularies/haze/accept.txt +++ b/.vale/config/vocabularies/haze/accept.txt @@ -23,3 +23,4 @@ worktrees config stdin stdout +direnv diff --git a/DEVELOPING.md b/DEVELOPING.md new file mode 100644 index 0000000..d7f9f65 --- /dev/null +++ b/DEVELOPING.md @@ -0,0 +1,80 @@ +# Developing + +## Setup + +### Nix based development environment + +The recommended way to setup the development environment is to use +[Lix](https://lix.systems/install/)/[Nix](https://nixos.org/download/). + +Once installed, you can enter the development shell using `nix develop` or, +setup [direnv](https://direnv.net/) to automatically enter the development shell +when you enter the folder. + +The development shell provides all necessary tooling to develop haze. + +### Without Nix + +The fooling tools need to be setup to develop without using Nix to manage the +development setup: + +- [`cargo`](https://doc.rust-lang.org/cargo/getting-started/installation.html) - + For building the program +- [`mdbook`](https://github.com/rust-lang/mdBook) - For building the + documentation +- [`prettier`](https://prettier.io/) - For formatting the non-rust files +- [`vale`](https://vale.sh/) - For checking documentation + +## Building + +```bash +cargo build +``` + +The binary can then be found at `target/debug/haze`. + +## Formatting + +### With Nix + +```bash +nix fmt +``` + +### Without Nix + +#### Rust code + +```bash +cargo fmt +``` + +#### Documentation + +```bash +prettier --write '**/*.md' +``` + +### Building documentation + +```bash +mdbook serve +``` + +### Checking documentation + +```bash +vale src/ book/src/ book/README.md *.md +``` + +### Run all checks + +```bash +nix flake check +``` + +### Building docker images + +```bash +nix run .#'"haze-image-php-8.4"'.copyToDockerDaemon +``` diff --git a/README.md b/README.md index 6f17bf1..33aee03 100644 --- a/README.md +++ b/README.md @@ -35,3 +35,7 @@ Documentation for haze can be found in the - Navigate to the address that is provided in the output. See the [book](https://icewind.codeberg.page/haze/) for more details. + +## Developing + +See [DEVELOPING.md](./DEVELOPING.md) for information on how to work on `haze`. diff --git a/flake.nix b/flake.nix index 5308a7a..d4c9127 100644 --- a/flake.nix +++ b/flake.nix @@ -69,7 +69,7 @@ ]; checks = { - vale = {vale, ...}: "${vale}/bin/vale src/ book/src/ CHANGELOG.md README.md book/README.md"; + vale = {vale, ...}: "${vale}/bin/vale src/ book/src/ book/README.md *.md"; }; homeModules = {