diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2010-06-04 10:56:56 -0600 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2010-06-04 10:56:56 -0600 |
commit | 507e06f58620b53160c93e7fcc44bfff7b95ef27 (patch) | |
tree | 3e10fbdb874b2779c98ab791de5d38aeae55bb33 | |
parent | 359a86cda43eb9e74dd886ae15f6e92f2e89a6f6 (diff) | |
download | org-mode-507e06f58620b53160c93e7fcc44bfff7b95ef27.tar.gz |
org-mime: now allows style customization based on class attributes
-rw-r--r-- | contrib/lisp/org-mime.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el index 43ad7f5..e61236c 100644 --- a/contrib/lisp/org-mime.el +++ b/contrib/lisp/org-mime.el @@ -89,15 +89,23 @@ (defun org-mime-change-element-style (element style) "Set new default htlm style for <ELEMENT> elements in exported html." (while (re-search-forward (format "<%s" element) nil t) - (replace-match (format "<%s style=\"%s;\"" element style)))) + (replace-match (format "<%s style=\"%s\"" element style)))) + +(defun org-mime-change-class-style (class style) + "Set new default htlm style for objects with classs=CLASS in +exported html." + (while (re-search-forward (format "class=\"%s\"" class) nil t) + (replace-match (format "class=\"%s\" style=\"%s\"" class style)))) ;; ;; example addition to `org-mime-html-hook' adding a dark background ;; ;; color to <pre> elements ;; (add-hook 'org-mime-html-hook ;; (lambda () ;; (org-mime-change-element-style -;; "pre" (format "color: %s; background-color: %s" -;; "#E6E1DC" "#232323")))) +;; "pre" (format "color: %s; background-color: %s;" +;; "#E6E1DC" "#232323")) +;; (org-mime-change-class-style +;; "verse" "border-left: 2px solid gray; padding-left: 4px;"))) (defun org-mime-file (ext path id) "Markup a file for attachment." |