forked from blallo/talk-hm-0x15
markdown plugin can now process slides that are added at runtime
This commit is contained in:
parent
ef9168c7c4
commit
c453bc4770
1 changed files with 25 additions and 10 deletions
|
@ -9,9 +9,8 @@
|
|||
}
|
||||
else {
|
||||
// Browser globals (root is window)
|
||||
root.returnExports = factory( root.marked );
|
||||
root.returnExports.processSlides();
|
||||
root.returnExports.convertSlides();
|
||||
root.RevealMarkdown = factory( root.marked );
|
||||
root.RevealMarkdown.initialize();
|
||||
}
|
||||
}( this, function( marked ) {
|
||||
|
||||
|
@ -281,6 +280,11 @@
|
|||
|
||||
var section = sections[i];
|
||||
|
||||
// Only parse the same slide once
|
||||
if( !section.getAttribute( 'data-markdown-parsed' ) ) {
|
||||
|
||||
section.setAttribute( 'data-markdown-parsed', true )
|
||||
|
||||
var notes = section.querySelector( 'aside.notes' );
|
||||
var markdown = getMarkdownFromSlide( section );
|
||||
|
||||
|
@ -296,10 +300,21 @@
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// API
|
||||
return {
|
||||
|
||||
initialize: function() {
|
||||
processSlides();
|
||||
convertSlides();
|
||||
},
|
||||
|
||||
// TODO: Do these belong in the API?
|
||||
processSlides: processSlides,
|
||||
convertSlides: convertSlides,
|
||||
slidify: slidify
|
||||
|
||||
};
|
||||
|
||||
}));
|
||||
|
|
Loading…
Reference in a new issue