-
Notifications
You must be signed in to change notification settings - Fork 3
/
view.html
152 lines (135 loc) · 7.45 KB
/
view.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<!DOCTYPE html>
<!--
~ This file is part of gorilla-repl. Copyright (C) 2014-, Jony Hudson.
~
~ gorilla-repl is licenced to you under the MIT licence. See the file LICENCE.txt for full details.
-->
<html id="document">
<head>
<link rel="shortcut icon" href="favicon.ico"/>
<link href='http://fonts.googleapis.com/css?family=Arvo:400,700,400italic,700italic|Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<!--<link href='css/fonts.css' rel='stylesheet' type='text/css'/>-->
<link rel="stylesheet" href="jslib/codemirror-4.5/lib/codemirror.css"/>
<link rel="stylesheet" href="css/worksheet.css"/>
<link rel="stylesheet" href="css/output.css"/>
<link rel="stylesheet" href="css/viewer.css"/>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG-full.js&delayStartupUntil=configured"></script>
<script type="text/javascript" src="jslib/marked/marked.min.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/lib/codemirror.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/addon/runmode/runmode.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/addon/runmode/colorize.js"></script>
<script type="text/javascript" src="jslib/codemirror-4.5/mode/clojure/clojure.js"></script>
<script type="text/javascript" src="jslib/jquery/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="jslib/underscore/underscore.min.js"></script>
<script type="text/javascript" src="jslib/knockoutjs/knockout-3.0.0.min.js"></script>
<script type="text/javascript" src="jslib/d3/d3.v3.min.js"></script>
<script type="text/javascript" src="jslib/d3/d3.geo.projection.min.js"></script>
<script type="text/javascript" src="jslib/vega/vega.1.3.3.min.js"></script>
<script type="text/javascript" src="jslib/uuid/uuid.core.js"></script>
<script type="text/javascript" src="js/worksheetParser.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/mathJaxViewer.js"></script>
<script type="text/javascript" src="js/outputViewer.js"></script>
<script type="text/javascript" src="js/renderer.js"></script>
<script type="text/javascript" src="js-viewer/segment-viewer.js"></script>
<script type="text/javascript" src="js-viewer/worksheet-viewer.js"></script>
<script type="text/javascript" src="js-viewer/github.js"></script>
<script type="text/javascript" src="js-viewer/bitbucket.js"></script>
<script type="text/javascript" src="js-viewer/main-viewer.js"></script>
<title data-bind="text: title">Gorilla REPL viewer</title>
</head>
<body>
<!-- The page stub -->
<div class="header">
<div class="header-left">Made with <a href="http://clojure.org" target="_blank">Clojure</a> and
<a href="http://gorilla-repl.org" target="_blank">Gorilla REPL</a></div>
<div class="header-right">
<a href="#" data-bind="click: showCopyBox">View this worksheet on <span data-bind="text: host"></span></a>
</div>
</div>
<div id="contents" data-bind="css: {veiled: copyBoxVisible}">
<div class="segment container-segment">
<div class="container-children">
<div data-bind="template: {name: 'segment-template', foreach: worksheet().segments()}">
</div>
</div>
</div>
</div>
<div class="scroll-pad"></div>
<!-- Templates -->
<script type="text/html" id="segment-template">
<div data-bind="template: {name: renderTemplate}"></div>
</script>
<script type="text/html" id="code-segment-template">
<div class="segment code">
<div class="segment-main">
<pre class="static-code clojure"><code data-bind="text: contents"></code></pre>
</div>
<div class="error-text" data-bind="text: errorText, visible: errorText() !== ''"></div>
<div class="console-text" data-bind="visible: consoleText() !== ''">
<pre><code data-bind="html: consoleText"></code></pre>
</div>
<div class="output"
data-bind="visible: (output() != ''), outputViewer: output, segmentID: id">
</div>
<div class="segment-footer"></div>
</div>
</script>
<script type="text/html" id="free-segment-template">
<div class="segment free">
<div class="segment-main">
<div class="free-preview" data-bind="mathJaxViewer: renderedContent"></div>
</div>
<div class="segment-footer"></div>
</div>
</script>
<!-- Copying instructions -->
<div class="copyBox" style="display: none" data-bind="visible: copyBoxVisible">
<p>This code can be found on <span data-bind="text: host"></span> here:</p>
<div data-bind="visible: (!(source().toLowerCase() === 'gist'))">
<a data-bind="attr: {href: sourceURL}, text: sourceURL" target="_blank"></a>
</div>
<div data-bind="visible: (source().toLowerCase() === 'gist')">
<a data-bind="attr: {href: sourceURL}, text: sourceURL" target="_blank"></a>
</div>
<p>You can run and edit your own copy of this worksheet in under five minutes, even if you've never used
Clojure or Gorilla REPL before:</p>
<div data-bind="visible: (!(source().toLowerCase() === 'gist'))">
<ul>
<li>If you don't yet have Leiningen installed, then follow the instructions
<a href="http://leiningen.org/#install" target="_blank">here</a>. It only takes a couple of minutes.</li>
<li>Clone the <span data-bind="text: host"></span> project that contains this worksheet:
<a data-bind="attr: {href: sourceURL}, text: sourceURL" target="_blank"></a>.</li>
<li>Open a terminal in the project directory and run "lein gorilla".</li>
<li>Open the load dialog by pressing "alt+g alt+l" ("ctrl+g ctrl+l" on Mac).</li>
<li>Enter the path "<span data-bind="text: filename"></span>" into the dialog.</li>
</ul>
</div>
<div data-bind="visible: (source().toLowerCase() === 'gist')">
<ul>
<li>If you don't have Gorilla REPL installed yet, then follow the instructions
<a href="http://gorilla-repl.org/start.html" target="_blank">here</a>.
</li>
<li>Download the worksheet from the GitHub gist:
<a data-bind="attr: {href: sourceURL}, text: sourceURL" target="_blank"></a>.</li>
<li>Assuming you've added the Gorilla plugin to your "profiles.clj", as described in the getting started
instructions from step one, then run "lein gorilla"</li>
<li>Open the load dialog by pressing "alt+g alt+l" ("ctrl+g ctrl+l" on Mac).</li>
<li>Enter the path to the file you saved in step two.</li>
</ul>
</div>
<p>That's it, you're done. Have fun!</p>
<div class="button" data-bind="click: hideCopyBox">OK, got it</div>
</div>
</body>
<script>
(function(){
var t,i,e,n=window,o=document,a=arguments,s="script",r=["config","track","identify","visit","push","call","trackForm","trackClick"],c=function(){var t,i=this;for(i._e=[],t=0;r.length>t;t++)(function(t){i[t]=function(){return i._e.push([t].concat(Array.prototype.slice.call(arguments,0))),i}})(r[t])};for(n._w=n._w||{},t=0;a.length>t;t++)n._w[a[t]]=n[a[t]]=n[a[t]]||new c;i=o.createElement(s),i.async=1,i.src="//static.woopra.com/js/t/5.js",e=o.getElementsByTagName(s)[0],e.parentNode.insertBefore(i,e)
})("woopra");
woopra.config({
domain: 'gorilla-repl.org'
});
woopra.track();
</script>
</html>