1

org-mode次のようにドキュメントに絵文字を追加しました。

bla bla :turtle: bla yadda

GitHub ビューアで見ると、対応する Unicode 文字エンティティに置き換えられます。

org-mode html (esp. ox-reveal) エクスポートで同じ効果を得るには、どのフックをプルする必要がありますか?

4

2 に答える 2

1

この目的のために、カスタマイズ可能な変数があることがわかりました。

org-export-html-protect-char-alist is a variable defined in `org-html.el'.
Its value is (("&" . "&amp;") ("<" . "&lt;") (">" . "&gt;"))

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
  '(("&" . "&amp;")
    ("<" . "&lt;")
    (">" . "&gt;")
    (":turtle:" . "&#x1f422;")
    (":dash:" . "&#x1f4a8;")
    (":-)" . "&#x1f60a;")
    (":-(" . "&#x1f61e;"))
  "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"))))

これはうまく機能しますが、カスタマイズ可能な変数に追加するだけのより良い方法があるでしょうか?

于 2016-04-04T13:00:19.927 に答える
1

company-emojiパッケージを使用できます。それをダウンロードして、init ファイルに以下を記述します。

(require 'company-emoji)
(add-to-list 'company-backends 'company-emoji)

org-html-export-to-html で動作します。ox-reveal については知りませんが、絵文字も表示されると思います。

于 2016-03-26T19:56:30.517 に答える