org-mode
次のようにドキュメントに絵文字を追加しました。
bla bla :turtle: bla yadda
GitHub ビューアで見ると、対応する Unicode 文字エンティティに置き換えられます。
org-mode html (esp. ox-reveal) エクスポートで同じ効果を得るには、どのフックをプルする必要がありますか?
org-mode
次のようにドキュメントに絵文字を追加しました。
bla bla :turtle: bla yadda
GitHub ビューアで見ると、対応する Unicode 文字エンティティに置き換えられます。
org-mode html (esp. 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 ユーザーではない) 私はこれを my に入れただけ.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"))))
これはうまく機能しますが、カスタマイズ可能な変数に追加するだけのより良い方法があるでしょうか?
company-emojiパッケージを使用できます。それをダウンロードして、init ファイルに以下を記述します。
(require 'company-emoji)
(add-to-list 'company-backends 'company-emoji)
org-html-export-to-html で動作します。ox-reveal については知りませんが、絵文字も表示されると思います。