You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Notes: the file should be a single PureScript module with the module name `Main`.
25
+
26
+
-**Load From Gist**: Load PureScript code from a gist using the `gist` parameter
27
+
- Format: `gist=<gist id>`
28
+
- Example: `gist=37c3c97f47a43f20c548`
29
+
- Notes: the file should be named `Main.purs` with the module name `Main`.
30
+
31
+
-**View Mode**: Control the view mode using the `view` parameter
32
+
- Options are: `code`, `output`, `both` (default)
33
+
- Example: `view=output` will only display the output
34
+
35
+
-**Auto Compile**: Automatic compilation can be turned off using the `compile` parameter
36
+
- Options are: `true` (default), `false`
37
+
- Example: `compile=false` will turn auto compilation off
38
+
39
+
-**JavaScript Code Generation**: Print the resulting JavaScript code in the output window instead of the output of the program using the `js` parameter
40
+
- Options are: `true`, `false` (default)
41
+
- Example: `js=true` will print JavaScript code instead of the program's output
42
+
43
+
-**Session**: Load code from a session which is stored with [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) using the `session` parameter
44
+
- Usually managed by Try PureScript
45
+
- Example: `session=9162f098-070f-4053-60ea-eba47021450d` (Note: will probably not work for you)
46
+
- When used with the `gist` or `github` query parameters the code will be loaded from the source file and not the session
47
+
48
+
### Which Libraries Are Available?
18
49
19
50
Try PureScript aims to provide a complete, recent package set from <https://github.com/purescript/package-sets>. The available libraries are those listed in `staging/spago.dhall`, at the versions in the package set mentioned in `staging/packages.dhall`.
Before deploying an updated package set, someone (your reviewer) should check that the memory required to hold the package set's externs files does not exceed that of the try.purescript.org server.
43
74
44
-
### Control Features via the Query String
45
-
46
-
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):
47
-
48
-
-**Load From Gist**: Load PureScript code from Gist id using the `gist` parameter
49
-
- Example: `gist=37c3c97f47a43f20c548` will load the code from this Gist if the file was named `Main.purs`
50
-
51
-
-**View Mode**: Control the view mode using the `view` parameter
52
-
- Options are: `code`, `output`, `both` (default)
53
-
- Example: `view=output` will only display the output
54
-
55
-
-**Auto Compile**: Automatic compilation can be turned off using the `compile` parameter
56
-
- Options are: `true` (default), `false`
57
-
- Example: `compile=false` will turn auto compilation off
58
-
59
-
-**JavaScript Code Generation**: Print the resulting JavaScript code in the output window instead of the output of the program using the `js` parameter
60
-
- Options are: `true`, `false` (default)
61
-
- Example: `js=true` will print JavaScript code instead of the program's output
62
-
63
-
-**Session**: Load code from a session which is stored with [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) using the `session` parameter
64
-
- Usually managed by Try PureScript
65
-
- Example: `session=9162f098-070f-4053-60ea-eba47021450d` (Note: will probably not work for you)
66
-
- When used with the `gist` query parameter the code will be loaded from the Gist and not the session
# then: Setting phasers to stun... (port 8081) (ctrl-c to quit)
99
106
```
100
107
108
+
### 3. Choosing a Tag
109
+
110
+
The built-in examples for Try PureScript are loaded from this GitHub repository. To change the tag that the examples are loaded from, you'll need to touch three files:
111
+
112
+
*`client/config/dev/Try.Config.purs`
113
+
*`client/config/prod/Try.Config.purs`
114
+
*`client/examples/Main.purs`, in the `fromExample` function.
115
+
116
+
If you are preparing a release or if you need to adjust examples in development, you should change the tag in these three places (and ensure you're using the same tag in each place!).
117
+
101
118
## Server API
102
119
103
120
The server is a very basic web service which wraps the PureScript compiler, allowing clients to send PureScript code to be compiled and receiving either compiled JS or error messages in response.
, p (text "Try out the examples below, or create your own!")
14
+
, h2 (text "Examples")
15
+
, list (map fromExample examples)
16
+
, h2 (text "Share Your Code")
17
+
, p (text "A PureScript file can be loaded from GitHub from a gist or a repository. To share code using a gist, simply include the gist ID in the URL as follows:")
0 commit comments