[Top][All Lists]

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

Re: [O] Conditionally formatting org-html-postamble-format

From: Kaushal Modi
Subject: Re: [O] Conditionally formatting org-html-postamble-format
Date: Thu, 28 Jan 2016 04:36:54 +0000

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: 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 "<div style=\"display: inline\" ")
        (d2 "</div>"))
    (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

reply via email to

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