profile
viewpoint
Eric Charles echarles @datalayer In the cloud. https://datalayer.io Disrupt or die @datalayer

jupyter-server/jupyter_server 204

The backend—i.e. core services, APIs, and REST endpoints—to Jupyter web applications.

jupyterlab/extension-examples 160

JupyterLab Extensions by Examples

jupyterlab/rtc 141

Real Time Collaboration for Jupyter and beyond

datalayer-attic/zeppelin 26

:airplane: Apache Zeppelin on Kubernetes.

jupyterlab/nbclassic 10

Jupyter Notebook as a Jupyter Server extension

jupyterlab/benchmarks 2

Benchmarking tools for JupyterLab

Carreau/quansight-labs-site 0

Development site and blog for Quansight Labs

echarles/echarles 0

Eric Charles' profile page.

PR opened jupyterlab/rtc

Rust backend is now TextArea-specific + params + cleanup
  • The backend is now specific to the TextArea demonstrator, that's why is has been renamed into amtextarea.rs (am stands for automerge indeed)
  • all variables referring to the document have been renamed into doc followed by a more specific hint about the format of the value : doc_backend, doc_data ...
  • a first test has been added into amtextarea.rs. run it with cargo test.
  • The JupyterLab Extension handler builds a textarea automerge backend, passing it its specific values for the doc_id and default_text :
 self.automerge_backend = jrtcam.automerge.new_document("automerge-room", "Hello !")
+50 -51

0 comment

4 changed files

pr created time in 3 minutes

Pull request review commentjupyterlab/jupyterlab

Add xeus-robot to the debugger documentation

 Requirements  For the debugger to be enabled and visible, a kernel with support for debugging is required. -For now ``xeus-python`` is the only Jupyter Kernels for Python that supports debugging.-However other Jupyter Kernels can also support debugging and be compatible with the JupyterLab debugger+Here is a list of kernels that are known to be supporting the debug protocol:++- `xeus-python <https://github.com/jupyter-xeus/xeus-python>`_: Jupyter kernel for the Python programming language+- `xeus-robot <https://github.com/jupyter-xeus/xeus-robot>`_: Jupyter kernel for Robot Framework++Other Jupyter Kernels can also support debugging and be compatible with the JupyterLab debugger by implementing the `Jupyter Debugger Protocol <https://jupyter-client.readthedocs.io/en/latest/messaging.html#debug-request>`_. -To install ``xeus-python`` in a new ``conda`` environment:+If you know of other kernels with support for debugging, please open a PR to add them to this list!++Here is an example on how to install ``xeus-python`` in a new ``conda`` environment:
Here is an example of how to install ``xeus-python`` in a new ``conda`` environment:
jtpio

comment created time in 3 minutes

Pull request review commentjupyterlab/jupyterlab

Add xeus-robot to the debugger documentation

 Requirements  For the debugger to be enabled and visible, a kernel with support for debugging is required. -For now ``xeus-python`` is the only Jupyter Kernels for Python that supports debugging.-However other Jupyter Kernels can also support debugging and be compatible with the JupyterLab debugger+Here is a list of kernels that are known to be supporting the debug protocol:++- `xeus-python <https://github.com/jupyter-xeus/xeus-python>`_: Jupyter kernel for the Python programming language+- `xeus-robot <https://github.com/jupyter-xeus/xeus-robot>`_: Jupyter kernel for Robot Framework++Other Jupyter Kernels can also support debugging and be compatible with the JupyterLab debugger by implementing the `Jupyter Debugger Protocol <https://jupyter-client.readthedocs.io/en/latest/messaging.html#debug-request>`_. -To install ``xeus-python`` in a new ``conda`` environment:+If you know of other kernels with support for debugging, please open a PR to add them to this list!
If you know of other kernels with support for debugging, please open a PR to add them to this list.

I know you are excited about getting new kernels. To me this seems a bit much for documentation :).

jtpio

comment created time in 3 minutes

pull request commentjupyterlab/jupyterlab

Add xeus-robot to the debugger documentation

Thanks for making a pull request to JupyterLab!

To try out this branch on binder, follow this link: Binder

jtpio

comment created time in 6 minutes

