Skip to content

Commit 0964663

Browse files
committed
Merge branch 'gh-pages'
See #132. We would like to keep all source files in a single branch and use `gh-pages` purely for hosting build artifacts. Going forward we would build the PS source and push it (along with the html, css, other js dependencies, README.md, etc.) to `gh-pages`. No edits would happen directly in `gh-pages`.
2 parents c0fdba6 + a3332b9 commit 0964663

40 files changed

+111971
-0
lines changed

client/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/bower_components/
2+
/node_modules/
3+
/.pulp-cache/
4+
/output/
5+
/generated-docs/
6+
/.psc-package/
7+
/.psc*
8+
/.purs*
9+
/.psa*
10+
/.stack*

client/.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: node_js
2+
dist: trusty
3+
sudo: required
4+
node_js: 6
5+
install:
6+
- npm install -g bower
7+
- npm install
8+
- bower install --production
9+
script:
10+
- npm run -s build

client/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
try.purescript.org

client/DEPENDENCIES

Lines changed: 2365 additions & 0 deletions
Large diffs are not rendered by default.

client/LICENSE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Copyright (c) 2013-16 PureScript
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9+
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

client/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
Try PureScript
2+
--------------
3+
4+
[Try PureScript](https://try.purescript.org) is an online PureScript code editor for quickly experimenting with PureScript code snippets and ideas.
5+
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:
16+
17+
- Writing code using the [Ace Editor](http://ace.c9.io)
18+
- Automatic compilation
19+
- PureScript syntax highlighting
20+
- Run and print output or show resulting JavaScript
21+
- Multiple view modes: code, output or both
22+
- Persistent session
23+
- Load PureScript code from Github Gists
24+
- Save PureScript code as anonymous Github Gists
25+
- (_Note: These Gists are not associated with your GitHub account and are visible to anyone with a link to them_)
26+
27+
28+
## Control Features via the Query String
29+
30+
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):
31+
32+
- **Load From Gist**: Load PureScript code from Gist id using the `gist` parameter
33+
- Example: `gist=37c3c97f47a43f20c548` will load the code from this Gist if the file was named `Main.purs`
34+
35+
- **View Mode**: Control the view mode using the `view` parameter
36+
- Options are: `code`, `output`, `both`
37+
- Example: `view=output` will only display the output
38+
39+
- **Backend**: Control which backend will compile your code using the `backend` parameter
40+
- Options are: `core`, `thermite`, `slides`, `flare`, `mathbox`, `behavior`
41+
- Example: `backend=thermite` will use the thermite backend
42+
43+
- **Auto Compile**: Automatic compilation can be turned off using the `compile` parameter
44+
- Options are: `true`, `false`
45+
- Example: `compile=false` will turn auto compilation off
46+
47+
- **JavaScript Code Generation**: Print the resulting JavaScript code in the output window instead of the output of the program using the `js` parameter
48+
- Options are: `true`, `false`
49+
- Example: `js=true` will print JavaScript code instead of the program's output
50+
51+
- **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
52+
- Usually managed by Try PureScript
53+
- Example: `session=9162f098-070f-4053-60ea-eba47021450d` (Note: will probably not work for you)
54+
- When used with the `gist` query parameter the code will be loaded from the Gist and not the session
55+
56+
## Packages
57+
58+
- 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).
59+
60+
- 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+

