Merge branch 'master' of github.com:michaelbjames/elm-examples
This commit is contained in:
commit
4511cf0961
1 changed files with 51 additions and 37 deletions
88
README.md
88
README.md
|
@ -1,65 +1,79 @@
|
||||||
elm-examples
|
# Elm Examples
|
||||||
======================
|
|
||||||
|
|
||||||
Welcome to the starter kit!
|
A collection of simple Elm projects.
|
||||||
|
|
||||||
|
These projects are nice examples of typical Elm code *and*
|
||||||
|
are fun to play with in [Elm Reactor][reactor].
|
||||||
|
|
||||||
Setup
|
[reactor]: https://github.com/elm-lang/elm-reactor
|
||||||
--
|
|
||||||
|
## Get Set Up
|
||||||
|
|
||||||
|
#### The Easy Way
|
||||||
|
|
||||||
|
If you have `curl` and `bash` you can get setup by running [this script][setup]
|
||||||
|
with the following commands. It will set up a directory named `elm-starter-kit`
|
||||||
|
that has everything you need to get started!
|
||||||
|
|
||||||
|
[setup]: https://github.com/michaelbjames/elm-examples/blob/master/setup.sh
|
||||||
|
|
||||||
### Do you trust me?
|
|
||||||
```shell
|
```shell
|
||||||
curl https://raw.githubusercontent.com/michaelbjames/elm-examples/master/setup.sh | bash
|
curl https://raw.githubusercontent.com/michaelbjames/elm-examples/master/setup.sh | bash
|
||||||
|
../elm-reactor/dist/build/elm-reactor/elm-reactor
|
||||||
```
|
```
|
||||||
Now run `../elm-reactor/dist/build/elm-reactor/elm-reactor` to get started.
|
|
||||||
|
|
||||||
--
|
After that the Reactor should be running at [http://localhost:8000](http://localhost:8000).
|
||||||
|
Check it out!
|
||||||
|
|
||||||
If not, here's how we'll get set up.
|
#### The Hard Way
|
||||||
|
|
||||||
We need to:
|
If you don't want to run a script from the internet or just cannot run it,
|
||||||
|
follow these instructions:
|
||||||
|
|
||||||
1. Find a private spot to install into
|
Create a directory to play around in:
|
||||||
2. Clone the latest of Elm, elm-reactor, and this repository
|
|
||||||
3. Install into local sandboxes these repositories
|
|
||||||
4. Run and enjoy the examples
|
|
||||||
|
|
||||||
#### Before we do anything:
|
|
||||||
```shell
|
```shell
|
||||||
mkdir elm-starter-kit
|
mkdir elm-starter-kit
|
||||||
cd elm-starter-kit
|
cd elm-starter-kit
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Now let's get the latest from the repos we need:
|
Elm Reactor is not available with Elm Platform yet, so for now we need
|
||||||
|
to build from source. First we need to build the latest version of the
|
||||||
|
compiler:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git clone git@github.com:elm-lang/Elm.git
|
git clone git@github.com:elm-lang/Elm.git
|
||||||
git clone git@github.com:elm-lang/elm-reactor.git
|
|
||||||
git clone git@github.com:michaelbjames/elm-examples.git
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Next we need to build each
|
|
||||||
##### elm
|
|
||||||
```shell
|
|
||||||
cd elm
|
cd elm
|
||||||
cabal sandbox init
|
cabal sandbox init
|
||||||
cabal install --only-dependencies; cabal configure; cabal build; cabal install
|
cabal install -j
|
||||||
```
|
|
||||||
##### elm-reactor
|
|
||||||
```shell
|
|
||||||
cd ../elm-reactor
|
|
||||||
cabal sandbox init
|
|
||||||
cabal sandbox add-source ../elm
|
|
||||||
cabal install --only-dependencies; cabal configure; cabal build; cabal install
|
|
||||||
```
|
|
||||||
##### elm-examples
|
|
||||||
```shell
|
|
||||||
cd ../elm-examples/todo
|
|
||||||
elm --make --only-js Todo.elm
|
|
||||||
cd ..
|
cd ..
|
||||||
```
|
```
|
||||||
|
|
||||||
### Let's try it out!
|
Now we can build the Reactor:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone git@github.com:elm-lang/elm-reactor.git
|
||||||
|
cd elm-reactor
|
||||||
|
cabal sandbox init
|
||||||
|
cabal sandbox add-source ../elm
|
||||||
|
cabal install -j
|
||||||
|
cd ..
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally we can clone *this* repo and build the Todo example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git clone git@github.com:michaelbjames/elm-examples.git
|
||||||
|
cd elm-examples/todo
|
||||||
|
elm --make --only-js Todo.elm
|
||||||
|
```
|
||||||
|
|
||||||
|
And finally we can get started with the examples! Start the reactor
|
||||||
|
from the `elm-examples` directory:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
../elm-reactor/dist/build/elm-reactor/elm-reactor
|
../elm-reactor/dist/build/elm-reactor/elm-reactor
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The Reactor should be running at [http://localhost:8000](http://localhost:8000).
|
||||||
|
Check it out!
|
||||||
|
|
Loading…
Reference in a new issue