PR opened jupyterlab/jupyterlab

Add xeus-robot to the debugger documentation

<!-- Thanks for contributing to JupyterLab! Please fill out the following items to submit a pull request. See the contributing guidelines for more information: https://github.com/jupyterlab/jupyterlab/blob/master/CONTRIBUTING.md -->

References

Fixes #9634

<!-- Note issue numbers this pull request addresses (should be at least one, see contributing guidelines above). -->

<!-- Note any other pull requests that address this issue and how this pull request is different. -->

Code changes

Documentation changes.

<!-- Describe the code changes and how they address the issue. -->

User-facing changes

In the documentation:

image

<!-- Describe any visual or user interaction changes and how they address the issue. -->

<!-- For visual changes, include before and after screenshots here. -->

Backwards-incompatible changes

None <!-- Describe any backwards-incompatible changes to JupyterLab public APIs. -->

+9 -3

0 comment

1 changed file

pr created time in 6 minutes

issue commentjupyterlab/jupyterlab

Viewing a table object in a new window

So I needed to quickly check results in a pandas DataFrame using interactive filtering but did not want to install a third-party plugin; here is what you can easily achieve with sidecar + ipywidgets:

pandas_explorer-demo

Gist with code: https://gist.github.com/krassowski/159bb0c76ff47edb031710e2cff6862f

The code could be improved by rewriting the search to use regular expressions and to sanitize the cell content (html), but other than that it works fine for me. An important feature is the default limit on numer of columns and rows so that large datasets do not freeze the lab.

The only major issue is with sidecar layout preventing scrollbars from working. It was raised a few time over at the sidecar repository but it seems to receive little attention. It would really be great if someone with better understanding of the widgets system could have a look at https://github.com/jupyter-widgets/jupyterlab-sidecar/issues/59 (and issues mentioned in there).

pdeffebach

comment created time in 8 minutes

pull request commentjupyterlab/jupyterlab

Fix use of hyphen in module name

I'm working on some test extensions.

hbcarlos

comment created time in 18 minutes

pull request commentjupyterlab/jupyterlab

Fix use of hyphen in module name

Thinking out loud. Maybe it will be possible to construct some test cases by generating extensions with hyphens and underscores in the names, using the cookiecutter.

hbcarlos

comment created time in 20 minutes

issue commentjupyterlab/jupyterlab

Absolute File Paths not working

Could you elaborate and give some examples of what you are proposing?

apiarian

comment created time in an hour

delete branch jupyterlab/jupyterlab

delete branch : krassowski-patch-2

delete time in an hour

issue commentjupyterlab/jupyterlab

Absolute File Paths not working

could we have something like file but root for script cells? mayby this would also work for markdown?

apiarian

comment created time in 2 hours

issue commentjupyterlab/jupyterlab

Rich text copy for code editor

I was thinking about using @jupyterlab/rendermime as for example here:

https://github.com/jupyterlab/jupyterlab/blob/b4db7f03d2ad0b91a9c8c252c56ae5e4a9408fbb/packages/tooltip/src/widget.ts#L77-L78

Although when looking at the output of some markdown code, it still uses the cm-${token.type} classes in the HTML just like the code editor, so you would still have to use computed styles to place them inline for the clipboard.

Maybe. On one hand browsers are intelligent enough to be able to copy the relevant styles when it is a user-invoked copy operation, but on the other I just tested it with a code snippet in markdown in Chrome and see that bold style was correctly copied but the colors were effectively lost as those are set as CSS variables (well the style was inlined properly copied but the referenced variables are no longer there after paste into a different document); this would be browser dependent I believe.

jqrun

comment created time in 2 hours

PR opened jupyterlab/rtc

Fix for last version of automerge
+8 -7

0 comment

2 changed files

pr created time in 3 hours

issue commentjupyterlab/jupyterlab

Rich text copy for code editor

Good point!

Implementation wise it could completely ignore CodeMirror existence and use the Markdown render, rendering the code wrapped with triple backticks (with proper language mode) to an off-screen HTML element and then just copying the generated HTML to clipboard. It would be much cleaner I think, and would avoid any overlay issues. Also, it should be easily possible to implement with the current JupyterLab public APIs.

