From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Rottmann Subject: [PATCH] Allow functions for HTML export preamble and postamble Date: Fri, 03 Jul 2009 23:06:29 +0200 Message-ID: <87vdm9sch6.fsf@delenn.lan> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MMpxw-0008W2-S4 for emacs-orgmode@gnu.org; Fri, 03 Jul 2009 17:06:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MMpxr-0008JE-PD for emacs-orgmode@gnu.org; Fri, 03 Jul 2009 17:06:40 -0400 Received: from [199.232.76.173] (port=57284 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MMpxr-0008J1-Gr for emacs-orgmode@gnu.org; Fri, 03 Jul 2009 17:06:35 -0400 Received: from mail.gmx.net ([213.165.64.20]:34579) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MMpxq-0001iz-9y for emacs-orgmode@gnu.org; Fri, 03 Jul 2009 17:06:34 -0400 Received: from delenn.lan (delenn.lan [192.168.1.11]) by nathot.lan (Postfix) with ESMTPS id C7CE73A672 for ; Fri, 3 Jul 2009 23:06:30 +0200 (CEST) Received: from rotty by delenn.lan with local (Exim 4.69) (envelope-from ) id 1MMpxl-0008VF-EL for emacs-orgmode@gnu.org; Fri, 03 Jul 2009 23:06:29 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: org-mode mailing list --=-=-= Hi! Well, the subject says it all -- attached is a rough patch to allow more flexibility with the HTML export; I use it like this: (defun rotty/homepage-preamble (opt-plist) (insert "
") (insert " ") (insert (format "

rotty > %s

\n" (plist-get opt-plist :title))) (insert "
\n") (insert "
\n")) Note that this is my first real patch to org-mode, so be gentle ;-). --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=t_html-export-amble-funtions.diff From: Andreas Rottmann Subject: [PATCH] Allow functions for {pre/post}amble --- lisp/org-html.el | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/org-html.el b/lisp/org-html.el index ee72065..be4ddfd 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -606,6 +606,7 @@ PUB-DIR is set, use this as the publishing directory." (file-name-sans-extension (file-name-nondirectory buffer-file-name))) "UNTITLED")) + (custom-plist (org-combine-plists (list :title title) opt-plist)) (html-table-tag (plist-get opt-plist :html-table-tag)) (quote-re0 (concat "^[ \t]*" org-quote-string "\\>")) (quote-re (concat "^\\(\\*+\\)\\([ \t]+" org-quote-string "\\>\\)")) @@ -745,7 +746,7 @@ lang=\"%s\" xml:lang=\"%s\"> date author description keywords style)) - (insert (or (plist-get opt-plist :preamble) "")) + (org-export-html-insert-plist-item opt-plist :preamble custom-plist) (when (plist-get opt-plist :auto-preamble) (if title (insert (format org-export-html-title-format @@ -1372,7 +1373,7 @@ lang=\"%s\" xml:lang=\"%s\"> (if org-export-html-with-timestamp (insert org-export-html-html-helper-timestamp)) - (insert (or (plist-get opt-plist :postamble) "")) + (org-export-html-insert-plist-item opt-plist :postamble custom-plist) (insert "\n
\n\n\n")) (unless (plist-get opt-plist :buffer-will-be-killed) @@ -1425,6 +1426,14 @@ lang=\"%s\" xml:lang=\"%s\"> (kill-buffer (current-buffer))) (current-buffer))))) +(defun org-export-html-insert-plist-item (plist key &rest args) + (let ((item (plist-get plist key))) + (cond ((functionp item) + (apply item args)) + (item + (insert item))))) + + (defun org-export-html-format-href (s) "Make sure the S is valid as a href reference in an XHTML document." (save-match-data -- tg: (0795e42..) t/html-export-amble-funtions (depends on: master) --=-=-= Regards, Rotty --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--