diff --git a/Readme.org b/Readme.org index 8ab538f..6a68fe6 100755 --- a/Readme.org +++ b/Readme.org @@ -521,6 +521,15 @@ fibs = 0 : 1 : next fibs the presentation HTML file into the Reveal.js root directory and reopen it in the browser. +*** Easy-Template for Speaker Notes + + Org-reveal registers 'n' as the key for speaker notes easy-template. + So you can press '<' followed by 'n' and then press TAB, the ~#+BEGIN_NOTES~ + and ~#+END_NOTES~ pair is inserted automatically. + + Customize ~org-reveal-note-key-char~ to change the default key + 'n'. set it to nil will forbid the auto-completion for speaker notes. + ** Multiplexing Reveal.js supports multiplexing, which allows allows your audience to view the slides of the presentation you are controlling on their own phone, tablet diff --git a/ox-reveal.el b/ox-reveal.el index 2f4ec0c..b24e809 100755 --- a/ox-reveal.el +++ b/ox-reveal.el @@ -320,6 +320,18 @@ can contain the following escaping elements: :group 'org-export-reveal :type 'boolean) +(defcustom org-reveal-note-key-char "n" + "If not nil, org-reveal-note-key-char's value is registered as + the key character to Org-mode's structure completion for + Reveal.js notes. When `<' followed by the key character are + typed and then the completion key is pressed, which is usually + `TAB', \"#+BEGIN_NOTES\" and \"#+END_NOTES\" is inserted. + + The default value is \"n\". Set the variable to nil to disable + registering the completion" + :group 'org-export-reveal + :type 'string) + (defun if-format (fmt val) (if val (format fmt val) "")) @@ -604,8 +616,7 @@ dependencies: [ " ;; JS libraries (let* ((builtins - '(classList - (format " { src: '%slib/js/classList.js', condition: function() { return !document.body.classList; } }" root-path) + '(classList (format " { src: '%slib/js/classList.js', condition: function() { return !document.body.classList; } }" root-path) markdown (format " { src: '%splugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: '%splugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }" root-path root-path) highlight (format " { src: '%splugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }" root-path) @@ -1025,6 +1036,10 @@ publishing directory. Return output file name." (org-publish-org-to 'reveal filename ".html" plist pub-dir)) +;; Register auto-completion for speaker notes. +(when org-reveal-note-key-char + (add-to-list 'org-structure-template-alist + (list org-reveal-note-key-char "#+BEGIN_NOTES\n\?\n#+END_NOTES"))) (provide 'ox-reveal)