Skip to content

Commit 7b317b7

Browse files
Gil Mizrahipaf31
authored andcommitted
Add a "How to Add a New Backend" guide (#87)
1 parent 0621c92 commit 7b317b7

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ Try PureScript
33

44
[Try PureScript](https://try.purescript.org) is an online PureScript code editor for quickly experimenting with PureScript code snippets and ideas.
55

6-
### Features:
6+
## How to Add a New Backend
7+
8+
- Create a `bower.json`/`psc-package.json` file with all the dependencies you want to be available for the library backend and optionally an extra `Try` module if you want. [Example PR](https://github.com/purescript/trypurescript/pull/84/files)
9+
- Write an example in a github gist and name it `Main.purs`. [Example Gist](https://gist.github.com/ff1e87f0872d2d891e77d209d8f7706d)
10+
- add a backend button and a backend option in `index.html` and `index.js` respectively. [Example PR](https://github.com/purescript/trypurescript/pull/85/files)
11+
- Note to link the gist from the previous bullet in the `mainGist` field in `index.js`
12+
- Ask phil to update the `core` main gist to link to the new backend
13+
14+
15+
## Features:
716

817
- Writing code using the [Ace Editor](http://ace.c9.io)
918
- Automatic compilation
@@ -16,19 +25,19 @@ Try PureScript
1625
- (_Note: These Gists are not associated with your GitHub account and are visible to anyone with a link to them_)
1726

1827

19-
### Control Features via the Query String
28+
## Control Features via the Query String
2029

2130
Most of these features can be controlled not only from the toolbar, but also using the [query parameters](https://en.wikipedia.org/wiki/Query_string):
2231

2332
- **Load From Gist**: Load PureScript code from Gist id using the `gist` parameter
24-
- Example: `gist=37c3c97f47a43f20c548` will load the code from this Gist
33+
- Example: `gist=37c3c97f47a43f20c548` will load the code from this Gist if the file was named `Main.purs`
2534

2635
- **View Mode**: Control the view mode using the `view` parameter
2736
- Options are: `code`, `output`, `both`
2837
- Example: `view=output` will only display the output
2938

3039
- **Backend**: Control which backend will compile your code using the `backend` parameter
31-
- Options are: `core`, `thermite`, `slides`, `flare`, `mathbox`
40+
- Options are: `core`, `thermite`, `slides`, `flare`, `mathbox`, `behavior`
3241
- Example: `backend=thermite` will use the thermite backend
3342

3443
- **Auto Compile**: Automatic compilation can be turned off using the `compile` parameter
@@ -44,8 +53,10 @@ Most of these features can be controlled not only from the toolbar, but also usi
4453
- Example: `session=9162f098-070f-4053-60ea-eba47021450d` (Note: will probably not work for you)
4554
- When used with the `gist` query parameter the code will be loaded from the Gist and not the session
4655

47-
### Packages
56+
## Packages
4857

4958
- The packages set and compiler version for Try-PureScript can be viewed [here](https://github.com/purescript/trypurescript/tree/master/staging/core/psc-package.json).
5059

5160
- The packages set and compiler version for Try-Thermite can be viewed [here](https://github.com/paf31/try-thermite/blob/gh-pages/staging/psc-package.json).
61+
62+

0 commit comments

Comments
 (0)