Skip to content

Commit

Permalink
Use devenv for the IHP Guide
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed May 9, 2024
1 parent 45b0a2a commit 579c148
Show file tree
Hide file tree
Showing 7 changed files with 524 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
aws-region: eu-west-1
- name: Build Docs
run: |
cd $GITHUB_WORKSPACE
nix develop --impure --command build-guide
cd $GITHUB_WORKSPACE/Guide
nix build --impure --out-link guide.tar.gz
- name: Build API Reference
run: |
cd $GITHUB_WORKSPACE
nix develop --impure --command build-api-reference
tar -czvf api-reference.tar.gz haddock-build
- name: Uploading to S3
run: |
aws s3 cp ./Guide/guide.tar.gz s3://${{ secrets.S3_BUCKET }}/docs/guide.tar.gz
aws s3 cp ./guide.tar.gz s3://${{ secrets.S3_BUCKET }}/docs/guide.tar.gz
aws s3 cp ./api-reference.tar.gz s3://${{ secrets.S3_BUCKET }}/docs/api-reference.tar.gz
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,17 @@ cd IHP
direnv allow
```

Then switch to the `Guide` directory:
Then switch to the `Guide` directory and run `direnv allow` again:

```
cd Guide
direnv allow
```

To rebuild the html files from the markdown files on every file change run:

```
make watch
devenv up
```

This will automatically open a browser window with the compiled html of the documentation. You can now make changes to the markdown files and they are reflected in the browser after a page refresh.
Expand Down
1 change: 1 addition & 0 deletions Guide/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake . --impure
5 changes: 0 additions & 5 deletions Guide/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ all: $(HTML_FILES) bootstrap.css instantclick.js search.js search.css
%.html: %.markdown layout.html
mmark -i $< -o $@ --template layout.html --ext-skylighting --ext-ghc-highlighter --ext-punctuation --ext-toc 2-6

watch: all
@echo "Server is starting at: http://localhost:3000/index.html"
@nix-shell -p haskellPackages.wai-app-static --command "warp" &
@ls *.markdown layout.html | entr make

clean:
rm $(HTML_FILES)

Expand Down
Loading

0 comments on commit 579c148

Please sign in to comment.