-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b41ab9a
commit 000755e
Showing
15 changed files
with
98 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY | ||
_commit: v4.0.9 | ||
_commit: v4.2.4 | ||
_src_path: https://github.com/jupyterlab/extension-template | ||
author_email: '' | ||
author_name: '' | ||
author_name: Project Jupyter Contributors | ||
data_format: string | ||
file_extension: '' | ||
has_binder: true | ||
has_settings: false | ||
kind: frontend | ||
labextension_name: jupyterlab-toparea-text | ||
labextension_name: '@jupyterlab-examples/toparea' | ||
mimetype: '' | ||
mimetype_name: '' | ||
project_short_description: A JupyterLab extension to add text in the top area. | ||
python_name: jupyterlab_toparea_text | ||
repository: '' | ||
python_name: jupyterlab_examples_toparea | ||
repository: https://github.com/jupyterlab/extension-examples | ||
test: false | ||
viewer_name: '' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ node_modules | |
**/lib | ||
**/package.json | ||
!/package.json | ||
jupyterlab_toparea_text | ||
jupyterlab_examples_toparea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
enableImmutableInstalls: false | ||
|
||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,41 @@ | ||
# Top Area Text Widget (jupyterlab_toparea_text) | ||
# Top area widget (cross compatible extension) | ||
|
||
A very simple example that adds a basic text widget to the top area. See [related video](https://www.youtube.com/watch?v=mqotG1MkHa4). | ||
This example is part of the [Extension Dual Compatibility Guide](https://jupyterlab.readthedocs.io/en/latest/extension_dual_compatibility.html). | ||
You can find details about this example on that page. | ||
This example defines an extension that adds a single self-contained text widget | ||
to the top bar of the UI. | ||
|
||
![preview](./preview.jpg) | ||
|
||
## Jupyter Notebook / JupyterLab compatibility | ||
|
||
As Jupyter Notebook 7+ is built with components from JupyterLab, and since | ||
both use the same building blocks, that means your extension can work | ||
on both (or any other frontend built with JupyterLab components) with | ||
little or no modification depending on its design. | ||
|
||
This extension doesn't need to do anything at all to be compatible | ||
with both JupyterLab and Notebook 7+ (both apps have a top area that can hold the | ||
widget, so it will be visible in both JupyterLab and Notebook 7+ upon install and | ||
after launch). This will be the case if your extension only uses features | ||
that both applications have. | ||
|
||
## Adding a widget to the top area | ||
|
||
You can add a widget to the top area by calling the following | ||
method of the application shell: | ||
|
||
```ts | ||
// src/index.ts#L34-L34 | ||
|
||
app.shell.add(widget, 'top', { rank: 1000 }); | ||
``` | ||
|
||
The _rank_ is used to order the widget within the top area. | ||
|
||
## Where to Go Next | ||
|
||
If your extension is using features that are not common to both interfaces, | ||
special steps needs to be taken. You can have a look at the [Shout button example](../shout-button-message) | ||
that uses a feature available in JupyterLab but not in Notebook 7+. | ||
|
||
You can have more information about this in the | ||
[Extension Dual Compatibility Guide](https://jupyterlab.readthedocs.io/en/latest/extension_dual_compatibility.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"packageManager": "python", | ||
"packageName": "jupyterlab_toparea_text", | ||
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_toparea_text" | ||
"packageName": "jupyterlab_examples_toparea", | ||
"uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyterlab_examples_toparea" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__import__('setuptools').setup() | ||
__import__("setuptools").setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.