j1-template 2022.4.1 → 2022.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/layouts/content_generator_article_navigator.html +1 -1
- data/_includes/themes/j1/layouts/content_generator_blog_archive.html +1 -1
- data/_includes/themes/j1/layouts/content_generator_news_panel_posts.html +1 -1
- data/assets/themes/j1/adapter/js/nbinteract.js +11 -0
- data/assets/themes/j1/modules/bokeh/README.md +380 -0
- data/assets/themes/j1/modules/bokeh/js/v2.4.3/bokeh.min.js +596 -0
- data/assets/themes/j1/modules/nbInteract/css/theme/uno/nbinteract-core.css +7 -0
- data/assets/themes/j1/modules/nbInteract/css/theme/uno/nbinteract-core.min.css +1 -1
- data/assets/themes/j1/modules/vega/js/vega/LICENSE +27 -0
- data/assets/themes/j1/modules/vega/js/vega/README.md +42 -0
- data/assets/themes/j1/modules/vega/js/vega/vega-core.js +34550 -0
- data/assets/themes/j1/modules/vega/js/vega/vega-core.min.js +2 -0
- data/assets/themes/j1/modules/vega/js/vega/vega-core.min.js.map +1 -0
- data/assets/themes/j1/modules/vega/js/vega/vega.js +49095 -0
- data/assets/themes/j1/modules/vega/js/vega/vega.min.js +2 -0
- data/assets/themes/j1/modules/vega/js/vega/vega.min.js.map +1 -0
- data/assets/themes/j1/modules/vega/js/vega-embed/LICENSE +27 -0
- data/assets/themes/j1/modules/vega/js/vega-embed/README.md +230 -0
- data/assets/themes/j1/modules/vega/js/vega-embed/vega-embed.js +6607 -0
- data/assets/themes/j1/modules/vega/js/vega-embed/vega-embed.js.map +1 -0
- data/assets/themes/j1/modules/vega/js/vega-embed/vega-embed.min.js +21 -0
- data/assets/themes/j1/modules/vega/js/vega-embed/vega-embed.min.js.map +1 -0
- data/assets/themes/j1/modules/vega/js/vega-lite/LICENSE +27 -0
- data/assets/themes/j1/modules/vega/js/vega-lite/README.md +34 -0
- data/assets/themes/j1/modules/vega/js/vega-lite/vega-lite-schema.json +30999 -0
- data/assets/themes/j1/modules/vega/js/vega-lite/vega-lite.js +24585 -0
- data/assets/themes/j1/modules/vega/js/vega-lite/vega-lite.js.map +1 -0
- data/assets/themes/j1/modules/vega/js/vega-lite/vega-lite.min.js +2 -0
- data/assets/themes/j1/modules/vega/js/vega-lite/vega-lite.min.js.map +1 -0
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/nbinteract.yml +1 -1
- data/lib/starter_web/_data/modules/navigator_menu.yml +40 -23
- data/lib/starter_web/_data/modules/nbinteract.yml +314 -295
- data/lib/starter_web/_data/resources.yml +101 -0
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/assets/images/modules/attics/wrongtog-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/attics/yellow-cactus-1920x1280.jpg +0 -0
- data/lib/starter_web/assets/images/modules/icons/bokeh/bokeh-32x32.ico +0 -0
- data/lib/starter_web/assets/images/modules/icons/bokeh/bokeh.ico +0 -0
- data/lib/starter_web/assets/images/modules/icons/bokeh/logo-160x160.png +0 -0
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/jupyter/examples/{j1-circular-times-table.adoc → distributed/j1-circular-times-table.adoc} +7 -2
- data/lib/starter_web/pages/public/jupyter/examples/{j1-interactive-widgets.adoc → distributed/j1-common-used-widgets.adoc} +14 -6
- data/lib/starter_web/pages/public/jupyter/examples/{j1-odes-in-python.adoc → distributed/j1-odes-in-python.adoc} +7 -2
- data/lib/starter_web/pages/public/jupyter/examples/{j1_climate-change-forecast.adoc → localized/j1_climate-change-forecast.adoc} +10 -5
- data/lib/starter_web/pages/public/jupyter/where_to_go.adoc +239 -0
- data/lib/starter_web/pages/public/learn/where_to_go.adoc +23 -7
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +35 -30
- data/lib/starter_web/pages/public/jupyter/docs/_includes/attributes.asciidoc +0 -58
- data/lib/starter_web/pages/public/jupyter/docs/_includes/documents/j1_docs_example_static.asciidoc +0 -232
- data/lib/starter_web/pages/public/jupyter/docs/j1-nbinteract-doc.adoc +0 -563
- data/lib/starter_web/pages/public/jupyter/docs/nbi-widget-manual.adoc +0 -465
- data/lib/starter_web/pages/public/jupyter/docs/nbinteract-doc.adoc +0 -473
- data/lib/starter_web/pages/public/jupyter/examples/j1-testing-plotly.adoc +0 -94
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_circular_times_table-checkpoint.ipynb +0 -12387
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_climate_change_forecast-checkpoint.ipynb +0 -1058
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_docs_example_dynamic-checkpoint.ipynb +0 -14478
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_interactive_widgets-checkpoint.ipynb +0 -738
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_ode_selected-checkpoint.ipynb +0 -14478
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_odes_in_python-checkpoint.ipynb +0 -15227
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/factor_by_factor.mp4 +0 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/line_by_line.mp4 +0 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/point_by_point.mp4 +0 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_examples_central_limit_theorem-checkpoint.ipynb +0 -247
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_examples_variability_of_the_sample_mean-checkpoint.ipynb +0 -323
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_recipes_graphing-checkpoint.ipynb +0 -387
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_recipes_interactive_questions-checkpoint.ipynb +0 -185
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_recipes_layout-checkpoint.ipynb +0 -384
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_tutorial_interact-checkpoint.ipynb +0 -254
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_tutorial_monty_hall-checkpoint.ipynb +0 -732
- data/lib/starter_web/pages/public/jupyter/services/binderhub.adoc +0 -564
- data/lib/starter_web/pages/public/jupyter/services/jupyterhub.adoc +0 -244
@@ -1,563 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: J1 NBI
|
3
|
-
tagline: jupyter notebook integration
|
4
|
-
date: 2022-04-17 00:00:00
|
5
|
-
description: >
|
6
|
-
The package nbinteract aims to enable authors and educators to create and
|
7
|
-
share interactive web pages easily. Interactive explanations of concepts are
|
8
|
-
useful for communicating and explaining tricky concepts.
|
9
|
-
keywords: >
|
10
|
-
opensource, free, load, download, start, starter, example,
|
11
|
-
high, easy, use, secure, encrypt, standard, popular,
|
12
|
-
generate, create, learn, distribute, publish, deploy,
|
13
|
-
beginner, advanced, expert, student, learner, writer, reader, visitor
|
14
|
-
framework, toolkit, integration, extension, module, api,
|
15
|
-
dynamic, static, generator, client, server, internet, local, localhost
|
16
|
-
page, web, website, webdesign, material, design, responsive,
|
17
|
-
javascript, nodejs, ruby, windows, linux, osx, mac, os,
|
18
|
-
http, https, html, html5, css, scss, style,
|
19
|
-
browser, firefox, chrome, edge, opera, safari,
|
20
|
-
configuration, generator, navigation, menu, dropdown, fab, action, button
|
21
|
-
application, interface, provider, api, repository,
|
22
|
-
cookie, language, translation, gdpr, dsgvo, privacy,
|
23
|
-
asciidoc, aciidoctor, bootstrap, jekyll, liquid,
|
24
|
-
hyvor, disqus, git, github, netlify, heroku, apple, microsoft,
|
25
|
-
provider, service, internet, support,
|
26
|
-
google, analytics, advertising, search, console, silverlight, score,
|
27
|
-
j1, template, jekyllone, comment,
|
28
|
-
python, jupyter, notebook, textbook, api, app, nbinteract,
|
29
|
-
nbi, integration, binder, binderhub, jupyterhub
|
30
|
-
|
31
|
-
categories: [ J1, Integration ]
|
32
|
-
tags: [ NBI, nbinteract ]
|
33
|
-
|
34
|
-
scrollbar: false
|
35
|
-
fab_menu_id: page_ctrl_simple
|
36
|
-
personalization: true
|
37
|
-
|
38
|
-
permalink: /pages/public/jupyter/docs/j1-nbinteract-docs/
|
39
|
-
regenerate: true
|
40
|
-
|
41
|
-
resources: [ animate, clipboard, lightbox, nbinteract, rouge ]
|
42
|
-
resource_options:
|
43
|
-
- attic:
|
44
|
-
padding_top: 400
|
45
|
-
padding_bottom: 50
|
46
|
-
opacity: 0.5
|
47
|
-
slides:
|
48
|
-
- url: /assets/images/modules/attics/kirklai-1920x1280.jpg
|
49
|
-
alt: Photo by 𝓴𝓘𝓡𝓚 𝕝𝔸𝕀 on Unsplash
|
50
|
-
badge:
|
51
|
-
type: unsplash
|
52
|
-
author: 𝓴𝓘𝓡𝓚 𝕝𝔸𝕀
|
53
|
-
href: https://unsplash.com/@kirklai
|
54
|
-
---
|
55
|
-
|
56
|
-
// Page Initializer
|
57
|
-
// =============================================================================
|
58
|
-
// Enable the Liquid Preprocessor
|
59
|
-
:page-liquid:
|
60
|
-
|
61
|
-
// Set (local) page attributes here
|
62
|
-
// -----------------------------------------------------------------------------
|
63
|
-
// :page--attr: <attr-value>
|
64
|
-
:binder-badges-enabled: true
|
65
|
-
:binder--home: https://mybinder.org/
|
66
|
-
:binder--docs: https://mybinder.readthedocs.io/en/latest/
|
67
|
-
:github-repo--binderhub: https://github.com/jupyterhub/binderhub
|
68
|
-
:binder-app-launch--tree: https://mybinder.org/v2/gh/jekyll-one/j1-binder-repo/main?urlpath=/tree
|
69
|
-
|
70
|
-
// Load Liquid procedures
|
71
|
-
// -----------------------------------------------------------------------------
|
72
|
-
{% capture load_attributes %}themes/{{site.template.name}}/procedures/global/attributes_loader.proc{%endcapture%}
|
73
|
-
|
74
|
-
// Load page attributes
|
75
|
-
// -----------------------------------------------------------------------------
|
76
|
-
{% include {{load_attributes}} scope="all" %}
|
77
|
-
|
78
|
-
// Page content
|
79
|
-
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
80
|
-
ifeval::[{binder-badges-enabled} == true]
|
81
|
-
image:/assets/images/badges/configBinder.png[Binder, link="{binder--home}", {browser-window--new}]
|
82
|
-
image:/assets/images/badges/docsBinder.png[Binder, link="{binder--docs}", {browser-window--new}]
|
83
|
-
endif::[]
|
84
|
-
|
85
|
-
// Include sub-documents (if any)
|
86
|
-
// -----------------------------------------------------------------------------
|
87
|
-
|
88
|
-
// tut: https://www.dataquest.io/blog/jupyter-notebook-tutorial/
|
89
|
-
// tut: https://reproducible-science-curriculum.github.io/publication-RR-Jupyter/01-documentation/index.html
|
90
|
-
|
91
|
-
// integration: https://code.visualstudio.com/docs/datascience/jupyter-notebooks
|
92
|
-
// intro: https://jupyter-notebook-beginner-guide.readthedocs.io/en/latest/index.html
|
93
|
-
// Books: https://jupyterbook.org/intro.html
|
94
|
-
// 2HTML: https://stackoverflow.com/questions/35896866/how-to-export-current-notebook-in-html-on-jupyter
|
95
|
-
|
96
|
-
// info: https://en.wikipedia.org/wiki/Galileo_Galilei
|
97
|
-
|
98
|
-
CAUTION: Each interactive element presented on this page uses *time-consuming*
|
99
|
-
operations that take a while to finish. The elements are built through a
|
100
|
-
backend in the cloud. Please be patient to see the results.
|
101
|
-
|
102
|
-
The Jupyter Project is a non-profit organization founded in 2014 by
|
103
|
-
_Fernando Perez_. The Jupyter project supports interactive scientific
|
104
|
-
Data evaluations and scientific calculations. The main applications provided
|
105
|
-
by the Jupyter Project are:
|
106
|
-
|
107
|
-
* Jupyter Notebook (JN)
|
108
|
-
* JupyterHub (JH)
|
109
|
-
|
110
|
-
NOTE: The name _Jupyter_ refers to the three main programming languages
|
111
|
-
_Julia_, _Python_ and _R_ supported by the Jupyter Notebook App. The
|
112
|
-
name _Jupyter_ is a homage to the notebook entries by _Galileo Galilei_
|
113
|
-
on the discovery of the moons of Jupiter, where he made his observations
|
114
|
-
and the measurement data together.
|
115
|
-
|
116
|
-
Jupyter Notebook (JN) is an open source web application that allows data
|
117
|
-
scientists to create and share documents that include live code, equations,
|
118
|
-
and other multimedia resources. JN combines two components:
|
119
|
-
|
120
|
-
Web application::
|
121
|
-
a browser-based tool for interactive authoring of documents which combine
|
122
|
-
explanatory text, mathematics, computations and their rich media output.
|
123
|
-
|
124
|
-
Notebook documents::
|
125
|
-
a representation of all content visible in the web application, including
|
126
|
-
inputs and outputs of the computations, explanatory text, mathematics,
|
127
|
-
images, and rich media representations of objects.
|
128
|
-
|
129
|
-
== Jupyter Basics
|
130
|
-
|
131
|
-
To understand this documentation better, below you find a brief description
|
132
|
-
of JupyterHub (JH) and the three base components of Jupyter Notebook (JN).
|
133
|
-
|
134
|
-
=== Jupyter Notebook App
|
135
|
-
|
136
|
-
The Jupyter Notebook *App* is a server-client application that allows editing
|
137
|
-
and running notebook documents via a web browser. The Notebook App can be
|
138
|
-
executed on a local desktop requiring no internet access or can be installed
|
139
|
-
on a remote server and accessed through the internet.
|
140
|
-
|
141
|
-
=== Notebook documents
|
142
|
-
|
143
|
-
Notebook documents (or *notebooks* for short) are documents created by the
|
144
|
-
Notebook App, and both computer code (e.g., Python) and rich text may contain
|
145
|
-
elements (paragraphs, equations, figures, links, etc.). Notebook documents are
|
146
|
-
human-readable documents, alongside code descriptions and results (figures,
|
147
|
-
tables, etc.).
|
148
|
-
|
149
|
-
=== Kernels
|
150
|
-
|
151
|
-
Generally, a notebook *kernel* is a *calculating machine* that lives in the
|
152
|
-
Jupyter Notebook App to process a Notebook document and executes its
|
153
|
-
code. The *Ipython* kernel, used for the NBI integration, runs _Python_
|
154
|
-
code, and produces the results.
|
155
|
-
|
156
|
-
=== JupyterHub
|
157
|
-
|
158
|
-
_JupyterHub_ (JH) brings the power of notebooks to *groups* of users. It
|
159
|
-
gives users access to computational environments and resources without
|
160
|
-
burdening the users with installation and maintenance tasks. Users can get
|
161
|
-
their work done in their own workspaces on shared resources which can be
|
162
|
-
managed efficiently by system administrators without having the Jupyter
|
163
|
-
Notebook App (JN) locally installed on their systems.
|
164
|
-
|
165
|
-
JupyterHub runs in the cloud or on hardware hosted on your own and makes
|
166
|
-
it possible to serve a pre-configured data science environment to any user.
|
167
|
-
It is customizable and scalable and is suitable for small and large teams,
|
168
|
-
academic courses, and large-scale infrastructure (for example like the
|
169
|
-
Binder service).
|
170
|
-
|
171
|
-
== Binder
|
172
|
-
|
173
|
-
Binder allows you to create custom computing environments that can be
|
174
|
-
shared and used by many remote users. A Binder service is powered by
|
175
|
-
link:{github-repo--binderhub}[BinderHub Repo on Github, {browser-window--new}],
|
176
|
-
an open-source tool that runs on Kubernetes, a portable, extensible,
|
177
|
-
open-source platform for managing containerized services. One such deployment
|
178
|
-
lives at link:{binder--home}[Binder Home, {browser-window--new}], and is free
|
179
|
-
to use.
|
180
|
-
|
181
|
-
== The Package nbInteract (NBI)
|
182
|
-
|
183
|
-
As a web technology, _Jupyter Notebook_ provides a platform for authoring
|
184
|
-
interactive scientific documents. For example, the popular `ipywidgets`
|
185
|
-
Python library allows users to create web-based user interfaces to interact
|
186
|
-
with arbitrary Python functions. Users can create these interfaces using
|
187
|
-
Python directly in the notebook instead of HTML and JavaScript, significantly
|
188
|
-
lowering the time needed to create these interfaces.
|
189
|
-
|
190
|
-
This ease of use encourages instructors and researchers to create interactive
|
191
|
-
explanations of their work. Unfortunately, it isn't easy to *share* these
|
192
|
-
interactive notebooks with the public. Sharing the notebook file itself
|
193
|
-
retains full interactivity but requires *viewers* to have Jupyter, Python,
|
194
|
-
and all other packages used in the notebook installed on their machines.
|
195
|
-
|
196
|
-
The freely available Binder service circumvents this by hosting notebook
|
197
|
-
servers pre-packaged with the necessary software. However, both of these
|
198
|
-
options still require readers to have prior familiarity with the Jupyter
|
199
|
-
environment, making them less suitable for use with non-technical people.
|
200
|
-
|
201
|
-
Authors can convert a Jupyter notebook to a static HTML document and host
|
202
|
-
the document as a publicly-accessible web page. However, this method does
|
203
|
-
not preserve the interactive elements of the notebook. The resulting web
|
204
|
-
page only contains text and images.
|
205
|
-
|
206
|
-
.NBI textbook (excerpt)
|
207
|
-
lightbox::nbi-textbook--excerpt[ 800, {data-nbi-textbook--excerpt}, role="mt-3 mb-4" ]
|
208
|
-
// image::pages/nbinteract/nbi-textbook-example.jpg["NBI textbook (excerpt)", 800]
|
209
|
-
|
210
|
-
The Python package `nbinteract` allows authors to convert Jupyter notebooks
|
211
|
-
into *interactive*, standalone HTML pages: the textbooks. The interactive
|
212
|
-
elements can use arbitrary Python code to generate output, including Python
|
213
|
-
libraries that use C extensions (e.g., _NumPy_ and _Pandas_) and libraries
|
214
|
-
that create images (e.g., _Matplotlib_).
|
215
|
-
|
216
|
-
Anyone with a modern web browser can use the resulting web pages even if
|
217
|
-
the viewer does *not* have Python or Jupyter installed on their computer.
|
218
|
-
To make this possible, NBI uses the freely available cloud service _Binder_.
|
219
|
-
Two communication libraries are used to interact with the _BinderHub_ and the
|
220
|
-
_JupyterHub_ services
|
221
|
-
|
222
|
-
You can find an overview of these services and their communication interfaces
|
223
|
-
at:
|
224
|
-
|
225
|
-
* link:{url-j1--binderhub}[BinderHub, {browser-window--new}]
|
226
|
-
* link:{url-j1--jupyterhub}[JupyterHub, {browser-window--new}]
|
227
|
-
|
228
|
-
TIP: The `nbinteract` package also includes additional methods for interactive
|
229
|
-
plots (widgets) designed for very fast interaction prototyping in the notebook
|
230
|
-
and smooth interaction on static HTML web pages.
|
231
|
-
|
232
|
-
== J1 NBI Integration
|
233
|
-
|
234
|
-
The integration of NBI consists of the following components:
|
235
|
-
|
236
|
-
* the (modified) JS and CSS files of the library *nbinteract-core* specified
|
237
|
-
as resource record `nbinteract` (see: `~/_data/resources.yml`)
|
238
|
-
* an J1 adapter `nbinteract.js` for integration
|
239
|
-
* a module configuration `nbinteract.yml`
|
240
|
-
* an Asciidoc Extension `textbook::` to integrate textbooks (in webpages)
|
241
|
-
|
242
|
-
The built-in Starter Web of the template comes with a suitable J1 NBI
|
243
|
-
configuration and documents for testing. You can find examples of pages that
|
244
|
-
contain interactive textbooks under the menu `Lern` underneath the submenu
|
245
|
-
`Experimental|Textbooks`.
|
246
|
-
|
247
|
-
WARNING: To develop your *Jupyter Notebooks*, a *local* installation of the
|
248
|
-
*Python* programming language is required. For the development of Jupyter
|
249
|
-
Notebooks, the *Jupyter* package and the installation of the library
|
250
|
-
*nbinteract* are expected.
|
251
|
-
|
252
|
-
The module for J1 NBI integration is available as a stable version. However,
|
253
|
-
it is still in an experimental state. The main reason for that experimental
|
254
|
-
status is the *age* of the underlying library `nbinteract-core`.
|
255
|
-
|
256
|
-
NOTE: Recent library updates are more than a year ago, and the current
|
257
|
-
version of the Jupyter Notebook *JupyterLab* application, unfortunately,
|
258
|
-
*not* supported (yet).
|
259
|
-
|
260
|
-
=== Notebooks vs. Textbooks
|
261
|
-
|
262
|
-
Jupyter Notebook documents with the extension `.ipynb` are (data) files in
|
263
|
-
JSON format and can only be run using the *App* of Jupyter Notebook. On the
|
264
|
-
other hand, Textbooks are HTML exports with the extension `.html` from
|
265
|
-
Jupyter Notebooks to be viewed in a web browser.
|
266
|
-
|
267
|
-
For integrating textbooks in webpages, the notebooks with the extension
|
268
|
-
`.ipynb` are to be *exported* to HTML (text) files using the (Python)
|
269
|
-
program nbinteract. Textbooks that have already been exported can be found
|
270
|
-
for the *Starter Web* in the folder `~/pages/public/jupyter/notebooks/textbooks`.
|
271
|
-
|
272
|
-
== J1 NBI Configuration
|
273
|
-
|
274
|
-
The Template system J1 integrates the Javascript (core) library
|
275
|
-
`nbinteract-core.js` from NBI (nbinteract). The integration is a J1 module
|
276
|
-
that requires *no programming* to integrate interactive textbooks in
|
277
|
-
your webpages.
|
278
|
-
|
279
|
-
WARNING: The (core) library integrated with J1 can *only* used with the
|
280
|
-
Template System J1. The library `nbinteract-core` is modified for the use
|
281
|
-
with J1, allowing seamless integration between NBI and the pages of a J1 Web.
|
282
|
-
|
283
|
-
=== Modul configuration
|
284
|
-
|
285
|
-
As with all modules available with J1, *no programming* is required. An
|
286
|
-
adapter for the template system takes the necessary steps for integration,
|
287
|
-
so easy integration into your website is possible using the module
|
288
|
-
configuration.
|
289
|
-
|
290
|
-
==== Default settings
|
291
|
-
|
292
|
-
Find all parameters used for the default settings below. The configuration
|
293
|
-
file is `~/_data/default/nbinteract.yml`.
|
294
|
-
|
295
|
-
.Default settings
|
296
|
-
[cols="3a,4a,5a", subs=+macros, options="header", width="100%", role="rtable mt-3"]
|
297
|
-
|===
|
298
|
-
|Paramter |Value |Description
|
299
|
-
|
300
|
-
|`spec`
|
301
|
-
|`<user>/<repo>/<branch>`
|
302
|
-
|Defines the *public* repo the configuration data is available to be read
|
303
|
-
by the *Binder* service.
|
304
|
-
|
305
|
-
|`baseUrl`
|
306
|
-
|`https://mybinder.org`
|
307
|
-
|Base URL of the *Binder* service.
|
308
|
-
|
309
|
-
|`provider`
|
310
|
-
|gh\|gist\|gl
|
311
|
-
|Provider of the *public* repo. +
|
312
|
-
`gh`, GitHub +
|
313
|
-
`gist`, GitHub Gist +
|
314
|
-
`gl`, GitLab
|
315
|
-
|
316
|
-
|`button_styles`
|
317
|
-
|CSS styles
|
318
|
-
|For *Bootstrap*, styles like `btn btn-primary btn-raised ` can be used.
|
319
|
-
|
320
|
-
|`show_nbi_messages`
|
321
|
-
|`true`\|`false`
|
322
|
-
|Show info\|progress\|error messages while nbinteract is being initialized.
|
323
|
-
Messges are shown in (Bootstrap) modals. +
|
324
|
-
Default: `false`
|
325
|
-
|
326
|
-
|`indicate_nbi_activity`
|
327
|
-
|`true`\|`false`
|
328
|
-
|Show a spinner while nbinteract in being initialized.
|
329
|
-
Default: `true`
|
330
|
-
|
331
|
-
|`nbi_messages_auto_close`
|
332
|
-
|`true`\|`false`
|
333
|
-
|Close the nbi messages modals automatically. +
|
334
|
-
Default: `true`
|
335
|
-
|
336
|
-
|`nbi_init_timeout`
|
337
|
-
|`integer`
|
338
|
-
|Time (ms) textbooks on a page are to be finally initialized. If the
|
339
|
-
init phase tooks longer, an error is issued. +
|
340
|
-
Default: `180000` (3 min)
|
341
|
-
|
342
|
-
|`nbi_messages_auto_close_delay`
|
343
|
-
|`integer`
|
344
|
-
|Delay (ms) to auto-close nbi messages modal. +
|
345
|
-
Default: `3500` (3.5 sec)
|
346
|
-
|
347
|
-
|`nbi_init_mathjax`
|
348
|
-
|`true`\|`false`
|
349
|
-
|Load and initialize the MathJax JS library. +
|
350
|
-
Default: `true`
|
351
|
-
|
352
|
-
|===
|
353
|
-
|
354
|
-
WARNING: In the current implementation of NBI for J1, the JS library *MathJax*
|
355
|
-
*may* interfere with the HTML output of other pages of a J1 website. Integrating
|
356
|
-
the MatJax JS library may result in *strange outcomes* for other contents.
|
357
|
-
For that reason, the MathJax library should be used *carefully* for the
|
358
|
-
time being.
|
359
|
-
|
360
|
-
.Example settings (`~/_data/default/nbinteract.yml`)
|
361
|
-
[source, yaml]
|
362
|
-
----
|
363
|
-
# ------------------------------------------------------------------------------
|
364
|
-
# Default settings
|
365
|
-
#
|
366
|
-
defaults:
|
367
|
-
|
368
|
-
spec: jekyll-one/j1-binder-repo/main
|
369
|
-
baseUrl: 'https://mybinder.org'
|
370
|
-
provider: gh
|
371
|
-
|
372
|
-
button_styles: btn btn-primary btn-raised hidden
|
373
|
-
|
374
|
-
show_nbi_messages: true
|
375
|
-
indicate_nbi_activity: false
|
376
|
-
nbi_messages_auto_close: true
|
377
|
-
|
378
|
-
nbi_init_timeout: 180000
|
379
|
-
nbi_messages_auto_close_delay: 3500
|
380
|
-
|
381
|
-
nbi_init_mathjax: true
|
382
|
-
----
|
383
|
-
|
384
|
-
==== Textbook settings
|
385
|
-
|
386
|
-
Find all parameters used for the textbook settings below. The configuration
|
387
|
-
file is `~/_data/nbinteract.yml`.
|
388
|
-
|
389
|
-
.Textbook settings
|
390
|
-
[cols="3a,4a,5a", options="header", width="100%", role="rtable mt-3"]
|
391
|
-
|===
|
392
|
-
|Paramter |Value |Description
|
393
|
-
|
394
|
-
|`enabled`
|
395
|
-
|`true`\|`false`
|
396
|
-
|Enables\|Disables the use of a notebook. If disabled, *no* J1 adapter
|
397
|
-
setting are generated for this Jupyter Notebook. +
|
398
|
-
Default: `true`
|
399
|
-
|
400
|
-
|`id`
|
401
|
-
|`string`
|
402
|
-
|The id of a notebook that is used by the *Asciidoc Extension*
|
403
|
-
`textbook::<id>[]` to place the HTML portion for the HTML code
|
404
|
-
of an exported Jupyter Notebook. +
|
405
|
-
Default: `no default`
|
406
|
-
|
407
|
-
|`xhr_data`
|
408
|
-
|`string`
|
409
|
-
|The name of the exported HTML data file of a Jupyter Notebook. +
|
410
|
-
Default: `no default`
|
411
|
-
|
412
|
-
|`xhr_data_path`
|
413
|
-
|`path`
|
414
|
-
|The (data) path the Jupyter Notebook is exported. +
|
415
|
-
Default: `no default`
|
416
|
-
|
417
|
-
|`use_mathjax`
|
418
|
-
|`true`\|`false`
|
419
|
-
|This is a per notebook setting to enable mathjax processing. In general
|
420
|
-
`nbi_init_mathjax` from *default* settings are be set to `true` (enabled). +
|
421
|
-
Default: `false`
|
422
|
-
|
423
|
-
|===
|
424
|
-
|
425
|
-
.Example settings (~/_data/nbinteract.yml)
|
426
|
-
[source, yaml]
|
427
|
-
----
|
428
|
-
# ------------------------------------------------------------------------------
|
429
|
-
# User configuration settings
|
430
|
-
#
|
431
|
-
settings:
|
432
|
-
|
433
|
-
textbooks:
|
434
|
-
|
435
|
-
# --------------------------------------------------------------------------
|
436
|
-
# J1 NBI Textbooks J1 NBI Docs
|
437
|
-
# --------------------------------------------------------------------------
|
438
|
-
|
439
|
-
# --------------------------------------------------------------------------
|
440
|
-
# Demo notebook 'selected ODEs'
|
441
|
-
#
|
442
|
-
- textbook:
|
443
|
-
enabled: true
|
444
|
-
|
445
|
-
id: j1_docs_example_dynamic
|
446
|
-
xhr_data: j1_docs_example_dynamic.html
|
447
|
-
xhr_data_path: /pages/public/jupyter/notebooks/textbooks
|
448
|
-
use_mathjax: false
|
449
|
-
|
450
|
-
----
|
451
|
-
|
452
|
-
=== Binder configuration
|
453
|
-
|
454
|
-
The use of J1 NBI requires a valid Binder configuration. The binder
|
455
|
-
configuration is to be provided via a public Git repo. An example of such a
|
456
|
-
Git repo you find on Github at
|
457
|
-
link:{url-j1--gh-binder-repo}[J1 Binder Repo, {browser-window--new}].
|
458
|
-
The configuration settings are described in the <<Default settings>> section.
|
459
|
-
|
460
|
-
=== Textbook configuration
|
461
|
-
|
462
|
-
Besides the default settings for J1 NBI (`~/_data/default/nbinteract.yml`),
|
463
|
-
*individual* settings for each textbook (nbinteract HTML textebook) are
|
464
|
-
required to include textbooks in webpages. You find examples in the
|
465
|
-
configuration file `~/_data/nbinteract.yml`, a description of the parameters
|
466
|
-
used in the <<Textbook settings>> section.
|
467
|
-
|
468
|
-
=== Textbook integration
|
469
|
-
|
470
|
-
For integrating textbooks (nbinteract HTML notebook) into web pages, the
|
471
|
-
resource of J1 NBI Module is required. The `ID` of the module of the J1 NBI
|
472
|
-
integration is: `nbinteract`.
|
473
|
-
|
474
|
-
.Example of a Frontmatter for a page using Textbooks
|
475
|
-
[source, yaml, role="noclip"]
|
476
|
-
----
|
477
|
-
title: J1 NbInteract
|
478
|
-
tagline: nbi integration
|
479
|
-
date: 2022-04-17 00:00:00
|
480
|
-
description: >
|
481
|
-
Things you should know about this site,
|
482
|
-
the people and the software and/or
|
483
|
-
services provided.
|
484
|
-
|
485
|
-
categories: [ J1, Integration ]
|
486
|
-
tags: [ NBI, nbinteract ]
|
487
|
-
|
488
|
-
scrollbar: false
|
489
|
-
fab_menu_id: page_ctrl_simple
|
490
|
-
personalization: true <1>
|
491
|
-
|
492
|
-
permalink: /pages/public/jupyter/docs/j1-nbinteract-docs/
|
493
|
-
regenerate: true
|
494
|
-
|
495
|
-
resources: [ nbinteract, rouge ] <2>
|
496
|
-
----
|
497
|
-
<1> Binder's services require *Personalization* accepted in the users
|
498
|
-
*cookie* settings. Difficulties with the rules of privacy should be
|
499
|
-
explicitly pointed out and responded to in a suitable form if the cookie
|
500
|
-
settings of the visitor do not allow this.
|
501
|
-
<2> If highlighting the source code parts is desired in a textbook, the
|
502
|
-
`rouge` module must included as well.
|
503
|
-
|
504
|
-
Once the configuration steps for using J1 NBI have been completed, integrating
|
505
|
-
textbooks is very easy. The Asciidoc extension `textbook::` can include a
|
506
|
-
textbook (nbinteract HTML Notebook) anywhere.
|
507
|
-
|
508
|
-
.General syntax
|
509
|
-
[source, conf, role="noclip"]
|
510
|
-
----
|
511
|
-
textbook::<notebook-id>[]
|
512
|
-
----
|
513
|
-
|
514
|
-
Einbinden des Textbooks mit der ID `j1_docs_example_dynamic` in eine Webseite.
|
515
|
-
|
516
|
-
.Example
|
517
|
-
[source, conf]
|
518
|
-
----
|
519
|
-
textbook::j1_docs_example_dynamic[]
|
520
|
-
----
|
521
|
-
|
522
|
-
|
523
|
-
== NBI Textbook examples
|
524
|
-
|
525
|
-
For the J1 template, textbooks are typically integrated as *dynamic* HTML
|
526
|
-
pages. In addition to the dynamic pages, textbooks can also be integrated as
|
527
|
-
*static* HTML code. You can find examples for both variants in the following
|
528
|
-
sections.
|
529
|
-
|
530
|
-
=== Static Textbook
|
531
|
-
|
532
|
-
The `nbconvert` tool converts *Jupyter Notebooks* to various other formats via
|
533
|
-
Jinja templates. The tool allows you to convert an .ipynb notebook file into
|
534
|
-
various *static* formats. For more details, refer to
|
535
|
-
link:{url-nbconvert--doc}[nbconvert - usage, {browser-window--new}].
|
536
|
-
|
537
|
-
.Generate a static textbook
|
538
|
-
[source, sh]
|
539
|
-
----
|
540
|
-
jupyter nbconvert --execute --to html <full_path_to>/<notebook.ipynb>
|
541
|
-
----
|
542
|
-
|
543
|
-
Below you find an static HTML output (Textbook) generated via `nbconvert`.
|
544
|
-
|
545
|
-
include::{documentdir}/j1_docs_example_static.asciidoc[]
|
546
|
-
|
547
|
-
=== Interactive Textbook
|
548
|
-
|
549
|
-
*Interactive* Textbooks are generated using `nbinteract`:
|
550
|
-
|
551
|
-
.Generate an interactive textbook
|
552
|
-
[source, sh]
|
553
|
-
----
|
554
|
-
nbinteract <full_path_to>/<notebook.ipynb> -t plain -s fake/fake
|
555
|
-
----
|
556
|
-
|
557
|
-
textbook::j1_docs_example_dynamic[]
|
558
|
-
|
559
|
-
=== Conclusion
|
560
|
-
|
561
|
-
Compare both textbook versions, dynamic versus static, in terms of
|
562
|
-
*interactivity*. Again, compare the _Evaluation_ section at section
|
563
|
-
<<Interactive Textbook>> with the static conterpart at <<Static Textbook>>.
|