ox-reveal update
This commit is contained in:
@@ -1147,49 +1147,7 @@ used as a communication channel."
|
||||
;; #+REVEAL_POSTAMBLE:
|
||||
(setq org-reveal-postamble (replace-regexp-in-string "\n" "" (concat "<script>" (org-reveal--read-file (concat (expand-file-name config-dir) "scripts/flipcard/flipcard.js")) "\n</script>"))) ;; only one line!
|
||||
(setq org-reveal-root (concat "file://" (expand-file-name config-dir) "scripts/reveal.js"))
|
||||
(setq org-reveal-single-file t)
|
||||
;; overwrite to implement `org-reveal-single-file' (:reveal-single-file)
|
||||
;; used in `org-reveal-scripts' as reveal-4-plugin
|
||||
(defun org-reveal-plugin-scripts-4 (info)
|
||||
"Return scripts for initializing reveal.js 4.x builtin scripts"
|
||||
(let ((plugins (org-reveal--get-plugins info)))
|
||||
(if (not (null plugins))
|
||||
;; Generate plugin scripts
|
||||
(let* ((available-plugins
|
||||
'(highlight ("RevealHighlight" . "highlight/highlight.js")
|
||||
markdown ("RevealMarkdown" . "markdown/markdown.js")
|
||||
search ("RevealSearch" . "search/search.js")
|
||||
notes ("RevealNotes" . "notes/notes.js")
|
||||
math ("RevealMath" . "math/math.js")
|
||||
zoom ("RevealZoom" . "zoom/zoom.js")))
|
||||
(plugin-info (seq-filter 'identity
|
||||
(seq-map (lambda (p)
|
||||
(plist-get available-plugins p))
|
||||
plugins))))
|
||||
(if (not (null plugin-info))
|
||||
(cons
|
||||
;; Plugin initialization script
|
||||
(let* ((root-path (file-name-as-directory (plist-get info :reveal-root))) ;; changed
|
||||
(local-root-path (org-reveal--file-url-to-path root-path)) ;; changed
|
||||
(in-single-file (plist-get info :reveal-single-file))) ;; changed
|
||||
(mapconcat
|
||||
(lambda (p)
|
||||
(if in-single-file
|
||||
(concat "<script>\n"
|
||||
(org-reveal--read-file
|
||||
(concat local-root-path "plugin/" (cdr p)))
|
||||
"\n</script>")
|
||||
(format "<script src=\"%splugin/%s\"></script>\n" root-path (cdr p))))
|
||||
plugin-info
|
||||
""))
|
||||
;; Reveal initialization for plugins
|
||||
(format "plugins: [%s]"
|
||||
(mapconcat #'car plugin-info ",")))
|
||||
;; No available plugin info found. Perhaps wrong plugin
|
||||
;; names are given
|
||||
(cons nil nil)))
|
||||
;; No plugins, return empty string
|
||||
(cons nil nil)))))
|
||||
(setq org-reveal-single-file t))
|
||||
|
||||
(use-package ox-tufte ;; https://melpa.org/#/ox-tufte
|
||||
:defer t ;; will be loaded via `org-export-backends' see above inside `org'
|
||||
|
||||
Reference in New Issue
Block a user