Skip to content

Commit f7a860d

Browse files
authored
Merge pull request #453 from dylex/category
Allow configuring jupyterlab launcher category
2 parents 75cba2c + 8455608 commit f7a860d

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

docs/source/server-process.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,15 @@ the following keys:
123123
explicit entry.
124124
2. **icon_path**
125125
Full path to an svg icon that could be used with a launcher. Currently only used by the
126-
JupyterLab launcher
126+
JupyterLab launcher, when category is "Notebook" (default) or "Console".
127127
3. **title**
128128
Title to be used for the launcher entry. Defaults to the name of the server if missing.
129+
4. **path_info**
130+
The trailing path that is appended to the user's server URL to access the proxied server.
131+
By default it is the name of the server followed by a trailing slash.
132+
5. **category**
133+
The category for the launcher item. Currently only used by the JupyterLab launcher.
134+
By default it is "Notebook".
129135

130136
### `new_browser_tab`
131137

jupyter_server_proxy/api.py

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ async def get(self):
2222
"enabled": sp.launcher_entry.enabled,
2323
"title": sp.launcher_entry.title,
2424
"path_info": sp.launcher_entry.path_info,
25+
"category": sp.launcher_entry.category,
2526
},
2627
"new_browser_tab": sp.new_browser_tab,
2728
}

jupyter_server_proxy/config.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525

2626
LauncherEntry = namedtuple(
27-
"LauncherEntry", ["enabled", "icon_path", "title", "path_info"]
27+
"LauncherEntry", ["enabled", "icon_path", "title", "path_info", "category"]
2828
)
2929
ServerProcess = namedtuple(
3030
"ServerProcess",
@@ -148,6 +148,7 @@ def make_server_process(name, server_process_config, serverproxy_config):
148148
icon_path=le.get("icon_path"),
149149
title=le.get("title", name),
150150
path_info=le.get("path_info", name + "/"),
151+
category=le.get("category", "Notebook"),
151152
),
152153
new_browser_tab=server_process_config.get("new_browser_tab", True),
153154
request_headers_override=server_process_config.get(
@@ -230,6 +231,10 @@ class ServerProxy(Configurable):
230231
The trailing path that is appended to the user's server URL to access the proxied server.
231232
By default it is the name of the server followed by a trailing slash.
232233
234+
category
235+
The category for the launcher item. Currently only used by the JupyterLab launcher.
236+
By default it is "Notebook".
237+
233238
new_browser_tab
234239
Set to True (default) to make the proxied server interface opened as a new browser tab. Set to False
235240
to have it open a new JupyterLab tab. This has no effect in classic notebook.

labextension/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ async function activate(
202202
launcher.add({
203203
command: CommandIDs.open,
204204
args: argsForServer(server_process),
205-
category: "Notebook",
205+
category: launcher_entry.category,
206206
kernelIconUrl: launcher_entry.icon_url || void 0,
207207
});
208208
}

labextension/src/tokens.ts

+1
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,5 @@ export interface ILauncherEntry {
102102
path_info: string;
103103
// the `?` means this argument may not exist, but if it does, it must be a string
104104
icon_url?: string;
105+
category?: string;
105106
}

0 commit comments

Comments
 (0)