From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: inconsistency in backend export functions? Date: Thu, 12 Dec 2013 09:27:54 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b33d5fcc5c68604ed57266d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr7FD-0002Ak-0C for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 09:28:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vr7F7-0008Sh-3l for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 09:28:02 -0500 Received: from mail-pb0-x233.google.com ([2607:f8b0:400e:c01::233]:36683) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr7F6-0008Pj-QW for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 09:27:57 -0500 Received: by mail-pb0-f51.google.com with SMTP id up15so600296pbc.38 for ; Thu, 12 Dec 2013 06:27:55 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" --047d7b33d5fcc5c68604ed57266d Content-Type: text/plain; charset=ISO-8859-1 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 --047d7b33d5fcc5c68604ed57266d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi All,

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

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

(defun org-backend-xxx (element contents info)
=A0 code that conve= rts element to a string)

but, that does not work for a plain-t= ext element. Even in ox-latex.el it is defined with only two arguments, wit= h 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 m= e. Am I missing something in the docs somewhere?

John

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

<= /div>
--047d7b33d5fcc5c68604ed57266d-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: inconsistency in backend export functions? Date: Thu, 12 Dec 2013 17:44:14 +0100 Message-ID: <871u1ixbmp.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr9Mn-0002em-73 for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 11:44:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vr9Mi-0003gA-7A for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 11:44:00 -0500 Received: from mail-ee0-x22c.google.com ([2a00:1450:4013:c00::22c]:39381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr9Mi-0003g5-01 for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 11:43:56 -0500 Received: by mail-ee0-f44.google.com with SMTP id b57so363288eek.17 for ; Thu, 12 Dec 2013 08:43:54 -0800 (PST) In-Reply-To: (John Kitchin's message of "Thu, 12 Dec 2013 09:27:54 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Kitchin Cc: "emacs-orgmode@gnu.org" Hello, John Kitchin 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: inconsistency in backend export functions? Date: Thu, 12 Dec 2013 12:01:15 -0500 Message-ID: References: <871u1ixbmp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1cb402c5e4804ed594bf3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr9dZ-0008W1-Qc for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 12:01:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vr9dV-0000nn-5T for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 12:01:21 -0500 Received: from mail-pb0-x22e.google.com ([2607:f8b0:400e:c01::22e]:47685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vr9dU-0000nd-Ud for emacs-orgmode@gnu.org; Thu, 12 Dec 2013 12:01:17 -0500 Received: by mail-pb0-f46.google.com with SMTP id md12so852143pbc.19 for ; Thu, 12 Dec 2013 09:01:16 -0800 (PST) In-Reply-To: <871u1ixbmp.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: "emacs-orgmode@gnu.org" --e89a8ff1cb402c5e4804ed594bf3 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Dec 12, 2013 at 11:44 AM, Nicolas Goaziou 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 --e89a8ff1cb402c5e4804ed594bf3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable