更换 ox-reveal 为 org-re-reveal

1. 问题

使用 Spacemacs 更新依赖包之后, org-mode 更新至 9.2 版本. org-structure-template-alist 的结构定义发生了变化, ox-reveal 的源码与 Org 9.2 不兼容.

打开 org 文件出现以下的错误:

In Org 9.2 the format was changed from something like

("s" "#+BEGIN_SRC ?\n#+END_SRC") to something like

("s" . "src")

ox-reveal Original issue

2. 解决方法

ox-reveal 项目已经很久没有更新了, 看起来应该没有再维护了.

;; 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")))


;; needs to be updated as

;; Register auto-completion for speaker notes.
(when org-reveal-note-key-char
(add-to-list 'org-structure-template-alist
(cons org-reveal-note-key-char "NOTES")))

直接的解决方法更换 ox-reveal 为 org-re-reveal

2.1. spacemacs 用户

将 org-re-reveal 添加到 dotspacemacs-additional-packages

dotspacemacs/user-config 中添加

(with-eval-after-load 'org
(require 'org-re-reveal)
(setq org-re-reveal-root "file://path-to-reveal.js")
)

2019-10更新

org layer 已经将原来的 org-reveal 更新为 org-re-reveal. 只需在 .spacemacs 中开启即可.

dotspacemacs/layers 中设置

dotspacemacs-configuration-layers
'(
(org :variables
org-enable-github-support t
org-enable-reveal-js-support t)
)

dotspacemacs/user-config 中设置

(with-eval-after-load 'org
(require 'org-re-reveal)
(setq org-re-reveal-root "file://"))

Generated using Emacs 29.0.50 (Org mode 9.4.6)