From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Antczak Subject: How to export drawer? Date: Fri, 04 Apr 2014 11:25:03 +0200 Message-ID: <87mwg1xx8w.fsf@neutrico-themes.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW0PG-0004aD-Or for emacs-orgmode@gnu.org; Fri, 04 Apr 2014 05:27:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WW0P7-00036U-Vd for emacs-orgmode@gnu.org; Fri, 04 Apr 2014 05:27:26 -0400 Received: from 6.mo68.mail-out.ovh.net ([46.105.63.100]:57836 helo=mo68.mail-out.ovh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WW0P7-00031Y-PA for emacs-orgmode@gnu.org; Fri, 04 Apr 2014 05:27:17 -0400 Received: from mail189.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo68.mail-out.ovh.net (Postfix) with SMTP id 80590100877B for ; Fri, 4 Apr 2014 11:27:15 +0200 (CEST) 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: emacs-orgmode@gnu.org Hi List, I got a problem which is blocker for me and this is why I have to ask here for help. I would like to export some org to html with custom backend based on 'html. What I need is to override function org-html-headline from ox-html.el I just want to export drawer with some specific name. For example LOGBOOK or CLOCKTABLE. So, I got this piece of code #+BEGIN_SRC el (let* (clocktable (and (plist-get info :with-drawers) (let* ((drawers (org-element-map headline 'drawer 'iden= tity info nil 'headline))) (mapconcat (lambda (d) (when (string=3D (org-element-property := drawer-name d) "CLOCKTABLE") (org-export-data-with-backend d 'html = info))) drawers ""))))) #+END_SRC And this does what I need.... well not exactly. This code returns drawer in html format. Unfortunately it returns drawers recursively. If my org file is flat then everything is ok. If my org file is like this: #+BEGIN_SRC * TODO No clocktable here Task with no clocktable ** TODO First clocktable :CLOCKTABLE: CLOCK: [2014-04-04 pi=C4=85 02:45]--[2014-04-04 pi=C4=85 02:45] =3D> = 0:00 CLOCK: [2014-04-04 pi=C4=85 02:45]--[2014-04-04 pi=C4=85 02:45] =3D> = 0:00 :END: Placeholder *** DONE First SUB clocktable :CLOCKTABLE: CLOCK: [2014-04-04 pi=C4=85 02:45]--[2014-04-04 pi=C4=85 05:45] =3D> = 3:00 :END: Sub clocktable here ** TODO Second clocktable :CLOCKTABLE: CLOCK: [2014-04-04 pi=C4=85 02:45]--[2014-04-04 pi=C4=85 03:45] =3D> = 1:00 :END: Second clocktable #+END_SRC Then in my task "No clocktable here " I can see all CLOCKTABLES from children tasks. Could someone help me to disable this recursion properly? Cheers, Marcin