From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: Conditionally formatting org-html-postamble-format Date: Thu, 28 Jan 2016 04:36:54 +0000 Message-ID: References: <20160127192600.08cdad14@lt70.mpip-mainz.mpg.de> <20160127205536.5fb468ca@lt70.mpip-mainz.mpg.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113e26ce76969f052a5d78d3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOeKR-0000b5-2I for emacs-orgmode@gnu.org; Wed, 27 Jan 2016 23:37:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOeKQ-0001Ni-75 for emacs-orgmode@gnu.org; Wed, 27 Jan 2016 23:37:06 -0500 Received: from mail-oi0-x233.google.com ([2607:f8b0:4003:c06::233]:36853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOeKQ-0001NZ-2J for emacs-orgmode@gnu.org; Wed, 27 Jan 2016 23:37:06 -0500 Received: by mail-oi0-x233.google.com with SMTP id o124so19644506oia.3 for ; Wed, 27 Jan 2016 20:37:05 -0800 (PST) In-Reply-To: <20160127205536.5fb468ca@lt70.mpip-mainz.mpg.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Robert H. Klein" , Nick Dokos Cc: emacs-org list --001a113e26ce76969f052a5d78d3 Content-Type: text/plain; charset=UTF-8 Thank you guys. With your help, I came up with this solution and it works great! I tested it with all 4 combinations (author=nil/non-nil and date=nil/non-nil). # #+AUTHOR: #+AUTHOR: Kaushal Modi # #+DATE: #+DATE: {{{time(%b %e %Y\, %a)}}} ;; Customize the HTML postamble (defun modi/org-html-postamble-fn (info) "My custom postamble for org to HTML exports. INFO is the property list of export options." (let ((author (car (plist-get info :author))) (creator (plist-get info :creator)) (date (car (org-export-get-date info))) (d1 "
")) (concat "Exported using " d1 "class=\"creator\">" creator d2 ; emacs and org versions (when author (concat " by " author)) (when date (concat " on " d1 "class=\"date\">" date d2)) "."))) (setq org-html-postamble #'modi/org-html-postamble-fn) ; default: 'auto --001a113e26ce76969f052a5d78d3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you guys.

With your help, I came = up with this solution and it works great! I tested it with all 4 combinatio= ns (author=3Dnil/non-nil and date=3Dnil/non-nil).

=
# #+AUTHOR:
#+AUTHOR: Kaushal Modi
# #+DATE:
=
#+DATE: {{{time(%b %e %Y\, %a)}}}

= ;; Customize the HTML postamble
(defun modi/org-html-postamble-fn= (info)
=C2=A0 "My custom postamble for org to HTML exports.=
INFO is the property list of export options."
=C2= =A0 (let ((author (car (plist-get info :author)))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 (creator (plist-get info :creator))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 (date (car (org-export-get-date info)))
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 (d1 "<div style=3D\"display: inline\" &= quot;)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (d2 "</div>"))=
=C2=A0 =C2=A0 (concat "Exported using "
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 d1 "class=3D\"creator\&quo= t;>" creator d2 ; emacs and org versions
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when author
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (concat " by " author))
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when date
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (concat " on " d1 "class=3D\= "date\">" date d2))
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 ".")))
(setq org-html-postamble #'mo= di/org-html-postamble-fn) ; default: 'auto


--001a113e26ce76969f052a5d78d3--