Skip to content

Commit

Permalink
Merge pull request jupyter-server#277 from Zsailer/docs-extension-points
Browse files Browse the repository at this point in the history
update docs to use _jupyter_server_extension_points
  • Loading branch information
blink1073 committed Aug 19, 2020
2 parents fb9b479 + 84f930c commit 73e297d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/source/developers/extensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ Then add this handler to Jupyter Server's Web Application through the ``_load_ju
Making an extension discoverable
--------------------------------

To make this extension discoverable to Jupyter Server, first define a ``_jupyter_server_extension_paths()`` 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.
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.

.. code-block:: python
def _jupyter_server_extension_paths():
def _jupyter_server_extension_points():
"""
Returns a list of dictionaries with metadata describing
where to find the `_load_jupyter_server_extension` function.
Expand Down Expand Up @@ -255,7 +255,7 @@ To make an ``ExtensionApp`` discoverable by Jupyter Server, add the ``app`` key+
from myextension import MyExtensionApp
def _jupyter_server_extension_paths():
def _jupyter_server_extension_points():
"""
Returns a list of dictionaries with metadata describing
where to find the `_load_jupyter_server_extension` function.
Expand Down Expand Up @@ -301,14 +301,14 @@ Distributing a server extension

Putting it all together, authors can distribute their extension following this steps:

1. Add a ``_jupyter_server_extension_paths()`` function at the extension's root.
1. Add a ``_jupyter_server_extension_points()`` function at the extension's root.
This function should likely live in the ``__init__.py`` found at the root of the extension package. It will look something like this:

.. code-block:: python
# Found in the __init__.py of package
def _jupyter_server_extension_paths():
def _jupyter_server_extension_points():
return [
{
"module": "myextension.app",
Expand Down

0 comments on commit 73e297d

Please sign in to comment.