anaconda / nbpresent

next generation slides for Jupyter Notebooks
BSD 3-Clause "New" or "Revised" License
161 stars 23 forks source link

improve documentation / support request: how do I use nbpresent and its themes to get the slideshow to turn out how I want? #79

Closed jason-s closed 8 years ago

jason-s commented 8 years ago

Normally I would not put a "support request" in a github issue (I know you guys are all volunteers), but there are a number of things I cannot figure out how to do, and I can't find documentation to do them, and they seem like pretty common things that someone would want to do.

I have attached three files:

numpy-matplotlib-intro-ipynb.zip numpy-matplotlib-intro-output.zip numpy-matplotlib-intro-nbpresent.zip

There are a number of features here...

bollwyvl commented 8 years ago

Thanks for the interest!

  • if I want to edit the theme CSS manually, how can I do it?

The theme information is added very late in the process, actually via generated embedded CSS from data stored in the notebook metadata. So right now, you basically have to manipulate the data directly: the importing notebook has examples of doing this. Indeed, it might be hard to override the formatting manually via CSS, as we are attempting to normalize a lot of things that happen due to assumptions about how things appear in the notebook.

  • I want to add some custom Javascript, how can I do it? (My script puts two links to .js files into the rendered HTML, one is to slideshow-custom.js and the other is to a .js file with the same base name as the HTML file)
  • if I want to use an external .css file to override elements of the theme CSS, how can I do it?

You can just create an HTML slide that calls that out explicitly. Assuming you are using the IPython kernel:

%%html
<link rel="stylesheet" href="the-stylesheets.css"/>

An alternative is to make use of a custom nbconvert template which might be attractive if you are doing lots of customization.

  • I really don't want to mess around with regions and having to define a position for each of them, I just want plain concatenation.

The officially-supported revealjs-based presentations are still there, and not going away anytime soon! However, we can't change much about how the revealjs slides work, as there are just too many things out there that make use of them. In the near term in nbpresent, there is an importer that will bring the officially-formatted slides in, but doesn't, for example, support subslides or fragments. We've considered making this a dynamic feature, such that the slides themselves get generated dynamically in a data driven fashion.

  • I want to get my slides to use reveal.js for the animation and 2-D slide navigation features -- how can I do this?

Yup, just keep using slideshow and nbconvert! Definitely check out RISE, which works directly with the slideshow metadata, and was in many ways the inspiration for the nbpresent work. I'm interested to hear what you think might go into nbpresent that would make you consider switching, but glad you are using Jupyter to present your science! For more background, check out the original proposal for an idea of where we might get to one day!

jason-s commented 8 years ago

Thanks for the prompt feedback! I'll check out the %%html magic.

The big draw for me with nbpresent is its integrated features in Jupyter, I can just hit the "play" button and go.

I tried nbconvert templates when I did this work last year, I kept running into too many problems (the big one for me was that it included tons and tons of unused CSS) and I ended up just bailing and transmogrifying to HTML myself with a small Python script (that I called slides-dammit) that uses the markdown library and keeps things simple and the way that I want it.

If I can get the style to be close enough to my hand-crafted Python script in look & feel, then I can use both (nbpresent when editing, slides-dammit for final production).

jason-s commented 8 years ago

Thanks for the recommendation for RISE, I just installed it. I think it's closer to what I am looking for.