1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-13 11:16:48 +03:00
juvix/tests/smoke/Commands/html.smoke.yaml
Jonathan Cubides 22027f137c
Refactor html command with extra options (#1725)
This PR redefines the `html` command unifying our previous subcommands
for the HTML backend. You should use the command in the following way to
obtain the same results as before:

- `juvix html src.juvix` -> `juvix html src.juvix --only-source`
- `juvix dev doc src.juvix` -> `juvix html src.juvix`

- Other fixes here include the flag `--non-recursive`, which replaces
the previous behavior in that we now generate all the HTML recursively
by default.
- The flag `--no-print-metadata` is now called `--no-footer` 
- Also, another change introduced by this PR is asset handling; for
example, with our canonical Juvix program,
the new output is organized as follows.

```
juvix html HelloWorld.juvix --only-source && tree html/
Copying assets files to test/html/assets
Writing HelloWorld.html
html/
├── assets
│   ├── css
│   │   ├── linuwial.css
│   │   ├── source-ayu-light.css
│   │   └── source-nord.css
│   ├── images
│   │   ├── tara-magicien.png
│   │   ├── tara-seating.svg
│   │   ├── tara-smiling.png
│   │   ├── tara-smiling.svg
│   │   ├── tara-teaching.png
│   │   └── tara-teaching.svg
│   └── js
│       ├── highlight.js
│       └── tex-chtml.js
└── HelloWorld.html
├── Stdlib.Data.Bool.html
├── Stdlib.Data.List.html
├── Stdlib.Data.Maybe.html
├── Stdlib.Data.Nat.html
├── Stdlib.Data.Ord.html
├── Stdlib.Data.Product.html
├── Stdlib.Data.String.html
├── Stdlib.Function.html
├── Stdlib.Prelude.html
└── Stdlib.System.IO.html
```
In addition, for the vscode-plugin, this PR adds two flags,
`--prefix-assets` and `--prefix-url`, for which one provides input to
help vscode find resource locations and Juvix files.

PS. Make sure to run `make clean` the first time you run `make install`
for the first time.
2023-01-17 18:11:59 +01:00

147 lines
4.3 KiB
YAML

working-directory: ./../../../examples/
tests:
- name: html-stdout
command:
shell:
- bash
script: |
cd milestone/ValidityPredicates
juvix html SimpleFungibleToken.juvix --only-source
cat html/SimpleFungibleToken.html
stdout:
contains:
<!DOCTYPE HTML>
exit-status: 0
- name: output-dir
command:
shell:
- bash
script: |
rm -rf html
juvix html milestone/ValidityPredicates/SimpleFungibleToken.juvix --only-source --output-dir=html --non-recursive
[ -d html/assets ]
[ -f html/SimpleFungibleToken.html ]
stdout:
matches: |
Copying assets files to .*
Writing .*SimpleFungibleToken.html
exit-status: 0
- name: recursive-generation
command:
shell:
- bash
script: |
rm -rf html
juvix html milestone/ValidityPredicates/SimpleFungibleToken.juvix --only-source --output-dir=html
(ls html | wc -l)
cd html
[ -f Stdlib.Data.Ord.html ]
[ -f Stdlib.Data.String.html ]
[ -f Stdlib.Data.Nat.html ]
[ -f Stdlib.System.IO.html ]
[ -f Stdlib.Function.html ]
[ -f Stdlib.Data.List.html ]
[ -f Stdlib.Data.String.Ord.html ]
[ -f Stdlib.Data.Product.html ]
[ -f Data.Int.Ops.html ]
[ -f Stdlib.Data.Maybe.html ]
[ -f Data.Int.html ]
[ -f Stdlib.Data.Bool.html ]
[ -f Stdlib.Prelude.html ]
[ -f Anoma.Base.html ]
[ -f SimpleFungibleToken.html ]
[ -f assets/css/source-ayu-light.css ]
[ -f assets/css/source-nord.css ]
[ -f assets/images/tara-magicien.png ]
[ -f assets/images/tara-seating.svg ]
[ -f assets/images/tara-smiling.png ]
[ -f assets/images/tara-smiling.svg ]
[ -f assets/images/tara-teaching.png ]
[ -f assets/images/tara-teaching.svg ]
[ -f assets/js/highlight.js ]
[ -f assets/js/tex-chtml.js ]
stdout:
contains: |
SimpleFungibleToken.html
exit-status: 0
- name: judoc-assets
command:
shell:
- bash
script: |
rm -rf html
juvix html milestone/ValidityPredicates/SimpleFungibleToken.juvix --output-dir=html
(ls html | wc -l)
cd html
[ -f Stdlib.Data.Ord.html ]
[ -f Stdlib.Data.String.html ]
[ -f Stdlib.Data.Nat.html ]
[ -f Stdlib.System.IO.html ]
[ -f Stdlib.Function.html ]
[ -f Stdlib.Data.List.html ]
[ -f Stdlib.Data.String.Ord.html ]
[ -f Stdlib.Data.Product.html ]
[ -f Data.Int.Ops.html ]
[ -f Stdlib.Data.Maybe.html ]
[ -f Data.Int.html ]
[ -f Stdlib.Data.Bool.html ]
[ -f Stdlib.Prelude.html ]
[ -f Anoma.Base.html ]
[ -f SimpleFungibleToken.html ]
[ -f assets/css/source-ayu-light.css ]
[ -f assets/css/source-nord.css ]
[ -f assets/css/linuwial.css ]
[ -f assets/images/tara-magicien.png ]
[ -f assets/images/tara-seating.svg ]
[ -f assets/images/tara-smiling.png ]
[ -f assets/images/tara-smiling.svg ]
[ -f assets/images/tara-teaching.png ]
[ -f assets/images/tara-teaching.svg ]
[ -f assets/js/highlight.js ]
[ -f assets/js/tex-chtml.js ]
stdout:
contains: |
SimpleFungibleToken.html
exit-status: 0
- name: non-recursive-generation
command:
shell:
- bash
script: |
rm -rf html
juvix html milestone/ValidityPredicates/SimpleFungibleToken.juvix --output-dir=html --non-recursive
(ls html | wc -l)
cd html
[ -d assets ]
[ -f SimpleFungibleToken.html ]
stdout:
matches: |
Copying assets files to .*
Writing .*SimpleFungibleToken.html
4
exit-status: 0
- name: non-recursive-generation-only-source
command:
shell:
- bash
script: |
rm -rf html
juvix html milestone/ValidityPredicates/SimpleFungibleToken.juvix --output-dir=html --non-recursive --only-source
(ls html | wc -l)
cd html
[ -d assets/ ]
[ -f SimpleFungibleToken.html ]
stdout:
matches: |
Copying assets files to .*
Writing .*SimpleFungibleToken.html
2
exit-status: 0