From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Harkins Subject: sa-ignore-headline for HTML export Date: Wed, 08 Jan 2014 09:29:25 +0800 Message-ID: <655e7cf5-021a-413d-9485-5f7e48bb05ba@dewdrop-world.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0hxm-0000zs-Us for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 20:29:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0hxh-0006me-45 for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 20:29:42 -0500 Received: from mail-pb0-x234.google.com ([2607:f8b0:400e:c01::234]:58782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0hxg-0006mT-T5 for emacs-orgmode@gnu.org; Tue, 07 Jan 2014 20:29:37 -0500 Received: by mail-pb0-f52.google.com with SMTP id uo5so886503pbc.39 for ; Tue, 07 Jan 2014 17:29:35 -0800 (PST) Received: from localhost ([219.136.3.109]) by mx.google.com with ESMTPSA id ka3sm139024410pbc.32.2014.01.07.17.29.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Jan 2014 17:29:34 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: orgmode Hi Suvayu, I've been using your "sa-ignore-headline" filter [1] for a while -- works=20 great for LaTeX. (defun sa-ignore-headline (contents backend info) "Ignore headlines with tag `ignoreheading'." (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii) (string-match "\\`.*ignoreheading.*\n" (downcase contents))) (replace-match "" nil nil contents))) Unfortunately, although this is supposed to apply to latex, html and ascii=20= backends, the string-match works only for LaTeX. I was just trying it with=20= HTML and there was no effect. For HTML export, the "contents" end up looking like this:

2=20 B   ignoreheading

Text B

.. where there is no backquote to match. So I've changed the string-match predicate to read as follows (also=20 removing the downcase), and it now works with HTML export. (string-match ".*ignoreheading.*" contents) That's a hack -- sufficient for now, but ideally I suppose it should=20 dispatch to a different predicate per backend. Posting here because I didn't see a way on stackexchange to comment on your=20= answer. Thanks for the function! It would have taken me ages to figure it out on my=20= own. hjh [1]=20 http://stackoverflow.com/questions/10295177/is-there-an-equivalent-of-org-mod= es-b-ignoreheading-for-non-beamer-documents