我已将表情符号添加到我的org-mode
文档中,如下所示:
bla bla :turtle: bla yadda
通过 GitHub 查看器查看它时,它们会被替换为相应的 unicode 字符实体。
我必须拉哪些钩子才能在 org-mode html(尤其是 ox-reveal)导出中获得相同的效果?
我已将表情符号添加到我的org-mode
文档中,如下所示:
bla bla :turtle: bla yadda
通过 GitHub 查看器查看它时,它们会被替换为相应的 unicode 字符实体。
我必须拉哪些钩子才能在 org-mode html(尤其是 ox-reveal)导出中获得相同的效果?
您可以使用company-emoji包。下载它,然后将以下内容放入您的 init 文件中:
(require 'company-emoji)
(add-to-list 'company-backends 'company-emoji)
它适用于我的 org-html-export-to-html。虽然不知道 ox-reveal,但会假设它也会显示表情符号。
事实证明,为此目的有一个可自定义的变量:
org-export-html-protect-char-alist is a variable defined in `org-html.el'.
Its value is (("&" . "&") ("<" . "<") (">" . ">"))
Documentation:
Alist of characters to be converted by `org-html-protect'.
You can customize this variable.
This variable was introduced, or its default value was changed, in
version 24.1 of Emacs.
所以现在(不是一个铁杆 Emacs Lisp 用户)我只是把它放在我的.emacs
:
(defcustom org-export-html-protect-char-alist
'(("&" . "&")
("<" . "<")
(">" . ">")
(":turtle:" . "🐢")
(":dash:" . "💨")
(":-)" . "😊")
(":-(" . "😞"))
"Alist of characters to be converted by `org-html-protect'."
:group 'org-export-html
:version "24.1"
:type '(repeat (cons (string :tag "Character")
(string :tag "HTML equivalent"))))
这很好用,但也许有更好的方法来附加到可自定义的变量?