Is it possible to add/remove slides while a presentation is running with reveal.js? To be precise, is there an API for that or maybe some dirty workaround?
My workaround for this was to:
Initialize reveal with an empty section
tag.
HTML
Javascript
Reveal.initialize();
//slide deck wrapper
deck = $('#blank').parent();
Store this tag then remove it from the DOM.
// a blank is initialized and stored as a variable
wrap = $('#blank').clone()
.attr('id',null)
.prop('outerHTML');
// remove the blank
$('#blank').remove();
Lastly a new element is added to deck and wrapped in the empty tag.
$('Slide added
').appendTo(deck)
.wrap( wrap );
Here is a demo. I haven't tried this technique with any complicated configurations, but for a simple presentation this suffices.