Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
116 lines (109 loc) · 8.36 KB
/
Copy pathindex.html
File metadata and controls
116 lines (109 loc) · 8.36 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>nbplayer — Jupyter Notebook Player</title>
<meta charset="utf-8">
<!-- Bootstrap CSS -->
<meta name="viewport" content="initial-scale=1">
<script src="./vendor/js/vendor/es5-shim.min.js"></script>
<script src="./vendor/js/vendor/marked.min.js"></script>
<script src="./vendor/js/vendor/purify.min.js"></script>
<script src="./vendor/js/vendor/ansi_up.min.js"></script>
<script src="./vendor/js/vendor/prism.min.js"></script>
<script src="./vendor/js/vendor/katex.min.js"></script>
<script src="./vendor/js/vendor/katex-auto-render.min.js"></script>
<script src="./vendor/js/vendor/notebook.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<link rel="stylesheet" href="./vendor/css/vendor/katex.min.css" />
<link rel="stylesheet" href="./vendor/css/vendor/prism.css" />
<link rel="stylesheet" href="./vendor/css/notebook.css" />
<link rel="stylesheet" href="./vendor/css/nbpreview.css" />
<link rel="stylesheet" href="./css/nbplayer.css" />
<link rel="stylesheet" href="custom.css" />
</head>
<body>
<div id="main">
<h2 id="welcome">Welcome to Notebook Player</h2>
<div class= "blue-gradient" id="controls">
<div id="header">Jupyter Notebook Player Settings</div>
<p>
<label>Kernel:
<select class="form-select form-select-sm" id="sageLang">
<option value="sage">SageMath</option>
<option value="r">R</option>
<option value="maxima">Maxima</option>
<option value="octave">Octave</option>
<option value="singular">Singular</option>
<option value="python">Python</option>
<option value="Gap">Gap</option>
<option value="gp">GP</option>
<option value="macauley2">Macauley2</option>
<option value="html">HTML</option>
</select>
</label>
<br/>
<label>Cells:
<select class="form-select form-select-sm" id="sageCellsType">
<option value="linked">All linked in same environment</option>
<option value="auto">Automatic Evaluation</option>
<option value="single">Neither linked nor autoevaluated</option>
</select>
</label>
<br/>
<label>Player Modes:
<select class="form-select form-select-sm" id="playerPanes">
<option value="ExecRead">Start in Execution Mode</option>
<option value="ReadExec">Start in Read Mode</option>
<option value="Exec">Execution Mode Only</option>
</select>
</label>
</p>
<input type="file" class="form-control-file" id="file" accept=".ipynb">
</div>
<div id="help">
<p>Notebook-Player is a tool to convert Jupyter notebooks into dynamic HTML pages using <a href="https://sagecell.sagemath.org/" target="_blank">SageCell</a>.</p>
<h3>Important Notice</h3>
<p><b>As of March 22nd 2021 SageCell has restricted cell Internet access.</b> Notebooks that require Internet access <b>from within code cells</b> will after conversion only work for whitelisted URLs. Whitelisting includes all GitHub URLs. If you need any particular URL whitelisted, please, request in <a href="https://groups.google.com/g/sage-cell" target="_blank">the SageCell Group</a>.</p>
<h3 id="usage">Usage</h3>
<p>Make the required player settings for the web page to be generated and load the Jupyter notebook file.</p>
<p>Create the intended view and save the file.</p>
<p>A stylesheet <code>custom.css</code> and Javascript file <code>custom.js</code> in the same directory as the output html file can be used to improve the output.</p>
<h4 id="input-and-output-cells">Input and Output Cells</h4>
<p>Input and output cell make it possible to transfer data from one notebook player document to another. Each notebook must contain at most one input and at most one output cell.</p>
<h4 id="output-cells">Output Cells</h4>
<p>Output cells have a markdown cell, giving some explanations, and a code cell printing the commands to instantiate key variables with their current values. Note that only literal values, no objects or plots, can be saved.</p>
<p>Output markdown cells must have a node of the form <code><span class="nbdataOut"></span></code> This node may contain a node <code><ul></ul></code> with child nodes <code><li class="successor"><a>...</a></li></code> where the <code><a></a></code> node links to a notebook with an input cell using these variables.</p>
<h4 id="input-cells">Input Cells</h4>
<p>Input cells have a markdown cell, giving some explanations, and a code cell executing the commands to instantiate key variables with specific values.</p>
<p>Input markdown cells must contain a node <code><span class="nbdataIn"></span></code>.</p>
<p><a href="Sample.ipynb">Here</a> you can download a sample notebook with an input and an output cell.</p>
<h4>Saved States</h4>
<p>
Output cells have a <code>Save state</code> button. After the output code cell has been evaluated, this button saves the output to the local storage where it can be accessed by default as <code>mtStatus</code>.
</p>
<p>
If the page generated by the Notebook Player is called through it's page URL augmented by <code>?status=SomeStatusCode</code>, then the status of the page will be saved from the output cell as <code>SomeStatusCode</code> and the last state saved previously under <code>SomeStatusCode</code> will be automatically loaded into the input cell of the page if there is one.
</p>
<h4>Notebook Sites</h4>
<p>
Notebook Sites collect pages as generated by Notebook Player and transfer data between their input/output cells. There is a <a href="https://dahn-research.eu/nbsite" target="_blank">Notebook Sites player online</a> available which can be used to display collections of Notebook Player pages.
</p>
<h3 id="known-issues">Known Issues</h3>
<p>After saving the resulting html view, the page in the player is no longer functional. In order to generate an alternative view, the page must be reloaded.</p>
</div>
<div id="notebook-holder"></div>
<div id="footer">
© 2021 Ingo Dahn, License: <a href="http://creativecommons.org/licenses/by-sa/4.0/" target="_blank">CC-BY-SA</a><br/>
This page uses <i>nbpreview</i> - see </i><a href="https://github.com/jsvine/nbpreview"><code>nbpreview</code> code on GitHub</a>.
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://sagecell.sagemath.org/embedded_sagecell.js"></script>
<script src="./vendor/js/FileSaver.min.js"></script>
<script src="./vendor/js/nbpreview.js"></script>
<script src="./nbplayerConfig.js"></script>
<script src="./js/nbrunner.min.js"></script>
<script src="./js/nbplayer.min.js"></script>
</body>
</html>