client/bower.json

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"name": "try-purescript",
3+
"ignore": [
4+
"**/.*",
5+
"node_modules",
6+
"bower_components",
7+
"output"
8+
],
9+
"dependencies": {
10+
"purescript-console": "^4.1.0",
11+
"purescript-foreign-generic": "^7.0.0",
12+
"purescript-jquery": "^5.0.0",
13+
"purescript-js-timers": "^4.0.1",
14+
"purescript-parallel": "^4.0.0",
15+
"purescript-prelude": "^4.1.0",
16+
"purescript-random": "^4.0.0",
17+
"purescript-web-html": "^1.2.0"
18+
},
19+
"devDependencies": {
20+
"ace": "^1.2.8",
21+
"jquery": "^3.2.1",
22+
"underscore": "^1.8.3",
23+
"react": "^16.1.0",
24+
"mathbox": "^0.0.5",
25+
"purescript-arrays": "^5.1.0",
26+
"purescript-bifunctors": "^4.0.0",
27+
"purescript-console": "^4.1.0",
28+
"purescript-const": "^4.1.0",
29+
"purescript-contravariant": "^4.0.0",
30+
"purescript-control": "^4.1.0",
31+
"purescript-distributive": "^4.0.0",
32+
"purescript-effect": "^2.0.0",
33+
"purescript-either": "^4.1.0",
34+
"purescript-enums": "^4.0.0",
35+
"purescript-exceptions": "^4.0.0",
36+
"purescript-exists": "^4.0.0",
37+
"purescript-foldable-traversable": "^4.1.0",
38+
"purescript-foreign": "^5.0.0",
39+
"purescript-foreign-object": "^1.0.0",
40+
"purescript-free": "^5.1.0",
41+
"purescript-functions": "^4.0.0",
42+
"purescript-functors": "^3.1.0",
43+
"purescript-generics-rep": "^6.1.0",
44+
"purescript-globals": "^4.0.0",
45+
"purescript-identity": "^4.1.0",
46+
"purescript-integers": "^4.0.0",
47+
"purescript-lazy": "^4.0.0",
48+
"purescript-math": "^2.1.0",
49+
"purescript-maybe": "^4.0.0",
50+
"purescript-ordered-collections": "^1.0.0",
51+
"purescript-prelude": "^4.1.0",
52+
"purescript-profunctor": "^4.0.0",
53+
"purescript-proxy": "^3.0.0",
54+
"purescript-quickcheck": "^5.0.0",
55+
"purescript-random": "^4.0.0",
56+
"purescript-refs": "^4.1.0",
57+
"purescript-semirings": "^5.0.0",
58+
"purescript-st": "^4.0.0",
59+
"purescript-strings": "^4.0.0",
60+
"purescript-tailrec": "^4.0.0",
61+
"purescript-transformers": "^4.1.0",
62+
"purescript-tuples": "^5.1.0",
63+
"purescript-typelevel-prelude": "^3.0.0",
64+
"purescript-unfoldable": "^4.0.0",
65+
"purescript-validation": "^4.0.0"
66+
}
67+
}

