emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: Nick Dokos
Subject: Re: [O] Conditionally formatting org-html-postamble-format
Date: Wed, 27 Jan 2016 14:51:16 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Kaushal Modi <address@hidden> writes:

> Hi Robert,
>
> Thanks for the reply.
>
>> how about using a postamble function instead of html-postamble-format
>
> Does it mean that I need to look into modifying the 
> org-html--build-pre/postamble function?
>

No, Robert is talking about the variable org-html-postamble,
which you can set to a function. No need to muck around with
the internals of org.

C-h v org-html-postamble says

,----
| org-html-postamble is a variable defined in ‘ox-html.el’.
| Its value is auto
| 
| Documentation:
| Non-nil means insert a postamble in HTML export.
| 
| When set to ‘auto’, check against the
| ‘org-export-with-author/email/creator/date’ variables to set the
| content of the postamble.  When set to a string, use this string
| as the postamble.  When t, insert a string as defined by the
| formatting string in ‘org-html-postamble-format’.
| 
| When set to a function, apply this function and insert the
| returned string.  The function takes the property list of export
| options as its only argument.
| 
| Setting :html-postamble in publishing projects will take
| precedence over this variable.
`----

Try

--8<---------------cut here---------------start------------->8---
(defun foo (info)
  "This is my postamble")

(setq org-html-postamble (function foo))
--8<---------------cut here---------------end--------------->8---

and complicate the function as necessary to produce what you want.
Of course, you can use an anonymous function too:

--8<---------------cut here---------------start------------->8---
(setq org-html-postamble (function (lambda (info)
                                     "This is my postamble")))
--8<---------------cut here---------------end--------------->8---

--
Nick




reply via email to

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