File tree 9 files changed +83
-5
lines changed
9 files changed +83
-5
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ conda activate jupyterlabextensions && \
90
90
./content
91
91
```
92
92
93
- PS: You can run both ` shell 1 ` and ` shell 2 ` commands with ` npm run dev` .
93
+ PS: You can run both ` shell 1 ` and ` shell 2 ` commands with ` yarn run dev` .
94
94
95
95
Open JupyterLab in your browser.
96
96
Original file line number Diff line number Diff line change @@ -129,3 +129,31 @@ TODO Enable back the `Theme Toggle` extension (disabled for now for CI).
129
129
The ` Top Bar ` extension transforms the existing JupyterLab topbar into a draggable area where third party plugins can add their widgets.
130
130
131
131
TODO Enable back the ` Theme Toggle ` extension (disabled for now for CI).
132
+
133
+ ## Cell Toolbar
134
+
135
+ This extension removes the ` duplicate cell ` icon and add a new ` restart and run all ` icon in the notebook cell toolbar. This is achieved by adding the needed definition in the pluing setting
136
+
137
+ ``` json
138
+ {
139
+ "title" : " Cell Toolbar" ,
140
+ "description" : " Settings for the Cell Toolbar extension" ,
141
+ "type" : " object" ,
142
+ "properties" : {},
143
+ "additionalProperties" : false ,
144
+ "jupyter.lab.toolbars" : {
145
+ "Cell" : [
146
+ {
147
+ "name" : " restart-run-all" ,
148
+ "command" : " notebook:restart-run-all" ,
149
+ "rank" : 10
150
+ },
151
+ {
152
+ "name" : " duplicate-cell" ,
153
+ "command" : " notebook:duplicate-cell" ,
154
+ "disabled" : true
155
+ }
156
+ ]
157
+ }
158
+ }
159
+ ```
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " @datalayer/example-jupyterlab-extensions " ,
2
+ "name" : " jupyterlabextensions " ,
3
3
"version" : " 0.1.0" ,
4
4
"description" : " JupyterLab Extensions Example." ,
5
5
"keywords" : [
Original file line number Diff line number Diff line change
1
+ {
2
+ "title" : " Cell Toolbar" ,
3
+ "description" : " Settings for the Cell Toolbar extension" ,
4
+ "type" : " object" ,
5
+ "properties" : {},
6
+ "additionalProperties" : false ,
7
+ "jupyter.lab.toolbars" : {
8
+ "Cell" : [
9
+ {
10
+ "name" : " restart-run-all" ,
11
+ "command" : " notebook:restart-run-all" ,
12
+ "rank" : 10
13
+ },
14
+ {
15
+ "name" : " duplicate-cell" ,
16
+ "command" : " notebook:duplicate-cell" ,
17
+ "disabled" : true
18
+ }
19
+ ]
20
+ }
21
+ }
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ function activate(
113
113
palette : ICommandPalette ,
114
114
restorer : ILayoutRestorer
115
115
) : void {
116
- console . log ( 'jupyterlab_apod_left is activated.' ) ;
116
+ console . log ( 'JupyterLab extension apod_left is activated.' ) ;
117
117
118
118
const content = new APODWidget ( ) ;
119
119
const widget = new MainAreaWidget ( { content } ) ;
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ function activate(
80
80
palette : ICommandPalette ,
81
81
restorer : ILayoutRestorer | null
82
82
) : void {
83
- console . log ( 'JupyterLab extension jupyterlab_apod is activated!' ) ;
83
+ console . log ( 'JupyterLab extension apod_main is activated!' ) ;
84
84
let widget : MainAreaWidget < APODWidget > ;
85
85
const command = 'apod:open' ;
86
86
app . commands . addCommand ( command , {
Original file line number Diff line number Diff line change 1
1
import apodLeft from './apod-left' ;
2
2
import apodMain from './apod-main' ;
3
3
import cellFlash from './cell-flash' ;
4
+ import cellToolbar from './cell-toolbar' ;
4
5
import codeCellButton from './code-cell-button' ;
5
6
import contextMenu from './context-menu' ;
6
7
import execTime from './exec-time' ;
@@ -27,6 +28,7 @@ export default [
27
28
apodLeft ,
28
29
apodMain ,
29
30
cellFlash ,
31
+ cellToolbar ,
30
32
contextMenu ,
31
33
execTime ,
32
34
internals ,
Original file line number Diff line number Diff line change
1
+ import {
2
+ JupyterFrontEnd ,
3
+ JupyterFrontEndPlugin
4
+ } from '@jupyterlab/application' ;
5
+
6
+ import { ISettingRegistry } from '@jupyterlab/settingregistry' ;
7
+
8
+ /**
9
+ * The plugin registration information.
10
+ */
11
+ const cellToolbar : JupyterFrontEndPlugin < void > = {
12
+ id : 'jupyterlabextensions:cell-toolbar' ,
13
+ description : 'A JupyterLab extension changing the Cell Toolbar.' ,
14
+ autoStart : true ,
15
+ optional : [ ISettingRegistry ] ,
16
+ activate : async ( _ : JupyterFrontEnd , settingRegistry : ISettingRegistry ) => {
17
+ console . log ( 'The Cell Toolbar extension is activated.' ) ;
18
+ // Nothing is needed, this is done by config.
19
+ // The following is just to show in the browser console the loaded setting.
20
+ if ( settingRegistry ) {
21
+ const setting = await settingRegistry . load ( cellToolbar . id ) ;
22
+ console . log ( '--- cellToolbar setting' , setting ) ;
23
+ }
24
+ }
25
+ } ;
26
+
27
+ export default cellToolbar ;
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ export const cellFactoryPlugin: JupyterFrontEndPlugin<NotebookPanel.IContentFact
130
130
provides : NotebookPanel . IContentFactory ,
131
131
autoStart : true ,
132
132
activate : ( app : JupyterFrontEnd , editorServices : IEditorServices ) => {
133
- console . log ( 'jupyterlabextensions:cellcodebtn overrides default nootebook content factory.' ) ;
133
+ console . log ( 'jupyterlabextensions:cellcodebtn overrides default notebook content factory.' ) ;
134
134
const { commands } = app ;
135
135
const editorFactory = editorServices . factoryService . newInlineEditor ;
136
136
return new ContentFactoryWithFooterButton ( commands , { editorFactory } ) ;
You can’t perform that action at this time.
0 commit comments