diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c1717c31b..158d762fca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -201,11 +201,6 @@ jobs: version: "13.0" cached: "${{ steps.cache-llvm.outputs.cache-hit }}" - - name: Build the mdbook - run: | - cd main - make docs - - name: Make runtime run: | cd main @@ -226,6 +221,11 @@ jobs: make html-examples make demo-example + - name: Build the mdbook + run: | + cd main + make docs + - name: Setup Pages uses: actions/configure-pages@v3 if: >- diff --git a/.gitignore b/.gitignore index b323864963..de4db86e48 100644 --- a/.gitignore +++ b/.gitignore @@ -62,6 +62,7 @@ _build.*/ *.agdai .agda/ agda2hs/ +docs/examples/html/.* docs/*.html *.cabal /src/Juvix/Utils/OldParser.hs diff --git a/Makefile b/Makefile index 7081797969..046c78a7e8 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ PREFIX="$(PWD)/.stack-work/prefix" UNAME := $(shell uname) EXAMPLEMILESTONE=examples/milestone -EXAMPLEHTMLOUTPUT=_docs/examples/html +EXAMPLEHTMLOUTPUT=docs/examples/html EXAMPLES= Collatz/Collatz.juvix \ Fibonacci/Fibonacci.juvix \ Hanoi/Hanoi.juvix \ @@ -79,7 +79,7 @@ demo-example: # -- MDBook .PHONY: docs -docs: +docs: html-examples @cp $(METAFILES) docs/ @cp -r assets/ docs/ @mdbook build diff --git a/docs/examples/README.md b/docs/examples/README.md index da14b91da3..75e44c6d98 100644 --- a/docs/examples/README.md +++ b/docs/examples/README.md @@ -4,12 +4,12 @@ The following links are clickable versions of their corresponding Juvix programs. The HTML output can be generated by running `juvix html --recursive FileName.juvix`. -- [HelloWorld.juvix](https://docs.juvix.org/examples/html/HelloWorld/HelloWorld.html) -- [Fibonacci.juvix](https://docs.juvix.org/examples/html/Fibonacci/Fibonacci.html) -- [Hanoi.juvix](https://docs.juvix.org/examples/html/Hanoi/Hanoi.html) -- [PascalsTriangle.juvix](https://docs.juvix.org/examples/html/PascalsTriangle/PascalsTriangle.html) -- [Collatz.juvix](https://docs.juvix.org/examples/html/Collatz/Collatz.html) -- [TicTacToe.juvix](https://docs.juvix.org/examples/html/TicTacToe/CLI/CLI.TicTacToe.html) +- [HelloWorld.juvix](./html/examples/html/HelloWorld/HelloWorld.html) +- [Fibonacci.juvix](./html/examples/html/Fibonacci/Fibonacci.html) +- [Hanoi.juvix](./html/examples/html/Hanoi/Hanoi.html) +- [PascalsTriangle.juvix](./html/examples/html/PascalsTriangle/PascalsTriangle.html) +- [Collatz.juvix](./html/examples/html/Collatz/Collatz.html) +- [TicTacToe.juvix](./html/TicTacToe/CLI/CLI.TicTacToe.html) The [Juvix standard library](https://anoma.github.io/juvix-stdlib/) contains common functions that can be used in Juvix programs. diff --git a/docs/reference/examples.md b/docs/reference/examples.md index 824ffa0e95..88613be6fb 100644 --- a/docs/reference/examples.md +++ b/docs/reference/examples.md @@ -2,9 +2,9 @@ The following links are clickable versions of their corresponding Juvix programs. The HTML output is generated by running `juvix html --recursive FileName.juvix`. -- [HelloWorld.juvix](https://docs.juvix.org/examples/html/HelloWorld/HelloWorld.html) -- [Fibonacci.juvix](https://docs.juvix.org/examples/html/Fibonacci/Fibonacci.html) -- [Hanoi.juvix](https://docs.juvix.org/examples/html/Hanoi/Hanoi.html) -- [PascalsTriangle.juvix](https://docs.juvix.org/examples/html/PascalsTriangle/PascalsTriangle.html) -- [Collatz.juvix](https://docs.juvix.org/examples/html/Collatz/Collatz.html) -- [TicTacToe.juvix](https://docs.juvix.org/examples/html/TicTacToe/CLI/CLI.TicTacToe.html) +- [HelloWorld.juvix](./../examples/html/HelloWorld/HelloWorld.html) +- [Fibonacci.juvix](./../examples/html/Fibonacci/Fibonacci.html) +- [Hanoi.juvix](./../examples/html/Hanoi/Hanoi.html) +- [PascalsTriangle.juvix](./../examples/html/PascalsTriangle/PascalsTriangle.html) +- [Collatz.juvix](./../examples/html/Collatz/Collatz.html) +- [TicTacToe.juvix](./../examples/html/TicTacToe/CLI/CLI.TicTacToe.html) diff --git a/docs/tutorials/learn.md b/docs/tutorials/learn.md index 8786a78e2c..c250a3666e 100644 --- a/docs/tutorials/learn.md +++ b/docs/tutorials/learn.md @@ -743,8 +743,8 @@ case tail' lst You have now learnt the very basics of Juvix. To consolidate your understanding of Juvix and functional programming, try doing some of the following exercises. To learn how to write more complex Juvix -programs, see the [advanced -tutorial](https://docs.juvix.org/examples/html/Tutorial/Tutorial.html) +programs, see the +[advanced tutorial](./../examples/html/Tutorial/Tutorial.html) and the [Juvix program examples](../reference/examples.md). 1. Define a function `prime : Nat -> Nat` which checks if a given