Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very early Jupyterlab extension prototype #381

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

damianavila
Copy link
Owner

@damianavila damianavila commented May 7, 2018

Hey folks, particularly @parmentelat and @athornton who were interested in this issue, this is what I have today... in fact is something I did several months ago and I did not have time to continue working on it. But, it will give you ideas about how to port RISE to a jupyterlab extension.

I tested this with the latest jupyterlab and it seems to work OK.

Some things I would like to highlight:

  1. This implements a very basic slideshow with 4 cells... we should generalize the behavior to deal with any number of cells as RISE do, but I started this simple to have something working.
  2. You will see a lot of commented code, some of them it probably non-sense but maybe it could give you information about how the thing evolved.
  3. Currently, this is implemented as a button in the toolbar, such as RISE... but maybe an Open with... option (right click over the notebook file) and something at the menu level is better... in that way, we should only migrate the parts that convert from the notebook view into the slideshow view. The steps going from the slide to the notebook view, it does not make sense in an Open with... scenario, I think.
  4. I added here a helper npm package called reveal_rise which provides the reveal.css content with some modification to remove the RESET styles, otherwise, it resets the style of the whole application
    I have already pushed the helper into the npm site, but I wanted to give you some context about it.

Finally, if we can work together on this, I believe we can have a better prototype, much closer to RISE in a few weeks. Let's see how it goes!

Let me know if you have questions or any other things to discuss...

@gsemet
Copy link

gsemet commented May 16, 2018

Looking forward to get RISE in jupyterlab !

@damianavila damianavila mentioned this pull request May 21, 2018
@damianavila
Copy link
Owner Author

@parmentelat @athornton, please let me know if you are playing with this... Next week, I will probably spend some time on the extension since I will be colocated with Jupyter/JupyterLab devs at the annual team meeting which I hope help leverage and accelerate the ongoing thing 😉

@parmentelat
Copy link
Collaborator

Hello Damian; nope, I have not had the time to look into this any deeper so far, sorry

@athornton
Copy link

I am not going to get to it before next week; I've been pulled sideways to work on horizontal scalability of some of our components and haven't had time to do much upstream work.

@parmentelat
Copy link
Collaborator

I don't know what's wrong with me today, but this again should not have been closed, re-opening

@parmentelat parmentelat reopened this May 22, 2018
@Bamieh
Copy link

Bamieh commented May 27, 2018

Thank you for you effort guys! I am looking forwards to seeing this implemented. CheersThank you for you effort guys! I am looking forwards to seeing this implemented. Cheers

@athornton
Copy link

Starting to poke at it a little today. I'm also on the hook to support a workshop we're hosting, so I don't know how much time I will really have today and tomorrow, but just wanted to say that I've at least got a story to work on it in my project cycle that starts tomorrow.

@damianavila
Copy link
Owner Author

@athornton @parmentelat I have made a commit cleaning all the historical comments and pushing a little markupSlides function taking care of the slide type of cells. So you have an idea about how that would work. Things are functional but in a very light version and prone to have errors... let's see how it continues 😉

@athornton
Copy link

Awesome! Thank you. I will try to play some this weekend before getting sucked into setting up for the LSST Europe conference next week.

@egavves
Copy link

egavves commented Jun 3, 2018

Hi,

first of all, congrats on this, I find the prospect of using Jupyter-lab for blended presentations with code and content exciting!

I was wondering if you have an idea, when do you expect to have a minimum stable version (or should I stick to jupyter for now)? I plan to use it in my course, i think it would it really help students understand things better.

Best,

@damianavila
Copy link
Owner Author

I was wondering if you have an idea, when do you expect to have a minimum stable version (or should I stick to jupyter for

I would expect to have some minimal stable version by August, meaning main functionality but without all the niceties of the current RISE implementation.

@davclark
Copy link

Does this truly require jupyterlab < 0.17?

@damianavila
Copy link
Owner Author

Does this truly require jupyterlab < 0.17?

I have it working with jupyterlab 0.32.1
I need to catch up with the latest version yet.

@athornton
Copy link

https://github.com/lsst-sqre/RISE has a version that builds against 0.34 but it is untested. Feel free to grab it though.

@stonebig
Copy link

@athornton: is your patch just a matter of doing this on an existing rise-5.4.2 ?

jupyter.exe  labextension install jupyterlab_rise

@stonebig
Copy link

stonebig commented Sep 8, 2018

Jupyterlab-1.0 is coming (apparently in october). Is there an alternative in Jupyterlab, if this is not available ?

@leeweizhe1993
Copy link

Strongly looking forward to the extension supporting jupyterlab XD

@damianavila
Copy link
Owner Author

Strongly looking forward to the extension supporting jupyterlab XD

Strongly looking forward to having time to work on this 😉
Hopefully, I can devote some time in the next few weeks/months, but no promises (but I would try to do my best to push it forward).

@juliensiebert
Copy link

Hi!

I tried today (windows 10, jupyter-lab 0.35.3), followed the instructions for installing in a dev environment (conda). I had to change the dependencies settings in the json file to allow for jupyter-lab > 0.16.2 (see below).

  "dependencies": {
    "@jupyterlab/application": ">=0.16.2",
    "@jupyterlab/notebook": ">=0.16.2",
    "reveal.js": "^3.6.0",
    "reveal_rise": "^1.0.0"
  },

The install went smoothly (no error at least).

However the button for RISE lost its content and is almost invisible.

screenshot-2019-1-16 jupyterlab

Looking at the HTML code for the button, I got:

<button class="myButton jp-ToolbarButtonComponent" title="RISE me"></button>

It seems that the icon is missing.

However (bis), nothing happens when I click on the button

capture

Any idea what is happening?

@henryiii
Copy link

Almost the entire PyHEP conference was given as notebook talks; but mostly just scrolling JupyterLab pages. It would be fantastic if RISE would come back for JupyterLab!

@parmentelat
Copy link
Collaborator

parmentelat commented Nov 1, 2020

Hey @damianavila

many thanks for taking the time to clean all that up; I just gave that a try

running jupyter lab on our examples/ subdir, I could start the slideshow on README.ipynb
unfortunately that's about all I could do; subsequent attempts at running rise in the same lab session - including on the same notebook - seems to be failing; had to reload the jupyterlab app from the browser to be able to run rise again (edit: when clicking the rise icon a second time or on another notebook, I get a white page and that's it...)
other example notebooks do not seem to work at all - even as a first attempt

