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

Add RISE-lab plugin for jupyterlab_rise #326

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

Conversation

f0k
Copy link

@f0k f0k commented Mar 28, 2024

This adds a plugin for jupyterlab_rise. The current RISE plugin is not compatible with it. It is not very smart, instead of trying to access the underlying reveal.js, it steps through the slides and observes whether the slide anchor in the window URL was updated, otherwise it assumes we reached the end.

It requires jupyter to be invoked with jupyter lab (not jupyter notebook), and then to be passed an URL of the form:
http://server:port/rise/your_path/your_notebook.ipynb?token=your_token

Works for me, maybe it will be useful for others!

closes #325

Copy link
Owner

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I've left a comment about the plugin activation logic. Other than that it looks good to me.

}

isActive() {
return true;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can break other plugins activation. Would there be a more robust way to detect it's called in a jupyterlab_rise context?

Alternatively, we could exclude the plugin here:

if (id === 'generic') continue;

but I'd rather go with the former approach.

Copy link
Author

@f0k f0k Apr 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good point. So this would break automatic plugin selection. I'll check if there is a way to tell whether we are in the correct context without waiting for the presentation to be loaded, but it will take a while until I'll get around to that. If I don't find anything, would it be permissible to do a waitForSelector and only return after a not-too-long timeout?

@f0k
Copy link
Author

f0k commented Apr 10, 2024

Ok, I've added a very basic jupyterlab_rise detection: It checks whether the window title is "Rise". This is the only part that remains from the original web page as delivered by the server, everything else in the DOM seems to be replaced via javascript after loading the page, and would be unreliable to test for. It will break plugin detection if someone deliberately titled their reveal.js (or other) presentation "Rise", but I guess we could live with that?

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.

Converting a jupyterlab_rise presentation
2 participants