Interesting idea with the markdown render off screen! Could you point me to which renderer to use for that? Although when looking at the output of some markdown code, it still uses the cm-${token.type} classes in the HTML just like the code editor, so you would still have to use computed styles to place them inline for the clipboard.

jqrun

comment created time in 3 hours

issue openedjupyterlab/jupyterlab

jupyterlab cannot run tkinter with error "no display name and no $DISPLAY environment variable"

Description

jupyterlab cannot run tkinter with error "no display name and no $DISPLAY environment variable" Jupyterlab runs on my CentOS server and I open Jupyterlab from a Windows PC's browser

Reproduce

import time
import tkinter
import tkinter.messagebox

def download():
    time.sleep(10)
    tkinter.messagebox.showinfo('tip','done!')
    
def show_about():
    tkinter.messagebox.showinfo('about','version:v1.0')
    
def main():
    top = tkinter.Tk()
    top.title('singel')
    top.geometry('200x150')
    top.wm_attributes('-topmost',True)
    panel = tkinter.Frame(top)
    button1 = tkinter.Button(panel,text='down',command=download)
    button1.pack(side='left')
    button2 = tkinter.Button(panel,text='about',command=show_about)
    button2.pack(side='right')
    tkinter.mainloop()
   
if __name__=='__main__':
    main()

Error

> ---------------------------------------------------------------------------
> TclError                                  Traceback (most recent call last)
> <ipython-input-7-9fc2379911a3> in <module>
>      23 
>      24 if __name__=='__main__':
> ---> 25     main()
> 
> <ipython-input-7-9fc2379911a3> in main()
>      11 
>      12 def main():
> ---> 13     top = tkinter.Tk()
>      14     top.title('singel')
>      15     top.geometry('200x150')
> 
> ~/anaconda3/lib/python3.8/tkinter/__init__.py in __init__(self, screenName, baseName, className, useTk, sync, use)
>    2259                 baseName = baseName + ext
>    2260         interactive = 0
> -> 2261         self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
>    2262         if useTk:
>    2263             self._loadtk()
> 
> TclError: no display name and no $DISPLAY environment variable

Context

Jupyterlab in my linux server

  • Operating System and version: centos 7
  • JupyterLab version: 3.0.5

My laptop

  • Operating System and version: windows 10
  • Browser and version: Google Chrome 87.0.4280.141

created time in 5 hours

Pull request review commentjupyterlab/jupyterlab

