diff --git a/README.md b/README.md index 596c6bfb86b764cb9dee05daa392e879a12590e4..3be084d3ec4354335174d6e096113d2183092534 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,8 @@ If you're interested in using speaker notes, reveal.js comes with a Node server To include speaker notes in your presentation, simply add an `<aside class="notes">` element to any slide. These notes will be hidden in the main presentation view. +It's also possible to write your notes with Markdown. To enable Markdown, simply add the ```data-markdown``` attribute to your ```<aside>``` elements and reveal.js will automatically load the JavaScript parser. + You'll also need to [install Node.js](http://nodejs.org/); then, install the server dependencies by running `npm install`. Once Node.js and the dependencies are installed, run the following command from the root directory: @@ -229,4 +231,4 @@ You can change the appearance of the speaker notes by editing the file at `plugi MIT licensed -Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se \ No newline at end of file +Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se diff --git a/plugin/speakernotes/client.js b/plugin/speakernotes/client.js index b164a56378d0e084fc26bb61ee9ec7e2f76eeb9f..20f8e2f24b2ae0bf45b4bb74dfec2c9a810ffd63 100644 --- a/plugin/speakernotes/client.js +++ b/plugin/speakernotes/client.js @@ -28,7 +28,9 @@ indexv : event.indexv, nextindexh : nextindexh, nextindexv : nextindexv, - socketId : socketId + socketId : socketId, + markdown : notes ? notes.getAttribute('data-markdown') != null : false + }; socket.emit('slidechanged', slideData); diff --git a/plugin/speakernotes/notes.html b/plugin/speakernotes/notes.html index 88924c0d663b98637a46456d381a33827361f527..f61501d74ffa56ea2bce600fafdf38fc68753b9d 100644 --- a/plugin/speakernotes/notes.html +++ b/plugin/speakernotes/notes.html @@ -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; } - notes.innerHTML = data.notes; + 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); });