Thomas
Thomas

Reputation: 2163

Buffer local export options in org-html-export

I'm creating a simple web page with org-mode and I use org-html-postamble to do a timestamp and copyright notice for my project, as described here. Now I would like to disable the postamble for only one of the source files. Can I do this with buffer local options as explained here: http://orgmode.org/manual/Export-settings.html ?

I tried

#+ORG_HTML_POSTAMBLE: nil

to no avail.

Edit: I updated the question after more research showed why it would not work.

Upvotes: 0

Views: 477

Answers (2)

Thomas
Thomas

Reputation: 2163

The answer to the question is "no". File local variables don't take precedence over what is defined in the project alist. Quoting from the variable description of org-html-postamble:

Setting :html-postamble in publishing projects will take precedence over this variable.

My solution is to define two functions

(defun first-postamble (plist) (format "(c) Donald Duck - %s" (format-time-string "%d %b %Y")))
(defun second-postamble (plist) (format "(c) Daisy Duck - %s" (format-time-string "%d %b %Y")))

in my .emacs and then use #+BIND: org-html-postamble first-postamble in buffers that need the first postamble and correspondingly for the second.

Upvotes: 0

Dan
Dan

Reputation: 5369

If you're talking about a file rather than just a buffer, you can add a local variables list. Either put the following line as the very first line of your file:

## -*- org-export-html-postamble: nil -*-

or else put the following chunk elsewhere (probably at the very end of the file):

## Local Variables:
## org-export-html-postamble: nil
## End:

Otherwise, you can temporarily bind the variable by putting this component in the buffer (which would probably be the most org-modey way to do it):

#+BIND: org-export-html-postamble nil

Based on the following snippet from the org manual export settings page:

If org-export-allow-bind-keywords is non-nil, Emacs variables can become buffer-local during export by using the BIND keyword. Its syntax is ‘#+BIND: variable value’. This is particularly useful for in-buffer settings that cannot be changed using specific keywords.

Upvotes: 2

Related Questions