Fix use of hyphen in module name

 def _get_labextension_metadata(module):         Importable Python module exposing the         magic-named `_jupyter_labextension_paths` function     """++    mod_path = osp.abspath(module)+    if not osp.exists(mod_path):+        raise FileNotFoundError('The path `{}` does not exist.'.format(module))++    # Check if the path is a valid labextension     try:         m = importlib.import_module(module)+        if hasattr(m, '_jupyter_labextension_paths') :+            labexts = m._jupyter_labextension_paths()+            return m, labexts+        else :+            m = None+     except Exception:         m = None -    if not hasattr(m, '_jupyter_labextension_paths'):-        mod_path = osp.abspath(module)-        if osp.exists(mod_path):--            # Try getting the package name from setup.py-            try:-                package = subprocess.check_output([sys.executable, 'setup.py', '--name'], cwd=mod_path).decode('utf8').strip()-            except subprocess.CalledProcessError:-                from setuptools import find_packages-                package = find_packages(mod_path)[0]--            # Replace hyphens with underscores to match Python convention-            package = package.replace('-', '_')--            # Make sure the package is installed-            import pkg_resources-            try:-                dist = pkg_resources.get_distribution(package)-            except pkg_resources.DistributionNotFound:-                subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-e', mod_path])-                sys.path.insert(0, mod_path)--            m = importlib.import_module(package)--    if not hasattr(m, '_jupyter_labextension_paths'):-        raise KeyError('The Python module {} is not a valid labextension, '-                       'it is missing the `_jupyter_labextension_paths()` method.'.format(module))-    labexts = m._jupyter_labextension_paths()-    return m, labexts+    # Try getting the package name from setup.py+    try:+        package = subprocess.check_output([sys.executable, 'setup.py', '--name'], cwd=mod_path).decode('utf8').strip()+    except subprocess.CalledProcessError:+        raise FileNotFoundError('The Python package `{}` is not a valid package, '+                'it is missing the `setup.py` file.'.format(module))++    # Make sure the package is installed+    import pkg_resources+    try:+        dist = pkg_resources.get_distribution(package)+    except pkg_resources.DistributionNotFound:+        subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-e', mod_path])

Installing the package is the default behavior of the develop command at the moment.

hbcarlos

comment created time in 7 hours

Pull request review commentjupyterlab/jupyterlab

Fix use of hyphen in module name

 def _get_labextension_metadata(module):         Importable Python module exposing the         magic-named `_jupyter_labextension_paths` function     """++    mod_path = osp.abspath(module)+    if not osp.exists(mod_path):+        raise FileNotFoundError('The path `{}` does not exist.'.format(module))++    # Check if the path is a valid labextension     try:         m = importlib.import_module(module)+        if hasattr(m, '_jupyter_labextension_paths') :+            labexts = m._jupyter_labextension_paths()+            return m, labexts+        else :+            m = None+     except Exception:         m = None -    if not hasattr(m, '_jupyter_labextension_paths'):-        mod_path = osp.abspath(module)-        if osp.exists(mod_path):--            # Try getting the package name from setup.py-            try:-                package = subprocess.check_output([sys.executable, 'setup.py', '--name'], cwd=mod_path).decode('utf8').strip()-            except subprocess.CalledProcessError:-                from setuptools import find_packages-                package = find_packages(mod_path)[0]--            # Replace hyphens with underscores to match Python convention-            package = package.replace('-', '_')--            # Make sure the package is installed-            import pkg_resources-            try:-                dist = pkg_resources.get_distribution(package)-            except pkg_resources.DistributionNotFound:-                subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-e', mod_path])-                sys.path.insert(0, mod_path)--            m = importlib.import_module(package)--    if not hasattr(m, '_jupyter_labextension_paths'):-        raise KeyError('The Python module {} is not a valid labextension, '-                       'it is missing the `_jupyter_labextension_paths()` method.'.format(module))-    labexts = m._jupyter_labextension_paths()-    return m, labexts+    # Try getting the package name from setup.py+    try:+        package = subprocess.check_output([sys.executable, 'setup.py', '--name'], cwd=mod_path).decode('utf8').strip()+    except subprocess.CalledProcessError:+        raise FileNotFoundError('The Python package `{}` is not a valid package, '+                'it is missing the `setup.py` file.'.format(module))++    # Make sure the package is installed+    import pkg_resources+    try:+        dist = pkg_resources.get_distribution(package)+    except pkg_resources.DistributionNotFound:+        subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-e', mod_path])

Not sure, personally I install the python package before installing the extension but maybe someone is using jupyter-labextensions develop . to install everything.

hbcarlos

comment created time in 7 hours

Pull request review commentjupyterlab/jupyterlab

