Support markdown in speaker notes
It's pretty nice to have markdown in slides. It's even nicer to have markdown in speaker notes too :)edit
parent
e6e80283f2
commit
a8a3765bec
|
@ -27,7 +27,9 @@
|
|||
indexv : event.indexv,
|
||||
nextindexh : nextindexh,
|
||||
nextindexv : nextindexv,
|
||||
socketId : socketId
|
||||
socketId : socketId,
|
||||
markdown : notes ? notes.getAttribute('data-markdown') != null : false
|
||||
|
||||
};
|
||||
|
||||
socket.emit('slidechanged', slideData);
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
<div id="notes"></div>
|
||||
|
||||
<script src="/socket.io/socket.io.js"></script>
|
||||
<script src="/lib/js/showdown.js"></script>
|
||||
|
||||
<script>
|
||||
var socketId = '{{socketId}}';
|
||||
|
@ -99,7 +100,13 @@
|
|||
// ignore data from sockets that aren't ours
|
||||
if (data.socketId !== socketId) { return; }
|
||||
|
||||
if (data.markdown) {
|
||||
notes.innerHTML = (new Showdown.converter()).makeHtml(data.notes);
|
||||
}
|
||||
else {
|
||||
notes.innerHTML = data.notes;
|
||||
}
|
||||
|
||||
currentSlide.contentWindow.Reveal.navigateTo(data.indexh, data.indexv);
|
||||
nextSlide.contentWindow.Reveal.navigateTo(data.nextindexh, data.nextindexv);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue