emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: "Robert H. Klein" <roklein@roklein.de>, Nick Dokos <ndokos@gmail.com>
Cc: emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: Conditionally formatting org-html-postamble-format
Date: Thu, 28 Jan 2016 04:36:54 +0000	[thread overview]
Message-ID: <CAFyQvY0ZV_O8ZmBpnRRr8F37C2ZU8pCFq57jNgoq8ubaKr5LGA@mail.gmail.com> (raw)
In-Reply-To: <20160127205536.5fb468ca@lt70.mpip-mainz.mpg.de>

[-- Attachment #1: Type: text/plain, Size: 958 bytes --]

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 "<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

[-- Attachment #2: Type: text/html, Size: 1495 bytes --]

      reply	other threads:[~2016-01-28  4:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 21:46 Conditionally formatting org-html-postamble-format Kaushal Modi
2016-01-27 18:26 ` Robert H. Klein
2016-01-27 18:35   ` Kaushal Modi
2016-01-27 19:51     ` Nick Dokos
2016-01-27 19:55     ` Robert H. Klein
2016-01-28  4:36       ` Kaushal Modi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFyQvY0ZV_O8ZmBpnRRr8F37C2ZU8pCFq57jNgoq8ubaKr5LGA@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ndokos@gmail.com \
    --cc=roklein@roklein.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).