Skip to content

Commit

Permalink
Add notes plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Jun 23, 2014
1 parent ac2df5a commit 727d085
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -32,10 +32,17 @@ Example:
> Best quote ever.
Note: speaker notes FTW!
```

The separator syntax can be overriden (e.g. I like to use three blank lines).

## Speaker Notes

You can use the [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) feature by using a line starting with `Note:`.


## Usage

To open specific Markdown file as Reveal.js slideshow:
Expand Down
9 changes: 6 additions & 3 deletions bin/server.js
Expand Up @@ -86,7 +86,8 @@ var startMarkdownServer = function(basePath, initialMarkdownPath, port, theme, s
var renderMarkdownAsSlides = function(req, res) {

var markdown = '',
markdownPath;
markdownPath,
fsPath;

// Look for print-pdf option
if (~req.url.indexOf('?print-pdf')) {
Expand All @@ -95,8 +96,10 @@ var renderMarkdownAsSlides = function(req, res) {

markdownPath = path.resolve(opts.userBasePath + req.url);

if(fs.existsSync(markdownPath)) {
markdown = fs.readFileSync(markdownPath).toString();
fsPath = markdownPath.replace(/(\?.*)$/, '');

if(fs.existsSync(fsPath)) {
markdown = fs.readFileSync(fsPath).toString();
render(res, markdown)
} else {
var parsedUrl = url.parse(req.url.replace(/^\//, ''));
Expand Down
2 changes: 2 additions & 0 deletions demo/a.md
@@ -1,5 +1,7 @@
Foo

Note: test note

---

Bar
Expand Down
3 changes: 2 additions & 1 deletion template/reveal.html
Expand Up @@ -36,7 +36,8 @@
dependencies: [
{ src: '/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: '/plugin/markdown/marked.js', condition: function() { return !!document.querySelector('[data-markdown]'); } },
{ src: '/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector('[data-markdown]'); } }
{ src: '/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector('[data-markdown]'); } },
{ src: '/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
Expand Down

0 comments on commit 727d085

Please sign in to comment.