|
@@ -396,6 +396,10 @@ lab_flags['watch'] = (
|
|
|
{'LabApp': {'watch': True}},
|
|
|
"Start the app in watch mode."
|
|
|
)
|
|
|
+lab_flags['expose-global'] = (
|
|
|
+ {'LabApp': {'expose_global': True}},
|
|
|
+ "Expose the global app instance to browser via window.lab"
|
|
|
+)
|
|
|
|
|
|
|
|
|
class LabApp(NotebookApp):
|
|
@@ -476,6 +480,9 @@ class LabApp(NotebookApp):
|
|
|
watch = Bool(False, config=True,
|
|
|
help="Whether to serve the app in watch mode")
|
|
|
|
|
|
+ expose_global = Bool(False, config=True,
|
|
|
+ help="Whether to expose the global app instance to browser via window.lab")
|
|
|
+
|
|
|
def init_webapp(self, *args, **kwargs):
|
|
|
super().init_webapp(*args, **kwargs)
|
|
|
settings = self.web_app.settings
|