1
1
mirror of https://github.com/anoma/juvix.git synced 2024-09-11 16:26:33 +03:00

Fix: broken links of Example programs (#2003)

This PR fixes the broken links that refer to Juvix Examples in the
documentation. Ideally, this wouldn't occur since we utilize a link
checker, but this tool only works well for relative links, which was not
the case for the links of the examples. Additionally, I slightly
modified the CI workflow by generating the HTML for the examples first,
followed by the entire book.

- Closes  #2001
- Check the output using this: https://jonaprieto.github.io/juvix/
This commit is contained in:
Jonathan Cubides 2023-04-14 11:16:05 +02:00 committed by GitHub
parent e1a23c677c
commit 085d301e64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 21 deletions

View File

@ -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: >-

1
.gitignore vendored
View File

@ -62,6 +62,7 @@ _build.*/
*.agdai
.agda/
agda2hs/
docs/examples/html/.*
docs/*.html
*.cabal
/src/Juvix/Utils/OldParser.hs

View File

@ -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

View File

@ -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.

View File

@ -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)

View File

@ -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