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

export the revealjs presentation that RISE renders #336

Open
kcompher opened this issue Jan 25, 2018 · 29 comments
Open

export the revealjs presentation that RISE renders #336

kcompher opened this issue Jan 25, 2018 · 29 comments
Labels

Comments

@kcompher
Copy link

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
Copy link
Owner

damianavila commented Jan 25, 2018

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

@kcompher
Copy link
Author

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

@damianavila
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link

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
Copy link

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
Copy link
Collaborator

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
Copy link
Owner

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
Copy link

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
Copy link
Owner

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

@FSpanhel
Copy link

FSpanhel commented Mar 31, 2020

Have a look at the comment by JeremyBYU on ipython-contrib/jupyter_contrib_nbextensions#943
It seems to work with sub-slides and fragments

@damianavila
Copy link
Owner

Interesting link @FSpanhel, thanks for sharing it!

@prosoitos
Copy link

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
Copy link

prosoitos commented Aug 31, 2020

The best workaround I have found (and it's not even hacky, it's plain ridiculous 😆 ) 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
Copy link
Collaborator

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
Copy link

prosoitos commented Sep 2, 2020

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
Copy link

prosoitos commented Sep 2, 2020

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
Copy link

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

@damianavila
Copy link
Owner

@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
Copy link

prosoitos commented Sep 9, 2020

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
Copy link

prosoitos commented Sep 10, 2020

@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
Copy link

prosoitos commented Sep 10, 2020

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... 😳

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
Copy link
Collaborator

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
Copy link

armsp commented Oct 29, 2020

@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
Copy link
Owner

@armsp you are using nbconvert to export, right? Have you tried decktape? See my comment above: #336 (comment)

@armsp
Copy link

armsp commented Oct 30, 2020

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

@damianavila
Copy link
Owner

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

@robperch
Copy link

robperch commented Apr 8, 2021

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants