[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] What's wrong with org-export-html-final-hook in 8.x
From: |
Rasmus |
Subject: |
Re: [O] What's wrong with org-export-html-final-hook in 8.x |
Date: |
Tue, 14 May 2013 17:31:15 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Hi Visayafan,
> Recently I upgrade my Org Mode from 7.8.11 to the latest 8.0.2 and find
> org-export-html-final-hook doesn't work.
This variable no longer exists, since quite I while I think (check the
git log if interested).
You could switch to filters. Here's an ugly hack for removing titles
on my web-site (the title is already inserted in a shared preamble).
#+BEGIN_SRC emacs-lisp
(defun rasmus/org-html-ignore-title-if-present (string backend info)
"Strip title if it's already there. Ignore BACKEND and INFO."
(when (and (org-export-derived-backend-p backend 'html)
(string-match "h1 class=\"mytitle\"" string))
(replace-regexp-in-string "<h1 class=\"title\">.*?</h1>" "" string)))
(add-to-list 'org-export-filter-final-output-functions
'rasmus/org-html-ignore-title-if-present)
#+END_SRC
Hope it helps,
Rasmus
--
Summon the Mothership!