forked from ianb/doctestjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtry.html
125 lines (104 loc) · 3.17 KB
/
try.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
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="doctest.css">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Doctest.js: Try It!</title>
<meta name="description" content="Doctest.js is a Javascript testing framework">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href=".resources/boilerplate/css/normalize.min.css">
<link rel="stylesheet" href=".resources/boilerplate/css/main.css">
<link rel="stylesheet" href=".resources/doc.css">
<script src=".resources/boilerplate/js/vendor/modernizr-2.6.1.min.js"></script>
<script src="doctest.js"></script>
<!-- EXTRA_HEAD -->
<style>
#display {
width: 100%;
}
#editor {
width: 100%;
height: 15em;
}
table#layout {
width: 100%;
}
table#layout td {
vertical-align: top;
padding: 1em;
}
table#layout pre.test {
margin-top: 0;
}
#doctest-output {
height: 4em;
margin-top: -0.3em;
}
</style>
<script src=".resources/try.js"></script>
<!-- /EXTRA_HEAD -->
</head>
<body class="autodoctest">
<div class="header-container">
<header class="wrapper clearfix">
<h1 class="title"><a href="/">Doctest.js</a>: <!-- TITLE -->Try It!<!-- /TITLE --></h1>
<nav>
<ul>
<li><a href="https://github.com/ianb/doctestjs">Github</a></li>
<li><a href="/reference.html">Reference</a></li>
<li><a href="/tutorial.html">Tutorial</a></li>
</ul>
</nav>
</header>
</div>
<div class="main-container">
<div class="main wrapper clearfix">
<!-- BODY -->
<div id="doctest-output"></div>
<table id="layout">
<tr>
<td style="width: 50%">
<textarea id="editor" style="width: 100%; height: 10em">// Put your tests here
function factorial(n) {
return n <= 0 ? 1 : n * factorial(n-1);
}
print(factorial(3));
// => 10
</textarea>
<br>
<button id="testit" type="button">Test!</button>
</td>
<td>
<div id="display">
<pre id="test-location"></pre>
</div>
</td>
</tr>
</table>
<!-- /BODY -->
</div> <!-- #main -->
</div> <!-- #main-container -->
<div class="footer-container">
<footer class="wrapper">
<h3 class="no-toc">doctest.js is by <a href="http://ianbicking.org">Ian Bicking</a>.
It's on <a href="https://github.com/ianb/doctestjs">github</a>!</h3>
</footer>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src=".resources/boilerplate/js/vendor/jquery-1.8.1.min.js"><\/script>')
</script>
<script src=".resources/boilerplate/js/main.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-34921728-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>