emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christian Moe <mail@christianmoe.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Alexander Baier <lexi.baier@gmail.com>,
	emacs-orgmode@gnu.org, Christian Moe <mail@christianmoe.com>
Subject: Re: [Exporter] Export of property drawers
Date: Fri, 10 May 2013 15:37:48 +0200	[thread overview]
Message-ID: <m27gj7vtub.fsf@vpn-client437.uio.no> (raw)
In-Reply-To: <871u9fnt8o.fsf@gmail.com>


Thanks, Nicolas,

That's very useful to know. And although "d:t" was a lot simpler, I
understand the point that people will want to customize how they want to
export their databases anyway. Your information below is enough to get
me started and may save me days of work.

Yours,
Christian

Nicolas Goaziou writes:

> Through macros, you can already access to specific properties, e.g.:
>
>   {{{property(ARCHIVE)}}}
>
> There is no function to dump the whole database in the export buffer
> because it contains many Org-specific entries which are irrelevant and
> because there are many ways to dump it.
>
> That's not what you asked, but the following function:
>
> #+begin_emacs-lisp
> (defun my-database-dump (backend)
>   (goto-char (point-min))
>   (while (re-search-forward "^[ \t]*:PROPERTIES" nil t)
>     (let ((element (org-element-at-point)))
>       (when (eq (org-element-type element) 'property-drawer)
>         (goto-char (org-element-property :end element))
>         (insert "#+BEGIN_EXAMPLE\n"
>                 (buffer-substring (org-element-property :begin element)
>                                   (progn (goto-char
>                                           (org-element-property :end element))
>                                          (skip-chars-backward " \r\t\n")
>                                          (forward-line)
>                                          (point)))
>                 "#+END_EXAMPLE\n")))))
> #+end_emacs-lisp
>
> when added to `org-export-before-parsing-hook', will wrap every property
> drawer within an example block so it can appear in the export output.
>
>
> Regards,

  reply	other threads:[~2013-05-10 13:35 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 [this message]
2013-05-10 13:14   ` Alexander Baier

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m27gj7vtub.fsf@vpn-client437.uio.no \
    --to=mail@christianmoe.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=lexi.baier@gmail.com \
    --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 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).