emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Exporter] Export of property drawers
@ 2013-05-09 16:46 Alexander Baier
  2013-05-09 18:13 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Alexander Baier @ 2013-05-09 16:46 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

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.

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

(org-export-define-derived-backend 'my-ascii 'ascii
  :translate-alist '((template .
                      org-tut-ascii-translater-property-drawer)))
===============================================================================

This are my ERT-tests:
===============================================================================
(ert-deftest org-tut-export-test ()
  (with-temp-buffer
    (org-mode)
    (let ((org-export-show-temporary-export-buffer nil))
      (insert (org-tut-test-contents))
      (org-export-to-buffer 'my-ascii "*Org ASCII Export*" nil nil t nil)
      (should (eql (org-tut-result)
                   (with-current-buffer "*Org ASCII Export*"
                     (buffer-substring-no-properties
                      (point-min) (point-max)))))
      )
    )
  )

(defun org-tut-test-contents ()
  nil
  "* Alex
  :PROPERTIES:
  :MATNR:    1234567
  :END:
** Task 1
*** Subtask 1.1
    :PROPERTIES:
    :POINTS:   5
    :END:
")

(defun org-tut-result ()
  nil
  "1 Alex
======
Matnr=1234567

1.1 Task 1 
~~~~~~~~~~

1.1.1 Subtask 1.1
-----------------
Points: 5
")
===============================================================================

Upon exporting I only get the headlines, without any properties related
stuff.

If you need any further info, I will gladly provide it.

Regards,
Alex

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

end of thread, other threads:[~2013-05-10 13:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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).