From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] fix hook calling in org-export-remove-or-extract-drawers Date: Wed, 02 May 2012 14:35:53 +0200 Message-ID: <87havyrc9i.fsf@gmail.com> References: <87aa1sw78b.fsf@gnu.org> <874nrzdbq7.fsf@gnu.org> <87r4v3kbo4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPYpX-0007HK-Ol for emacs-orgmode@gnu.org; Wed, 02 May 2012 08:38:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPYpR-0003Zm-Bb for emacs-orgmode@gnu.org; Wed, 02 May 2012 08:38:51 -0400 In-Reply-To: (Bill Wishon's message of "Tue, 1 May 2012 11:29:13 -0700") 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: Bill Wishon Cc: Bastien , emacs-orgmode@gnu.org Bill Wishon writes: > What I was trying to achieve when I got into trying out the > org-export-format-drawer-function was to try and customize the look of the > properties drawers when they're exported to html. By default they are > exported as pre formatted text with the class=example. What would be the > right way to reformat this during output so that I could present this in > another format, say a table or bullet list? This is an area I'm still working on in the next export engine. Filters allow to modify output from a back-end. But back-ends ignore properties drawers. Therefore, filters aren't useful in this case, since there's no output to modify in the first place. Though, you can provide a function telling a back-end how to export a property drawer. As every call-back function, it must accept three arguments: the parsed drawer, its contents (nil in this case) and a plist containing export directives (named the communication channel). For now, you have to follow strict naming conventions (but I'll remove them) and call it org-BACKEND-ELEMENT. Here BACKEND is `e-html' and element `property-drawer'. Also, all properties in the drawer are stored in an alist under `:properties' attribute. So `org-e-html-property-drawer' might look like the following: #+begin_src emacs-lisp (defun org-e-html-property-drawer (p-drawer contents info) (format "
\n%s\n
" (mapconcat (lambda (prop) (format "
%s
%s
" (car prop) (cdr prop))) (org-element-property :properties p-drawer) "\n"))) #+end_src Now every call to `e-html' back-end will change property drawers into a description list. This isn't good enough though, because once this function has been defined, there's no clean way back and it will affect all HTML export in the same session. I'm working on providing a way to fix it. Regards, -- Nicolas Goaziou