Skip to content

Commit

Permalink
getting-started: add create-melange-app (#165)
Browse files Browse the repository at this point in the history
* getting-started: add create-melange-app

* s/recommended/automated
  • Loading branch information
jchavarri authored Feb 27, 2024
1 parent 612dbde commit adebe36
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
# Getting started

Get up and running with Melange in no time!
Get up and running with Melange in no time! Below you will find the two main
ways to get started with Melange:
1. Automated, using
[create-melange-app](https://github.com/dmmulroy/create-melange-app)
2. Manually, using
[melange-opam-template](https://github.com/melange-re/melange-opam-template)

## Getting started (automated): `create-melange-app`

If you prefer an automated way to install the Melange toolchain, you can use
[create-melange-app](https://github.com/dmmulroy/create-melange-app) to start a
new project. To do so, run these commands:

```bash
npm create melange-app@latest
npm run dev
```

## Getting started (manual): `melange-opam-template`

If you prefer manually installing the toolchain, follow the instructions below.

## Install a package manager
### Install a package manager

To work with Melange, you need to install a package manager compatible with
OCaml. If you are not sure which one to use, we recommend
Expand All @@ -14,19 +34,17 @@ Instructions for installing opam on different operating systems can be found at
the opam [install page](https://opam.ocaml.org/doc/Install.html), and you can
find [a whole section about it](package-management.md) on this website.

## Template
### Get the template

The easiest way to get started with Melange is by using the
[melange-opam-template](https://github.com/melange-re/melange-opam-template).
You can clone it from [this
You can clone `melange-opam-template` from [this
link](https://github.com/melange-re/melange-opam-template/generate), and follow
the instructions in the [readme
file](https://github.com/melange-re/melange-opam-template/blob/main/README.md)
to configure the [local opam
switch](https://opam.ocaml.org/blog/opam-local-switches/) and download the
necessary dependencies to build the project.

## Editor integration
### Editor integration

One of the goals of Melange is to remain compatible with OCaml. One of the major
benefits of this compatibility is that developers working on Melange projects
Expand All @@ -49,12 +67,12 @@ are several options available. You can read about them in the [editor setup
page](http://ocamlverse.net/content/editor_setup.html) of the OCamlverse
documentation site.

## Alternative package managers (experimental)
### Alternative package managers (experimental)

Melange can also be used with other package managers. The following instructions
apply to [Nix](#nix) and [esy](#esy).

### [Nix](https://nixos.org/)
#### [Nix](https://nixos.org/)

Melange provides an overlay that can be:

Expand Down Expand Up @@ -105,7 +123,7 @@ Make sure [Nix](https://nixos.org/download.html) is installed. The following

To enter a Melange development shell, run `nix develop -c $SHELL`.

### [esy](https://esy.sh/)
#### [esy](https://esy.sh/)

First, make sure `esy` is
[installed](https://esy.sh/docs/en/getting-started.html#install-esy). `npm i -g
Expand Down

0 comments on commit adebe36

Please sign in to comment.