damianavila / RISE

RISE: "Live" Reveal.js Jupyter/IPython Slideshow Extension
Other
3.67k stars 416 forks source link

export the revealjs presentation that RISE renders #336

Open kcompher opened 6 years ago

kcompher commented 6 years ago

Exporting notebooks to revealJS via nbpresent, npconvert and pandoc all present challenges, and I would like to save the revealJS presentation that RISE creates and rehost it as a standalone static site.

Where does RISE render presentation where I can hopefully just copy it, or is there a better way to export it?

Thanks!

damianavila commented 6 years ago

You can use nbconvert --to slides to create an static slide from your notebook. You mentioned nbconvert before, what problems did you have?

kcompher commented 6 years ago

It didn't seem to catch all the sub-slides and fragments

damianavila commented 6 years ago

It didn't seem to catch all the sub-slides and fragments

It should do it, can you share your presentation (or an example where you see that behavior)?

Thanks!

kcompher commented 6 years ago

Thanks so much for your help! nbconvert works, and I just pop the following into the last notebook cell. %sh jupyter nbconvert Code\ Governance\ Demo.ipynb --to slides --reveal-prefix ../reveal.js

It still would be nice if I could export the RISE version. For instance I have very simple rise.css I call as as a stylesheet that styles test and notebook cells. %md import rise_style; rise_style.style()

When my simple css styling gets clobbered when I define a reveal theme with... %md

I'll try to rewrite the simple notebook style, but do you have any examples I could use to integrate my notebook css with a reveal css, or is there a rise css I can call as a reveal theme?

Thanks again!

damianavila commented 6 years ago

I'll try to rewrite the simple notebook style, but do you have any examples I could use to integrate my notebook css with a reveal css, or is there a rise css I can call as a reveal theme?

Maybe this could help: https://damianavila.github.io/RISE/customize.html#adding-custom-css

fccoelho commented 5 years ago

I am having the same issue: when I try to save the presentation as HTML, all the reveal theme, and other niceties are gone. It's a pity because destroy the portability of your presentation.

RISE should export a folder complete with all the Reveal stuff.

nozebacle commented 5 years ago

Hello, I'm facing the same issues as the above: I created a pretty simple notebook, but when I use nbconvert the result is very different from the version I see when I render it from Jupyter. Is there any way to have access to the files that are generated are runtime? Are they store somewhere or they are never stored? Thanks!

parmentelat commented 5 years ago

Hi

at this point, there is no file involved in the workflow from a Jupyter notebook to reveal.js; as the older livereveal name suggests, conversion to reveal-friendly structures is done live and in-memory; this is by-design, as it allows for a drastically faster, cleaner and unclobbered workflow.

over time we've added features in RISE (primarily IIRC: css customization, and header/footer/background), that nbconvert has not followed on; this I guess is where the issue lies

damianavila commented 5 years ago

over time we've added features in RISE (primarily IIRC: css customization, and header/footer/background), that nbconvert has not followed on; this I guess is where the issue lies

In fact, the static slides you get with nbconvert were always close (well, maybe not to close) but not the same that you see on the live RISE view. We maybe need to make some more work in nbconvert itself to render stuff close to the RISE view...

artur-deluca commented 4 years ago

Any advances on this through RISE? I've posted an issue on nbconvert about this problem but no one seemed to give too much importance...

damianavila commented 4 years ago

No updates recently, although I will take a look, as time permits, into the issue you opened on nbconvert.

FSpanhel commented 4 years ago

Have a look at the comment by JeremyBYU on https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/943 It seems to work with sub-slides and fragments

damianavila commented 4 years ago

Interesting link @FSpanhel, thanks for sharing it!

prosoitos commented 4 years ago

I'm having the same issue. I normally create html presentations for workshops using Hugo and the reveal-hugo theme. The presentation is then accessible online on my website.

I switched to Jupyter notebooks and RISE to have live coding functionality and it works great. The problem is that I don't know how to maintain a static copy of the workshop available online for workshop attendees to go back to after the workshop.

I thought that exporting to an html file with nbconvert would work since I could make that html live on my site. But I have a heavily customized css file and the exported html is not just ugly, but really not functional (same with pdf export).

Any suggestion on how I could make a static version of my presentation as a permanent webpage on my website would be great.

Thanks!!

prosoitos commented 4 years ago

The best workaround I have found (and it's not even hacky, it's plain ridiculous :laughing: ) is to take screenshots of all the slides and stitch all the png into a pdf. It does work, but it's tedious to do and about as inelegant as can possibly be imagined lol (I am so not proud of myself for doing it this way ah ah ah).

parmentelat commented 4 years ago

Hi

