-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpages.ml
540 lines (473 loc) · 23.1 KB
/
pages.ml
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
(*
* iocamlserver - IOCaml notebook server
*
* (c) 2014 MicroJamJar Ltd
*
* Author(s): [email protected]
* Description: HTML page templates
*
*)
(* see ipython/html/templates/page.html etc *)
(*
Cow uses xmlm which is a XML codec. We want to write HTML5.
If you have something like;
<script ...></script>
cow will rewrite this to;
<script .../>
Thats quite proper XML but not HTML5 in which, according to the spec,
the trailing '/' is silently dropped. This buggers up the document
structure as there is no end tag, unless its a so called void element
in which case there should be no end tag at all. In those cases the
trailing '/' is ok.
A quick and dirty fix is simply to include a space between the open
and closing tags and xmlm will not rewrite it to a self closing tag.
These are the void elements where we are OK.
area, base, br, col, command, embed, hr, img, input,
keygen, link, meta, param, source, track, wbr
We have problems with these tags below and I've bodged the ones I
could find.
script, div and li
A not unreasonable approach might be to rewrite this in XHTML at
some point.
*)
open Cow
let empty = <:html< >>
let page
title
base_project_url static_url
data_project
data_base_project_url
data_base_kernel_url
data_notebook_id
body_class
stylesheet header site script =
<:html<
<html>
<head>
<meta charset="utf-8"></meta>
<title>$str:title$</title>
<link rel="shortcut icon" type="image/x-icon" href=$str:static_url "base/images/favicon.ico"$ />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<link rel="stylesheet" href=$str:static_url "components/jquery-ui/themes/smoothness/jquery-ui.min.css"$ type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- XXX or less -->
$stylesheet$
<link rel="stylesheet" href=$str:static_url "custom/custom.css" $ type="text/css" />
<script src=$str:static_url "components/requirejs/require.js"$ type="text/javascript" charset="utf-8"> </script>
<script>
require.config({
baseUrl: '$str:static_url ""$',
});
</script>
</head>
<body
data-project=$str:data_project$
data-base-project-url=$str:data_base_project_url$
data-base-kernel-url=$str:data_base_kernel_url$
data-notebook-id=$str:data_notebook_id$
class=$str:body_class$
>
<noscript>
<div id='noscript'>
IPython Notebook requires JavaScript.<br/>
Please enable it to proceed.
</div>
</noscript>
<div id="header" class="navbar navbar-static-top">
<div class="navbar-inner navbar-nobg">
<div class="container">
<div id="ipython_notebook" class="nav brand pull-left">
<a href="$str:base_project_url$" alt='dashboard'>
<img src=$str:static_url "base/images/ipynblogo.png"$
alt='IPython Notebook'/>
</a>
</div>
<!-- XXX login-widget -->
$header$
</div>
</div>
</div>
<div id="site">
$site$
</div>
<script src=$str:static_url "components/jquery/jquery.min.js"$
type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "components/jquery-ui/ui/minified/jquery-ui.min.js"$
type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "components/bootstrap/bootstrap/js/bootstrap.min.js"$
type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "base/js/namespace.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "base/js/page.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "auth/js/loginwidget.js"$ type="text/javascript" charset="utf-8"> </script>
<!-- XXX if use_less -->
$script$
<script src=$str:static_url "custom/custom.js"$ type="text/javascript" charset="utf-8"> </script>
</body>
</html>
>>
let notebook_stylesheet mathjax_url static_url =
let mathjax_url' = mathjax_url ^ "?config=TeX-AMS_HTML-full&delayStartupUntil=configured" in
<:html<
<script type="text/javascript"
src=$str:mathjax_url'$
charset="utf-8">
</script>
<script type="text/javascript">
// MathJax disabled, set as null to distingish from *missing* MathJax,
// where it will be undefined, and should prompt a dialog later.
window.mathjax_url = '$str:mathjax_url$';
</script>
<!--
<script type="text/javascript">
window.mathjax_url = '';
</script>
-->
<link rel="stylesheet" href=$str:static_url "components/codemirror/lib/codemirror.css"$ />
<link rel="stylesheet" href=$str:static_url "style/style.min.css"$ type="text/css"/>
<link rel="stylesheet" href=$str:static_url "notebook/css/override.css"$ type="text/css" />
>>
let notebook_header =
<:html<
<span id="save_widget" class="nav pull-left">
<span id="notebook_name"> </span>
<span id="checkpoint_status"> </span>
<span id="autosave_status"> </span>
</span>
>>
let notebook_site online js_kernel =
let file_menu =
if online then
<:html<
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">File</a>
<ul class="dropdown-menu">
<li id="download_ipynb"><a href="#">Download Notebook (.ipynb)</a></li>
</ul>
</li>
>>
else
<:html<
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">File</a>
<ul class="dropdown-menu">
<li id="new_notebook"><a href="#">New</a></li>
<li id="open_notebook"><a href="#">Open...</a></li>
<!-- <hr/> -->
<li class="divider"> </li>
<li id="copy_notebook"><a href="#">Make a Copy...</a></li>
<li id="rename_notebook"><a href="#">Rename...</a></li>
<li id="save_checkpoint"><a href="#">Save and Checkpoint</a></li>
<!-- <hr/> -->
<li class="divider"> </li>
<li id="restore_checkpoint" class="dropdown-submenu"><a href="#">Revert to Checkpoint</a>
<ul class="dropdown-menu">
<li><a href="#"> </a></li>
<li><a href="#"> </a></li>
<li><a href="#"> </a></li>
<li><a href="#"> </a></li>
<li><a href="#"> </a></li>
</ul>
</li>
<li class="divider"> </li>
<li class="dropdown-submenu"><a href="#">Download as</a>
<ul class="dropdown-menu">
<li id="download_ipynb"><a href="#">IPython (.ipynb)</a></li>
<li id="download_py"><a href="#">Python (.py)</a></li>
</ul>
</li>
<li class="divider"> </li>
<li id="kill_and_exit"><a href="#" >Close and halt</a></li>
</ul>
</li>
>>
in
let kernel_menu =
if js_kernel then
<:html< >>
else
<:html<
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Kernel</a>
<ul class="dropdown-menu">
<li id="int_kernel"><a href="#">Interrupt</a></li>
<li id="restart_kernel"><a href="#">Restart</a></li>
</ul>
</li>
>>
in
<:html<
<div id="menubar-container" class="container">
<div id="menubar">
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<ul id="menus" class="nav">
$file_menu$
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Edit</a>
<ul class="dropdown-menu">
<li id="cut_cell"><a href="#">Cut Cell</a></li>
<li id="copy_cell"><a href="#">Copy Cell</a></li>
<li id="paste_cell_above" class="disabled"><a href="#">Paste Cell Above</a></li>
<li id="paste_cell_below" class="disabled"><a href="#">Paste Cell Below</a></li>
<li id="paste_cell_replace" class="disabled"><a href="#">Paste Cell & Replace</a></li>
<li id="delete_cell"><a href="#">Delete Cell</a></li>
<li id="undelete_cell" class="disabled"><a href="#">Undo Delete Cell</a></li>
<li class="divider"> </li>
<li id="split_cell"><a href="#">Split Cell</a></li>
<li id="merge_cell_above"><a href="#">Merge Cell Above</a></li>
<li id="merge_cell_below"><a href="#">Merge Cell Below</a></li>
<li class="divider"> </li>
<li id="move_cell_up"><a href="#">Move Cell Up</a></li>
<li id="move_cell_down"><a href="#">Move Cell Down</a></li>
<li class="divider"> </li>
<li id="select_previous"><a href="#">Select Previous Cell</a></li>
<li id="select_next"><a href="#">Select Next Cell</a></li>
</ul>
</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">View</a>
<ul class="dropdown-menu">
<li id="toggle_header"><a href="#">Toggle Header</a></li>
<li id="toggle_toolbar"><a href="#">Toggle Toolbar</a></li>
</ul>
</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Insert</a>
<ul class="dropdown-menu">
<li id="insert_cell_above"><a href="#">Insert Cell Above</a></li>
<li id="insert_cell_below"><a href="#">Insert Cell Below</a></li>
</ul>
</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Cell</a>
<ul class="dropdown-menu">
<li id="run_cell"><a href="#">Run</a></li>
<li id="run_cell_in_place"><a href="#">Run in Place</a></li>
<li id="run_all_cells"><a href="#">Run All</a></li>
<li id="run_all_cells_above"><a href="#">Run All Above</a></li>
<li id="run_all_cells_below"><a href="#">Run All Below</a></li>
<li class="divider"> </li>
<li id="change_cell_type" class="dropdown-submenu"><a href="#">Cell Type</a>
<ul class="dropdown-menu">
<li id="to_code"><a href="#">Code</a></li>
<li id="to_markdown"><a href="#">Markdown </a></li>
<li id="to_raw"><a href="#">Raw Text</a></li>
<li id="to_heading1"><a href="#">Heading 1</a></li>
<li id="to_heading2"><a href="#">Heading 2</a></li>
<li id="to_heading3"><a href="#">Heading 3</a></li>
<li id="to_heading4"><a href="#">Heading 4</a></li>
<li id="to_heading5"><a href="#">Heading 5</a></li>
<li id="to_heading6"><a href="#">Heading 6</a></li>
</ul>
</li>
<li class="divider"> </li>
<li id="toggle_output"><a href="#">Toggle Current Output</a></li>
<li id="all_outputs" class="dropdown-submenu"><a href="#">All Output</a>
<ul class="dropdown-menu">
<li id="expand_all_output"><a href="#">Expand</a></li>
<li id="scroll_all_output"><a href="#">Scroll Long</a></li>
<li id="collapse_all_output"><a href="#">Collapse</a></li>
<li id="clear_all_output"><a href="#">Clear</a></li>
</ul>
</li>
</ul>
</li>
$kernel_menu$
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Help</a>
<ul class="dropdown-menu">
<li><a href="http://caml.inria.fr" target="_blank">OCaml</a></li>
<li><a href="http://ocaml.org" target="_blank">OCaml Community</a></li>
<li class="divider"> </li>
<li><a href="http://opam.ocaml.org/" target="_blank">Opam Package Manager</a></li>
<li><a href="https://github.com/ocaml/ocaml" target="_blank">OCaml On Github</a></li>
<li><a href="http://caml.inria.fr/cgi-bin/viewvc.cgi/ocaml" target="_blank">OCaml SVN</a></li>
<li class="divider"> </li>
<li><a href="http://caml.inria.fr/pub/docs/manual-ocaml" target="_blank">OCaml Manual</a></li>
<li><a href="http://realworldocaml.org" target="_blank">Real World OCaml</a></li>
<li><a href="https://github.com/rizo/awesome-ocaml" target="_blank">Awesome OCaml!</a></li>
<li class="divider"> </li>
<li><a href="https://github.com/andrewray/iocaml" target="_blank">IOCaml Kernel On Github</a></li>
<li><a href="https://github.com/andrewray/iocamlserver" target="_blank">IOCaml Server On Github</a></li>
<li><a href="https://github.com/andrewray/iocamljs" target="_blank">IOCamlJS Kernel On Github</a></li>
<li><a href="http://andrewray.github.io/iocamljs" target="_blank">IOCamlJS Demos</a></li>
<li class="divider"> </li>
<li><a href="http://ipython.org/documentation.html" target="_blank">IPython Help</a></li>
<li><a href="http://ipython.org/ipython-doc/stable/interactive/notebook.html" target="_blank">Notebook Help</a></li>
<li id="keyboard_shortcuts"><a href="#">Keyboard Shortcuts</a></li>
</ul>
</li>
</ul>
<div id="notification_area"> </div>
</div>
</div>
</div>
</div>
<div id="maintoolbar" class="navbar">
<div class="toolbar-inner navbar-inner navbar-nobg">
<div id="maintoolbar-container" class="container"> </div>
</div>
</div>
</div>
<div id="ipython-main-app">
<div id="notebook_panel">
<div id="notebook"> </div>
<div id="pager_splitter"> </div>
<div id="pager">
<div id='pager_button_area'>
</div>
<div id="pager-container" class="container"> </div>
</div>
</div>
</div>
<div id='tooltip' class='ipython_tooltip' style='display:none'> </div>
>>
let notebook_scripts static_url kernel =
let kernel =
let kpath = "services/kernels/js/kernel" in
static_url
(match kernel with
| `byte_code_kernel | `js_kernel_file(_) -> kpath ^ ".js"
| `js_kernel(_, t) -> kpath ^ "." ^ t ^ ".js")
in
<:html<
<script src=$str:static_url "components/codemirror/lib/codemirror.js"$ charset="utf-8"> </script>
<script type="text/javascript">
CodeMirror.modeURL = '$str:static_url "components/codemirror/mode/%N/%N.js"$';
</script>
<script src=$str:static_url "components/codemirror/addon/mode/loadmode.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/addon/mode/multiplex.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/addon/mode/overlay.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/addon/edit/matchbrackets.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/addon/comment/comment.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/mode/htmlmixed/htmlmixed.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/mode/xml/xml.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/mode/javascript/javascript.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/mode/css/css.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/mode/rst/rst.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/mode/markdown/markdown.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/mode/gfm/gfm.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/codemirror/mode/python/python.js"$ charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/codemirror-ipython.js"$ charset="utf-8"> </script>
<script src=$str:static_url "components/highlight.js/build/highlight.pack.js"$ charset="utf-8"> </script>
<script src=$str:static_url "dateformat/date.format.js"$ charset="utf-8"> </script>
<script src=$str:static_url "base/js/events.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "base/js/utils.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "base/js/dialog.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/layoutmanager.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/mathjaxutils.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/outputarea.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/cell.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/celltoolbar.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/codecell.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/completer.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/textcell.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:kernel$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/savewidget.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/quickhelp.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/pager.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/menubar.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/toolbar.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/maintoolbar.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/notebook.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/notificationwidget.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/notificationarea.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/tooltip.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/config.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/main.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/contexthint.js"$ charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/celltoolbarpresets/default.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "notebook/js/celltoolbarpresets/slideshow.js"$ type="text/javascript" charset="utf-8"> </script>
>>
let dashboard_site path =
let split_path =
let open Re in (* requires path to start with a / *)
let sl = char '/' in
let path_comp = compile (seq [ sl; group (rep (compl [sl])) ]) in
let rec f pos =
try
let x = exec ~pos path_comp path in
get x 1 :: f (snd (get_ofs x 0))
with Not_found -> []
in
f 0
in
let split_path' =
<:html< <li> <span>/</span></li> >> ::
List.map (fun c -> <:html< <li>$str:c$ <span>/</span></li> >>) split_path
in
<:html<
<div id="ipython-main-app" class="container">
<div id="tabs" class="tabbable">
<ul class="nav nav-tabs" id="tabs">
<li class="active"><a href="#notebooks" data-toggle="tab">Notebooks</a></li>
<!-- <li><a href="#clusters" data-toggle="tab">Clusters</a></li> -->
</ul>
<div class="tab-content">
<div id="notebooks" class="tab-pane active">
<div id="notebook_toolbar">
<form id='alternate_upload' class='alternate_upload' >
<span id="drag_info" style="position:absolute" >
To import a notebook, drag the file onto the listing below or <strong>click here</strong>.
</span>
<input type="file" name="datafile" class="fileinput" multiple='multiple' />
</form>
<span id="notebook_buttons">
<button id="refresh_notebook_list" title="Refresh notebook list" class="btn btn-small">Refresh</button>
<button id="new_notebook" title="Create new notebook" class="btn btn-small">New Notebook</button>
</span>
</div>
<div id="notebook_list">
<div id="notebook_list_header" class="row-fluid list_header">
<div id="project_name">
<ul class="breadcrumb">
$list:split_path'$
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
>>
let dashboard_stylesheet static_url =
<:html<
<link rel="stylesheet" href=$str:static_url "style/style.min.css"$ type="text/css"/>
<link rel="stylesheet" href=$str:static_url "tree/css/override.css"$ type="text/css" />
>>
let dashboard_scripts static_url =
<:html<
<script src=$str:static_url "base/js/dialog.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "tree/js/notebooklist.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "tree/js/clusterlist.js"$ type="text/javascript" charset="utf-8"> </script>
<script src=$str:static_url "tree/js/main.js"$ type="text/javascript" charset="utf-8"> </script>
>>
let generate_notebook_html ~base_path ~title ~path ~notebook_guid ~kernel =
let static_url x = base_path ^ "/static/" ^ x in
let mathjax_url = "https://cdn.mathjax.org/mathjax/latest/MathJax.js" in
let base_project_url = if base_path="" then "/" else base_path in
let data_base_project_url = base_path ^ "/" in
let data_base_kernel_url = "/" in
let body_class = "notebook_app" in
let style = notebook_stylesheet mathjax_url static_url in
let header = notebook_header in
let site = notebook_site (base_path <> "") (kernel <> `byte_code_kernel) in
let script = notebook_scripts static_url kernel in
let page = page
title base_project_url static_url
path data_base_project_url data_base_kernel_url
notebook_guid body_class
style header site script
in
"<!DOCTYPE HTML>\n" ^ Cow.Html.to_string page
let generate_dashboard_html ~path =
let static_url x = "/static/" ^ x in
let base_project_url = "/" in
let data_base_project_url = "/" in
let data_base_kernel_url = "/" in
let body_class = "" in
let style = dashboard_stylesheet static_url in
let header = empty in
let site = dashboard_site path in
let script = dashboard_scripts static_url in
let page = page
"IOCaml Dashboard" base_project_url static_url
path data_base_project_url data_base_kernel_url
"" body_class
style header site script
in
"<!DOCTYPE HTML>\n" ^ Cow.Html.to_string page