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

Markdown plugin: add markdown slides at runtime #586

Closed

Comments

@croeck
Copy link

croeck commented Sep 4, 2013

Hi,

I would love to add slides to my presentation while it is already running. With most aspects of reveal.js this is working great. However, the markdown slides are parsed while reveal.js is being initialized and currently there is no possibility to re-run the markdown plugin.

First, I would request to provide a simple API call for the markdown plugin to initialize all markdown slides, similar to reveal.js itself.

The following code refers to the bottom of the markdown.js file in the markdown plugin and would implement this functionality:

    var initialize = function() {
        querySlidingMarkdown();
        queryMarkdownSlides();
    };

    querySlidingMarkdown();
    queryMarkdownSlides();

    // --------------------------------------------------------------------//
    // ------------------------------- API --------------------------------//
    // --------------------------------------------------------------------//

    return {
        initialize: initialize
    };

Second, this would require to change the existing methods because already parsed slides would be parsed again and therefore become corrupted.
My first thought was to remove the data-markdown attribute after a section has been parsed and add a data-markdown-parsed attribute instead.

Basically both changes are working as desired, but I am not quite sure about the side-effects this would have, especially on the notes part of reveal.js

I would love to hear your comments on this.

(And thanks for the already fantastic tool!)

@hakimel
Copy link
Owner

hakimel commented Sep 4, 2013

Sure, I'm all for adding an API to the plugin and using data-markdown-parsed to flag already processed sections sounds goood.

@palday
Copy link

palday commented Sep 6, 2013

+1 for this idea.

@hakimel
Copy link
Owner

hakimel commented Sep 6, 2013

Just added this to the dev branch. RevealMarkdown.initialize() will trigger parsing of any new Markdown in the DOM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment