Skip to content
Permalink
Browse files

Update instructions for building the website

  • Loading branch information...
sbrunk committed Jul 13, 2019
1 parent 4c79ef8 commit 8a207fe213fa36ee3cd7566f823df16171933fd9
Showing with 17 additions and 20 deletions.
  1. +1 −1 docs/pages/api.md
  2. +15 −18 docs/pages/dev-website.md
  3. +1 −1 docs/website/pages/en/index.js
@@ -8,7 +8,7 @@ hide_title: true
The API of almond is two-fold:
- the [Ammonite API](api-ammonite.md) gives access to the REPL internals
(loading dependencies, evaluating code, getting the full classpath),
- the [almond Jupyter API](api-usage-jupyter.md) allows to communicate with
- the [almond Jupyter API](api-jupyter.md) allows to communicate with
Jupyter front-ends.

Both of these APIs can be used:
@@ -2,38 +2,35 @@
title: Generate the website
---

Install pre-requisites with
Make sure you have installed *Ammonite*, *npm* and yarn.

Then run
```bash
$ sbt \
interpreter-api/exportVersions \
interpreter-api/publishLocal \
scala-kernel-api/publishLocal
amm scripts/site.sc --npmInstall true --yarnRunBuild true --publishLocal true
```

Then run
If you're getting an error message like `Cannot resolve $file import: almond/scripts/website/Website.sc`
make sure you have checked out the git submodule for the website script:

```bash
$ scripts/generate-website.sh
git submodule init
git submodule update
```

If the generation is successful, this should print instructions to run
a small webserver serving the website, like
If the generation is successful, you can run a small webserver to serve the website locally, like

```bash
$ npx http-server docs/website/build/almond
$ npx http-server docs/website/build
```

This command should itself print the address to access the local website,
like `http://127.0.0.1:8080`.
This command should print the address to access the local website, like `http://127.0.0.1:8080`.

## Watch sources

Pass `--watch` to `generate-website.sh` above,
```bash
$ scripts/generate-website.sh --watch
```
To watch sources and rebuild/hot-reload on changes in `docs/pages` or `docs/website` run

In another terminal, go under the `docs/website` directory, and run
```bash
$ yarn start
$ amm scripts/site.sc --yarnRunBuild true --watch true
```

This should open a browser window, pointing at the locally running website.
@@ -69,7 +69,7 @@ class HomeSplash extends React.Component {
<div className="inner">
<ProjectTitle />
<PromoSection>
<Button href="https://mybinder.org/v2/gh/almond-sh/examples/master?urlpath=lab">Try it online</Button>
<Button href="https://mybinder.org/v2/gh/almond-sh/examples/master?urlpath=lab%2Ftree%2Fnotebooks%2Findex.ipynb">Try it online</Button>
<Button href={docUrl('try-docker', language)}>Try it with docker</Button>
<Button href={docUrl('quick-start-install', language)}>Install</Button>
</PromoSection>

0 comments on commit 8a207fe

Please sign in to comment.
You can’t perform that action at this time.