Remove the try-dhall-server
build product (#752)
This build product is no longer necessary now that the live demo can import things from the Prelude
This commit is contained in:
parent
ed30a6a394
commit
82165d525d
28
README.md
28
README.md
|
@ -97,9 +97,9 @@ And each of them with `stack build <package-name>`, for example:
|
||||||
$ stack build dhall-json
|
$ stack build dhall-json
|
||||||
```
|
```
|
||||||
|
|
||||||
## Build and serve the "Try Dhall" website
|
## Build the "Try Dhall" website
|
||||||
|
|
||||||
This is currently only supported for Nix on Linux
|
Building the website from source is currently only supported for Nix on Linux.
|
||||||
|
|
||||||
You can build the static assets by running:
|
You can build the static assets by running:
|
||||||
|
|
||||||
|
@ -107,28 +107,12 @@ You can build the static assets by running:
|
||||||
$ nix-build --attr try-dhall-static
|
$ nix-build --attr try-dhall-static
|
||||||
```
|
```
|
||||||
|
|
||||||
For local testing you can open the generated `./result/index.html` directly in
|
... then open `./result/index.html` in your browser.
|
||||||
your browser and everything will work except for relative imports of the
|
|
||||||
Prelude.
|
|
||||||
|
|
||||||
To also test imports you can build the `try-dhall-server` script which uses
|
You can also download archive containing the pre-built website from CI using
|
||||||
`warp` to serve the static assets:
|
this link:
|
||||||
|
|
||||||
```bash
|
* [try-dhall.tar.bz2](http://hydra.dhall-lang.org/job/dhall-haskell/master/tarball-try-dhall/latest/download-by-type/file/binary-dist)
|
||||||
$ nix-build --attr try-dhall-server
|
|
||||||
$ result/bin/try-dhall-server
|
|
||||||
Serving directory /nix/store/i7x86qs888rndrhvw92y69jd5xaji060-try-dhall-static on port 3000 with ["index.html","index.htm"] index files.
|
|
||||||
```
|
|
||||||
|
|
||||||
... and then open `http://localhost:3000` in your browser. You will then be
|
|
||||||
able to import things from the Prelude within your Dhall configuration using
|
|
||||||
a path like `http://localhost:3000/Prelude/List/map`. Similarly, if you host
|
|
||||||
this on some public-facing domain such as `https://try.dhall-lang.org` then you
|
|
||||||
can import the Prelude using `https://try.dhall-lang.org/Prelude/List/map`.
|
|
||||||
|
|
||||||
Note that imports from other domains (such as `prelude.dhall-lang.org`) will not
|
|
||||||
yet work since cross-origin resource-sharing (CORS) is not enabled. This is why
|
|
||||||
the "Try Dhall" server serves its own copy of the Prelude.
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
|
@ -6,5 +6,5 @@ let
|
||||||
in
|
in
|
||||||
{ inherit (shared) dhall dhall-bash dhall-json dhall-text;
|
{ inherit (shared) dhall dhall-bash dhall-json dhall-text;
|
||||||
|
|
||||||
inherit (shared_ghcjs) dhall-try try-dhall-server try-dhall-static;
|
inherit (shared_ghcjs) dhall-try try-dhall-static;
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,12 +270,6 @@ let
|
||||||
${pkgsNew.coreutils}/bin/install --target-directory "$TMPDIR/inst/try-dhall/js" -D $src/js/*
|
${pkgsNew.coreutils}/bin/install --target-directory "$TMPDIR/inst/try-dhall/js" -D $src/js/*
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try-dhall-server = pkgsNew.writeScriptBin "try-dhall-server" ''
|
|
||||||
${pkgsNew.haskellPackages.wai-app-static}/bin/warp --docroot ${pkgsNew.try-dhall-static}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
overlayCabal2nix = pkgsNew: pkgsOld: {
|
overlayCabal2nix = pkgsNew: pkgsOld: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user