[Top][All Lists]

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

[O] Summary: File-local export filters

From: Carsten Dominik
Subject: [O] Summary: File-local export filters
Date: Sun, 22 Sep 2013 00:16:59 +0200

On 21.9.2013, at 14:44, Nicolas Goaziou <address@hidden> wrote:

> Carsten Dominik <address@hidden> writes:
>> OK, I'll try this. However, if the code is a bit more extensive, an
>> SRC block would make it more comfortable to maintain this code inside
>> a file. If I want to write a somewhat complex filter function, it is
>> not convenient to do so in #+BIND line.
> I can't see why it would be inconvenient, since you needn't define the
> filter within the BIND keyword.
> Anyway, you can write a source block that sets locally the filters. That
> should work too.

Indeed, this can be done.  Here is an example (thanks also to Eric for
quick help with the export arguments):

* Special export setup                                             :noexport:

#+begin_src emacs-lisp :exports results :results none
  (defun my-org-export-filter-timestamp-function (timestamp backend info)
    "removes relevant brackets from a timestamp"
    (when (org-export-derived-backend-p backend 'html)
      (replace-regexp-in-string "&[gl]t;\\|[][]" "" timestamp)))
  (make-local-variable 'org-export-filter-timestamp-functions)
  (add-to-list 'org-export-filter-timestamp-functions

- Carsten

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

reply via email to

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