Skip to content

Commit adebe36

Browse files
authored
getting-started: add create-melange-app (#165)
* getting-started: add create-melange-app * s/recommended/automated
1 parent 612dbde commit adebe36

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

docs/getting-started.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
# Getting started
22

3-
Get up and running with Melange in no time!
3+
Get up and running with Melange in no time! Below you will find the two main
4+
ways to get started with Melange:
5+
1. Automated, using
6+
[create-melange-app](https://github.com/dmmulroy/create-melange-app)
7+
2. Manually, using
8+
[melange-opam-template](https://github.com/melange-re/melange-opam-template)
9+
10+
## Getting started (automated): `create-melange-app`
11+
12+
If you prefer an automated way to install the Melange toolchain, you can use
13+
[create-melange-app](https://github.com/dmmulroy/create-melange-app) to start a
14+
new project. To do so, run these commands:
15+
16+
```bash
17+
npm create melange-app@latest
18+
npm run dev
19+
```
20+
21+
## Getting started (manual): `melange-opam-template`
22+
23+
If you prefer manually installing the toolchain, follow the instructions below.
424

5-
## Install a package manager
25+
### Install a package manager
626

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

17-
## Template
37+
### Get the template
1838

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

29-
## Editor integration
47+
### Editor integration
3048

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

52-
## Alternative package managers (experimental)
70+
### Alternative package managers (experimental)
5371

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

57-
### [Nix](https://nixos.org/)
75+
#### [Nix](https://nixos.org/)
5876

5977
Melange provides an overlay that can be:
6078

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

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

108-
### [esy](https://esy.sh/)
126+
#### [esy](https://esy.sh/)
109127

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

0 commit comments

Comments
 (0)