you might consider creating a binder instead; the same way as we do for the demo notebooks of RISE itself; in our case the binder link is https://mybinder.org/v2/gh/damianavila/RISE/master?filepath=examples%2FREADME.ipynb (it is the first one available in the resources section in the main README page here)

it's pretty easy to set up, since you primarily need to provide mybinder.org with the URL for your git repo - provided that it's publicly available of course - plus the path to the main slideshow; take a look at the autolaunch setting if you want the slideshow mode to trigger automatically upon startup

users can then enjoy a fully functional/executable environment, so on that side it's very good there are other cons of course, one being that binder is not always super fast, but in your context that might be just the simplest way to go ? because yes of course, manually binding screenshots is not going to bring you very far ;-)

prosoitos commented 4 years ago

Ah, right. You can tell that I am new to the Jupyter world: this must be an obvious solution, but I didn't think of it.

Thank you for reminding me of the existence of binder. I will consider this option, but I don't think that I will use it: I still would like to be able to export my presentation into an html or pdf file as a quick reference/cheatsheet that users can quickly refer to after a workshop to get a reminder of this or that command while working on their own projects. Binder provides a very different thing. It's a wonderful project, just not what I'm after to make my RISE presentations available in a light-weight unencumbered and efficient format.

prosoitos commented 4 years ago

Actually, short of a better solution, I found something that kind of works:

With a complex css file, split slides, and lots of fancy customization, jupyter nbconvert --to pdf and jupyter nbconvert --to slides both gave broken, unusable results. But jupyter nbconvert --to html works. It is plain, pictures are huge, no formatting, etc. but it is usable.

prosoitos commented 4 years ago

I ended up going with the screenshot DIY lame solution :flushed: but at least I wrote a script with scrot and ImageMagick to (mostly) automate the process.

damianavila commented 4 years ago

@prosoitos did you tried this: https://rise.readthedocs.io/en/stable/exportpdf.html#using-decktape Just curious, a long time ago I tested it, and it worked pretty well, although it was a simple presentation...

prosoitos commented 4 years ago

No, I had not noticed this option. Thanks for pointing it out. I'll give it a try and report here how that went.

By the way, my screenshot system (beside being a totally clunky ridiculous one) also has the disadvantage that the hyperlinks are of course inaccessible. So while this is what I did for my last workshop, I am really not satisfied by this.

prosoitos commented 4 years ago

@damianavila : thanks for mentioning decktape! There are issues (e.g. images not embedded, of course the scrolling slides are cut, and some of the colours + the dimensions are off). Resolution is also not perfect. But the result is much better than with nbconvert! This is for sure an interesting avenue worth following and playing with.

prosoitos commented 4 years ago

As for binder, I still have to figure out how to make it work with unofficial kernels.

Edit: got it to work. I had to create a new repo as the Hugo architecture of the repo my notebook was in was preventing binder from finding the requirement and postBuild files.

New edit: actually, I can't get the bash kernel and RISE to work in binder. I can get one or the other to work, but I don't know how to set the requirement, environment, etc. files to have both work. There is some conda conflict thing going on in my attempts.

Last edit: I finally got it to work. Apparently an environment.yml file and a requirements.txt file don't play well together. Moving everything in the environment.yml and deleting requirements.txt solved my problems.

Sorry for all my ranting and irrelevant comments on this thread... :flushed:

binder does work and at the end of all these tries, it probably is the best solution... @parmentelat, I think you were right and I should go with that. Thanks again for your suggestion.

parmentelat commented 4 years ago

glad you could get it to work; and please don't apologize, this piece of info might very well be relevant to others some day :)

armsp commented 3 years ago

@damianavila @parmentelat I am having the same issue with my slides. If you don't use the split-cell extension then things are sort of usable - No CSS, even a bit of custom HTML in markdown cells for centering the headings doesn't work in exported outputs.

The beauty of RISE is that with the split cell extension, the slides just work so damn well, but on export it fails miserably.

I really wish there was good support for CSS and split-cells extension to be exported properly as reveal.js slides.

damianavila commented 3 years ago

@armsp you are using nbconvert to export, right? Have you tried decktape? See my comment above: https://github.com/damianavila/RISE/issues/336#issuecomment-686792250

armsp commented 3 years ago

@damianavila I thought decktape was for PDF export right? I wanted html slides only cause I have some gifs and interactive slides.

damianavila commented 3 years ago

Ahhh... ok, yep decktape is for PDF, AFAIK.

robperch commented 3 years ago

@damianavila same issue here... I would love to generate an HTML that looks just like the RISE presentation I generate with my jupyter nb (e.g. CSS, split-cell, interactive graphs). My objective is to host this HTML file on GitHub to easily share slides using just a link.

Reading the comments above, I think that the best approach is to use Binder. I'll give it a try and see how this approach works for my problem.