[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [Exporter] Export of property drawers
From: |
Alexander Baier |
Subject: |
Re: [O] [Exporter] Export of property drawers |
Date: |
Fri, 10 May 2013 15:14:49 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Hello Nicolas,
thank you for the clarification and examples, they helped a lot and I
got it working as I wanted it.
Regards,
Alex
Nicolas Goaziou <address@hidden> writes:
> Hello,
>
> Alexander Baier <address@hidden> writes:
>
>> i want to export property drawers of an org-file to ASCII. How do I do
>> this? I got the impression, that the exporter does not touch the
>> properties drawers. So I started to fiddle with the exporter but got no
>> satisfying results out of it.
>
> You can either define a new back-end, as you did, or defadvice the
> current one.
>>
>> This is what i tried so far:
>>
>> The elisp i wrote in this process:
>> ===============================================================================
>> (defun org-tut-ascii-translater-property-drawer (drawer backend info)
>> (let ((prop (org-element-property :properties drawer)))
>> (format "%S" prop))) ;; i just wanted to see, if anything arrives
>> here
>
> There is no `:properties' attribute for property drawers. Also you are
> mixing translators and filters: arguments for translators are ELEMENT
> CONTENTS INFO. Use, for example:
>
> (defun my-ascii-property-drawer (drawer contents info)
> contents)
>
>
>> (org-export-define-derived-backend 'my-ascii 'ascii
>> :translate-alist '((template .
>> org-tut-ascii-translater-property-drawer)))
>
> Replace `template' with `property-drawer'. You also need to define
> a translator for `node-property' elements, e.g.,
>
> (defun my-ascii-node-property (node-prop contents info)
> (concat (org-element-property :key node-prop)
> ": "
> (org-element-property :value node-prop)))
>
> and
>
> (org-export-define-derived-backend 'my-ascii 'ascii
> :translate-alist '((property-drawer . my-ascii-property-drawer)
> (node-property . my-ascii-node-property)))
>
>
> Regards,