Skip to content

Commit e51feac

Browse files
author
keb
committed
fix errors and indentation
1 parent 06a9cdc commit e51feac

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

docs/installation.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ $ npm install -D MithrilJS/mithril.d.ts#next
4444

4545
### Create a project locally
4646

47-
You can use one of several existing Mithril starter templates such as
48-
* [mithril-esbuild-starter](https://github.com/kevinfiol/mithril-esbuild-starter)
47+
You can use one of several existing Mithril.js starter templates such as
4948
* [mithril-vite-starter](https://github.com/ArthurClemens/mithril-vite-starter)
49+
* [mithril-esbuild-starter](https://github.com/kevinfiol/mithril-esbuild-starter)
5050
* [mithril-rollup-starter](https://github.com/kevinfiol/mithril-rollup-starter)
5151

5252
For example, if you'd like to get started with `mithril-esbuild-starter`, run the following commands:
@@ -66,55 +66,56 @@ npm run dev
6666

6767
### Quick start with [esbuild](https://esbuild.github.io/)
6868

69-
1. Initialize the directory as an npm package
69+
1. Initialize the directory as an npm package.
7070
```bash
7171
$ npm init --yes
7272
```
7373

74-
2. install required tools
74+
2. Install required tools.
7575
```bash
7676
$ npm install mithril
7777
$ npm install esbuild --save-dev
7878
```
7979

8080
3. Add a "start" entry to the scripts section in `package.json`.
81-
```json
82-
{
83-
"...": "...",
84-
"scripts": {
85-
"start": "esbuild ./src/index.js --bundle --outfile=./bin/main.js --watch"
81+
```json
82+
{
83+
"...": "...",
84+
"scripts": {
85+
"start": "esbuild index.js --bundle --outfile=bin/main.js --watch"
86+
}
8687
}
87-
}
88-
```
88+
```
8989

90-
Optionally, if you'd like to use JSX, you can use the `--jsx-factory` and `--jsx-fragment` flags with esbuild.
90+
Optionally, if you'd like to use JSX, you can use the `--jsx-factory` and `--jsx-fragment` flags with esbuild.
9191

92-
```json
93-
{
94-
"...": "...",
95-
"scripts": {
96-
"start": "esbuild src/index.js --bundle --outfile=public/app.js --jsx-factory=m --jsx-fragment='\"[\"' --watch"
92+
```json
93+
{
94+
"...": "...",
95+
"scripts": {
96+
"start": "esbuild index.js --bundle --outfile=bin/main.js --jsx-factory=m --jsx-fragment='\"[\"' --watch"
97+
}
9798
}
98-
}
99-
```
99+
```
100100

101-
4. Create `src/index.js` file.
101+
4. Create `index.js` file.
102102
```javascript
103103
import m from "mithril";
104-
m.render(document.body, "hello world");
104+
m.render(document.getElementById("app"), "hello world");
105105
```
106106

107-
5. create `index.html`
107+
5. Create `index.html` file.
108108
```html
109109
<!DOCTYPE html>
110110
<body>
111+
<div id="app"></div>
111112
<script src="bin/main.js"></script>
112113
</body>
113114
```
114115

115-
6. run bundler
116+
6. Run your bundler script.
116117
```bash
117118
$ npm run start
118119
```
119120

120-
7. open `index.html` in a browser
121+
7. Open `index.html` in a browser. You should see `hello world` rendered on your page.

0 commit comments

Comments
 (0)