emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* inconsistency in backend export functions?
@ 2013-12-12 14:27 John Kitchin
  2013-12-12 16:44 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: John Kitchin @ 2013-12-12 14:27 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

Hi All,

I was playing around with creating a new backend to convert an org-file to
a json representation, and I came across this apparent inconsistency in the
backend function signatures.

at http://orgmode.org/worg/dev/org-export-reference.html it suggests the
backend transcoding functions should have this signature:

(defun org-backend-xxx (element contents info)
  code that converts element to a string)

but, that does not work for a plain-text element. Even in ox-latex.el it is
defined with only two arguments, with no contents.

(defun org-latex-plain-text (text info)

My exporter works when I define it this way too, but it seemed like an odd
inconsistency to me. Am I missing something in the docs somewhere?

John

-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

[-- Attachment #2: Type: text/html, Size: 1385 bytes --]

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

* Re: inconsistency in backend export functions?
  2013-12-12 14:27 inconsistency in backend export functions? John Kitchin
@ 2013-12-12 16:44 ` Nicolas Goaziou
  2013-12-12 17:01   ` John Kitchin
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2013-12-12 16:44 UTC (permalink / raw)
  To: John Kitchin; +Cc: emacs-orgmode@gnu.org

Hello,

John Kitchin <jkitchin@andrew.cmu.edu> writes:

> I was playing around with creating a new backend to convert an org-file to
> a json representation, and I came across this apparent inconsistency in the
> backend function signatures.
>
> at http://orgmode.org/worg/dev/org-export-reference.html it suggests the
> backend transcoding functions should have this signature:
>
> (defun org-backend-xxx (element contents info)
>   code that converts element to a string)
>
> but, that does not work for a plain-text element. Even in ox-latex.el it is
> defined with only two arguments, with no contents.
>
> (defun org-latex-plain-text (text info)
>
> My exporter works when I define it this way too, but it seemed like an odd
> inconsistency to me. Am I missing something in the docs somewhere?

This is documented in `org-export-define-backend' docstring.


Regards,

-- 
Nicolas Goaziou

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

* Re: inconsistency in backend export functions?
  2013-12-12 16:44 ` Nicolas Goaziou
@ 2013-12-12 17:01   ` John Kitchin
  0 siblings, 0 replies; 3+ messages in thread
From: John Kitchin @ 2013-12-12 17:01 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 519 bytes --]

On Thu, Dec 12, 2013 at 11:44 AM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:

> org-export-define-backend


Thanks! I didn't understand that docstring like that the first time I read
it, but now it makes sense (and even answers how to get the whole body
between {} with the template symbol!).

John

-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

[-- Attachment #2: Type: text/html, Size: 1015 bytes --]

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

end of thread, other threads:[~2013-12-12 17:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-12 14:27 inconsistency in backend export functions? John Kitchin
2013-12-12 16:44 ` Nicolas Goaziou
2013-12-12 17:01   ` John Kitchin

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