erikmd / learn-ocaml-meetup-demo-repository

Minimal working example of a learn-ocaml source repo (slides : https://www.irit.fr/~Erik.Martin-Dorel/exposes/2022-W41_learn-ocaml_meetup.pdf)

Home Page:https://erikmd.github.io/learn-ocaml-meetup-demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

learn-ocaml-meetup-demo-repository

Minimal working example of a learn-ocaml source repository.

Remark

In the running server, only the exercises that are indexed in src/exercises/index.json will be shown.

How to run a server locally (using Docker and learn-ocaml:master)

  • Install Docker
  • Open a terminal in this folder (cd .../learn-ocaml-meetup-demo-repository/)
  • Run ./run.sh
  • Copy the teacher token that is generated (X-...-...-...-...)
  • Open http://localhost:8080/ then login using your token.
  • Open the Exercises view.
  • To stop the server:
    • type Ctrl + C from the initial terminal,
    • or run docker stop learn-ocaml-server from another terminal.

How to run a server locally (using a static binary from a release)

  • Clone this repo (git clone https://github.com/erikmd/learn-ocaml-meetup-demo-repository.git)
  • Open a terminal in this folder (cd .../learn-ocaml-meetup-demo-repository/)
  • Run the commands below to:
    • Get the learn-ocaml binary from the latest release.
    • Get the learn-ocaml-www.zip archive, and unpack it.
    • Run the server.

GNU/Linux:

mkdir server && cd server
curl -fSOL https://github.com/ocaml-sf/learn-ocaml/releases/download/v0.15.0/learn-ocaml-linux-x86_64
curl -fSOL https://github.com/ocaml-sf/learn-ocaml/releases/download/v0.15.0/learn-ocaml-www.zip
unzip learn-ocaml-www.zip
mv learn-ocaml{-linux-x86_64,}
chmod a+x learn-ocaml
./learn-ocaml --contents-dir=learn-ocaml-www --repo=../src

then two folders www and sync are created.

macOS:

mkdir server && cd server
curl -fSOL https://github.com/ocaml-sf/learn-ocaml/releases/download/v0.15.0/learn-ocaml-darwin-x86_64
curl -fSOL https://github.com/ocaml-sf/learn-ocaml/releases/download/v0.15.0/learn-ocaml-www.zip
unzip learn-ocaml-www.zip
mv learn-ocaml{-darwin-x86_64,}
chmod a+x learn-ocaml
xattr -d com.apple.quarantine learn-ocaml
./learn-ocaml --contents-dir=learn-ocaml-www --repo=../src

then two folders www and sync are created.

Finally:

  • Copy the teacher token that is generated and shown in the logs (X-...-...-...-...)
  • Open http://localhost:8080/ then login using your token.
  • Open the Exercises view.
  • If need be, type Ctrl + C to stop the server.

How to deploy a static server using GitHub Pages

About

Minimal working example of a learn-ocaml source repo (slides : https://www.irit.fr/~Erik.Martin-Dorel/exposes/2022-W41_learn-ocaml_meetup.pdf)

https://erikmd.github.io/learn-ocaml-meetup-demo/

License:MIT License


Languages

Language:OCaml 90.0%Language:Shell 10.0%