emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/org-mime f831a69284 3/5: doc on hacking exported html


From: ELPA Syncer
Subject: [nongnu] elpa/org-mime f831a69284 3/5: doc on hacking exported html
Date: Sat, 5 Feb 2022 06:58:36 -0500 (EST)

branch: elpa/org-mime
commit f831a692848348f737815373c06759d13a06e5d3
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>

    doc on hacking exported html
---
 README.org  | 18 +++++++++++++-----
 org-mime.el |  5 +++--
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/README.org b/README.org
index 8cbff06499..816d705fd3 100644
--- a/README.org
+++ b/README.org
@@ -20,8 +20,6 @@ Screenshot:
 (setq org-mime-library 'mml)
 ;; OR for Wanderlust (WL)
 ;; (setq org-mime-library 'semi)
-;; OR for VM – not yet supported
-;; (setq org-mime-library 'vm)
 #+end_src
 * Usage
 ** =M-x org-mime-htmlize=
@@ -116,12 +114,22 @@ Please double check your org and latex setup. See 
[[https://github.com/org-mime/
 
 You can also modify the variable  =org-mime-org-html-with-latex-default=.
 
-** The exported HTML is wrong
+** fix exported HTML
 Please note this program can only embed exported HTML into mail. Org-mode is 
responsible for rendering HTML.
 
-One issue of org-mode is 
[[https://github.com/org-mime/org-mime/issues/38][unwanted numbers in 
displaymath and equation]].
+The *good news*  is the exported HTML could be changed in 
=org-mime-html-hook=. For example, below code renders text between "#" in red 
color,
+#+begin_src elisp
+(add-hook 'org-mime-html-hook
+          (lambda ()
+            (while (re-search-forward "#\\([^#]*\\)#" nil t)
+              (replace-match "<span style=\"color:red\">\\1</span>"))))
+#+end_src
+
+Surely you can fix the exported HTML in =org-mode=. For example, One issue of 
=org-mode= is [[https://github.com/org-mime/org-mime/issues/38][unwanted 
numbers in displaymath and equation]].
+
+Thibault Marin provided 
[[https://lists.gnu.org/archive/html/emacs-orgmode/2019-11/msg00016.html][a 
patch]] to fix the =org-mode=.
 
-Thibault Marin provided 
[[https://lists.gnu.org/archive/html/emacs-orgmode/2019-11/msg00016.html][a 
patch to fix the org-mode]].
+In summary, this package gives you freedom to hack the exported html in 
=org-mime-html-hook=. If you prefer a more "elegant" way, you could always 
investigate the =org-mode= instead.
 ** Keep gpg signatures outside of multipart
 =org-mime-find-html-start= gives user a chance to tweak the region beginning 
to htmlize,
 #+begin_src lisp
diff --git a/org-mime.el b/org-mime.el
index 1e1482ad17..02c21253d1 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -91,9 +91,10 @@
 ;;
 ;; Extra Tips:
 ;; 1. In order to embed images into your mail, use the syntax below,
-;; [[/full/path/to/your.jpg]]
 ;;
-;; 2. It's easy to define your own emphasis markup.
+;;    [[/full/path/to/your.jpg]]
+;;
+;; 2. It's easy to define your hack the exported HTML.
 ;; For example, below code renders text between "#" in red color,:
 ;;
 ;;   (add-hook 'org-mime-html-hook



reply via email to

[Prev in Thread] Current Thread [Next in Thread]