mirror of
https://github.com/yjwen/org-reveal.git
synced 2024-06-29 07:50:48 +02:00
Export only corrent sub-tree.
This commit is contained in:
parent
238523734f
commit
4f3cffd106
|
@ -612,6 +612,12 @@ fibs = 0 : 1 : next fibs
|
||||||
Code highlight by highlight.js is also disabled. But *code
|
Code highlight by highlight.js is also disabled. But *code
|
||||||
highlight by Emacs is not effected.*
|
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
|
* Tips
|
||||||
|
|
||||||
** Disable Heading Numbers
|
** Disable Heading Numbers
|
||||||
|
|
28
ox-reveal.el
28
ox-reveal.el
|
@ -39,7 +39,8 @@
|
||||||
:menu-entry
|
:menu-entry
|
||||||
'(?R "Export to reveal.js HTML Presentation"
|
'(?R "Export to reveal.js HTML Presentation"
|
||||||
((?R "To file" org-reveal-export-to-html)
|
((?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
|
:options-alist
|
||||||
'((:reveal-control nil "reveal_control" org-reveal-control t)
|
'((:reveal-control nil "reveal_control" org-reveal-control t)
|
||||||
|
@ -660,9 +661,10 @@ dependencies: [
|
||||||
|
|
||||||
(defun org-reveal-toc (depth info)
|
(defun org-reveal-toc (depth info)
|
||||||
"Build a slide of table of contents."
|
"Build a slide of table of contents."
|
||||||
(format "<section id=\"table-of-contents\">\n%s</section>\n"
|
(let ((toc (org-html-toc depth info)))
|
||||||
(replace-regexp-in-string "<a href=\"#" "<a href=\"#/slide-"
|
(if toc
|
||||||
(org-html-toc depth info))))
|
(format "<section id=\"table-of-contents\">\n%s</section>\n"
|
||||||
|
(replace-regexp-in-string "<a href=\"#" "<a href=\"#/slide-" toc)))))
|
||||||
|
|
||||||
(defun org-reveal-inner-template (contents info)
|
(defun org-reveal-inner-template (contents info)
|
||||||
"Return body of document string after HTML conversion.
|
"Return body of document string after HTML conversion.
|
||||||
|
@ -671,7 +673,9 @@ holding export options."
|
||||||
(concat
|
(concat
|
||||||
;; Table of contents.
|
;; Table of contents.
|
||||||
(let ((depth (plist-get info :with-toc)))
|
(let ((depth (plist-get info :with-toc)))
|
||||||
(when depth (org-reveal-toc depth info)))
|
(when (and depth
|
||||||
|
(not (plist-get info :reveal-subtree)))
|
||||||
|
(org-reveal-toc depth info)))
|
||||||
;; Document contents.
|
;; Document contents.
|
||||||
contents))
|
contents))
|
||||||
|
|
||||||
|
@ -923,9 +927,10 @@ info is a plist holding export options."
|
||||||
"</head>
|
"</head>
|
||||||
<body>\n"
|
<body>\n"
|
||||||
(org-reveal--build-pre/postamble 'preamble info)
|
(org-reveal--build-pre/postamble 'preamble info)
|
||||||
"<div class=\"reveal\">
|
"<div class=\"reveal\">
|
||||||
<div class=\"slides\">\n"
|
<div class=\"slides\">\n"
|
||||||
(if (plist-get info :reveal-title-slide)
|
(if (and (plist-get info :reveal-title-slide)
|
||||||
|
(not (plist-get info :reveal-subtree)))
|
||||||
(concat
|
(concat
|
||||||
(format "<section id=\"sec-title-slide\"%s%s%s%s>\n"
|
(format "<section id=\"sec-title-slide\"%s%s%s%s>\n"
|
||||||
(if-format " data-background=\"%s\""
|
(if-format " data-background=\"%s\""
|
||||||
|
@ -1030,6 +1035,15 @@ transformed fragment attribute to ELEM's attr_html plist."
|
||||||
(interactive)
|
(interactive)
|
||||||
(browse-url-of-file (expand-file-name (org-reveal-export-to-html async subtreep visible-only body-only ext-plist))))
|
(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
|
;;;###autoload
|
||||||
(defun org-reveal-publish-to-reveal
|
(defun org-reveal-publish-to-reveal
|
||||||
(plist filename pub-dir)
|
(plist filename pub-dir)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user