client/css/flare.css

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}
2+
3+
@import url(https://fonts.googleapis.com/css?family=Source+Code+Pro:400,700|Roboto:400,700);
4+
5+
body {
6+
margin: 20px;
7+
}
8+
9+
body, p, input, label, legend, h1, h2, h3, h4 {
10+
font-family: 'Roboto', sans-serif;
11+
}
12+
13+
a, a:visited, a:active, a:hover {
14+
color: #cc0000;
15+
}
16+
17+
.flare-input > label {
18+
display: inline-block;
19+
width: 150px;
20+
}
21+
22+
.flare-input {
23+
margin-bottom: 10px;
24+
}
25+
26+
.flare-input-number {
27+
width: 85px;
28+
}
29+
30+
input[type="range"] {
31+
width: 150px;
32+
border: 1px solid transparent;
33+
}
34+
35+
input:invalid {
36+
background-color: #DEAFB4;
37+
}
38+
39+
label {
40+
font-weight: bold;
41+
}
42+
43+
fieldset.flare-input-radioGroup {
44+
margin: 0px;
45+
margin-top: 15px;
46+
border: none;
47+
padding: 0px;
48+
}
49+
50+
.flare-input-radioGroup legend {
51+
padding: 0px;
52+
width: 150px;
53+
float: left;
54+
font-weight: bold;
55+
}
56+
57+
.flare-input-radioGroup label {
58+
margin-left: 3px;
59+
margin-right: 15px;
60+
cursor: pointer;
61+
font-weight: normal;
62+
}
63+
64+
code {
65+
background-color: #f0f0f0;
66+
padding-left: 3px;
67+
padding-right: 3px;
68+
}
69+
70+
.sparkle-test pre,
71+
.sparkle-test code,
72+
.sparkle-test input,
73+
.sparkle-test label,
74+
.sparkle-test legend,
75+
.sparkle-test select,
76+
.sparkle-test textarea {
77+
font-family: 'Source Code Pro', monospace;
78+
}
79+
80+
fieldset.sparkle-test {
81+
margin-top: 15px;
82+
margin-bottom: 40px;
83+
max-width: 800px;
84+
border: 1px solid #666;
85+
border-radius: 3px;
86+
padding: .35em .625em .75em;
87+
}
88+
89+
fieldset.sparkle-test > legend {
90+
background-color: #f0f0f0;
91+
border: 1px solid #666;
92+
border-radius: 3px;
93+
float: initial;
94+
width: initial;
95+
}
96+
97+
.sparkle-test pre {
98+
background-color: #f0f0f0;
99+
padding: 10px;
100+
max-width: 780px;
101+
102+
/* http://stackoverflow.com/a/248013/704831 */
103+
white-space: pre-wrap; /* CSS 3 */
104+
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
105+
white-space: -pre-wrap; /* Opera 4-6 */
106+
white-space: -o-pre-wrap; /* Opera 7 */
107+
word-wrap: break-word; /* Internet Explorer 5.5+ */
108+
}
109+
110+
.sparkle-test .flare-input {
111+
margin-bottom: 5px;
112+
}
113+
114+
.sparkle-test input:not([type="range"]) {
115+
padding: 3px;
116+
border-radius: 3px;
117+
border: 1px solid #888;
118+
}
119+
120+
.sparkle-test input:invalid {
121+
background-color: #DEAFB4;
122+
}
123+
124+
.sparkle-test .flare-input-number,
125+
.sparkle-test .flare-input-int-number {
126+
width: 80px;
127+
}
128+
129+
.sparkle-test fieldset {
130+
border-radius: 3px;
131+
margin-top: 5px;
132+
margin-bottom: 20px;
133+
}
134+
135+
.sparkle-test label {
136+
width: 160px;
137+
display: inline-block;
138+
}
139+
140+
.sparkle-test legend {
141+
padding: 2px 6px;
142+
font-weight: 700;
143+
}
144+
145+
.sparkle-test .flare-input-list button {
146+
margin-left: 5px;
147+
margin-right: 5px;
148+
}
149+
150+
.sparkle-test .sparkle-okay {
151+
background-color: #B4DEAF;
152+
}
153+
154+
.sparkle-test .sparkle-warn {
155+
background-color: #DEAFB4;
156+
}
157+
158+
.sparkle-string {
159+
color: #E91E63;
160+
}
161+
162+
.sparkle-number {
163+
color: #1339E8;
164+
}
165+
166+
.sparkle-boolean {
167+
font-weight: bold;
168+
}
169+
170+
.sparkle-constructor {
171+
font-weight: bold;
172+
}
173+
174+
.sparkle-record-field {
175+
font-style: italic;
176+
}
177+
178+
.sparkle-color {
179+
width: 1em;
180+
height: 1em;
181+
margin-right: 0.5em;
182+
display: inline-block;
183+
}
184+
185+
.sparkle-tooltip {
186+
cursor: default;
187+
}
188+
189+
.sparkle-tooltip:hover {
190+
background-color: #f2e7a6;
191+
}
192+
193+
.sparkle-tooltip > .sparkle-tooltip:hover {
194+
background-color: #e9d563;
195+
}
196+
197+
.sparkle-tooltip > .sparkle-tooltip > .sparkle-tooltip:hover {
198+
background-color: #dfc220;
199+
}
200+
201+
.sparkle-tooltip > .sparkle-tooltip > .sparkle-tooltip > .sparkle-tooltip:hover {
202+
background-color: #938015;
203+
}
204+
205+
.sparkle-tooltip > .sparkle-tooltip > .sparkle-tooltip > .sparkle-tooltip > .sparkle-tooltip:hover {
206+
background-color: #62560e;
207+
}

0 commit comments

Comments
 (0)