Skip to content

Add reveal.js slide formatting support#6178

Closed
genericg wants to merge 9 commits into
ipython:masterfrom
genericg:master
Closed

Add reveal.js slide formatting support#6178
genericg wants to merge 9 commits into
ipython:masterfrom
genericg:master

Conversation

@genericg
Copy link
Copy Markdown

A quick attempt at adding support for various reveal.js formatting options to nbconvert's slideshow output.

  • Formatting slide/sub-slide background and transitions
  • Formatting highlighting of slideshow fragments
  • Customising global slide options, e.g. auto-progress, showing/hiding controls etc...

A significant chunk of options documented on https://github.com/hakimel/reveal.js have been imple
mented.

Options are set in cell/notebook metadata, under a subsection "slideshow" e.g.

{
  "cell_type": "heading",
  "level": 2,
  "metadata": {
    "slideshow": {
      "slide_background": "http://ipython.org/ipython-doc/2/_images/ipynb_icon_128x128.png",
      "slide_type": "slide"
    }
  }, "source": [ "Background Images"]
}

Currently testing reveal.js formatting with https://gist.github.com/genericg/7ed51454b72f3199a851

Current issues:

  • fragment highlight css formatting can conflict with background settings/possibly being overriden by html formatter
  • not all global slide options tested
  • No unit tests, as not sure how to incorporate reveal.js output in to unit tests
  • probably lots more...

@Carreau
Copy link
Copy Markdown
Member

Carreau commented Jul 22, 2014

Hi ! Thanks for the pull request !

The nice things with templates is that you can define your own and do not have to require it to be merged with IPython to be used. I think it wound be better to put custom templates like that in separate package than could be updated from outside of IPython. Also it will allow to use them with earlier version of IPython. What does @damianavila think ?

@damianavila
Copy link
Copy Markdown
Member

Thanks for the PR! And sorry for the delay...
This is nice... and an interesting way to deal with all the config options inside reveal. It is very tempting to incorporate this to master because it is only using the slideshow metadata with prior defaults... so, naive users does not get affected at all, but advanced users can customized a lot of things in a very, very simple way.
@Carreau has also raised a valid point. If we do this an independent package, it could be useful for other people using earlier version of the IPython slides.
Maybe we can discuss this issue at the dev meeting to hear what other developers think about this.
I will add it to the hackpad.

@genericg
Copy link
Copy Markdown
Author

Thanks for the feedback,

I was tempted to submit this to something like https://github.com/ipython/nbconvert-examples, however I felt since it didn't change the behaviour of the existing slides template it may be worth being added to core. I also wanted some feedback on the naming/placement of the formatting metadata (i.e. is it acceptable to create a sub-section "slideshow" to contain formatting options).

Also, although I haven't really had chance to look in to it, some tweaking of the nbconvert default css may be required. For example, if you look at the example notebook I put together, on slides with a background any text contained in <\code> tags have a solid white background to them making the slides quite ugly. No doubt there are other formatting/layout issues to be addressed.

I must admit I'm not a web dev guy, css/jinja/javascript are a bit out of my comfort zone, so any conclusions I have jumped to might be way off.

Cheers

@Carreau
Copy link
Copy Markdown
Member

Carreau commented Jul 24, 2014

I was tempted to submit this to something like https://github.com/ipython/nbconvert-examples, however I felt since it didn't change the behaviour of the existing slides template it may be worth being added to core.

We know we should make lots more effort into documentation, and we try to keep the core as simple as possible and give hooks for things to live outside when possible.

I also wanted some feedback on the naming/placement of the formatting metadata (i.e. is it acceptable to create a sub-section "slideshow" to contain formatting options).

It would be nice to have what is reveal-specific under a reveal key (we discussed that on dev meeting a few minutes ago)

I must admit I'm not a web dev guy, css/jinja/javascript are a bit out of my comfort zone, so any conclusions I have jumped to might be way off.

Don't worry none of us are real web dev. We'll see what we can do to make this a separate package, this will help us understand what need to be done to make packaging theme easier.

@ellisonbg
Copy link
Copy Markdown
Member

Our general approach for the extensibility of nbconvert is that users should create their own custom templates. This type of customization (pure template mods) should be done outside of ipython. Closing

@ellisonbg ellisonbg closed this Sep 12, 2014
@takluyver takluyver added this to the no action milestone Sep 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants