Skip to content

Commit

Permalink
Update cabal build instructions using project
Browse files Browse the repository at this point in the history
- Add a note on builder package
- Also mention cabal run as an option
  • Loading branch information
philderbeast committed Jun 17, 2024
1 parent 0b3266d commit 9b78d27
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,20 @@ to review it as soon as we can.
### Working On The Builder

The `builder` is the static site generator that turns the markdown files, CSS,
images, and scripts into a website. It lives in the `builder`. Most of the time,
you won't need to make changes to the builder and you can follow the
instructions in the _Contributing Changes_ section above.
images, and scripts into a website.

> [!NOTE]
> The package in the builder folder has the `haskell-org-site` executable:
> ```
> $ cat cabal.project
> packages: builder
>
> $ cat builder/haskell-org.cabal | grep executable
> executable haskell-org-site
> ```
Most of the time, you won't need to make changes to the builder and you can
follow the instructions in the _Contributing Changes_ section above.

If you want to make a quick change or two, you can continue to use the
`buildAndWatch` script to rebuild changes, but for more substantial changes this
Expand All @@ -66,24 +77,20 @@ builder using either nix or cabal. Directions for both are given below:
### Manually Building the Site With Cabal

If you don't have nix installed, or if you are inside of the project's nix
shell, you will want to use cabal to compile the builder. To do so, enter the
`builder` directory and compile the program with:
shell, use cabal to build and execute the builder, the only package in
the project.

```shell
cabal v2-build
```
$ cabal build all
$ cabal exec haskell-org-site build
```

Once compiled, the builder must be run from the project root directory so that
it can find all of the content. To run the builder, you need to first find the
name of the executable. From the builder directory, you can find the executable
path by running:
With `cabal run` we can do this in one command.

```
cabal v2-exec -- which haskell-org-site
$ cabal run haskell-org-site -- build
```

Using that path, you can run the builder from the project root directory.

### Manually Building the Site With Nix

If you have nix installed, you can have nix build the builder by running:
Expand Down

0 comments on commit 9b78d27

Please sign in to comment.