diff --git a/Readme.org b/Readme.org index 6a68fe6..e6d7dd3 100755 --- a/Readme.org +++ b/Readme.org @@ -612,6 +612,12 @@ fibs = 0 : 1 : next fibs Code highlight by highlight.js is also disabled. But *code highlight by Emacs is not effected.* +** Export Current Subtree + + Use menu entry " C-c C-e R S" to export only current subtree, + without the title slide and the table of content, for a quick preview + of your current edition. + * Tips ** Disable Heading Numbers diff --git a/ox-reveal.el b/ox-reveal.el index b46d5f4..e8aa571 100755 --- a/ox-reveal.el +++ b/ox-reveal.el @@ -39,7 +39,8 @@ :menu-entry '(?R "Export to reveal.js HTML Presentation" ((?R "To file" org-reveal-export-to-html) - (?B "To file and Browse" org-reveal-export-to-html-and-browse))) + (?B "To file and browse" org-reveal-export-to-html-and-browse) + (?S "Current subtree to file" org-reveal-export-current-subtree))) :options-alist '((:reveal-control nil "reveal_control" org-reveal-control t) @@ -660,9 +661,10 @@ dependencies: [ (defun org-reveal-toc (depth info) "Build a slide of table of contents." - (format "
\n%s
\n" - (replace-regexp-in-string "\n%s\n" + (replace-regexp-in-string " \n" (org-reveal--build-pre/postamble 'preamble info) -"
+ "
\n" - (if (plist-get info :reveal-title-slide) + (if (and (plist-get info :reveal-title-slide) + (not (plist-get info :reveal-subtree))) (concat (format "
\n" (if-format " data-background=\"%s\"" @@ -1030,6 +1035,15 @@ transformed fragment attribute to ELEM's attr_html plist." (interactive) (browse-url-of-file (expand-file-name (org-reveal-export-to-html async subtreep visible-only body-only ext-plist)))) +(defun org-reveal-export-current-subtree + (&optional async subtreep visible-only body-only ext-plist) + "Export current subtree to a Reveal.js HTML file." + (interactive) + (org-narrow-to-subtree) + (let ((ret (org-reveal-export-to-html async subtreep visible-only body-only (plist-put ext-plist :reveal-subtree t)))) + (widen) + ret)) + ;;;###autoload (defun org-reveal-publish-to-reveal (plist filename pub-dir)