Playing Jupyter Notebooks through SageCells

37 views
Skip to first unread message

Ingo Dahn

unread,
Jan 11, 2021, 5:52:13 AM1/11/21
to sage-cell

To provide a way for students to work interactively with Jupyter notebooks, with a low entry threshold and a user interface that can be customized with CSS and Javascript, I have implemented the Notebook Player

The Notebook Player reads a Jupyter notebook, converts it into a static HTML page using the nbviewer software and replaces the static images of code cells by linked SageCells which can then be edited and executed by the student. The resulting single html page can be saved and hosted anywhere without any further installation.

Besides the Execute mode with active SageCells, the static view, as produced by nbviewer, is retained, as Read mode, in the generated html page. In both modes, code cell input can be hidden on demand.

Since linked SageCells must be executed one after another, the Notebook Player approach is suited only for notebooks with not too many code cells. Large notebooks should be split up, as the Notebook Player provides a method to transfer intermediate results from one notebook to another.

 Here is a sample page as generated by the Notebook Player.

 This is still experimental; suggestions and error reports are welcome. 

 

Andrey Novoseltsev

unread,
Jan 11, 2021, 12:37:58 PM1/11/21
to sage-cell
This is fantastic!!! I would love to have such a converter when I was teaching, everybody who is still doing it and uses Sage should definitely check it out!

Andrey Novoseltsev

unread,
Jan 11, 2021, 12:41:48 PM1/11/21
to sage-cell
Ingo - please let me know when you think it would be OK to link to this converter from our Help/root page!

I would also suggest to move instructions from a separate page accessible via Help link on the top to the main page below the current box with settings, so that users see it right away.

On Monday, 11 January 2021 at 03:52:13 UTC-7 ingo...@gmail.com wrote:

Ingo Dahn

unread,
Jan 14, 2021, 2:53:05 PM1/14/21
to sage-cell
Thanks for the suggestion. 

An updated version of the Notebook Player, converting Jupyter notebooks into web pages with SageCells, is now available at https://dahn-research.eu/nbplayer/. Feel free use it and to set references to this installation.

It's repo at https://github.com/ingodahn/nbplayer is now public and open for reporting any issue. The repo can be used to set up other installations.

Please discuss suggestions for improvements. in this thread.

Note that notebooks converted with the previous version need to be re-converted with the current version.

Andrey Novoseltsev

unread,
Jan 24, 2021, 11:25:17 AM1/24/21
to sage-cell
Added the link on the root and help pages, thank you for such a great contribution!

Ingo Dahn

unread,
Feb 2, 2021, 4:35:12 AM2/2/21
to sage-cell
Some added sugar: Notebook Site (https://dahn-research.eu/nbsite/) provides navigation between notebook pages and supports data transfer between these pages. This is intended in particular for large notebooks which are best represented as several pages with SageCells, corresponding to subnotebooks. 
Usage instructions and a sample site are available through the URL above. Suggestions and error reports are welcome.

Some use case for Notebook Player: Institutions here mostly maintain a single LMS where students can login with their university account. They are reluctant to support other systems (like CoCalc) which cannot be integrated (through LTI or as a plugin) into this existing LMS and require additional accounts.
As generated by Notebook Player, students can download a single HTML page with SageCells containing code they are requested to edit, save and upload into their LMS course for manual grading. To what extent this is actually possible needs to be tested for each LMS. I noted that our LMS Open OLAT supports this, with the restriction that pages shown for preview are not interactive, since Javascript is blocked.

Elimboto Yohana

unread,
Feb 10, 2021, 1:19:51 PM2/10/21
to Ingo Dahn, sage-cell
Hi Ingo,

Thank you for the great and useful tool, the "Notebook Player", I will take a look and explore it.

Kind regards,

Elimboto

--
You received this message because you are subscribed to the Google Groups "sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cell+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cell/02ac4c19-858b-4d59-973e-85587edb9d4dn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages