From: Alexander Baier <lexi.baier@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Alexander Baier <lexi.baier@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [Exporter] Export of property drawers
Date: Fri, 10 May 2013 15:14:49 +0200 [thread overview]
Message-ID: <87mws3vuwm.fsf@gmail.com> (raw)
In-Reply-To: <87fvxwni3q.fsf@gmail.com> (Nicolas Goaziou's message of "Thu, 09 May 2013 20:13:05 +0200")
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 <n.goaziou@gmail.com> writes:
> Hello,
>
> Alexander Baier <lexi.baier@gmail.com> 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,
prev parent reply other threads:[~2013-05-10 13:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-09 16:46 [Exporter] Export of property drawers Alexander Baier
2013-05-09 18:13 ` Nicolas Goaziou
2013-05-09 20:01 ` Christian Moe
2013-05-10 8:17 ` Nicolas Goaziou
2013-05-10 13:37 ` Christian Moe
2013-05-10 13:14 ` Alexander Baier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mws3vuwm.fsf@gmail.com \
--to=lexi.baier@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=n.goaziou@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.