Add easy template for speaker notes.

This commit is contained in:
Yujie Wen 2015-09-16 15:50:42 +08:00
parent 99cf48e5ec
commit fa67514b67
2 changed files with 26 additions and 2 deletions

View File

@ -521,6 +521,15 @@ fibs = 0 : 1 : next fibs
the presentation HTML file into the Reveal.js root directory and the presentation HTML file into the Reveal.js root directory and
reopen it in the browser. 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 ** Multiplexing
Reveal.js supports multiplexing, which allows allows your audience to view Reveal.js supports multiplexing, which allows allows your audience to view
the slides of the presentation you are controlling on their own phone, tablet the slides of the presentation you are controlling on their own phone, tablet

View File

@ -320,6 +320,18 @@ can contain the following escaping elements:
:group 'org-export-reveal :group 'org-export-reveal
:type 'boolean) :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) (defun if-format (fmt val)
(if val (format fmt val) "")) (if val (format fmt val) ""))
@ -604,8 +616,7 @@ dependencies: [
" "
;; JS libraries ;; JS libraries
(let* ((builtins (let* ((builtins
'(classList '(classList (format " { src: '%slib/js/classList.js', condition: function() { return !document.body.classList; } }" root-path)
(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]' ); } }, 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) { 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) 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." Return output file name."
(org-publish-org-to 'reveal filename ".html" plist pub-dir)) (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) (provide 'ox-reveal)