Fix use of hyphen in module name

 def _get_labextension_metadata(module):         Importable Python module exposing the         magic-named `_jupyter_labextension_paths` function     """++    mod_path = osp.abspath(module)+    if not osp.exists(mod_path):+        raise FileNotFoundError('The path `{}` does not exist.'.format(module))++    # Check if the path is a valid labextension     try:         m = importlib.import_module(module)+        if hasattr(m, '_jupyter_labextension_paths') :+            labexts = m._jupyter_labextension_paths()+            return m, labexts+        else :+            m = None+     except Exception:         m = None -    if not hasattr(m, '_jupyter_labextension_paths'):-        mod_path = osp.abspath(module)-        if osp.exists(mod_path):--            # Try getting the package name from setup.py-            try:-                package = subprocess.check_output([sys.executable, 'setup.py', '--name'], cwd=mod_path).decode('utf8').strip()-            except subprocess.CalledProcessError:-                from setuptools import find_packages-                package = find_packages(mod_path)[0]--            # Replace hyphens with underscores to match Python convention-            package = package.replace('-', '_')--            # Make sure the package is installed-            import pkg_resources-            try:-                dist = pkg_resources.get_distribution(package)-            except pkg_resources.DistributionNotFound:-                subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-e', mod_path])-                sys.path.insert(0, mod_path)--            m = importlib.import_module(package)--    if not hasattr(m, '_jupyter_labextension_paths'):-        raise KeyError('The Python module {} is not a valid labextension, '-                       'it is missing the `_jupyter_labextension_paths()` method.'.format(module))-    labexts = m._jupyter_labextension_paths()-    return m, labexts+    # Try getting the package name from setup.py+    try:+        package = subprocess.check_output([sys.executable, 'setup.py', '--name'], cwd=mod_path).decode('utf8').strip()+    except subprocess.CalledProcessError:+        raise FileNotFoundError('The Python package `{}` is not a valid package, '+                'it is missing the `setup.py` file.'.format(module))++    # Make sure the package is installed+    import pkg_resources+    try:+        dist = pkg_resources.get_distribution(package)+    except pkg_resources.DistributionNotFound:+        subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-e', mod_path])

Do we want to install the package?

hbcarlos

comment created time in 9 hours

Pull request review commentjupyterlab/jupyterlab

Fix use of hyphen in module name

 def _get_labextension_metadata(module):         Importable Python module exposing the         magic-named `_jupyter_labextension_paths` function     """++    mod_path = osp.abspath(module)+    if not osp.exists(mod_path):+        raise FileNotFoundError('The path `{}` does not exist.'.format(module))++    # Check if the path is a valid labextension     try:         m = importlib.import_module(module)+        if hasattr(m, '_jupyter_labextension_paths') :+            labexts = m._jupyter_labextension_paths()+            return m, labexts+        else :+            m = None+     except Exception:         m = None -    if not hasattr(m, '_jupyter_labextension_paths'):-        mod_path = osp.abspath(module)-        if osp.exists(mod_path):--            # Try getting the package name from setup.py-            try:-                package = subprocess.check_output([sys.executable, 'setup.py', '--name'], cwd=mod_path).decode('utf8').strip()-            except subprocess.CalledProcessError:-                from setuptools import find_packages-                package = find_packages(mod_path)[0]--            # Replace hyphens with underscores to match Python convention-            package = package.replace('-', '_')--            # Make sure the package is installed-            import pkg_resources-            try:-                dist = pkg_resources.get_distribution(package)-            except pkg_resources.DistributionNotFound:-                subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-e', mod_path])-                sys.path.insert(0, mod_path)--            m = importlib.import_module(package)--    if not hasattr(m, '_jupyter_labextension_paths'):-        raise KeyError('The Python module {} is not a valid labextension, '-                       'it is missing the `_jupyter_labextension_paths()` method.'.format(module))-    labexts = m._jupyter_labextension_paths()-    return m, labexts+    # Try getting the package name from setup.py+    try:+        package = subprocess.check_output([sys.executable, 'setup.py', '--name'], cwd=mod_path).decode('utf8').strip()

We should maybe not even do this anymore. @maartenbreddels found that this was causing issues when the setup.py does some logging.

hbcarlos

comment created time in 9 hours

Pull request review commentjupyterlab/jupyterlab

