emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How to export drawer?
@ 2014-04-04  9:25 Marcin Antczak
  2014-04-04 19:10 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Marcin Antczak @ 2014-04-04  9:25 UTC (permalink / raw)
  To: emacs-orgmode


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 'identity info nil 'headline)))
                    (mapconcat (lambda (d)
                                 (when (string= (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ą 02:45]--[2014-04-04 pią 02:45] =>  0:00
   CLOCK: [2014-04-04 pią 02:45]--[2014-04-04 pią 02:45] =>  0:00
   :END:
   Placeholder
*** DONE First SUB clocktable
    :CLOCKTABLE:
    CLOCK: [2014-04-04 pią 02:45]--[2014-04-04 pią 05:45] =>  3:00
    :END:
    Sub clocktable here
** TODO Second clocktable
   :CLOCKTABLE:
   CLOCK: [2014-04-04 pią 02:45]--[2014-04-04 pią 03:45] =>  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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-04-04 22:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-04  9:25 How to export drawer? Marcin Antczak
2014-04-04 19:10 ` Nicolas Goaziou
2014-04-04 21:06   ` Marcin Antczak
2014-04-04 21:49     ` Nicolas Goaziou
2014-04-04 22:06       ` Marcin Antczak

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).