so I understand this is a rough sketch; plus, this is my first time ever, so I may be misusing something; but could you please write in (even short) words what is expected to work or not at this point ?

thanks again !

@damianavila
Copy link
Owner Author

This is a rough sketch... working with some local notebook without any subslides... let me just push that notebook in the lab directory as well...

Currently exploring several ideas before going straight with the porting...

@damianavila
Copy link
Owner Author

damianavila commented Nov 1, 2020

I was able to do some work on packaging some other jupyterlab extensions recently so once we have this enough OK for a MVP, I want to ship it to get early feedback and keep iterating...

Btw, I just pushed the notebook I am using now for testing purposes...

@darkdragon-001
Copy link

@damianavila I just bought you a star on ko-fi. Looking forward to this feature!

@damianavila
Copy link
Owner Author

damianavila commented Nov 4, 2020

OK, finding interesting issues/problems along the way... you can see this video

https://youtu.be/7J9OaW4zvJE

where I described what I have written below + showing some real stuff you may find interesting (spoiler: dual-mode).

The multiple tabs experience JupyterLab provides is actually bringing us some issues at the time to use reveal.js.
Reveal.js does a lot of DOM manipulations and is not able to keep the reference to removed reveal objects.
And you remove elements, for instance, when you close a notebook that is already being RISEd... you are losing some reveal-based injected stuff that is not "repopulated" when you try to show the slideshow again.

I currently foresee two main alternatives:

  1. try to upgrade to reveal.js 4.0 that provides support to multiple presentations on the same page (not sure if it will work but I have some hopes trying to create a new slideshow every time a notebook is open and RISEd)

  2. a more drastic move to some other js slideshow library that is less aggressive manipulating the DOM and supporting a classed based markup (impress.js, maybe?)

I will keep researching and trying stuff... this is actually fun 😉

Btw, pushing again as soon as I have something others can successfully try...

@wstomv
Copy link

wstomv commented Jan 10, 2021

JupyterLab 3.0, which was released just before Christmas, has an improved extension mechanism (so I read). With JL 3.0 it is possible to distribute extensions separately (so-called prebuilt extensions) and to install them (e.g. through pip) without rebuilding JL.

Will that make things easier for providing RISE to JupyterLab users? I am eagerly looking forward to using RISE under JL. It is the last missing feature that blocks the transition from Classic to JL in my teaching.

@henryiii
Copy link

Note that simple mode in 3.0 also looks to be potentially useful, as it simplifies the structure quite a bit, dropping the multiple tabs.

@damianavila
Copy link
Owner Author

Will that make things easier for providing RISE to JupyterLab users?

It will make things easy at the time to deliver the RISE experience because we should be able to have just ONE package to install classic RISE AND jupyterlab RISE at the same time...

@westurner
Copy link

cc'ing from #270

JupyterLab 3.0 has new, better extension support that doesn't require rebuilding the JS:
jupyterlab.readthedocs.io/en/stable/extension/extension_dev.html#distributing-a-prebuilt-extension

Build a prebuilt extension using the jupyter labextension build command.
[...]
The official extension cookiecutter shows how to distribute prebuilt extensions via Python pip or conda packages. A system package manager, or even just an administrative script that copies directories, could be used as well.
jupyterlab/extension-cookiecutter-ts

What are the remaining tasks?

  • Update packaging to use JupyterLab 3.0 prebuilt extension support
  • Automated Tests
    • Is GitHub Actions already configured for this repo?

@asaboor-gh
Copy link

Consider using ipyslides with full control over how content is displayed, no need of metadata editing. Although there are limitations as author (myself) is not a frontend expert. It is based on ipywidgets mechanism, so you can live display content like bqplots, ipywidgets, ipyvolume etc.
See an example at binder

@fcollonval fcollonval mentioned this pull request Nov 15, 2021
16 tasks
@parmentelat parmentelat force-pushed the master branch 2 times, most recently from 5e2531e to 6d81041 Compare September 17, 2023 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.