Fix use of hyphen in module name

 def _get_labextension_metadata(module):         Importable Python module exposing the         magic-named `_jupyter_labextension_paths` function     """++    mod_path = osp.abspath(module)+    if not osp.exists(mod_path):+        raise FileNotFoundError('The path `{}` does not exist.'.format(module))++    # Check if the path is a valid labextension     try:         m = importlib.import_module(module)+        if hasattr(m, '_jupyter_labextension_paths') :+            labexts = m._jupyter_labextension_paths()+            return m, labexts+        else :+            m = None+     except Exception:         m = None -    if not hasattr(m, '_jupyter_labextension_paths'):-        mod_path = osp.abspath(module)-        if osp.exists(mod_path):--            # Try getting the package name from setup.py-            try:-                package = subprocess.check_output([sys.executable, 'setup.py', '--name'], cwd=mod_path).decode('utf8').strip()-            except subprocess.CalledProcessError:-                from setuptools import find_packages-                package = find_packages(mod_path)[0]--            # Replace hyphens with underscores to match Python convention-            package = package.replace('-', '_')--            # Make sure the package is installed-            import pkg_resources-            try:-                dist = pkg_resources.get_distribution(package)-            except pkg_resources.DistributionNotFound:-                subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-e', mod_path])-                sys.path.insert(0, mod_path)--            m = importlib.import_module(package)--    if not hasattr(m, '_jupyter_labextension_paths'):-        raise KeyError('The Python module {} is not a valid labextension, '-                       'it is missing the `_jupyter_labextension_paths()` method.'.format(module))-    labexts = m._jupyter_labextension_paths()-    return m, labexts+    # Try getting the package name from setup.py+    try:+        package = subprocess.check_output([sys.executable, 'setup.py', '--name'], cwd=mod_path).decode('utf8').strip()+    except subprocess.CalledProcessError:+        raise FileNotFoundError('The Python package `{}` is not a valid package, '+                'it is missing the `setup.py` file.'.format(module))++    # Make sure the package is installed+    import pkg_resources+    try:+        dist = pkg_resources.get_distribution(package)+    except pkg_resources.DistributionNotFound:+        subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-e', mod_path])+        sys.path.insert(0, mod_path)++    # Looking for modules in the package+    from setuptools import find_packages+    packages = find_packages(mod_path)++    # Looking for the labextension metadata+    for package in packages :+        m = importlib.import_module(package)+        if hasattr(m, '_jupyter_labextension_paths') :+            return m, m._jupyter_labextension_paths()

👍🏼

hbcarlos

comment created time in 9 hours

issue commentjupyterlab/jupyterlab

Command palette not searching for keywords correctly

Ideally we put the category names back in the command palette for each item, and we sort by best match without regard to the category the item is in.

falconair

comment created time in 11 hours

issue commentjupyterlab/jupyterlab

Command palette not searching for keywords correctly

This is really confusing because the headings are hidden. Here's what we see in JLab 2, which shows the headings. You'll notice that it still isn't very good because it shows all of the bad matches in that notebook category before showing the best matches in another category, but at least you kind of see what is going on. In JLab 3, the categories are not displayed, so it just is really confusing.

Screen Shot 2021-01-21 at 9 28 46 PM

falconair

comment created time in 11 hours

issue openedjupyterlab/jupyterlab

Command palette not searching for keywords correctly

<!-- Welcome! Before creating a new issue:

  • Search for relevant issues
  • Follow the issue reporting guidelines: https://jupyterlab.readthedocs.io/en/latest/getting_started/issue.html -->

Description

I open the command palette and search for "clear", expecting to find all commands related to clearing cells. It shows me "clear outputs", but not "clear all outputs". image For that, I have to search for "all" image

<!--Describe the bug clearly and concisely. Include screenshots if possible-->

Reproduce

<!--Describe step-by-step instructions to reproduce the behavior-->

  1. Open a notebook in JupyterLab (3.0)
  2. Press ctrl+shift+c (or open from menu)
  3. type in 'clear'

<!--Describe how you diagnosed the issue. See the guidelines at https://jupyterlab.readthedocs.io/en/latest/getting_started/issue.html -->

Expected behavior

I expect to see "Clear outputs" but also "Clear all outputs"

<!--Describe what you expected to happen-->

Context

<!--Complete the following for context, and add any other relevant context-->

  • Operating System and version:
  • Browser and version: Chrome, windows 10, 87.0.4280.141 (Official Build) (64-bit) (cohort: Stable)
  • JupyterLab version: 3.0

<details><summary>Troubleshoot Output</summary> <pre> Paste the output from running jupyter troubleshoot from the command line here. You may want to sanitize the paths in the output. </pre> </details>

<details><summary>Command Line Output</summary> <pre> Paste the output from your command line running jupyter lab here, use --debug if possible. </pre> </details>

<details><summary>Browser Output</summary> <pre> Paste the output from your browser Javascript console here. </pre> </details>

created time in 13 hours

issue commentjupyterlab/jupyterlab

Rich text copy for code editor

Implementation wise it could completely ignore CodeMirror existence and use the Markdown render, rendering the code wrapped with tripplebackticks (with proper language mode) to an off-screen HTML element and then just copying the generated HTML to clipboard. It would be much cleaner I think, and would avoid any overlay issues. Also, it should be easily possible to implement with the current JupyterLab public APIs.

jqrun

comment created time in 14 hours

issue commentjupyterlab/jupyterlab

Allow to customize the mobile layout threshold, or to turn it off in settings

Another annoyance is that the simple mode makes the New Launcher button open new tab/window. It can be counter productive when running JupyterLab as a chrome-app (or within electron) as:

  • it will open a new browser window and switch focus;
  • this is contrary to my expectation as I already learned that switching the simple mode does not destry the remaining main area widgets that I have open, just hides them:
    • I can switch between the main area widgets with shortcuts (I have them set up to <kbd>Ctrl</kbd> + <kbd>Tab</kbd>/<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Tab</kbd> to mimic the behaviour of most browsers)
    • I can open new main area widgets (I just do not see the bar with the tabs):
      • Settings → Advanced Settings Editor opens as a new main area widget in current window
      • both files and notebooks from the file browser open as main area widgets in current window

I think that the intent was to make it more like notebook, but I do not like this behaviour as default. As a user I would appreciate an option to turn it off easily, but maybe it should not be there at all as it is not consistent with other actions. Or maybe there should be two New Launcher buttons when in the simple mode (one opening in the current workspace/window, and another creating a new one); this could also be the same button with a modifier (like "hold shift to open in a new window").

krassowski

comment created time in 14 hours

issue commentjupyterlab/jupyterlab

Rich text copy for code editor

See solutions here: https://discuss.codemirror.net/t/rich-text-copy/695/4

Ah yeah I have already seen the discussions on the codemirror forums, but basically all existing hacks there require computing styles/scraping from stylesheets (and those actually wouldn't successfully ignore overlays from search/selection).

It's definitely already possible to do via an extension that makes some assumptions about Jupyterlab's styling structure and use of getComputedStyle + getPropertyValue.But I think that it would be much more clean and robust if @jupyterlab/codemirror offered this as an API, since it already owns exactly the styling for each token type. Also I think people would be very happy if they could natively copy paste input/output from lab with simple formatting (monospace, colors, text styles).

jqrun

comment created time in 14 hours

issue commentjupyterlab/jupyterlab

How can I apply powerline font in jupyterlab's Terminal?

I've made some further test on the fontFamily in the setting file. I installed Cascadia Mono and Cascadia Mono PL.

When I set fontFamily to Cascadia Mono, the terminal changed font successfully. But this font has no powerline symbols and will display □ in my terminal.

And when I set fontFamily to Cascadia Mono PL, the font breaks just as before.

So is jupyterlab just don't support powerline fonts or I missed something important?

wmhcqw

comment created time in 14 hours

issue commentjupyterlab/jupyterlab

Rich text copy for code editor

See solutions here: https://discuss.codemirror.net/t/rich-text-copy/695/4

jqrun

comment created time in 14 hours

issue commentjupyterlab/jupyterlab

Rich text copy for code editor

like other editors (VSCode for example).

VSCode copies code with formatting? How do you that?

As an initial thought, this sounds like it would be hard to do well.

Yes, a reproducer for that would be to copy any arbitrary code to clipboard in VSCode, and then paste it to an Outlook email. The result is code block complete with syntax highlighting.

For starters here, it would at least be useful to expose a basic html construct that applies styles per Codemirror token type since the styles are already organized per token type: https://github.com/jupyterlab/jupyterlab/blob/master/packages/codemirror/style/base.css

html = ''
for line in codemirrorline:
  for token in line:
    if token.type:
      html += <span ${styles(token.type)}>
    else:
      html += <span>
    
    html += token.string + </span>
  html += '<br>'
jqrun

comment created time in 14 hours

issue openedjupyterlab/jupyterlab

How can I apply powerline font in jupyterlab's Terminal?

I'm working on the jupyterlab 3.0.0 and I want to apply powerline font in my jupyterlab's Terminal.

I've successfully installed powerline in my ssh terminal and it works perfectly with the font PowerlineSymbols.

However, it seems that the jupyter could not find my Powerline Font installed in system. And I've tried several Powerline font and installed them in different ways(by file directly, by pip and by apt-get).

Here is my jupyterlab setting and some powerline fonts' list.

{
    // Terminal
    // @jupyterlab/terminal-extension:plugin
    // Terminal settings.
    // *************************************

    // Font size
    // The font size used to render text.
    "fontSize": 14,

    // Theme
    // The theme for the terminal.
    "theme": "dark",
    
    "fontFamily": "DejaVu Sans Mono for Powerline",

}
$ fc-list | grep Powerline
...
/home/my_user_name/.local/share/fonts/Roboto Mono Bold for Powerline.ttf: Roboto Mono for Powerline:style=Bold
/home/my_user_name/.local/share/fonts/Tinos Bold Italic for Powerline.ttf: Tinos for Powerline:style=Bold Italic
/home/my_user_name/.local/share/fonts/Meslo LG S DZ Bold Italic for Powerline.ttf: Meslo LG S DZ for Powerline:style=Bold Italic
/home/my_user_name/.local/share/fonts/Droid Sans Mono Slashed for Powerline.ttf: Droid Sans Mono Slashed for Powerline:style=Regular
/home/my_user_name/.local/share/fonts/Source Code Pro Powerline LightItalic.otf: Source Code Pro for Powerline,Source Code Pro Light:style=Light Italic,Italic
/home/my_user_name/.local/share/fonts/Monofur Italic for Powerline.ttf: monofur for Powerline:style=italic
/home/my_user_name/.local/share/fonts/Meslo LG S Italic for Powerline.ttf: Meslo LG S for Powerline:style=Italic
/home/my_user_name/.local/share/fonts/Meslo LG L Regular for Powerline.ttf: Meslo LG L for Powerline:style=Regular
/home/my_user_name/.local/share/fonts/ter-powerline-x14b.pcf.gz: Terminess Powerline:style=Bold
/home/my_user_name/.local/share/fonts/Arimo Italic for Powerline.ttf: Arimo for Powerline:style=Italic
/home/my_user_name/.local/share/fonts/Ubuntu Mono derivative Powerline Bold.ttf: Ubuntu Mono derivative Powerline:style=Bold
/home/my_user_name/.local/share/fonts/Space Mono Bold for Powerline.ttf: Space Mono for Powerline:style=Bold
/home/my_user_name/.local/share/fonts/Source Code Pro Powerline MediumItalic.otf: Source Code Pro for Powerline,Source Code Pro Medium:style=Medium Italic,Italic
/home/my_user_name/.local/share/fonts/DejaVu Sans Mono Bold for Powerline.ttf: DejaVu Sans Mono for Powerline:style=Bold
/home/my_user_name/.local/share/fonts/ter-powerline-x24b.pcf.gz: Terminess Powerline:style=Bold
/home/my_user_name/.local/share/fonts/Arimo Bold Italic for Powerline.ttf: Arimo for Powerline:style=Bold Italic
/home/my_user_name/.local/share/fonts/Cousine Italic for Powerline.ttf: Cousine for Powerline:style=Italic
/home/my_user_name/.local/share/fonts/Space Mono for Powerline.ttf: Space Mono for Powerline:style=Regular
/home/my_user_name/.local/share/fonts/Monofur Bold for Powerline.ttf: monofur for Powerline:style=bold
/home/my_user_name/.local/share/fonts/Inconsolata-g for Powerline.otf: Inconsolata\-g for Powerline:style=g
/home/my_user_name/.local/share/fonts/DejaVu Sans Mono for Powerline.ttf: DejaVu Sans Mono for Powerline:style=Book
/home/my_user_name/.local/share/fonts/Source Code Pro for Powerline.otf: Source Code Pro for Powerline:style=Regular
/home/my_user_name/.local/share/fonts/Cousine for Powerline.ttf: Cousine for Powerline:style=Regular
/home/my_user_name/.local/share/fonts/Tinos for Powerline.ttf: Tinos for Powerline:style=Regular
...

I wonder if there is something wrong with the fontFamily in my setting or something else.

Thanks!

created time in 14 hours

more