You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/developers/dependency.rst
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,15 @@
1
1
Depending on Jupyter Server
2
2
===========================
3
3
4
-
If your project depends directly on Jupyter Server, be sure to watch Jupyter Server's ChangeLog and pin your project to a version that works for your application. Major releases represent possible backwards-compatibility breaking API changes or features.
5
-
6
-
When a new major version in released on PyPI, a branch for that version will be created in this repository, and the version of the master branch will be bumped to the next major version number. That way, the master branch always reflects the latest un-released version.
4
+
If your project depends directly on Jupyter Server, be sure to watch Jupyter
5
+
Server's ChangeLog and pin your project to a version that works for your
6
+
application. Major releases represent possible backwards-compatibility breaking
7
+
API changes or features.
8
+
9
+
When a new major version in released on PyPI, a branch for that version will be
10
+
created in this repository, and the version of the master branch will be bumped
11
+
to the next major version number. That way, the master branch always reflects
Copy file name to clipboardExpand all lines: docs/source/developers/extensions.rst
+38-10Lines changed: 38 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,9 @@ You can check some simple examples on the `examples folder
10
10
Authoring a basic server extension
11
11
==================================
12
12
13
-
The simplest way to write a Jupyter Server extension is to write an extension module with a ``_load_jupyter_server_extension`` function. This function should take a single argument, an instance of the ``ServerApp``.
13
+
The simplest way to write a Jupyter Server extension is to write an extension
14
+
module with a ``_load_jupyter_server_extension`` function. This function should
15
+
take a single argument, an instance of the ``ServerApp``.
14
16
15
17
16
18
.. code-block:: python
@@ -62,7 +64,11 @@ Then add this handler to Jupyter Server's Web Application through the ``_load_ju
62
64
Making an extension discoverable
63
65
--------------------------------
64
66
65
-
To make this extension discoverable to Jupyter Server, first define a ``_jupyter_server_extension_points()`` function at the root of the module/package. This function returns metadata describing how to load the extension. Usually, this requires a ``module`` key with the import path to the extension's ``_load_jupyter_server_extension`` function.
67
+
To make this extension discoverable to Jupyter Server, first define a
68
+
``_jupyter_server_extension_points()`` function at the root of the module/
69
+
package. This function returns metadata describing how to load the extension.
70
+
Usually, this requires a ``module`` key with the import path to the extension's
71
+
``_load_jupyter_server_extension`` function.
66
72
67
73
.. code-block:: python
68
74
@@ -85,7 +91,10 @@ Second, add the extension to the ServerApp's ``jpserver_extensions`` trait. This
85
91
"my_extension": True
86
92
}
87
93
88
-
or loaded from a JSON file in the ``jupyter_server_config.d`` directory under one of `Jupyter's paths`_. (See the `Distributing a server extension`_ section for details on how to automatically enabled your extension when users install it.)
94
+
or loaded from a JSON file in the ``jupyter_server_config.d`` directory under
95
+
one of `Jupyter's paths`_. (See the `Distributing a server extension`_ section
96
+
for details on how to automatically enabled your extension when users install
97
+
it.)
89
98
90
99
.. code-block:: python
91
100
@@ -161,7 +170,10 @@ The basic structure of an ExtensionApp is shown below:
161
170
# Perform any required shut down steps
162
171
163
172
164
-
The ``ExtensionApp`` uses the following methods and properties to connect your extension to the Jupyter server. You do not need to define a ``_load_jupyter_server_extension`` function for these apps. Instead, overwrite the pieces below to add your custom settings, handlers and templates:
173
+
The ``ExtensionApp`` uses the following methods and properties to connect your
174
+
extension to the Jupyter server. You do not need to define a
175
+
``_load_jupyter_server_extension`` function for these apps. Instead, overwrite
176
+
the pieces below to add your custom settings, handlers and templates:
165
177
166
178
Methods
167
179
@@ -212,7 +224,9 @@ Jinja templating from frontend extensions
212
224
213
225
Many Jupyter frontend applications use Jinja for basic HTML templating. Since this is common enough, Jupyter Server provides some extra mixin that integrate Jinja with Jupyter server extensions.
214
226
215
-
Use ``ExtensionAppJinjaMixin`` to automatically add a Jinja templating environment to an ``ExtensionApp``. This adds a ``<name>_jinja2_env`` setting to Tornado Web Server's settings that will be used by request handlers.
227
+
Use ``ExtensionAppJinjaMixin`` to automatically add a Jinja templating
228
+
environment to an ``ExtensionApp``. This adds a ``<name>_jinja2_env`` setting
229
+
to Tornado Web Server's settings that will be used by request handlers.
216
230
217
231
.. code-block:: python
218
232
@@ -224,7 +238,9 @@ Use ``ExtensionAppJinjaMixin`` to automatically add a Jinja templating environme
224
238
...
225
239
226
240
227
-
Pair the example above with ``ExtensionHandlers`` that also inherit the ``ExtensionHandlerJinjaMixin`` mixin. This will automatically load HTML templates from the Jinja templating environment created by the ``ExtensionApp``.
241
+
Pair the example above with ``ExtensionHandlers`` that also inherit the
242
+
``ExtensionHandlerJinjaMixin`` mixin. This will automatically load HTML
243
+
templates from the Jinja templating environment created by the ``ExtensionApp``.
228
244
229
245
230
246
.. code-block:: python
@@ -347,7 +363,10 @@ Putting it all together, authors can distribute their extension following this s
347
363
This is where the extension logic will live (i.e. custom extension handlers, config, etc). See the sections above for more information on how to create an extension.
348
364
349
365
3. Add the following JSON config file to the extension package.
350
-
The file should be named after the extension (e.g. ``myextension.json``) and saved in a subdirectory of the package with the prefix: ``jupyter-config/jupyter_server_config.d/``. The extension package will have a similar structure to this example:
366
+
The file should be named after the extension (e.g. ``myextension.json``)
367
+
and saved in a subdirectory of the package with the prefix:
368
+
``jupyter-config/jupyter_server_config.d/``. The extension package will
369
+
have a similar structure to this example:
351
370
352
371
.. code-block::
353
372
@@ -413,12 +432,18 @@ Putting it all together, authors can distribute their extension following this s
413
432
Migrating an extension to use Jupyter Server
414
433
============================================
415
434
416
-
If you're a developer of a `classic Notebook Server`_ extension, your extension should be able to work with *both* the classic notebook server and ``jupyter_server``.
435
+
If you're a developer of a `classic Notebook Server`_ extension, your extension
436
+
should be able to work with *both* the classic notebook server and
437
+
``jupyter_server``.
417
438
418
439
There are a few key steps to make this happen:
419
440
420
441
1. Point Jupyter Server to the ``load_jupyter_server_extension`` function with a new reference name.
421
-
The ``load_jupyter_server_extension`` function was the key to loading a server extension in the classic Notebook Server. Jupyter Server expects the name of this function to be prefixed with an underscore—i.e. ``_load_jupyter_server_extension``. You can easily achieve this by adding a reference to the old function name with the new name in the same module.
442
+
The ``load_jupyter_server_extension`` function was the key to loading a
443
+
server extension in the classic Notebook Server. Jupyter Server expects the
444
+
name of this function to be prefixed with an underscore—i.e.
445
+
``_load_jupyter_server_extension``. You can easily achieve this by adding a
446
+
reference to the old function name with the new name in the same module.
422
447
423
448
.. code-block:: python
424
449
@@ -483,7 +508,10 @@ There are a few key steps to make this happen:
483
508
)
484
509
485
510
3. (Optional) Point extension at the new favicon location.
486
-
The favicons in the Jupyter Notebook have been moved to a new location in Jupyter Server. If your extension is using one of these icons, you'll want to add a set of redirect handlers this. (In ``ExtensionApp``, this is handled automatically).
511
+
The favicons in the Jupyter Notebook have been moved to a new location in
512
+
Jupyter Server. If your extension is using one of these icons, you'll want
513
+
to add a set of redirect handlers this. (In ``ExtensionApp``, this is
514
+
handled automatically).
487
515
488
516
This usually means adding a chunk to your ``load_jupyter_server_extension`` function similar to this:
Copy file name to clipboardExpand all lines: docs/source/developers/websocket-protocols.rst
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,10 @@ The Jupyter Server needs to pass messages between kernels and the Jupyter web ap
8
8
ZeroMQ wire protocol
9
9
--------------------
10
10
11
-
The kernel wire protocol over ZeroMQ takes advantage of multipart messages, allowing to decompose a message into parts and to send and receive them unmerged. The following table shows the message format (the beginning has been omitted for clarity):
11
+
The kernel wire protocol over ZeroMQ takes advantage of multipart messages,
12
+
allowing to decompose a message into parts and to send and receive them
13
+
unmerged. The following table shows the message format (the beginning has been
14
+
omitted for clarity):
12
15
13
16
.. list-table:: Format of a kernel message over ZeroMQ socket (indices refer to parts, not bytes)
Copy file name to clipboardExpand all lines: docs/source/operators/configuring-extensions.rst
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,9 @@
3
3
Configuring Extensions
4
4
======================
5
5
6
-
Some Jupyter Server extensions are also configurable applications. There are two ways to configure such extensions: i) pass arguments to the extension's entry point or ii) list configurable options in a Jupyter config file.
6
+
Some Jupyter Server extensions are also configurable applications. There are
7
+
two ways to configure such extensions: i) pass arguments to the extension's
8
+
entry point or ii) list configurable options in a Jupyter config file.
7
9
8
10
Jupyter Server looks for an extension's config file in a set of specific paths. Use the ``jupyter`` entry point to list these paths:
9
11
@@ -45,7 +47,9 @@ A Jupyter Server will automatically load config for each enabled extension. You
45
47
Extension config on the command line
46
48
------------------------------------
47
49
48
-
Server extension applications can also be configured from the command line, and multiple extension can be configured at the same time. Simply pass the traits (with their appropriate prefix) to the ``jupyter server`` entrypoint, e.g.:
50
+
Server extension applications can also be configured from the command line, and
51
+
multiple extension can be configured at the same time. Simply pass the traits
52
+
(with their appropriate prefix) to the ``jupyter server`` entrypoint, e.g.:
Copy file name to clipboardExpand all lines: docs/source/operators/multiple-extensions.rst
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,11 @@
4
4
Managing multiple extensions
5
5
----------------------------
6
6
7
-
One of the major benefits of Jupyter Server is that you can run serve multiple Jupyter frontend applications above the same Tornado web server. That's because every Jupyter frontend application is now a server extension. When you run a Jupyter Server will multiple extensions enabled, each extension appends its own set of handlers and static assets to the server.
7
+
One of the major benefits of Jupyter Server is that you can run serve multiple
8
+
Jupyter frontend applications above the same Tornado web server.
9
+
That's because every Jupyter frontend application is now a server extension.
10
+
When you run a Jupyter Server will multiple extensions enabled, each extension
11
+
appends its own set of handlers and static assets to the server.
Shut down the server after N seconds with no kernels or terminals running and no activity. This can be used together with culling idle kernels (MappingKernelManager.cull_idle_timeout) to shutdown the Jupyter server when it's not in use. This is not precisely timed: it may shut down up to a minute later. 0 (the default) disables this automatic shutdown.
517
+
Shut down the server after N seconds with no kernels or terminals running
518
+
and no activity. This can be used together with culling idle kernels
519
+
(MappingKernelManager.cull_idle_timeout) to shutdown the Jupyter server
520
+
when it's not in use. This is not precisely timed: it may shut down up to
521
+
a minute later. 0 (the default) disables this automatic shutdown.
Copy file name to clipboardExpand all lines: docs/source/users/configuration.rst
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,10 @@ By default, Jupyter Server looks for server-specific configuration in a ``jupyte
27
27
The paths under ``config`` are listed in order of precedence. If the same trait is listed in multiple places, it will be set to the value from the file will highest precendence.
28
28
29
29
30
-
Jupyter Server uses IPython's traitlets system for configuration. Traits can be listed in a Python or JSON config file. You can quickly create a ``jupyter_server_config.py`` file in the ``.jupyter`` directory, with all the defaults commented out, use the following command:
30
+
Jupyter Server uses IPython's traitlets system for configuration. Traits can be
31
+
listed in a Python or JSON config file. You can quickly create a
32
+
``jupyter_server_config.py`` file in the ``.jupyter`` directory, with all the
33
+
defaults commented out, use the following command:
0 commit comments